/* RubberJointsAI - Light Theme Mobile-First Joint Mobility Tracking App */

/* ============================================================================
   COLOR VARIABLES
   ============================================================================ */

:root {
  --bg: #f5f5f7;
  --s1: #ffffff;
  --s2: #f0f0f3;
  --s3: #e5e5ea;
  --brd: #d1d1d6;
  --tx: #1c1c1e;
  --tx2: #636366;
  --tx3: #8e8e93;
  --acc: #4a6cf7;
  --grn: #34c759;
  --org: #ff9500;
  --red: #ff3b30;
  --pur: #af52de;
  --yel: #ffcc00;
}

/* ============================================================================
   RESET + BASE
   ============================================================================ */

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

html,
body {
  height: 100%;
  width: 100%;
}

body {
  background-color: var(--bg);
  color: var(--tx);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   SCROLLBAR
   ============================================================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--s3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brd);
}

/* ============================================================================
   APP SHELL
   ============================================================================ */

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
  background-color: var(--bg);
}

/* ============================================================================
   BOTTOM NAVIGATION
   ============================================================================ */

.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding-bottom: env(safe-area-inset-bottom);
  background-color: var(--s1);
  border-top: 1px solid var(--brd);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--tx2);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 150ms ease;
  text-decoration: none;
}

.nav-btn svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.nav-btn.active {
  color: var(--acc);
}

.nav-btn.active svg {
  color: var(--acc);
}

/* Bottom nav (actual class names from layout) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding-bottom: env(safe-area-inset-bottom);
  background-color: var(--s1);
  border-top: 1px solid var(--brd);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  max-width: 480px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--tx3);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 150ms ease;
  text-decoration: none;
}

.nav-item .nav-icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.nav-item .nav-label {
  font-size: 10px;
}

.nav-item.active {
  color: var(--acc);
}

.nav-item.locked {
  opacity: 0.35;
  pointer-events: none;
  position: relative;
}

.nav-item .lock-icon {
  width: 10px;
  height: 10px;
  position: absolute;
  top: 4px;
  right: 2px;
  opacity: 0.6;
}

/* ============================================================================
   HEADER
   ============================================================================ */

header {
  text-align: center;
  padding: 24px 16px 16px;
  background-color: var(--bg);
}

.logo {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--acc);
  margin-bottom: 8px;
}

.badge,
.pill {
  display: inline-block;
  padding: 6px 14px;
  background-color: rgba(74, 108, 247, 0.1);
  border: 1px solid rgba(74, 108, 247, 0.2);
  border-radius: 20px;
  font-size: 13px;
  color: var(--acc);
  font-weight: 500;
}

/* Page header */
.page-header {
  text-align: center;
  padding: 24px 16px 16px;
}

/* Hero section */
.hero-section {
  text-align: center;
  padding: 16px 16px 8px;
}

.hero-day {
  font-size: 28px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 4px;
}

.hero-type {
  font-size: 14px;
  color: var(--tx2);
  margin-bottom: 2px;
}

.hero-time {
  font-size: 13px;
  color: var(--tx3);
  margin-bottom: 2px;
}

.hero-location {
  font-size: 13px;
  color: var(--tx3);
}

/* Legend */
.legend-section {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  padding: 12px 16px 16px;
  font-size: 12px;
  color: var(--tx3);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Supplements card */
.supplements-card {
  padding: 0;
}

.supplements-card .card-title {
  padding: 0 16px;
  margin-bottom: 12px;
}

.supplement-group .group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--tx3);
  margin: 0;
}

.supplements-card .supplement-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--brd);
}

.supplements-card .supplement-item:last-child {
  border-bottom: none;
}

.supplements-card .supplement-name {
  flex: 1;
  font-size: 14px;
  color: var(--tx);
  font-weight: 500;
}

.supplements-card .supplement-dose {
  font-size: 12px;
  color: var(--tx3);
  white-space: nowrap;
}

.supplements-card .supplement-checkbox {
  width: 22px;
  height: 22px;
  accent-color: var(--grn);
}

/* Error banner */
.error-banner {
  margin: 0 16px 12px;
  padding: 12px 16px;
  background-color: rgba(232, 100, 100, 0.15);
  border: 1px solid rgba(232, 100, 100, 0.3);
  border-radius: 12px;
  color: var(--red);
  font-size: 14px;
  text-align: center;
}

