/* journal.css - Daily Presence Journal - Standalone App */
/* Design: white bg, sage green #9db228, Fredoka, soft shadows, RTL-first */

/* ===== Reset & Variables ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-secondary: #ededed;
  --text: #2b2b2b;
  --text-secondary: #313131;
  --text-muted: #888888;
  --accent: #9db228;
  --accent-hover: #ab641d;
  --accent-gold: #c28e34;
  --btn-text: #ffffff;
  --radius: 3px;
  --font: 'Fredoka', Arial, Helvetica, sans-serif;
  --font-writing: 'Rubik', Arial, Helvetica, sans-serif;
  --transition: 0.3s ease;
  --shadow-soft: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-card: 0 1px 4px rgba(0,0,0,0.08);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
  padding-bottom: 70px; /* tab bar space */
}

/* ===== Screens ===== */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem 1.5rem 5rem;
  position: relative;
}

.screen.active { display: flex; }

/* Fade transition */
.screen.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

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

/* ===== Splash Screen ===== */
#screen-splash {
  justify-content: center;
  padding-bottom: 2rem;
}

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

.splash-mandala {
  width: min(50vw, 200px);
  height: min(50vw, 200px);
  margin: 0 auto 2rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-mandala-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(157,178,40,0.2);
  animation: breathe 4s ease-in-out infinite;
}

.splash-mandala-ring-2 {
  inset: 15%;
  border-color: rgba(157,178,40,0.12);
  animation-delay: 1s;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 1; }
}

.splash-symbol {
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.7;
  position: relative;
  z-index: 1;
}

.splash-title {
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.splash-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.splash-credit {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-writing);
  font-style: italic;
  margin-bottom: 2.5rem;
}

.splash-start-btn {
  background: var(--accent);
  border: none;
  color: var(--btn-text);
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 500;
  padding: 0.85rem 3rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}

.splash-start-btn:hover { background: var(--accent-hover); }

/* ===== Onboarding ===== */
#screen-onboarding {
  justify-content: center;
  padding-bottom: 2rem;
}

.onboarding-container {
  max-width: 340px;
  width: 100%;
  text-align: center;
}

.onboarding-slide {
  display: none;
  flex-direction: column;
  align-items: center;
}

.onboarding-slide.active { display: flex; }

.onboarding-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.onboarding-heading {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1rem;
}

.onboarding-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.onboarding-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 2rem;
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-secondary);
  transition: background var(--transition);
}

.onboarding-dot.active { background: var(--accent); }

.onboarding-next-btn {
  background: var(--accent);
  border: none;
  color: var(--btn-text);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 3rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  width: 100%;
  margin-bottom: 0.75rem;
}

.onboarding-next-btn:hover { background: var(--accent-hover); }

.onboarding-skip-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.4rem 1rem;
}

/* ===== Yearly Setup ===== */
.yearly-setup {
  max-width: 400px;
  width: 100%;
  padding: 1rem 0;
}

.yearly-title {
  font-size: 1.4rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: 0.5rem;
}

.yearly-intro {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.yearly-field { margin-bottom: 1.25rem; }

.yearly-field label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.yearly-input,
.yearly-textarea {
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--bg-secondary);
  border-radius: 0;
  color: var(--text);
  font-family: var(--font-writing);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  line-height: 1.6;
  transition: border-color var(--transition);
}

.yearly-input:focus,
.yearly-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.yearly-textarea { resize: none; }

.yearly-save-btn {
  background: var(--accent);
  border: none;
  color: var(--btn-text);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.8rem 2rem;
  border-radius: var(--radius);
  cursor: pointer;
  width: 100%;
  margin-top: 1rem;
  transition: background var(--transition);
}

.yearly-save-btn:hover { background: var(--accent-hover); }

/* ===== Daily Home ===== */
#screen-home { padding-top: 1.5rem; }

