@font-face {
  font-family: "Cairo";
  src: url("../fonts/cairo/Cairo-Light.ttf") format("truetype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Cairo";
  src: url("../fonts/cairo/Cairo-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Cairo";
  src: url("../fonts/cairo/Cairo-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Cairo";
  src: url("../fonts/cairo/Cairo-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Cairo";
  src: url("../fonts/cairo/Cairo-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Cairo";
  src: url("../fonts/cairo/Cairo-ExtraBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

/* ════════════════════════════════════════════
   RESET & BASE
   ════════════════════════════════════════════ */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

:root {
  /* Light Mode Tokens */
  color-scheme: light;
  --page-bg: #F5F5F3;
  --section-bg: #EFEFED;
  --card-bg: #FFFFFF;
  --card-elevated: #FFFFFF;
  --text-primary: #1A1A1F;
  --text-secondary: #6B6B76;
  --text-muted: #9B99A2;
  --text-on-accent: #FFFFFF;
  --accent-primary: #5632C3;
  --accent-secondary: #49CD8B;
  --accent-tertiary: #7F724B;
  --accent-warning: #A2864C;
  --border-subtle: #E8E7E4;
  --border-medium: #D4D3CF;
  --fitbit-color: #00B0B9;
  --google-color: #4285F4;
  --ms-color: #0364B8;
  --progress-track: #E8E7E4;
  --progress-fill-start: #5632C3;
  --progress-fill-end: #7B5AE0;
  --habit-check-bg: #F0EEF9;
  --habit-check-active: #5632C3;
  --calendar-today-bg: #5632C3;
  --calendar-today-text: #FFFFFF;
  --calendar-event: #E8F5E9;
  --calendar-event-dot: #49CD8B;
  --ai-card-bg: #F8F5FF;
  --ai-card-border: #E0D4F5;
  --quote-bg: #FDF8F0;
  --quote-border: #F0E0C4;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;
  --nav-height: 82px;
  --status-height: 54px;
  /* Grow tab tokens */
  --grow-gradient-start: #5632C3;
  --grow-gradient-end: #7B5AE0;
  --course-purple: #5632C3;
  --course-green: #49CD8B;
  --course-orange: #E8913A;
  --course-blue: #3A8EE8;
  --course-pink: #D94F8A;
  --course-teal: #2ABFBF;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--page-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

[dir="rtl"] body,
[dir="rtl"] button,
[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] textarea {
  font-family: "Cairo", Tahoma, Arial, sans-serif;
}

/* Book of the Day */
.botd-card {
  width: 100%;
  display: flex;
  gap: 16px;
  align-items: stretch;
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--card-bg), var(--quote-bg));
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.botd-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.botd-cover { width: 92px; min-width: 92px; height: 132px; border-radius: 9px; overflow: hidden; box-shadow: 0 7px 18px rgba(35,28,19,.2); }
.botd-cover img { width: 100%; height: 100%; display: block; object-fit: cover; }
.botd-info { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.botd-label { color: var(--accent-warning); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; margin-bottom: 7px; }
.botd-title { font-size: 16px; line-height: 1.25; margin-bottom: 4px; }
.botd-author { color: var(--text-muted); font-size: 11px; margin-bottom: 8px; }
.botd-meta { display: flex; gap: 12px; color: var(--text-secondary); font-size: 10px; margin-bottom: 9px; }
.botd-meta span:first-child { color: var(--accent-warning); }
.botd-cta { color: var(--accent-primary); font-size: 11px; font-weight: 700; }

body.book-view-open { overflow: hidden; }
.book-view-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  justify-content: center;
  background: rgba(17,14,23,.38);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s;
}
.book-view-overlay.show { opacity: 1; visibility: visible; }
.book-view-content {
  width: 100%;
  max-width: 600px;
  height: 100%;
  overflow-y: auto;
  background: var(--page-bg);
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
}
.book-view-overlay.show .book-view-content { transform: translateX(0); }
.bv-hero { background: linear-gradient(145deg,#312069,#5632c3); color: white; padding: 18px 20px 30px; position: relative; overflow: hidden; }
.bv-hero::after { content:""; position:absolute; width:190px; height:190px; border-radius:50%; background:rgba(255,255,255,.06); right:-70px; bottom:-90px; }
.bv-nav-bar { display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; position:relative; z-index:1; }
.bv-nav-title { font-size:13px; font-weight:700; }
.bv-back-btn,.bv-action-btn {
  width:38px; height:38px; border:0; border-radius:50%; background:rgba(255,255,255,.14); color:white;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.bv-back-btn svg,.bv-action-btn svg { width:18px; height:18px; }
.bv-action-btn.saved { background:#fff; color:#e34b5f; }
.bv-action-btn.saved svg { fill:currentColor; }
.bv-hero-main { display:flex; gap:20px; align-items:flex-end; position:relative; z-index:1; }
.bv-cover { width:112px; min-width:112px; height:160px; border-radius:9px; overflow:hidden; box-shadow:0 12px 28px rgba(0,0,0,.35); }
.bv-cover img { width:100%; height:100%; object-fit:cover; }
.bv-cat-badge { display:inline-block; background:rgba(255,255,255,.16); border-radius:99px; padding:5px 9px; font-size:9px; font-weight:700; text-transform:uppercase; margin-bottom:9px; }
.bv-book-title { font-size:21px; line-height:1.15; color:#fff; margin:0 0 8px; }
.bv-book-author { font-size:12px; color:rgba(255,255,255,.75); }
.bv-stats-row { display:flex; margin:-14px 20px 22px; position:relative; z-index:2; padding:14px 6px; background:var(--card-bg); border-radius:var(--radius-lg); box-shadow:var(--shadow-md); }
.bv-stat { flex:1; display:flex; flex-direction:column; align-items:center; gap:2px; text-align:center; }
.bv-stat:not(:last-child) { border-right:1px solid var(--border-subtle); }
.bv-stat b { color:var(--accent-tertiary); font-size:14px; }
.bv-stat-val { font-size:13px; font-weight:700; color:var(--text-primary); }
.bv-stat-label { color:var(--text-muted); font-size:8px; font-weight:700; text-transform:uppercase; }
.bv-section { padding:0 20px; margin-bottom:22px; }
.bv-section-head { display:flex; align-items:center; gap:8px; margin-bottom:11px; }
.bv-section-icon { width:27px; height:27px; border-radius:8px; display:flex; align-items:center; justify-content:center; color:white; font-size:13px; font-weight:800; }
.purple-icon { background:#5632c3; }.green-icon { background:#3ab575; }.orange-icon { background:#d47a25; }.blue-icon { background:#3a8ee8; }
.bv-section-title { color:var(--text-primary); font-size:15px; margin:0; }
.bv-summary-text,.bv-takeaways,.bv-author-card { background:var(--card-bg); border:1px solid var(--border-subtle); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); }
.bv-summary-text { padding:16px; color:var(--text-secondary); font-size:13px; line-height:1.65; }
.bv-summary-text strong { color:var(--text-primary); }
.bv-takeaways { padding:4px 16px; }
.bv-takeaway { display:flex; gap:12px; padding:13px 0; border-bottom:1px solid var(--border-subtle); }
.bv-takeaway:last-child { border-bottom:0; }
.bv-takeaway-num { width:27px; height:27px; min-width:27px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--habit-check-bg); color:var(--accent-primary); font-size:12px; font-weight:800; }
.bv-takeaway h3 { color:var(--text-primary); font-size:13px; margin:0 0 3px; }
.bv-takeaway p { color:var(--text-muted); font-size:11px; line-height:1.45; }
.bv-player { padding:18px; border-radius:var(--radius-lg); color:#fff; background:linear-gradient(135deg,#5632c3,#7b5ae0); }
.bv-player-head { display:flex; align-items:center; gap:11px; margin-bottom:14px; }
.bv-player-head small,.bv-player-head strong { display:block; }
.bv-player-head small { font-size:9px; text-transform:uppercase; opacity:.8; margin-bottom:2px; }
.bv-player-head strong { font-size:13px; }
.bv-player-play { width:46px; height:46px; min-width:46px; border:0; border-radius:50%; background:#fff; color:var(--accent-primary); display:flex; align-items:center; justify-content:center; cursor:pointer; }
.bv-player-play svg { width:20px; height:20px; }
.bv-player-progress { height:4px; background:rgba(255,255,255,.25); border-radius:8px; overflow:hidden; }
.bv-player-progress-fill { width:0; height:100%; background:#fff; }
.bv-player-times { display:flex; justify-content:space-between; margin-top:7px; font-size:9px; opacity:.8; }
.bv-author-card { display:flex; gap:14px; padding:15px; align-items:center; }
.bv-author-avatar { width:56px; height:56px; min-width:56px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; background:linear-gradient(135deg,#1a3a5c,#2a6a9e); }
.bv-author-card h3 { color:var(--text-primary); font-size:14px; margin:0 0 2px; }
.bv-author-card span { color:var(--accent-primary); font-size:10px; font-weight:600; }
.bv-author-card p { color:var(--text-muted); font-size:10px; line-height:1.4; margin-top:5px; }
.bv-actions { display:flex; gap:10px; padding:0 20px 28px; }
.bv-btn { flex:1; border-radius:99px; padding:13px; font:700 12px inherit; cursor:pointer; }
.bv-btn.primary { background:var(--accent-primary); color:#fff; border:1px solid var(--accent-primary); }
.bv-btn.secondary { background:var(--card-bg); color:var(--text-primary); border:1px solid var(--border-subtle); }
[dir="rtl"] .botd-card { text-align:right; }
[dir="rtl"] .book-view-content { transform:translateX(-100%); }
[dir="rtl"] .book-view-overlay.show .book-view-content { transform:translateX(0); }
@media (max-width:420px) {
  .bv-book-title { font-size:18px; }
  .bv-cover { width:96px; min-width:96px; height:138px; }
  .bv-stat-label { font-size:7px; }
}

/* Source-aligned Book of the Day overrides (sample.html) */
.botd-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  color: inherit;
  text-decoration: none;
}
.botd-card:hover { transform: none; box-shadow: var(--shadow-md); }
.botd-card:active { transform: scale(.98); }
.botd-card::before {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle,rgba(127,114,75,.08),transparent 70%);
  border-radius: 50%;
}
.botd-cover {
  width: 70px;
  min-width: 70px;
  height: 98px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}
.botd-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.botd-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--accent-tertiary);
  background: var(--quote-bg);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 6px;
}
.botd-title {
  width: 100%;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.2px;
  margin-bottom: 2px;
  line-height: 1.25;
  display: block;
  color: var(--text-primary);
  overflow-wrap: normal;
  word-break: normal;
  white-space: normal;
}
.botd-author { font-size: 11px; font-weight: 500; margin-bottom: 8px; }
.botd-meta { gap: 10px; margin-bottom: 8px; }
.botd-meta span { color: var(--text-secondary); font-size: 10px; font-weight: 500; }
.botd-meta span:first-child { color: var(--text-secondary); }
.botd-cta { font-size: 11px; font-weight: 700; }

/* The book detail is a real route; retain the sample's visual page treatment. */
.book-detail-page {
  --page-bg: #f5f5f3;
  --section-bg: #efefed;
  --card-bg: #fff;
  --text-primary: #1a1a1f;
  --text-secondary: #6b6b76;
  --text-muted: #9b99a2;
  --border-subtle: #e8e7e4;
  --habit-check-bg: #f0eef9;
  display: block;
  background: #e2e1de;
  color: var(--text-primary);
}
.book-detail-page .book-view-overlay {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: 600px;
  min-height: 100vh;
  margin: 0 auto;
  display: block;
  visibility: visible;
  opacity: 1;
  background: var(--page-bg);
}
.book-detail-page .book-view-content {
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 100vh;
  overflow: visible;
  transform: none;
  background: var(--page-bg);
  padding-bottom: 36px;
}
.book-detail-page .bv-hero {
  position: relative;
  padding: 24px 20px;
  background: linear-gradient(160deg,#2a3b5c,#1a3a5c 60%,#1f2f4a);
}
.book-detail-page .bv-nav-bar { margin-bottom: 22px; }
.book-detail-page .bv-nav-title { font-size: 14px; font-weight: 600; letter-spacing: .2px; }
.book-detail-page .bv-nav-title,
.book-detail-page .bv-book-title { color: #fff; }
.book-detail-page .bv-book-author { color: rgba(255,255,255,.85); }
.book-detail-page .bv-hero-main { gap: 18px; }
.book-detail-page .bv-cover {
  width: 120px;
  min-width: 120px;
  height: 172px;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(0,0,0,.4);
}
.book-detail-page .bv-cat-badge { padding: 4px 10px; margin-bottom: 10px; }
.book-detail-page .bv-book-title { font-size: 20px; font-weight: 800; letter-spacing: -.4px; line-height: 1.15; margin-bottom: 6px; }
.book-detail-page .bv-book-author { font-size: 13px; font-weight: 500; opacity: .85; }
.book-detail-page .bv-stats-row { padding: 14px 8px; margin: -16px 20px 18px; }
.book-detail-page .bv-stat { gap: 3px; }
.book-detail-page .bv-stat-val { font-size: 14px; }
.book-detail-page .bv-stat-label { font-size: 9px; letter-spacing: .3px; }
.book-detail-page .bv-section { padding: 0 20px; margin-bottom: 22px; }
.book-detail-page .bv-section-head { margin-bottom: 12px; }
.book-detail-page .bv-summary-text { border: 0; border-radius: var(--radius-md); padding: 14px 16px; line-height: 1.6; }
.book-detail-page .bv-section-title,
.book-detail-page .bv-takeaway h3,
.book-detail-page .bv-author-card h3,
.book-detail-page .bv-stat-val { color: #1a1a1f; }
.book-detail-page .bv-summary-text { color: #6b6b76; }
.book-detail-page .bv-summary-text strong { color: #1a1a1f; }
.book-detail-page .bv-takeaway p,
.book-detail-page .bv-author-card p,
.book-detail-page .bv-stat-label { color: #9b99a2; }
.book-detail-page .bv-player,
.book-detail-page .bv-player strong,
.book-detail-page .bv-player small,
.book-detail-page .bv-player-times { color: #fff; }
.book-detail-page .bv-takeaways { border: 0; padding: 6px 16px; }
.book-detail-page .bv-author-card { border: 0; padding: 16px; }
.book-detail-page .bv-player-play { width: 48px; height: 48px; min-width: 48px; }
.book-detail-page .bv-actions { margin-bottom: 16px; padding-bottom: 0; }
@media (max-width:420px) {
  .book-detail-page .bv-cover { width: 112px; min-width: 112px; height: 160px; }
  .book-detail-page .bv-book-title { font-size: 19px; }
}

/* ════════════════════════════════════════════
   GLOBAL REFINEMENTS
   ════════════════════════════════════════════ */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.mobile-first-site {
  display: flex;
  flex-direction: column;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  box-shadow: 0 0 60px rgba(0,0,0,0.08);
  transition: background-color 0.3s ease;
}

/* Page Fade-in */
main {
  animation: fadeIn 0.4s ease-out;
}

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

/* Refined Cards */
.tracker-card, .calendar-card, .habits-card, .ai-card, .circle-card, .continue-card, .goal-card, .mood-card {
  border: 1px solid var(--border-subtle);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tracker-card:hover, .calendar-card:hover, .habits-card:hover {
  box-shadow: var(--shadow-lg);
}

/* Micro-interactions */
.habit-item {
  transition: background-color 0.2s ease, transform 0.1s ease;
}
.habit-item:active {
  transform: scale(0.98);
}
.habit-item.completed {
  background-color: rgba(0, 0, 0, 0.01);
}

/* ════════════════════════════════════════════
   MODAL / OVERLAY FOR QUICK ADD
   ════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 210;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; animation: fadeIn 0.2s ease-out; }

.modal-content {
  background: var(--card-bg);
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.show .modal-content { transform: scale(1); }

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.modal-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-subtle);
  background: var(--section-bg);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  margin-bottom: 20px;
  transition: border-color 0.2s;
}
.modal-input:focus { border-color: var(--accent-primary); }

.modal-actions {
  display: flex;
  gap: 12px;
}
.btn-primary, .btn-secondary {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 14px;
  transition: opacity 0.2s;
}
.btn-primary { background: var(--accent-primary); color: white; }
.btn-secondary { background: var(--section-bg); color: var(--text-secondary); }
.btn-primary:active, .btn-secondary:active { opacity: 0.8; }

/* ════════════════════════════════════════════
   SCROLLABLE CONTENT
   ════════════════════════════════════════════ */
.main-container {
  flex: 1;
  padding-bottom: calc(var(--nav-height) + 16px);
  scroll-behavior: smooth;
  width: 100%;
}

/* ════════════════════════════════════════════
   TAB PANELS
   ════════════════════════════════════════════ */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* ════════════════════════════════════════════
   STATUS BAR
   ════════════════════════════════════════════ */
.status-bar {
  height: var(--status-height);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 32px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  position: sticky;
  top: 0;
  background: var(--page-bg);
  z-index: 50;
}
.status-bar .time { letter-spacing: -0.3px; }
.status-icons { display: flex; gap: 6px; align-items: center; }
.status-icons svg { width: 16px; height: 16px; }

/* ════════════════════════════════════════════
   MAIN PADDING
   ════════════════════════════════════════════ */
.main { padding: 8px 20px 0; }

/* ════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════ */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.greeting { display: flex; flex-direction: column; }
.greeting-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.greeting-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.header-actions { display: flex; gap: 10px; }
.icon-btn {
  width: 42px; height: 42px;
  border-radius: var(--radius-full);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn.primary-btn {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(86,50,195,0.35);
}
.icon-btn.secondary-btn {
  background: var(--card-bg);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}
.icon-btn svg { width: 20px; height: 20px; }
.notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #EF4444;
  border: 2px solid var(--page-bg);
}

/* ════════════════════════════════════════════
   COMMITMENT TRACKER
   ════════════════════════════════════════════ */
.tracker-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 14px;
}
@media (max-width: 380px) {
  .tracker-card {
    padding: 16px 14px;
  }
}
.tracker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.tracker-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.1px;
}
.tracker-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-primary);
}
.tracker-bar-track {
  width: 100%;
  height: 10px;
  background: var(--progress-track);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}
.tracker-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--progress-fill-start), var(--progress-fill-end));
  width: 78%;
  position: relative;
  animation: barFill 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.tracker-bar-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(86,50,195,0.4);
  border: 2.5px solid var(--accent-primary);
}
[dir="rtl"] .tracker-bar-fill::after {
  right: auto;
  left: 0;
}
@keyframes barFill {
  from { width: 0; }
}
.tracker-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 14px;
  background: var(--habit-check-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.tracker-stat {
  flex: 1 1 30%; /* Allow shrinking and growing, with a base of 30% */
  min-width: 80px; /* Ensure they don't get too squished */
  text-align: center;
  padding: 12px 8px;
}
.tracker-stat:not(:last-child) {
  border-right: 1px solid var(--border-subtle);
}
@media (max-width: 360px) {
  .tracker-stat {
    flex: 1 1 50%;
  }
  .tracker-stat:nth-child(2) {
    border-right: none;
  }
  [dir="rtl"] .tracker-stat:nth-child(2) {
    border-left: none;
  }
}
[dir="rtl"] .tracker-stat:not(:last-child) {
  border-right: none;
  border-left: 1px solid var(--border-subtle);
}
.stat-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.stat-num.green { color: var(--accent-secondary); }
.stat-num.purple { color: var(--accent-primary); }
.stat-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.1px;
}

/* ════════════════════════════════════════════
   MOTIVATIONAL QUOTE
   ════════════════════════════════════════════ */
.quote-card {
  background: var(--quote-bg);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 14px;
  border-left: 3px solid var(--quote-border);
  display: flex;
  align-items: center;
  gap: 14px;
}
[dir="rtl"] .quote-card {
  border-left: none;
  border-right: 3px solid var(--quote-border);
}
.quote-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--quote-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quote-icon svg { width: 18px; height: 18px; color: var(--accent-tertiary); }
.quote-text {
  font-size: 13px;
  font-weight: 400;
  color: var(--accent-tertiary);
  line-height: 1.45;
  font-style: italic;
}
.quote-author {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 3px;
  font-style: normal;
}

/* ════════════════════════════════════════════
   CALENDAR VIEW SELECTOR
   ════════════════════════════════════════════ */
.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.section-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-primary);
  text-decoration: none;
  cursor: pointer;
}

.cal-view-toggle {
  display: flex;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 3px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  border: 1px solid var(--border-subtle);
}
.cal-tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: none;
  background: transparent;
}
.cal-tab.active {
  background: var(--accent-primary);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(86,50,195,0.3);
}

/* ════════════════════════════════════════════
   CALENDAR GRID
   ════════════════════════════════════════════ */
.calendar-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 14px;
}
.cal-month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.cal-month {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.cal-nav {
  display: flex;
  gap: 8px;
}
.cal-nav-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.cal-nav-btn:hover { background: var(--section-bg); }
.cal-nav-btn svg { width: 14px; height: 14px; }
[dir="rtl"] .cal-nav-btn svg { transform: scaleX(-1); }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.cal-day-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cal-day {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-primary);
  padding: 7px 0;
  border-radius: var(--radius-sm);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.cal-day:hover { background: var(--section-bg); }
.cal-day.empty { color: transparent; pointer-events: none; }
.cal-day.other-month { color: var(--text-muted); opacity: 0.4; }
.cal-day.today {
  background: var(--calendar-today-bg);
  color: var(--calendar-today-text);
  font-weight: 700;
}
.cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--calendar-event-dot);
}
.cal-day.today.has-event::after { background: white; }
.cal-day.past { color: var(--text-muted); opacity: 0.5; }

/* ════════════════════════════════════════════
   ECOSYSTEM SYNC BADGES
   ════════════════════════════════════════════ */
.sync-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.sync-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1px;
}
.sync-badge.fitbit {
  background: rgba(0,176,185,0.08);
  color: var(--fitbit-color);
  border: 1px solid rgba(0,176,185,0.15);
}
.sync-badge.google {
  background: rgba(66,133,244,0.08);
  color: var(--google-color);
  border: 1px solid rgba(66,133,244,0.15);
}
.sync-badge.microsoft {
  background: rgba(3,100,184,0.08);
  color: var(--ms-color);
  border: 1px solid rgba(3,100,184,0.15);
}
.sync-badge svg { width: 12px; height: 12px; }
.sync-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-left: 2px;
}
[dir="rtl"] .sync-dot {
  margin-left: 0;
  margin-right: 2px;
}
.sync-dot.active { background: var(--accent-secondary); }
.sync-dot.pending { background: var(--accent-warning); }

/* ════════════════════════════════════════════
   HABIT CHECKLIST
   ════════════════════════════════════════════ */
.habits-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-md);
  margin-bottom: 14px;
}
.habit-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: opacity 0.2s;
}
.habit-item:last-child { border-bottom: none; }
.habit-checkbox {
  width: 24px; height: 24px;
  border-radius: 8px;
  border: 2px solid var(--border-medium);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-top: 1px;
  cursor: pointer;
}
.habit-checkbox.checked {
  background: var(--habit-check-active);
  border-color: var(--habit-check-active);
  box-shadow: 0 2px 8px rgba(86,50,195,0.25);
}
.habit-checkbox svg {
  width: 14px; height: 14px;
  color: white;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.habit-checkbox.checked svg {
  opacity: 1;
  transform: scale(1);
}
.habit-content { flex: 1; min-width: 0; }
.habit-top { display: flex; justify-content: space-between; align-items: center; }
.habit-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  transition: color 0.2s;
}
.habit-item.completed .habit-name {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--border-medium);
}
.habit-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--habit-check-bg);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.streak-badge svg { width: 11px; height: 11px; }
.habit-source {
  font-size: 10px;
  font-weight: 500;
  color: var(--fitbit-color);
  display: flex;
  align-items: center;
  gap: 3px;
}
.habit-note {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 5px 8px;
  background: var(--section-bg);
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

/* ════════════════════════════════════════════
   AI INSIGHT CARD
   ════════════════════════════════════════════ */
.ai-card {
  background: var(--ai-card-bg);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--ai-card-border);
  position: relative;
  overflow: hidden;
}
.ai-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(86,50,195,0.08) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(30%, -30%);
}
[dir="rtl"] .ai-card::before {
  right: auto;
  left: 0;
  transform: translate(-30%, -30%);
}
.ai-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.ai-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-icon svg { width: 15px; height: 15px; color: white; }
.ai-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.ai-text {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.55;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}
.ai-text strong { font-weight: 600; }
.ai-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-primary);
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(86,50,195,0.3);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 1;
}
.ai-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(86,50,195,0.4); }
.ai-cta:active { transform: scale(0.97); }
.ai-cta svg { width: 16px; height: 16px; }
[dir="rtl"] .ai-cta svg { transform: scaleX(-1); }