/* ============================================================================
   HERO
   ============================================================================ */

.hero {
  text-align: center;
  padding: 24px 16px;
  background-color: var(--bg);
}

.day-name {
  font-size: 26px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 4px;
}

.session-type {
  font-size: 14px;
  color: var(--tx2);
  margin-bottom: 4px;
}

.duration {
  font-size: 12px;
  color: var(--tx3);
}

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
  background-color: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 16px;
  padding: 16px;
  margin: 0 16px 12px;
  transition: border-color 150ms ease;
}

.card:hover {
  border-color: var(--s3);
}

.card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--tx3);
  margin-bottom: 16px;
}

/* ============================================================================
   CHECKLIST
   ============================================================================ */

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--brd);
  transition: opacity 150ms ease;
  cursor: pointer;
}

.check-item:last-child {
  border-bottom: none;
}

.check-box {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 2px solid var(--brd);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
  background-color: transparent;
}

.check-item.done .check-box {
  background-color: var(--grn);
  border-color: var(--grn);
}

.check-item.done .check-box::after {
  content: '✓';
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.check-name {
  flex: 1;
  font-size: 15px;
  color: var(--tx);
  transition: all 150ms ease;
}

.check-item.done .check-name {
  text-decoration: line-through;
  color: var(--tx3);
  opacity: 0.7;
}

.check-reps {
  font-size: 13px;
  color: var(--tx2);
}

/* ============================================================================
   CATEGORY DOTS
   ============================================================================ */

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.dot-mobility {
  background-color: var(--grn);
}

.dot-strength {
  background-color: var(--pur);
}

.dot-warmup {
  background-color: var(--org);
}

.dot-recovery {
  background-color: var(--acc);
}

/* ============================================================================
   SESSION GROUPS
   ============================================================================ */

.session-group {
  margin: 0 16px 12px;
  background-color: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 16px;
  overflow: hidden;
}

.session-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--tx3);
  background-color: var(--s2);
  border-bottom: 1px solid var(--brd);
}

.session-group .check-item {
  margin: 0;
  padding: 14px 16px;
  border-radius: 0;
  border-bottom: 1px solid var(--brd);
}

.session-group .check-item:last-of-type {
  border-bottom: none;
}

.check-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.check-sub {
  display: block;
  font-size: 12px;
  color: var(--tx3);
  margin-top: 2px;
}

.check-item.done .check-sub {
  opacity: 0.5;
}

.detail-warning {
  margin-top: 8px;
  padding: 8px 12px;
  background-color: rgba(232, 100, 100, 0.1);
  border-radius: 8px;
  color: var(--red);
  font-size: 13px;
}

/* ============================================================================
   SECTION DIVIDERS
   ============================================================================ */

.section-divider {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--tx3);
  padding: 16px;
  border-bottom: 1px solid var(--brd);
  margin-top: 8px;
}

/* ============================================================================
   EXERCISE DETAIL
   ============================================================================ */

.detail {
  display: none;
  background-color: var(--s2);
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--tx2);
  line-height: 1.6;
  transition: all 150ms ease;
}

.detail.open {
  display: block;
}

.session-group .detail {
  margin: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--brd);
  padding: 0 16px 14px 54px;
}

.session-group .detail.open + .check-item {
  border-top: none;
}

.detail ul {
  list-style: none;
  margin-left: 0;
}

.detail li {
  margin-bottom: 8px;
  padding-left: 16px;
  position: relative;
}

.detail li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--acc);
  font-weight: bold;
}

/* ============================================================================
   LEGEND
   ============================================================================ */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  font-size: 11px;
  color: var(--tx3);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================================
   STAT GRID
   ============================================================================ */

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px;
  margin-bottom: 16px;
}

.stat-box {
  background-color: var(--s2);
  border: 1px solid var(--brd);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--acc);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--tx3);
}

/* ============================================================================
   MILESTONES
   ============================================================================ */

.ms-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--brd);
}

.ms-item:last-child {
  border-bottom: none;
}

.ms-dot {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--brd);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  transition: all 150ms ease;
}

.ms-dot.done {
  background-color: var(--grn);
  border-color: var(--grn);
}