.home-container {
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.home-greeting {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.home-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.home-streak {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.home-streak-flame { font-size: 1.2rem; }

.home-streak-count {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent);
}

.home-streak-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Progress bar */
.home-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.home-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

.home-progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Station grid */
.home-stations {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.home-station-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: var(--bg);
  border: 2px solid var(--bg-secondary);
  border-radius: var(--radius);
  padding: 0.6rem 0.2rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  position: relative;
}

.home-station-btn:hover { border-color: var(--accent); }

.home-station-btn.completed {
  border-color: var(--accent);
  background: rgba(157,178,40,0.05);
}

.home-station-btn.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(157,178,40,0.15);
}

.home-station-icon { font-size: 1.2rem; }

.home-station-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.home-station-check {
  position: absolute;
  top: 2px;
  inset-inline-end: 4px;
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 600;
}

/* Continue button */
.home-continue-btn {
  background: var(--accent);
  border: none;
  color: var(--btn-text);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  cursor: pointer;
  width: 100%;
  transition: background var(--transition);
}

.home-continue-btn:hover { background: var(--accent-hover); }

.home-continue-btn.all-done {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

/* ===== Station Screen ===== */
.station-container {
  max-width: 420px;
  width: 100%;
  padding: 0.5rem 0;
}

/* Progress dots */
.station-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.station-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-secondary);
  transition: all var(--transition);
  cursor: pointer;
}

.station-dot.done { background: var(--accent); }

.station-dot.current {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(157,178,40,0.2);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(157,178,40,0.2); }
  50% { box-shadow: 0 0 0 5px rgba(157,178,40,0.1); }
}

/* Station header */
.station-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.station-number {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.station-title {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.station-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-writing);
  font-style: italic;
}

/* Teaching section */
.station-teaching {
  margin-bottom: 1.5rem;
  background: rgba(157,178,40,0.04);
  border-radius: var(--radius);
  overflow: hidden;
}

.station-teaching-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--accent);
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 500;
}

.station-teaching-arrow {
  font-size: 0.7rem;
  transition: transform var(--transition);
}

.station-teaching.open .station-teaching-arrow {
  transform: rotate(180deg);
}

.station-teaching-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.station-teaching.open .station-teaching-content {
  max-height: 300px;
}

.station-teaching-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
  padding: 0 1rem 1rem;
  font-family: var(--font-writing);
}

/* Station content - shared field styles */
.station-content { margin-bottom: 1.5rem; }

.field { margin-bottom: 1.25rem; }

.field-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-writing);
  margin-bottom: 0.75rem;
}

.field-input,
.field-textarea {
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--bg-secondary);
  border-radius: 0;
  color: var(--text);
  font-family: var(--font-writing);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  line-height: 1.6;
  transition: border-color var(--transition);
}

.field-input:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field-textarea {
  resize: none;
  min-height: 3.5rem;
}

/* Depth questions (station 1) */
.depth-questions { margin-bottom: 1rem; }

.depth-item { margin-bottom: 0.5rem; }

.depth-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem 0;
  text-align: start;
}

.depth-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--bg-secondary);
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: all var(--transition);
}

.depth-toggle.open .depth-toggle-icon {
  background: var(--accent);
  color: var(--btn-text);
}

.depth-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-inline-start: 1.75rem;
}

.depth-answer.open { max-height: 120px; }

/* Exercise grid (station 3) */
.exercise-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.exercise-btn {
  background: var(--bg);
  border: 2px solid var(--bg-secondary);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0.6rem 0.4rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  line-height: 1.3;
}

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

.exercise-btn.selected {
  border-color: var(--accent);
  background: rgba(157,178,40,0.06);
  color: var(--text);
}

.exercise-time {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Duration buttons */
.duration-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.duration-btn {
  flex: 1;
  background: var(--bg);
  border: 2px solid var(--bg-secondary);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.5rem;
  cursor: pointer;
  transition: all var(--transition);
}

.duration-btn:hover { border-color: var(--accent); }

.duration-btn.selected {
  border-color: var(--accent);
  background: rgba(157,178,40,0.06);
  color: var(--text);
}

/* Timer */
.timer-wrap { text-align: center; margin-bottom: 1.25rem; }

.timer-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 3px solid var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  position: relative;
  transition: border-color var(--transition);
}

.timer-circle.running { border-color: var(--accent); }

.timer-circle svg {
  position: absolute;
  inset: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  transform: rotate(-90deg);
}