/* ════════════════════════════════════════════
   ACTIVE CHALLENGES PREVIEW
   ════════════════════════════════════════════ */
.challenges-preview {
  background: linear-gradient(135deg, #49CD8B, #3AB575);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 14px;
  color: white;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 16px rgba(73,205,139,0.3);
}
.challenges-preview:active { transform: scale(0.98); }
.challenge-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.challenge-icon svg { width: 22px; height: 22px; color: white; }
.challenge-info { flex: 1; }
.challenge-label {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.challenge-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.challenge-arrow svg { width: 20px; height: 20px; color: white; opacity: 0.7; }
[dir="rtl"] .challenge-arrow svg { transform: scaleX(-1); }

/* ════════════════════════════════════════════
   BOTTOM NAVIGATION
   ════════════════════════════════════════════ */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  padding-top: 8px;
  z-index: 60;
}

/* Full-screen mobile app shell. Desktop keeps the centered presentation frame. */
@media (max-width: 767px) {
  html {
    width: 100%;
    min-height: 100%;
    background: var(--page-bg);
  }
  body.mobile-first-site {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    box-shadow: none;
    background: var(--page-bg);
  }
  .status-bar { display: none; }
  .main-container {
    width: 100%;
    min-width: 0;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
  .main {
    width: 100%;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  }
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: calc(66px + env(safe-area-inset-bottom));
    padding: 7px max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left));
    align-items: flex-start;
    box-shadow: 0 -5px 22px rgba(20,16,35,.08);
  }
  .nav-item {
    min-width: 0;
    min-height: 52px;
    padding: 5px 0 2px;
  }
  .nav-item svg { width: 23px; height: 23px; }
  .nav-item span { font-size: 10px; white-space: nowrap; }
  .search-overlay,
  .action-sheet {
    left: 0;
    width: 100%;
    max-width: none;
  }
  .search-overlay { transform: translateY(-100%); }
  .search-overlay.show { transform: translateY(0); }
  .action-sheet {
    transform: translateY(100%);
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
  .action-sheet.show { transform: translateY(0); }
  .search-overlay-header {
    padding-top: max(18px, env(safe-area-inset-top));
  }
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal-content {
    width: 100%;
    max-width: none;
    max-height: 90dvh;
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    padding: 22px 18px max(22px, env(safe-area-inset-bottom));
    transform: translateY(100%);
  }
  .modal-overlay.show .modal-content { transform: translateY(0); }
  .sync-badges, .courses-scroll, .books-scroll { scrollbar-width: none; }
  .sync-badges::-webkit-scrollbar,
  .courses-scroll::-webkit-scrollbar,
  .books-scroll::-webkit-scrollbar { display: none; }
  .book-detail-page .book-view-overlay {
    width: 100%;
    max-width: none;
    margin: 0;
  }
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 6px 0;
  transition: transform 0.2s;
}
.nav-item:active { transform: scale(0.9); }
.nav-item svg { width: 24px; height: 24px; color: var(--text-muted); transition: color 0.2s; }
.nav-item span {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
  letter-spacing: 0.1px;
}
.nav-item.active svg { color: var(--accent-primary); }
.nav-item.active span { color: var(--accent-primary); font-weight: 600; }
.nav-item .nav-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent-primary);
  opacity: 0;
  transition: opacity 0.2s;
}
.nav-item.active .nav-dot { opacity: 1; }