.ms-content {
  flex: 1;
  font-size: 14px;
  color: var(--tx);
}

.ms-date {
  font-size: 12px;
  color: var(--tx3);
}

.ms-btn {
  background-color: var(--s2);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--grn);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.ms-btn:hover {
  background-color: var(--s3);
}

.ms-btn:active {
  background-color: rgba(69, 196, 160, 0.2);
}

/* Expandable milestone detail */
.ms-detail {
  display: none;
  background-color: var(--s2);
  padding: 0 16px 12px 42px;
  font-size: 13px;
  color: var(--tx2);
  line-height: 1.6;
  border-bottom: 1px solid var(--brd);
}
.ms-detail.open {
  display: block;
}
.ms-detail p {
  margin: 0 0 8px;
}
.ms-detail .yt-demo-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #c00;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.ms-detail .yt-demo-link:hover {
  text-decoration: underline;
}
.ms-content-tap {
  cursor: pointer;
}

/* ============================================================================
   LIBRARY
   ============================================================================ */

.search-input {
  width: calc(100% - 32px);
  margin: 16px auto;
  padding: 12px 14px;
  background-color: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 10px;
  font-size: 14px;
  color: var(--tx);
  outline: none;
  transition: border-color 150ms ease;
}

.search-input::placeholder {
  color: var(--tx3);
}

.search-input:focus {
  border-color: var(--acc);
}

.lib-card {
  background-color: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 12px;
  padding: 14px;
  margin: 0 16px 12px;
  cursor: pointer;
  transition: all 150ms ease;
}

.lib-card:active {
  background-color: var(--s2);
}

.lib-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--tx);
  margin-bottom: 6px;
}

.lib-card-category {
  font-size: 12px;
  color: var(--tx2);
  display: flex;
  align-items: center;
  gap: 4px;
}

.lib-detail {
  padding: 16px;
}

.lib-detail section {
  margin-bottom: 16px;
}

.lib-detail section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lib-detail section p {
  font-size: 14px;
  color: var(--tx);
  line-height: 1.6;
}

.tag {
  display: inline-block;
  background-color: var(--s2);
  border: 1px solid var(--brd);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--tx2);
  margin-right: 6px;
  margin-bottom: 6px;
}

/* ============================================================================
   SETTINGS
   ============================================================================ */

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--brd);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-label {
  font-size: 15px;
  color: var(--tx);
  font-weight: 500;
}

.setting-desc {
  font-size: 12px;
  color: var(--tx3);
  margin-top: 2px;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 46px;
  height: 28px;
  background-color: var(--s3);
  border-radius: 14px;
  border: none;
  cursor: pointer;
  padding: 2px;
  transition: background-color 150ms ease;
  display: flex;
  align-items: center;
  padding-left: 2px;
}

.toggle-knob {
  width: 24px;
  height: 24px;
  background-color: var(--tx);
  border-radius: 11px;
  transition: transform 150ms ease;
}

.toggle.on {
  background-color: var(--grn);
}

.toggle.on .toggle-knob {
  transform: translateX(18px);
}

/* Date Input */
input[type='date'] {
  background-color: var(--s1);
  color: var(--tx);
  border: 1px solid var(--brd);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: border-color 150ms ease;
}

input[type='date']:focus {
  border-color: var(--acc);
}

input[type='date']::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

/* ============================================================================
   SUPPLEMENT GROUPS
   ============================================================================ */

.supplement-group {
  margin-bottom: 12px;
}

.supplement-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: var(--s2);
  border-top: 1px solid var(--brd);
}

.supplement-group:first-child .supplement-group-header {
  border-top: none;
}

.supplement-group-header .group-title {
  flex: 1;
  margin: 0;
}

.supplement-group-header .add-exercise-btn {
  flex-shrink: 0;
}

.group-header {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--tx3);
  padding: 12px 16px;
  background-color: var(--s2);
  margin: 0 16px 8px;
  border-radius: 8px;
}

.supplement-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background-color: var(--s1);
  border-bottom: 1px solid var(--brd);
  cursor: pointer;
  transition: background-color 150ms ease;
}

.supplement-item:last-child {
  border-bottom: none;
  border-radius: 0 0 12px 12px;
}

.supplement-item:first-child {
  border-radius: 12px 12px 0 0;
}