.timer-circle svg circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.timer-time {
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text);
  position: relative;
  z-index: 1;
}

.timer-controls {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.timer-btn {
  background: var(--accent);
  border: none;
  color: var(--btn-text);
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

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

.timer-btn.secondary {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}

.timer-btn.secondary:hover {
  background: var(--accent);
  color: var(--btn-text);
}

/* List items (gratitude, results) */
.list-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.list-item .field-input { flex: 1; }

.list-num {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 1.25rem;
  text-align: center;
}

.list-add-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.3rem 0;
}

.list-add-btn:hover { color: var(--accent-hover); }

/* Presence score (evening) */
.score-wrap {
  text-align: center;
  margin-bottom: 1rem;
}

.score-dots {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.score-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font);
}

.score-dot:hover { border-color: var(--accent); }

.score-dot.selected {
  background: var(--accent);
  color: var(--btn-text);
  border-color: var(--accent);
}

/* Station navigation */
.station-nav {
  display: flex;
  gap: 0.75rem;
}

.station-nav-btn {
  flex: 1;
  background: var(--accent);
  border: none;
  color: var(--btn-text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.station-nav-btn:hover { background: var(--accent-hover); }

.station-prev {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}

.station-prev:hover {
  background: var(--accent);
  color: var(--btn-text);
}

/* ===== AI Companion FAB ===== */
.companion-fab {
  position: fixed;
  bottom: 90px;
  inset-inline-end: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: var(--btn-text);
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(157,178,40,0.3);
  z-index: 50;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.companion-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(157,178,40,0.4);
}

.companion-fab-icon {
  font-size: 1.4rem;
  font-weight: 600;
  font-family: var(--font);
}

/* Gentle pulse */
.companion-fab::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(157,178,40,0.2);
  animation: fabPulse 3s ease-in-out infinite;
}

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

/* ===== Companion Panel (overlay) ===== */
.companion-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.companion-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.companion-panel {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  transform: translateY(100%);
  transition: transform 0.35s ease;
}

.companion-overlay.open .companion-panel {
  transform: translateY(0);
}

.companion-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.companion-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-secondary);
  margin: 10px auto;
}

.companion-close {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

.companion-close:hover {
  color: var(--text);
}

/* Tabs */
.companion-tabs {
  display: flex;
  border-bottom: 1px solid var(--bg-secondary);
  padding: 0 1rem;
  flex-shrink: 0;
}

.companion-tab {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.75rem 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.companion-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Tab content */
.companion-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.companion-tab-content.active { display: flex; flex-direction: column; }

.companion-explain-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.8;
  font-family: var(--font-writing);
}

/* Chat messages */
.companion-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.companion-message {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.6;
}

.companion-message-ai {
  background: rgba(157,178,40,0.08);
  align-self: flex-start;
  border-bottom-right-radius: 4px;
  color: var(--text-secondary);
}

[dir="rtl"] .companion-message-ai {
  border-bottom-right-radius: 12px;
  border-bottom-left-radius: 4px;
}

.companion-message-user {
  background: var(--bg-secondary);
  align-self: flex-end;
  border-bottom-left-radius: 4px;
}

[dir="rtl"] .companion-message-user {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.companion-typing {
  display: flex;
  gap: 4px;
  padding: 0.75rem 1rem;
  align-self: flex-start;
}

.companion-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s infinite;
}

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

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Chat input */
.companion-input-area {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.companion-input {
  flex: 1;
  background: var(--bg-secondary);
  border: none;
  border-radius: 20px;
  font-family: var(--font-writing);
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  color: var(--text);
}

.companion-input:focus { outline: none; }

.companion-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: var(--btn-text);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}

.companion-send-btn:hover { background: var(--accent-hover); }

.companion-disclosure {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem 1rem 0.75rem;
  font-family: var(--font-writing);
  font-style: italic;
  flex-shrink: 0;
}

/* ===== Weekly Summary ===== */
.summary-container {
  max-width: 400px;
  width: 100%;
  padding: 1rem 0;
}

.summary-title {
  font-size: 1.3rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: 1.5rem;
}

.summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.summary-stat {
  background: var(--bg);
  border: 1px solid var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.summary-stat-value {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent);
  display: block;
  margin-bottom: 0.15rem;
}

.summary-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Calendar heatmap */
.summary-calendar {
  margin-bottom: 1.5rem;
}

.summary-cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 3px;
}