/* ════════════════════════════════════════════
   HOME INDICATOR
   ════════════════════════════════════════════ */
.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: var(--text-primary);
  border-radius: 3px;
  opacity: 0.2;
  z-index: 70;
}

/* ════════════════════════════════════════════
   GROW TAB - LEARNING STREAK HERO
   ════════════════════════════════════════════ */
.grow-hero {
  background: linear-gradient(135deg, var(--grow-gradient-start), var(--grow-gradient-end));
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  color: white;
  position: relative;
  overflow: hidden;
}
.grow-hero::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.grow-hero::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -10px;
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.grow-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.grow-hero-title {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0.2px;
}
.grow-hero-streak {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}
.grow-hero-streak svg { width: 16px; height: 16px; }
.grow-hero-stats {
  display: flex;
  gap: 0;
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.grow-hero-stat {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
}
.grow-hero-stat:not(:last-child) {
  border-right: 1px solid rgba(255,255,255,0.12);
}
[dir="rtl"] .grow-hero-stat:not(:last-child) {
  border-right: none;
  border-left: 1px solid rgba(255,255,255,0.12);
}
.grow-hero-stat-num {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.grow-hero-stat-label {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.75;
  margin-top: 2px;
  letter-spacing: 0.2px;
}

/* ════════════════════════════════════════════
   GROW TAB - CONTINUE LEARNING CARDS
   ════════════════════════════════════════════ */
.continue-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.continue-card:active { transform: scale(0.98); }
.continue-card-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.continue-card-thumb svg { width: 28px; height: 28px; color: white; z-index: 1; position: relative; }
.continue-card-info { flex: 1; min-width: 0; }
.continue-card-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 5px;
}
.continue-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.continue-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.continue-card-meta span {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}
.continue-card-meta svg { width: 12px; height: 12px; }
.continue-progress-bar {
  width: 100%;
  height: 5px;
  background: var(--progress-track);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.continue-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.continue-card-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--section-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.continue-card-arrow svg { width: 16px; height: 16px; color: var(--text-muted); }
[dir="rtl"] .continue-card-arrow svg { transform: scaleX(-1); }

/* ════════════════════════════════════════════
   GROW TAB - FEATURED COURSES HORIZONTAL SCROLL
   ════════════════════════════════════════════ */
.courses-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.courses-scroll::-webkit-scrollbar { display: none; }
.course-card {
  min-width: 200px;
  max-width: 200px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}
.course-card:active { transform: scale(0.97); }
.course-card-banner {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.course-card-banner svg {
  width: 36px; height: 36px;
  color: white;
  opacity: 0.9;
  z-index: 1;
  position: relative;
}
.course-card-banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(to top, rgba(0,0,0,0.15), transparent);
}
.course-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}
[dir="rtl"] .course-card-badge {
  right: auto;
  left: 8px;
}
.course-card-badge.popular {
  background: rgba(255,255,255,0.9);
  color: var(--course-orange);
}
.course-card-badge.new {
  background: rgba(255,255,255,0.9);
  color: var(--course-green);
}
.course-card-body { padding: 12px 14px 14px; }
.course-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.1px;
  margin-bottom: 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-card-instructor {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.course-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.course-card-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}
.course-card-rating svg { width: 12px; height: 12px; color: #FBBF24; }
.course-card-duration {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ════════════════════════════════════════════
   GROW TAB - SKILL CATEGORIES GRID
   ════════════════════════════════════════════ */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.skill-item {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--border-subtle);
}
.skill-item:active { transform: scale(0.96); }
.skill-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.skill-icon svg { width: 18px; height: 18px; color: white; }
.skill-info { flex: 1; min-width: 0; }
.skill-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.1px;
  margin-bottom: 2px;
}
.skill-count {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ════════════════════════════════════════════
   GROW TAB - RECOMMENDED BOOKS
   ════════════════════════════════════════════ */
.books-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
}
.books-scroll::-webkit-scrollbar { display: none; }
.book-card {
  min-width: 120px;
  max-width: 120px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s;
}
.book-card:active { transform: scale(0.96); }
.book-cover {
  width: 120px;
  height: 168px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  display: flex;
  align-items: flex-end;
  padding: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.book-cover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
}
.book-cover-title {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  color: white;
  line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.book-author {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.book-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-primary);
}

/* ════════════════════════════════════════════
   GROW TAB - AI LEARNING PATH
   ════════════════════════════════════════════ */
.learning-path-card {
  background: var(--ai-card-bg);
  border: 1px solid var(--ai-card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.learning-path-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(86,50,195,0.06) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(30%, -30%);
}
[dir="rtl"] .learning-path-card::before {
  right: auto;
  left: 0;
  transform: translate(-30%, -30%);
}
.learning-path-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.learning-path-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.learning-path-icon svg { width: 15px; height: 15px; color: white; }
.learning-path-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.learning-path-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.1px;
  position: relative;
  z-index: 1;
}
.learning-path-steps {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
}
.lp-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.lp-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.lp-step-dot.done {
  background: var(--accent-secondary);
  color: white;
}
.lp-step-dot.current {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(86,50,195,0.2);
}
.lp-step-dot.upcoming {
  background: var(--progress-track);
  color: var(--text-muted);
}
.lp-step-line {
  position: absolute;
  top: 14px;
  left: 14%;
  right: 14%;
  height: 3px;
  background: var(--progress-track);
  border-radius: 2px;
  z-index: 0;
}
.lp-step-line-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
  border-radius: 2px;
  width: 50%;
}
[dir="rtl"] .lp-step-line-fill {
  background: linear-gradient(270deg, var(--accent-secondary), var(--accent-primary));
}
.lp-step-name {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.2px;
}
.lp-step-name.current {
  color: var(--accent-primary);
}
.learning-path-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(86,50,195,0.25);
  transition: all 0.2s;
  position: relative;
  z-index: 1;
}
.learning-path-cta svg { width: 14px; height: 14px; }
[dir="rtl"] .learning-path-cta svg { transform: scaleX(-1); }
.learning-path-cta:active { transform: scale(0.97); }