.supplement-check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 2px solid var(--brd);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
  background-color: transparent;
}

.supplement-item.taken .supplement-check {
  background-color: var(--grn);
  border-color: var(--grn);
}

.supplement-item.taken .supplement-check::after {
  content: '✓';
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}

.supplement-name {
  flex: 1;
  font-size: 14px;
  color: var(--tx);
  font-weight: 500;
}

.supplement-item.taken .supplement-name {
  opacity: 0.7;
  text-decoration: line-through;
}

.supplement-dosage {
  font-size: 12px;
  color: var(--tx3);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 150ms ease;
  text-decoration: none;
  display: inline-block;
  outline: none;
}

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

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-danger {
  background-color: var(--red);
  color: white;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-danger:active {
  transform: scale(0.98);
}

.btn-success {
  background-color: transparent;
  border: 2px dashed var(--grn);
  color: var(--grn);
}

.btn-success:hover {
  background-color: rgba(69, 196, 160, 0.1);
}

.btn-success:active {
  background-color: rgba(69, 196, 160, 0.2);
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.flex-col {
  display: flex;
  flex-direction: column;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.mt-8 {
  margin-top: 8px;
}

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

.mt-16 {
  margin-top: 16px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-12 {
  margin-bottom: 12px;
}

.mb-16 {
  margin-bottom: 16px;
}

.px-16 {
  padding-left: 16px;
  padding-right: 16px;
}

.py-12 {
  padding-top: 12px;
  padding-bottom: 12px;
}

.text-center {
  text-align: center;
}

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

.text-secondary {
  color: var(--tx2);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (min-width: 480px) {
  main {
    max-width: 480px;
    margin: 0 auto;
  }

  .nav,
  .bottom-nav {
    max-width: 480px;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
  }

  header,
  .hero,
  .page-header,
  .hero-section {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

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

.animate-slide-in {
  animation: slideIn 200ms ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-fade-in {
  animation: fadeIn 150ms ease-out;
}

/* ============================================================================
   YOUTUBE DEMO LINK
   ============================================================================ */

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.yt-demo-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #ff0000;
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 150ms ease;
}

.delete-exercise-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: transparent;
  color: #999;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
}

.delete-exercise-btn:hover {
  color: #e53e3e;
  border-color: #e53e3e;
  background: #fff5f5;
}

.delete-exercise-btn svg {
  stroke: currentColor;
}

.yt-demo-link:hover {
  opacity: 0.85;
}

.yt-demo-link svg {
  fill: #fff;
}

/* ============================================================================
   ACTIVITY SUMMARY BARS
   ============================================================================ */

.activity-summary {
  margin: 16px 16px 12px;
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 16px;
  padding: 16px;
}

.activity-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tx3);
  margin-bottom: 4px;
}

.activity-subtitle {
  font-size: 13px;
  color: var(--tx2);
  margin-bottom: 14px;
}

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

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

.progress-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  width: 80px;
  flex-shrink: 0;
  color: var(--tx);
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.progress-track {
  flex: 1;
  height: 10px;
  background: var(--s3);
  border-radius: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  min-width: 0;
}

.progress-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--tx2);
  width: 36px;
  flex-shrink: 0;
  text-align: right;
}

/* ============================================================================
   WEEKLY CALENDAR
   ============================================================================ */

.week-calendar {
  display: flex;
  justify-content: space-between;
  margin: 0 16px 16px;
  padding: 12px 8px;
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 16px;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 12px;
  min-width: 38px;
}

.week-day.today {
  background: #34c759;
}

.week-day.today .week-day-label,
.week-day.today .week-day-num {
  color: #fff;
}

.week-day-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.week-day-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--tx);
}

.week-day-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.week-day.past .week-day-label,
.week-day.past .week-day-num {
  opacity: 0.5;
}

.week-day.selected {
  background: var(--acc);
  opacity: 1;
}

.week-day.selected .week-day-label,
.week-day.selected .week-day-num {
  color: #fff;
  opacity: 1;
}

/* When selected AND today overlap, today's green wins */
.week-day.selected.today {
  background: #34c759;
}

/* ============================================================================
   DAY NAVIGATION
   ============================================================================ */

.day-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 16px 8px;
  padding: 8px 0;
}