.summary-cal-header span {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.summary-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.summary-cal-day {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.summary-cal-day.active {
  background: var(--accent);
  color: var(--btn-text);
}

.summary-cal-day.today {
  border: 2px solid var(--accent);
}

/* Word tags */
.summary-words { margin-bottom: 1.5rem; }

.summary-words-title {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 0.75rem;
}

.summary-word-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.summary-word-tag {
  background: rgba(157,178,40,0.08);
  border: 1px solid rgba(157,178,40,0.2);
  border-radius: var(--radius);
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.summary-back-btn {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.65rem 2rem;
  border-radius: var(--radius);
  cursor: pointer;
  width: 100%;
  margin-top: 1rem;
  transition: all var(--transition);
}

.summary-back-btn:hover {
  background: var(--accent);
  color: var(--btn-text);
}

/* ===== Settings ===== */
.settings-container {
  max-width: 400px;
  width: 100%;
  padding: 1rem 0;
}

.settings-title {
  font-size: 1.3rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: 1.5rem;
}

.settings-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--bg-secondary);
}

.settings-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.settings-toggle-group {
  display: flex;
  gap: 0.5rem;
}

.settings-toggle-btn {
  flex: 1;
  background: transparent;
  border: 1.5px solid var(--bg-secondary);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.5rem;
  cursor: pointer;
  transition: all var(--transition);
}

.settings-toggle-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(157,178,40,0.06);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Toggle switch */
.settings-switch {
  width: 44px;
  height: 24px;
  background: var(--bg-secondary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
}

.settings-switch[aria-checked="true"] { background: var(--accent); }

.settings-switch-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  transition: inset-inline-start var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.settings-switch[aria-checked="true"] .settings-switch-thumb {
  inset-inline-start: 22px;
}

.settings-link-btn {
  background: transparent;
  border: 1.5px solid var(--bg-secondary);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.6rem 1rem;
  cursor: pointer;
  width: 100%;
  text-align: start;
  transition: all var(--transition);
}

.settings-link-btn:hover { border-color: var(--accent); color: var(--accent); }

.settings-about-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.settings-disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.settings-back-btn {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.65rem 2rem;
  border-radius: var(--radius);
  cursor: pointer;
  width: 100%;
  margin-top: 1rem;
  transition: all var(--transition);
}

.settings-back-btn:hover {
  background: var(--accent);
  color: var(--btn-text);
}

/* ===== Bottom Tab Bar ===== */
.tab-bar {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  background: var(--bg);
  border-top: 1px solid var(--bg-secondary);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.tab-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: none;
  padding: 0.6rem 0;
  cursor: pointer;
  transition: color var(--transition);
  color: var(--text-muted);
  font-family: var(--font);
}

.tab-bar-item.active { color: var(--accent); }

.tab-bar-icon { font-size: 1.2rem; }

.tab-bar-label { font-size: 0.65rem; }

/* Hide tab bar on splash/onboarding/stations */
body.no-tabs .tab-bar { display: none; }
body.no-tabs .screen { padding-bottom: 2rem; }
body.no-tabs .companion-fab { bottom: 20px; }

/* ===== Offline Banner ===== */
.offline-banner {
  position: fixed;
  bottom: 60px;
  inset-inline: 0;
  background: var(--accent);
  color: var(--btn-text);
  text-align: center;
  padding: 0.4rem;
  font-size: 0.8rem;
  z-index: 300;
  display: none;
}

body.offline .offline-banner { display: block; }

/* ===== Accessibility ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ===== Responsive ===== */
@media (min-width: 480px) {
  .exercise-grid { grid-template-columns: 1fr 1fr 1fr; }
  .home-stations { gap: 0.75rem; }
}

@media (min-width: 768px) {
  .station-container,
  .home-container,
  .summary-container,
  .settings-container,
  .yearly-setup { max-width: 480px; }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