/* ════════════════════════════════════════════
   COACH TAB - AI CHAT INTERFACE
   ════════════════════════════════════════════ */
.coach-chat-area {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 14px;
}
.chat-message {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  animation: chatFadeIn 0.4s ease-out;
}
@keyframes chatFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-message:last-child { margin-bottom: 0; }
.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-avatar.ai {
  background: linear-gradient(135deg, var(--accent-primary), var(--grow-gradient-end));
}
.chat-avatar.ai svg { width: 16px; height: 16px; color: white; }
.chat-avatar.user {
  background: var(--section-bg);
  border: 1.5px solid var(--border-subtle);
}
.chat-avatar.user svg { width: 16px; height: 16px; color: var(--text-secondary); }
.chat-bubble {
  max-width: 260px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
}
.chat-bubble.ai-bubble {
  background: var(--section-bg);
  border-top-left-radius: 4px;
}
[dir="rtl"] .chat-bubble.ai-bubble {
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: 4px;
}
.chat-bubble.user-bubble {
  background: var(--accent-primary);
  color: white;
  border-top-right-radius: 4px;
  margin-left: auto;
}
[dir="rtl"] .chat-bubble.user-bubble {
  border-top-right-radius: var(--radius-md);
  border-top-left-radius: 4px;
  margin-left: 0;
  margin-right: auto;
}
.chat-bubble strong { font-weight: 600; }
.chat-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  padding-left: 42px;
}
[dir="rtl"] .chat-time {
  padding-left: 0;
  padding-right: 42px;
}
.chat-time.user-time {
  text-align: right;
  padding-left: 0;
  padding-right: 42px;
}
[dir="rtl"] .chat-time.user-time {
  text-align: left;
  padding-right: 0;
  padding-left: 42px;
}
.chat-input-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--section-bg);
  border-radius: var(--radius-full);
  padding: 4px 4px 4px 16px;
  border: 1px solid var(--border-subtle);
  margin-top: 14px;
}
[dir="rtl"] .chat-input-bar {
  padding: 4px 16px 4px 4px;
}
.chat-input-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  padding: 8px 0;
}
.chat-input-bar input::placeholder { color: var(--text-muted); }
.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(86,50,195,0.3);
  transition: transform 0.2s;
}
.chat-send-btn:active { transform: scale(0.92); }
.chat-send-btn svg { width: 16px; height: 16px; color: white; }
[dir="rtl"] .chat-send-btn svg { transform: scaleX(-1); }