.day-nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--s1);
  border: 1px solid var(--brd);
  font-size: 22px;
  font-weight: 700;
  color: var(--tx);
  text-decoration: none;
  transition: background 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.day-nav-arrow:hover {
  background: var(--s2);
}

.day-nav-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.day-nav-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--tx);
}

.day-nav-today-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--acc);
  text-decoration: none;
}

.day-nav-today-link:hover {
  text-decoration: underline;
}

/* ============================================================================
   FUTURE DAY READ-ONLY STYLES
   ============================================================================ */

.check-box-preview {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 2px dashed var(--brd);
  border-radius: 8px;
  background-color: transparent;
  opacity: 0.5;
}

.supplement-check-preview {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 2px dashed var(--brd);
  border-radius: 6px;
  background-color: transparent;
  opacity: 0.5;
}

.read-only {
  opacity: 0.65;
}

.read-only .check-name,
.read-only .supplement-name {
  color: var(--tx3);
}

/* ============================================================================
   GROUP PROGRESS COUNTER
   ============================================================================ */

.group-progress {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--tx3);
}

/* ============================================================================
   CALENDAR VIEW (Week Page)
   ============================================================================ */

.week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 16px 12px;
}

.week-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--s2);
  color: var(--tx);
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
}

.week-nav-today-link {
  font-size: 13px;
  color: var(--acc);
  text-decoration: none;
  font-weight: 600;
}

.cal-week {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px 16px;
}

a.cal-day {
  display: block;
  cursor: pointer;
  transition: transform 0.1s ease;
}

a.cal-day:active {
  transform: scale(0.98);
}

.cal-day {
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 14px;
  padding: 12px 14px;
}

.cal-day.is-today {
  outline: 2px solid var(--acc);
  outline-offset: -2px;
}

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

.cal-day-name {
  font-size: 14px;
  font-weight: 700;
}

.cal-day-date {
  font-size: 11px;
  color: var(--tx3);
  font-weight: 600;
}

.cal-day-type {
  font-size: 11px;
  color: var(--tx3);
  margin-bottom: 8px;
}

.cal-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cal-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-bar-lbl {
  font-size: 10px;
  font-weight: 700;
  width: 58px;
  flex-shrink: 0;
  text-align: right;
}

.cal-bar-track {
  flex: 1;
  height: 8px;
  background: var(--s3);
  border-radius: 4px;
  overflow: hidden;
}

.cal-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cal-bar-fill.full {
  box-shadow: 0 0 6px currentColor;
}

.cal-bar-ct {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx3);
  width: 28px;
  flex-shrink: 0;
}

.cal-empty {
  text-align: center;
  font-size: 12px;
  color: var(--tx3);
  padding: 4px 0;
  font-style: italic;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

/* ============================================================================
   PROGRESS PAGE ENHANCEMENTS
   ============================================================================ */

.week-pill {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(74, 108, 247, 0.1);
  color: var(--acc);
}

.ms-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--tx);
}

.ms-date {
  font-size: 11px;
  color: var(--tx3);
  margin-top: 1px;
}

/* ============================================================================
   SETTINGS PAGE CARDS
   ============================================================================ */

.settings-card {
  background-color: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 16px;
  padding: 16px;
  margin: 0 16px 14px;
}

.settings-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tx3);
  margin-bottom: 10px;
}