/* ════════════════════════════════════════════
   COACH TAB - QUICK ACTIONS
   ════════════════════════════════════════════ */
.quick-actions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
}
.quick-actions::-webkit-scrollbar { display: none; }
.quick-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--card-bg);
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.quick-action-chip:active { transform: scale(0.95); }
.quick-action-chip.active {
  background: var(--habit-check-bg);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.quick-action-chip svg { width: 14px; height: 14px; }

/* ════════════════════════════════════════════
   COACH TAB - MOOD CHECK-IN
   ════════════════════════════════════════════ */
.mood-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-md);
  margin-bottom: 14px;
  text-align: center;
}
.mood-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.1px;
}
.mood-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.mood-options {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.mood-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  border: 1.5px solid transparent;
}
.mood-option:active { transform: scale(0.92); }
.mood-option.selected {
  background: var(--habit-check-bg);
  border-color: var(--accent-primary);
}
.mood-emoji {
  font-size: 26px;
  line-height: 1;
}
.mood-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
.mood-option.selected .mood-label {
  color: var(--accent-primary);
}

/* ════════════════════════════════════════════
   COACH TAB - GOAL TRACKING CARDS
   ════════════════════════════════════════════ */
.goal-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.goal-card:active { transform: scale(0.98); }
.goal-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.goal-icon-sm {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.goal-icon-sm svg { width: 18px; height: 18px; color: white; }
.goal-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.goal-status-badge.on-track {
  background: rgba(73,205,139,0.1);
  color: var(--accent-secondary);
}
.goal-status-badge.behind {
  background: rgba(232,145,58,0.1);
  color: var(--course-orange);
}
.goal-status-badge.not-started {
  background: var(--section-bg);
  color: var(--text-muted);
}
.goal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.1px;
  margin-bottom: 4px;
}
.goal-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}
.goal-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.goal-progress-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
.goal-progress-pct {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-primary);
}
.goal-progress-track {
  width: 100%;
  height: 6px;
  background: var(--progress-track);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.goal-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

/* ════════════════════════════════════════════
   COACH TAB - UPCOMING SESSIONS
   ════════════════════════════════════════════ */
.session-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.session-card:active { transform: scale(0.98); }
.session-time-block {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--habit-check-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.session-time-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}
.session-time-unit {
  font-size: 8px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1px;
}
.session-info { flex: 1; min-width: 0; }
.session-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.1px;
  margin-bottom: 2px;
}
.session-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.session-meta-row span {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}
.session-meta-row svg { width: 12px; height: 12px; }
.session-type-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.session-type-dot.video { background: var(--course-blue); }
.session-type-dot.voice { background: var(--accent-secondary); }
.session-type-dot.chat { background: var(--accent-primary); }

/* ════════════════════════════════════════════
   COACH TAB - REFLECTION PROMPT
   ════════════════════════════════════════════ */
.reflection-card {
  background: linear-gradient(135deg, #FDF8F0, #F8F0E0);
  border: 1px solid var(--quote-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.reflection-card::before {
  content: '';
  position: absolute;
  top: -10px;
  right: -10px;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(162,134,76,0.1) 0%, transparent 70%);
  border-radius: 50%;
}
[dir="rtl"] .reflection-card::before {
  right: auto;
  left: -10px;
}
.reflection-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.reflection-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--quote-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.reflection-icon svg { width: 15px; height: 15px; color: var(--accent-tertiary); }
.reflection-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.reflection-prompt {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.45;
  font-style: italic;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.reflection-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-tertiary);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: all 0.2s;
}
.reflection-cta svg { width: 14px; height: 14px; }
[dir="rtl"] .reflection-cta svg { transform: scaleX(-1); }
.reflection-cta:active { transform: scale(0.97); }

/* ════════════════════════════════════════════
   CIRCLES TAB - COMMUNITY HERO
   ════════════════════════════════════════════ */
.circles-hero {
  background: linear-gradient(135deg, #3A8EE8, #5BA4F0, #7BB8F5);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  color: white;
  position: relative;
  overflow: hidden;
}
.circles-hero::before {
  content: '';
  position: absolute;
  top: -25px;
  right: -25px;
  width: 130px;
  height: 130px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.circles-hero::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: 20px;
  width: 90px;
  height: 90px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.circles-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.circles-hero-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.circles-hero-sub {
  font-size: 11px;
  opacity: 0.8;
  margin-top: 2px;
}
.circles-hero-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.2);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}
.circles-hero-badge svg { width: 14px; height: 14px; }
.circles-hero-stats {
  display: flex;
  gap: 0;
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.circles-hero-stat {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
}
.circles-hero-stat:not(:last-child) {
  border-right: 1px solid rgba(255,255,255,0.12);
}
[dir="rtl"] .circles-hero-stat:not(:last-child) {
  border-right: none;
  border-left: 1px solid rgba(255,255,255,0.12);
}
.circles-hero-stat-num {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.circles-hero-stat-label {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.75;
  margin-top: 2px;
  letter-spacing: 0.2px;
}

/* ════════════════════════════════════════════
   CIRCLES TAB - MY CIRCLES LIST
   ════════════════════════════════════════════ */
.circle-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.circle-card:active { transform: scale(0.98); }
.circle-card-button,.continue-card-button,.course-card-button,.skill-item-button {
  width:100%; text-align:inherit; font:inherit; color:inherit; cursor:pointer;
}
.course-card-button { min-width:260px; }
.button-link { border:0; background:transparent; padding:0; font:inherit; cursor:pointer; }
.empty-state {
  padding:24px 18px; border:1px dashed var(--border-subtle); border-radius:var(--radius-lg);
  color:var(--text-muted); text-align:center; display:grid; gap:6px;
}
.empty-state strong { color:var(--text-primary); }
.circle-avatar-stack {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.circle-avatar-stack svg {
  width: 24px;
  height: 24px;
  color: white;
  z-index: 1;
  position: relative;
}
.circle-avatar-stack::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.15), transparent);
}
.circle-info { flex: 1; min-width: 0; }
.circle-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}
.circle-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.circle-meta span {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}
.circle-meta svg { width: 12px; height: 12px; }
.circle-member-avatars {
  display: flex;
  margin-top: 4px;
}
.circle-member-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--card-bg);
  margin-left: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: white;
}
[dir="rtl"] .circle-member-dot {
  margin-left: 0;
  margin-right: -6px;
}
.circle-member-dot:first-child { margin-left: 0; }
[dir="rtl"] .circle-member-dot:first-child { margin-right: 0; }
.circle-member-dot.overflow {
  background: var(--section-bg);
  color: var(--text-muted);
  font-size: 8px;
}
.circle-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--section-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.circle-arrow svg { width: 16px; height: 16px; color: var(--text-muted); }
[dir="rtl"] .circle-arrow svg { transform: scaleX(-1); }
.circle-activity-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-secondary);
  border: 2px solid var(--card-bg);
}
[dir="rtl"] .circle-activity-dot {
  right: auto;
  left: 8px;
}