.settings-card-desc {
  font-size: 12px;
  color: var(--tx3);
  margin-bottom: 8px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid rgba(209, 209, 214, 0.5);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-label {
  font-size: 14px;
  color: var(--tx);
  font-weight: 500;
}

.setting-sub {
  font-size: 11px;
  color: var(--tx3);
  margin-top: 2px;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 46px;
  height: 28px;
  background-color: var(--s3);
  border-radius: 14px;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background-color 200ms ease;
  flex-shrink: 0;
}

.toggle i {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: left 200ms ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle.on {
  background-color: var(--grn);
}

.toggle.on i {
  left: 21px;
}

.btn-reset {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.btn-reset:active {
  opacity: 0.8;
}

.btn-save {
  width: 100%;
  background: var(--acc);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin: 6px 16px 14px;
  max-width: calc(100% - 32px);
  transition: opacity 150ms ease;
}

.btn-save:active {
  opacity: 0.8;
}

/* ============================================================================
   ADD EXERCISE BUTTON & PICKER
   ============================================================================ */

.add-exercise-btn {
  margin-left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--brd);
  background: transparent;
  color: var(--tx3);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 150ms ease;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}

.add-exercise-btn:hover {
  border-color: var(--acc);
  color: var(--acc);
}

.add-section-bar {
  display: flex;
  gap: 8px;
  margin: 12px 16px;
  flex-wrap: wrap;
}

.add-exercise-btn-large {
  flex: 1;
  min-width: 100px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px dashed var(--brd);
  background: transparent;
  color: var(--tx3);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.add-exercise-btn-large:hover {
  border-color: var(--acc);
  color: var(--acc);
}

/* Ask AI icon button — sits in the section header row */
.ask-ai-header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: 6px;
  color: #4a6cf7;
  background: #f0f4ff;
  border: 1px solid #dce3ff;
  border-radius: 50%;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.ask-ai-header-btn:hover {
  background: #dce3ff;
  color: #3451b2;
}
.ask-ai-header-btn svg {
  flex-shrink: 0;
}

.empty-section-hint {
  padding: 12px 16px 8px 28px;
  color: var(--tx3);
  font-size: 13px;
  font-style: italic;
}

.picker-group-header {
  padding: 10px 20px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tx3);
  border-top: 1px solid var(--brd);
  margin-top: 4px;
}

.picker-group-header:first-child {
  border-top: none;
  margin-top: 0;
}

/* Picker overlay (bottom sheet) */
.picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.picker-sheet {
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  animation: picker-slide-up 200ms ease-out;
}

@keyframes picker-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--brd);
}

.picker-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--tx);
}

.picker-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--tx3);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.picker-list {
  overflow-y: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}

.picker-loading {
  text-align: center;
  padding: 32px 0;
  color: var(--tx3);
  font-size: 14px;
}

.picker-item {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  cursor: pointer;
  transition: background 100ms ease;
  -webkit-tap-highlight-color: transparent;
}

.picker-item:hover {
  background: var(--s1);
}

.picker-item:active {
  background: var(--s2);
}

.picker-item-disabled {
  opacity: 0.4;
  cursor: default;
}

.picker-item-disabled:hover,
.picker-item-disabled:active {
  background: transparent;
}

.picker-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.picker-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--tx);
}

.picker-item-targets {
  font-size: 12px;
  color: var(--tx3);
}

.picker-item-rx {
  font-size: 13px;
  color: var(--tx2);
  margin-left: 12px;
  white-space: nowrap;
}

.picker-item-added {
  font-size: 11px;
  font-weight: 600;
  color: var(--grn);
  margin-left: 8px;
  text-transform: uppercase;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
  .nav,
  button {
    display: none;
  }

  body {
    background-color: white;
    color: black;
  }
}

/* ============================================================================
   AI COACH PAGE
   ============================================================================ */

.ai-container {
  display: flex;
  height: calc(100vh - 56px);
  height: calc(100dvh - 56px);
  position: relative;
  overflow: hidden;
  margin: -8px -16px 0;
}

/* --- Sidebar --- */
.ai-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--s1);
  border-right: 1px solid var(--brd);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.ai-sidebar.open {
  transform: translateX(0);
}

.ai-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.ai-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.ai-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--s3);
}

.ai-sidebar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--tx);
}

.ai-sidebar-close {
  background: none;
  border: none;
  color: var(--tx3);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.ai-sidebar-close:hover {
  background: var(--s2);
}

.ai-new-chat {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px;
  padding: 10px 14px;
  background: var(--acc);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.ai-new-chat:hover {
  background: #3a5ce6;
}

.ai-chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}

.ai-chat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
}

.ai-chat-item:hover {
  background: var(--s2);
}

.ai-chat-item.active {
  background: rgba(74, 108, 247, 0.08);
}

.ai-chat-item-title {
  font-size: 13px;
  color: var(--tx);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.ai-chat-item.active .ai-chat-item-title {
  color: var(--acc);
}

.ai-chat-item-time {
  font-size: 11px;
  color: var(--tx3);
  margin-left: 8px;
  flex-shrink: 0;
}

/* --- Main Chat Area --- */
.ai-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  height: calc(100dvh - 56px);
  min-width: 0;
}

.ai-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--s1);
  border-bottom: 1px solid var(--s3);
  flex-shrink: 0;
}