/* ════════════════════════════════════════════
   CIRCLES TAB - DISCOVER CIRCLES GRID
   ════════════════════════════════════════════ */
.discover-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
}
.discover-grid::-webkit-scrollbar { display: none; }
.discover-card {
  min-width: 160px;
  max-width: 160px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.discover-card:active { transform: scale(0.97); }
.discover-card-banner {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.discover-card-banner svg {
  width: 28px;
  height: 28px;
  color: white;
  opacity: 0.9;
  z-index: 1;
  position: relative;
}
.discover-card-members {
  position: absolute;
  bottom: 6px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(0,0,0,0.35);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  z-index: 2;
}
[dir="rtl"] .discover-card-members {
  right: auto;
  left: 8px;
}
.discover-card-members svg { width: 10px; height: 10px; color: white; opacity: 0.9; }
.discover-card-members span {
  font-size: 9px;
  font-weight: 600;
  color: white;
}
.discover-card-body { padding: 10px 12px 12px; }
.discover-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.1px;
  margin-bottom: 3px;
}
.discover-card-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.discover-join-btn {
  width: 100%;
  padding: 6px 0;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--accent-primary);
  background: transparent;
  color: var(--accent-primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.discover-join-btn.joined {
  background: var(--accent-primary);
  color: white;
}
.discover-join-btn:active { transform: scale(0.95); }

/* ════════════════════════════════════════════
   CIRCLES TAB - ACTIVITY FEED
   ════════════════════════════════════════════ */
.feed-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
}
.feed-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
}
.feed-item:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}
.feed-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
}
.feed-content { flex: 1; min-width: 0; }
.feed-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.feed-action {
  font-size: 12px;
  color: var(--text-secondary);
  }
.feed-action strong {
  font-weight: 600;
  color: var(--accent-primary);
}
.feed-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.4;
}
.feed-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}
.feed-reactions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.feed-reaction {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--section-bg);
  transition: all 0.2s;
}
.feed-reaction:active { transform: scale(0.92); }
.feed-reaction.liked {
  background: rgba(86,50,195,0.1);
  color: var(--accent-primary);
}
.feed-reaction svg { width: 13px; height: 13px; }

/* ════════════════════════════════════════════
   CIRCLES TAB - COMMUNITY CHALLENGES
   ════════════════════════════════════════════ */
.community-challenge {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--border-subtle);
}
.community-challenge:active { transform: scale(0.98); }
.community-challenge-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.community-challenge-icon svg { width: 22px; height: 22px; color: white; }
.community-challenge-icon .cc-fire {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 12px;
  line-height: 1;
}
[dir="rtl"] .community-challenge-icon .cc-fire {
  right: auto;
  left: -4px;
}
.community-challenge-info { flex: 1; min-width: 0; }
.community-challenge-circle {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.community-challenge-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.1px;
  margin-bottom: 4px;
}
.community-challenge-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.community-challenge-progress span {
  font-size: 11px;
  color: var(--text-muted);
}
.community-challenge-progress span strong {
  color: var(--accent-primary);
  font-weight: 700;
}
.cc-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--progress-track);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.cc-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
}
.cc-participants {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cc-participant-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--card-bg);
  margin-left: -4px;
  font-size: 7px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}
[dir="rtl"] .cc-participant-dot {
  margin-left: 0;
  margin-right: -4px;
}
.cc-participant-dot:first-child { margin-left: 0; }
[dir="rtl"] .cc-participant-dot:first-child { margin-right: 0; }

/* ════════════════════════════════════════════
   CIRCLES TAB - LEADERBOARD
   ════════════════════════════════════════════ */