/* Combined topbar + status banner — saves a full row */
.ai-topbar-combined {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.ai-topbar-center {
  flex: 1;
  min-width: 0;
}
.ai-topbar-week {
  font-size: 13px;
  font-weight: 700;
  color: #333;
}
.ai-topbar-bar {
  height: 3px;
  background: #eee;
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.ai-topbar-fill {
  height: 100%;
  background: #34c759;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.ai-menu-btn {
  background: none;
  border: none;
  color: var(--tx2);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
}

.ai-menu-btn:hover {
  background: var(--s2);
}

.ai-topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--tx);
  letter-spacing: 0.5px;
}

/* --- Status Banner (server-rendered, no AI call) --- */
.ai-status-banner {
  background: #fff;
  color: #333;
  padding: 12px 16px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid #eee;
}

.ai-status-banner-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ai-status-banner-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.ai-status-banner-phase {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  background: #f0f4ff;
  color: #4a6cf7;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.ai-status-banner-bar {
  height: 4px;
  background: #eee;
  border-radius: 2px;
  margin-bottom: 4px;
  overflow: hidden;
}

.ai-status-banner-fill {
  height: 100%;
  background: #34c759;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.ai-status-banner-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  text-align: center;
}

.ai-status-banner-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ai-stat-number {
  font-size: 14px;
  font-weight: 700;
}

.ai-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.7;
}

/* Slim banner — just week bar, no stats grid */
.ai-status-banner-slim {
  padding: 10px 16px 8px;
}

/* Compact info card — 3 lines max */
.ai-info-compact {
  padding: 8px 12px;
}
.ai-info-compact .ai-info-nugget {
  font-size: 12.5px;
  padding: 1px 0;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Messages --- */
.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
}

.ai-message {
  display: flex;
  gap: 8px;
  max-width: 100%;
  animation: aiFadeIn 0.3s ease;
}

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

.ai-message-user {
  flex-direction: row-reverse;
}

.ai-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--acc), var(--pur));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}

.ai-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 85%;
}

.ai-bubble p {
  margin-bottom: 8px;
}

.ai-bubble p:last-child {
  margin-bottom: 0;
}

.ai-bubble-assistant {
  background: var(--s1);
  color: var(--tx);
  border: 1px solid var(--s3);
  border-bottom-left-radius: 4px;
}

.ai-bubble-user {
  background: var(--acc);
  color: white;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}

/* --- Typing indicator --- */
.ai-typing {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.ai-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tx3);
  animation: aiBounce 1.4s infinite ease-in-out;
}

.ai-typing span:nth-child(1) { animation-delay: 0s; }
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* --- Status card inside welcome --- */
.ai-status-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(74, 108, 247, 0.06);
  border: 1px solid rgba(74, 108, 247, 0.15);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0;
}

.ai-status-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--tx3);
  font-weight: 600;
}

.ai-status-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--acc);
}

.ai-status-detail {
  font-size: 13px;
  color: var(--tx2);
}

/* --- Suggestion chips (pinned above input, single row) --- */
.ai-suggestions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 6px 12px 4px;
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ai-chip {
  padding: 7px 14px;
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 20px;
  font-size: 12px;
  color: var(--tx2);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.ai-chip:hover {
  background: rgba(74, 108, 247, 0.08);
  border-color: var(--acc);
  color: var(--acc);
}

/* --- Fixed bottom block: chips + input + disclaimer --- */
.ai-bottom-fixed {
  flex-shrink: 0;
  padding: 6px 12px 8px;
  background: var(--bg);
  border-top: 1px solid var(--s3);
}

.ai-suggestions-fixed {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- Input area --- */
.ai-input-area {
  padding: 8px 12px 12px;
  background: var(--bg);
  border-top: 1px solid var(--s3);
  flex-shrink: 0;
}

.ai-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 20px;
  padding: 6px 6px 6px 16px;
  transition: border-color 0.15s;
}

.ai-input-wrapper:focus-within {
  border-color: var(--acc);
}

.ai-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--tx);
  background: transparent;
  resize: none;
  line-height: 1.4;
  max-height: 120px;
  padding: 6px 0;
}

.ai-input::placeholder {
  color: var(--tx3);
}

.ai-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--acc);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.ai-send-btn:disabled {
  background: var(--s3);
  color: var(--tx3);
  cursor: not-allowed;
}

.ai-send-btn:not(:disabled):hover {
  background: #3a5ce6;
  transform: scale(1.05);
}

/* --- Prominent Disclaimer (must be clearly readable) --- */
.ai-disclaimer-prominent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 14px;
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #664d03;
}
.ai-disclaimer-prominent svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #e65100;
}
.ai-disclaimer-prominent strong {
  color: #b71c1c;
}

/* --- Joke of the Day Card --- */
.ai-joke-card {
  background: #fffbf0;
  border-radius: 0;
  padding: 10px 20px 8px;
  margin: 0;
  color: #6b5b3a;
  text-align: center;
  flex-shrink: 0;
  border-bottom: 1px solid #f0e8d8;
}
.ai-joke-icon {
  font-size: 20px;
  margin-bottom: 2px;
}
.ai-joke-text {
  font-size: 13px;
  font-style: italic;
  line-height: 1.4;
  font-weight: 500;
  margin-bottom: 4px;
  transition: opacity 0.2s ease;
}
.ai-joke-tagline {
  font-size: 12px;
  opacity: 0.75;
  font-weight: 600;
}

/* Joke card inside scrollable area — not fixed */
.ai-joke-in-scroll {
  flex-shrink: 1;
  border-radius: 12px;
  border: 1px solid #f0e8d8;
}

/* Inline chips inside scrollable area */
.ai-suggestions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
}

/* Slim joke — one-line bar */
.ai-joke-slim {
  background: #fffbf0;
  padding: 8px 16px;
  text-align: center;
  flex-shrink: 0;
  border-bottom: 1px solid #f0e8d8;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ai-joke-slim .ai-joke-text {
  font-size: 13px;
  font-style: italic;
  color: #6b5b3a;
  font-weight: 500;
}

/* Slim disclaimer */
.ai-disclaimer-slim {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 12px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.3;
  color: #8d6e00;
}
.ai-disclaimer-slim svg {
  flex-shrink: 0;
  color: #e65100;
}

/* --- Today's Info Card --- */
.ai-info-card {
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  animation: aiFadeIn 0.6s ease;
}
.ai-info-header {
  margin-bottom: 10px;
}
.ai-info-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--tx);
}
.ai-info-section {
  margin-bottom: 10px;
}
.ai-info-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tx3);
  margin-bottom: 6px;
}

/* Exercise preview rows */
.ai-exercise-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--s2);
}
.ai-exercise-row:last-of-type {
  border-bottom: none;
}
.ai-exercise-row.done {
  opacity: 0.5;
  text-decoration: line-through;
}
.ai-exercise-check {
  font-size: 14px;
  flex-shrink: 0;
}
.ai-exercise-name {
  flex: 1;
  font-weight: 500;
  color: var(--tx);
}
.ai-exercise-rx {
  font-size: 12px;
  color: var(--tx3);
  white-space: nowrap;
}
.ai-exercise-more {
  font-size: 12px;
  color: var(--acc);
  margin-top: 4px;
  font-weight: 500;
}

/* Supplement rows */
.ai-supplement-row {
  font-size: 13px;
  padding: 3px 0;
  color: var(--tx2);
}

/* Info footer nuggets */
.ai-info-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--s2);
}
.ai-info-nugget {
  font-size: 13px;
  color: var(--tx2);
  padding: 2px 0;
  line-height: 1.5;
}
.ai-info-nugget strong {
  color: var(--tx);
}

/* --- Tips section in info card --- */
.ai-info-tips {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}
.ai-tip {
  font-size: 12.5px;
  color: #555;
  padding: 3px 0;
  line-height: 1.4;
}
.ai-tip strong {
  color: #4a6cf7;
}

/* --- START TRAINING Button --- */
.ai-start-training-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 24px;
  margin: 0;
  background: #4a6cf7;
  color: white;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-decoration: none;
  border: none;
  border-bottom: 1px solid #eee;
  border-radius: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.ai-start-training-btn:hover {
  background: #3a5ce5;
}
.ai-start-training-btn:active {
  background: #3451b2;
}

/* --- Welcome text reveal --- */
.ai-welcome-text {
  animation: aiFadeIn 0.4s ease;
}