.leaderboard-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 14px;
}
.leaderboard-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.leaderboard-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  display: flex;
  align-items: center;
  justify-content: center;
}
.leaderboard-icon svg { width: 15px; height: 15px; color: white; }
.leaderboard-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-warning);
}
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.leaderboard-item:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}
.leaderboard-rank {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.leaderboard-rank.gold {
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  color: white;
}
.leaderboard-rank.silver {
  background: linear-gradient(135deg, #D1D5DB, #9CA3AF);
  color: white;
}
.leaderboard-rank.bronze {
  background: linear-gradient(135deg, #D97706, #B45309);
  color: white;
}
.leaderboard-rank.normal {
  background: var(--section-bg);
  color: var(--text-muted);
}
.leaderboard-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
}
.leaderboard-user-info { flex: 1; min-width: 0; }
.leaderboard-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.leaderboard-user-circle {
  font-size: 10px;
  color: var(--text-muted);
}
.leaderboard-user-name.me {
  color: var(--accent-primary);
}
.leaderboard-score {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.leaderboard-score-label {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ════════════════════════════════════════════
   RESPONSIVE (no phone frame on mobile)
   ════════════════════════════════════════════ */
@media (max-width: 420px) {
  body { background: var(--page-bg); align-items: flex-start; }
  .phone-frame {
    width: 100%;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
  .phone-frame::before { display: none; }
}

html[data-theme="dark"] {
    color-scheme: dark;
    --page-bg: #111114;
    --section-bg: #1C1C21;
    --card-bg: #1E1E24;
    --card-elevated: #26262E;
    --text-primary: #F0EFED;
    --text-secondary: #A0A0AB;
    --text-muted: #6B6B76;
    --border-subtle: #2C2C35;
    --border-medium: #3C3C47;
    --progress-track: #2C2C35;
    --habit-check-bg: #252535;
    --quote-bg: #1E1D18;
    --quote-border: #3A3520;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    --ai-card-bg: #1C1928;
    --ai-card-border: #2E2848;
    --calendar-event: #1A2E20;
}
html[data-theme="dark"] .bottom-nav { background: rgba(30,30,36,0.92); }
html[data-theme="dark"] .home-indicator { background: #F0EFED; opacity: 0.2; }
html[data-theme="dark"] .course-card-badge.popular {
    background: rgba(30,30,36,0.9);
}
html[data-theme="dark"] .course-card-badge.new {
    background: rgba(30,30,36,0.9);
}

/* ════════════════════════════════════════════
   SEARCH OVERLAY
   ════════════════════════════════════════════ */
.search-overlay {
  position: fixed;
  top: 0; left: 50%;
  width: 100%;
  max-width: 600px;
  transform: translate(-50%, -100%);
  height: 100%;
  background: var(--page-bg);
  z-index: 200;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.search-overlay.show {
  transform: translate(-50%, 0);
}
.search-overlay-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 60px 20px 14px;
  background: var(--page-bg);
  border-bottom: 1px solid var(--border-subtle);
}
.search-overlay input {
  flex: 1;
  border: none;
  background: var(--section-bg);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
}
.search-overlay input::placeholder { color: var(--text-muted); }
.search-cancel-btn {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}
.search-suggestions {
  padding: 8px 20px;
  overflow-y: auto;
  flex: 1;
}
.search-suggestion {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.search-suggestion:last-child { border-bottom: none; }
.search-suggestion:active { opacity: 0.6; }
.search-suggestion svg {
  width: 18px; height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.search-suggestion span {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}
.search-suggestion-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 0 4px;
}

/* ════════════════════════════════════════════
   ACTION SHEET
   ════════════════════════════════════════════ */
.action-sheet-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 190;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.action-sheet-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.action-sheet {
  position: fixed;
  bottom: 0; left: 50%;
  width: 100%;
  max-width: 600px;
  transform: translate(-50%, 100%);
  background: var(--card-bg);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 191;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: var(--nav-height);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
}
.action-sheet.show {
  transform: translate(-50%, 0);
}
.action-sheet-handle {
  width: 36px; height: 4px;
  background: var(--border-medium);
  border-radius: 2px;
  margin: 10px auto 0;
}
.action-sheet-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding: 14px 20px 8px;
  letter-spacing: 0.3px;
}
.action-sheet-options {
  padding: 0 16px;
}
.action-sheet-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}
.action-sheet-option:active { background: var(--section-bg); }
.action-sheet-option-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.action-sheet-option-icon svg { width: 18px; height: 18px; color: white; }
.action-sheet-option-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}
.action-sheet-cancel {
  margin: 8px 16px 16px;
  padding: 14px;
  border-radius: var(--radius-full);
  background: var(--section-bg);
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}
.action-sheet-cancel:active { background: var(--border-subtle); }

/* ════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 560px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--text-primary);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: toastIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
}
.toast.out {
  animation: toastOut 0.3s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* ════════════════════════════════════════════
   CALENDAR - SELECTED DAY
   ════════════════════════════════════════════ */
.cal-day.selected {
  box-shadow: inset 0 0 0 2px var(--accent-primary);
}
.cal-day.today.selected {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.6), inset 0 0 0 4px var(--accent-primary);
}

/* ════════════════════════════════════════════
   PLACEHOLDER VIEWS (Day/Annual)
   ════════════════════════════════════════════ */
.placeholder-view {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 14px;
  text-align: center;
  color: var(--text-muted);
}
.placeholder-view-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--section-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.placeholder-view-icon svg { width: 24px; height: 24px; color: var(--text-muted); }
.placeholder-view-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.placeholder-view-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ════════════════════════════════════════════
   SCENARIO FORMS (Quick Add Modal)
   ════════════════════════════════════════════ */
.modal-body { width: 100%; }
.scenario-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-label em {
  font-style: normal;
  font-weight: 400;
  color: var(--text-muted);
}
.form-textarea {
  resize: vertical;
  min-height: 44px;
  line-height: 1.4;
  font-family: inherit;
}
.form-textarea--lg { min-height: 110px; }
.modal-input::placeholder { color: var(--text-muted); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
[dir="rtl"] .form-select {
  background-position: left 14px center;
  padding-right: 16px;
  padding-left: 36px;
}
.form-row {
  display: flex;
  gap: 12px;
}
.form-row .form-field { flex: 1; }

.form-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--section-bg);
  cursor: pointer;
}
.form-toggle-title { display: block; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.form-toggle-sub { display: block; font-size: 11px; color: var(--text-muted); }
.form-toggle input[type=checkbox] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--border-medium);
  flex-shrink: 0;
  transition: background 0.2s;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.form-toggle input:checked ~ .toggle-switch { background: var(--accent-primary); }
.form-toggle input:checked ~ .toggle-switch::after { transform: translateX(18px); }
[dir="rtl"] .toggle-switch::after { left: auto; right: 2px; }
[dir="rtl"] .form-toggle input:checked ~ .toggle-switch::after { transform: translateX(-18px); }

/* Input-mode switcher (Write / Speak / Photo) */
.input-mode-switcher {
  display: flex;
  gap: 8px;
  padding: 5px;
  background: var(--section-bg);
  border-radius: var(--radius-md);
}
.mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 6px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.mode-tab svg { width: 16px; height: 16px; }
.mode-tab.active {
  background: var(--card-bg);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.input-panel { display: flex; flex-direction: column; gap: 14px; }
.input-panel[hidden] { display: none; }

.draft-indicator {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-success, #49CD8B);
  opacity: 0;
  transition: opacity 0.2s;
}
.draft-indicator.show { opacity: 1; }

/* Stub panels for Speak / Photo */
.input-panel--stub {
  align-items: center;
  text-align: center;
  padding: 12px 0 4px;
}
.stub-cta {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  transition: transform 0.12s;
}
.stub-cta svg { width: 30px; height: 30px; }
.stub-cta:active { transform: scale(0.95); }
.stub-cta--mic { background: linear-gradient(135deg, #D94F8A, #E86D9E); }
.stub-cta--cam { background: linear-gradient(135deg, #5632C3, #7B5AE0); }
.stub-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 280px;
  margin: 4px auto 0;
}

/* Photo capture stage (OCR) */
.ocr-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 4px;
}
.ocr-capture-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  width: 100%;
}
.ocr-capture-cta:active .stub-cta { transform: scale(0.95); }
.ocr-cta-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.ocr-preview {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ocr-preview img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--section-bg);
}
.ocr-retake {
  border: 1px solid var(--border-medium);
  background: var(--section-bg);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ocr-retake:active { opacity: 0.8; }
.ocr-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 14px 0;
}
.ocr-status.error { color: var(--accent-warning); }
.ocr-link-btn {
  border: none;
  background: transparent;
  color: var(--accent-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: underline;
}
.ocr-status.error .ocr-link-btn { color: var(--accent-warning); }
.ocr-link-btn:active { opacity: 0.7; }
.ocr-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--border-medium);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: ocr-spin 0.7s linear infinite;
}
.ocr-status.error .ocr-spinner { display: none; }
@keyframes ocr-spin { to { transform: rotate(360deg); } }

.ocr-capture-cta[hidden],
.ocr-preview[hidden],
.ocr-status[hidden] { display: none; }

@media (max-width: 360px) {
  .modal-content { padding: 18px; }
  .form-row { flex-direction: column; }
}
