/* css/main.css - Complete updated file for rehab.ai */
:root {
  --bg-page: #f5f7f9;
  --surface: #ffffff;
  --border-light: #e3e6ea;
  --text-primary: #1f2933;
  --text-secondary: #6b7280;
  --accent: #009688;
  --accent-soft: #00968810;
  --shadow-sm: 0 8px 20px rgba(0,0,0,0.02), 0 4px 8px rgba(0,0,0,0.03);
  --shadow-hover: 0 20px 30px -10px rgba(0,150,136,0.15), 0 8px 18px rgba(0,0,0,0.05);
  --card-bg: rgba(255,255,255,0.62);
  --backdrop-blur: blur(18px) saturate(160%);
  /* crystal glass: a bright rim and a soft top highlight on every glass surface */
  --glass-border: rgba(255,255,255,0.7);
  --glass-shine: inset 0 1px 0 rgba(255,255,255,0.75);
  /* the ambient light behind the glass (without it, translucent cards just look grey) */
  --ambient: radial-gradient(60vmax 45vmax at 0% 0%, rgba(0,150,136,0.20), transparent 60%),
             radial-gradient(55vmax 45vmax at 100% 12%, rgba(56,189,248,0.17), transparent 62%),
             radial-gradient(50vmax 35vmax at 45% 55%, rgba(45,212,191,0.08), transparent 70%),
             radial-gradient(70vmax 50vmax at 70% 100%, rgba(45,212,191,0.17), transparent 60%),
             radial-gradient(50vmax 40vmax at 10% 85%, rgba(129,140,248,0.08), transparent 60%);
  --icon-filter: none;
  --footer-bg: #eef1f4;
}

[data-theme="dark"] {
  --bg-page: #12181c;
  --surface: #1e2a32;
  --border-light: #2e3b45;
  --text-primary: #eef2f6;
  --text-secondary: #a0aec0;
  --accent: #14b8a6;
  --accent-soft: #14b8a620;
  --shadow-sm: 0 8px 20px rgba(0,0,0,0.4);
  --shadow-hover: 0 20px 30px -10px #14b8a640, 0 8px 18px #00000050;
  --card-bg: rgba(30,42,50,0.58);
  --footer-bg: #17222b;
  --glass-border: rgba(255,255,255,0.09);
  --glass-shine: inset 0 1px 0 rgba(255,255,255,0.06);
  --ambient: radial-gradient(60vmax 45vmax at 0% 0%, rgba(20,184,166,0.16), transparent 60%),
             radial-gradient(55vmax 45vmax at 100% 12%, rgba(56,189,248,0.10), transparent 62%),
             radial-gradient(70vmax 50vmax at 70% 100%, rgba(45,212,191,0.10), transparent 60%),
             radial-gradient(50vmax 40vmax at 10% 85%, rgba(129,140,248,0.08), transparent 60%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* the ambient light, fixed behind every page (a fixed layer: background-attachment: fixed fails on iPhone) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--ambient);
}

/* every glass surface: blur what is behind it, a bright rim, a top highlight */
.navbar, .tool-card, .glass-card, .more-tools-toggle, .composer, .sp-card, .sp-game, .sp-daily, .history-drawer {
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
}
.navbar, .tool-card, .glass-card, .more-tools-toggle, .sp-card, .sp-game {
  border-color: var(--glass-border) !important;
  box-shadow: var(--glass-shine), var(--shadow-sm);
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  transition: background-color 0.2s, color 0.2s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
}




main { flex: 1; }

/* SPA router outlet — takes over the flex-fill role each view's own CSS
   (e.g. ask.css's body/.ask-main rules) expects a direct main-tag child of
   body to have. min-height:0 lets a view's own internal scroll region (like
   Lixa's #chatMessages) size correctly instead of being pushed to its
   natural content size. #appRoot itself no longer scrolls — #transientHost
   and each kept-alive view's own wrapper do, independently, so that
   switching between Lixa and Workspace (kept alive, never rebuilt — see
   js/router.js) doesn't leak one view's scroll position into the other's. */
#appRoot {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

#transientHost {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
#transientHost[hidden] { display: none !important; }

#keepAliveHost {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}
#keepAliveHost[hidden] { display: none !important; }

.kept-alive-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.kept-alive-view[hidden] { display: none !important; }

/* navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 0.65rem 1rem;
  margin: 10px;
  border-radius: 10px;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-icon { font-size: 1.5rem; line-height: 1; }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-lop { font-weight: 600; font-size: 1rem; color: var(--accent); letter-spacing: 0.5px; }
.logo-full { font-size: 0.8rem; color: var(--text-secondary); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Route-specific controls each view relocates here on mount (history/new-chat
   buttons, workspace switcher, Motion's type dropdown, ...) — must lay out
   horizontally like the rest of .nav-right, not stack per the div default. */
#navbarViewSlot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  background: transparent;
  border: none;
  padding: 0.5rem;
  border-radius: 2rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.icon-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  display: none;
}
[data-theme="light"] .theme-toggle .moon-icon { display: block; }
[data-theme="dark"] .theme-toggle .sun-icon { display: block; }

/* hero */
.hero {
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
}
.hero-content {
  max-width: 700px;
  margin: 0 auto;
}
.hero h1 {
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.hero-accent {
  color: var(--accent);
  font-weight: 400;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* search section - replaces filter section */
.search-section {
  max-width: 1100px;
  margin: 1rem auto 2rem;
  padding: 0 1rem;
}
.search-wrapper {
  position: relative;
  margin-bottom: 1.2rem;
}
.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}
.search-bar {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 3rem;
  border: 1px solid var(--border-light);
  border-radius: 3rem;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: 0.2s;
  box-shadow: var(--shadow-sm);
}
.search-bar:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* tool grid section */
.tool-grid-section {
  max-width: 1280px;
  margin: 1rem auto 3rem;
  padding: 0 1rem;
}

/* Compact "Ask AI" banner card, sits above the tool grid */
.ask-ai-mini-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--accent);
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ask-ai-mini-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.ask-ai-mini-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.ask-ai-mini-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}

.ask-ai-mini-text strong {
  font-size: 0.95rem;
}

.ask-ai-mini-text span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ask-ai-mini-arrow {
  color: var(--accent);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); } /* two columns for four cards */
}

/* tool cards */
.tool-card {
  background: var(--card-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--border-light);
  border-radius: 2rem;
  padding: 1.8rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.5s ease forwards;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.tool-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.tool-title {
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.tool-description {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex: 1;
}

.tool-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--accent);
  border-top: 1px dashed var(--border-light);
  padding-top: 1rem;
}

.tool-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ===== More tools (collapsible) — the SPA-embedded tools also reachable
   from Lixa's @mention picker, for anyone who'd rather open the page. ===== */
.more-tools-section { margin-top: 1.5rem; }
.more-tools-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 1.5rem;
  padding: 0.9rem 1.3rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}
.more-tools-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }
.more-tools-toggle span { display: flex; align-items: center; gap: 0.6rem; }
.more-tools-caret { transition: transform 0.2s ease; color: var(--text-secondary); }
.more-tools-toggle.open .more-tools-caret { transform: rotate(180deg); }
.more-tools-grid {
  margin-top: 1rem;
  grid-template-columns: repeat(2, 1fr);
}
.more-tools-grid[hidden] { display: none !important; }
@media (min-width: 1024px) {
  .more-tools-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Stagger animation for cards */
.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.2s; }
.tool-card:nth-child(3) { animation-delay: 0.3s; }
.tool-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* empty state */
/* ".empty-state" is redefined (unscoped) by several per-tool stylesheets
   loaded later in the cascade — each with its own "display: flex/block",
   which otherwise beats the [hidden] attribute's UA default regardless of
   load order. This keeps hidden empty-states (e.g. the History drawer's,
   shown only once a fetch confirms there's really nothing) hidden. */
.empty-state[hidden] { display: none !important; }
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  background: var(--card-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 2rem;
  border: 2px dashed var(--border-light);
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  text-align: center;
  transition: all 0.3s ease;
}

.empty-state:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.empty-state::before {
  content: "🔍";
  display: block;
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.6;
  animation: gentleFloat 3s ease-in-out infinite;
}

.empty-state p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

@keyframes gentleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* A global utility class — must always win regardless of load order
   against any other component's same-specificity ".foo { display: ... }"
   rule (e.g. gait.css's unscoped ".empty-state" bleeding into the
   Workspace empty state via the SPA's single shared stylesheet cascade). */
.hidden { display: none !important; }

/* footer */
.site-footer {
  background: var(--footer-bg);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-light);
  font-size: 0.9rem;
}

/* Loading State (kept for potential future use) */
.loading-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  background: var(--card-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 2rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  text-align: center;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-light);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  border-radius: 50%;
  margin-bottom: 1.5rem;
  animation: spin 0.8s linear infinite;
}

.loading-state p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 500;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error State */
.error-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  background: var(--card-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 2rem;
  border: 1px solid rgba(220, 38, 38, 0.3);
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  text-align: center;
}

.error-state::before {
  content: "⚠️";
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.error-state p {
  color: #dc2626;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  font-weight: 500;
}

.retry-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.retry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--accent-soft);
  background: var(--accent);
  filter: brightness(1.1);
}

.retry-btn:active {
  transform: translateY(0);
}

/* Toast notification (minimal, kept from original) */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 2rem;
  background: var(--accent);
  color: white;
  border-radius: 2rem;
  box-shadow: var(--shadow-hover);
  z-index: 2000;
  max-width: 300px;
  transition: opacity 0.3s ease;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .hero-sub {
    font-size: 1rem;
  }
  
  .tool-grid { gap: 1rem; }

  .tool-card {
    padding: 1.1rem 1rem;
  }

  .tool-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
  }

  .tool-title {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
  }

  .tool-description {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.85rem;
  }

  .tool-meta {
    padding-top: 0.6rem;
    font-size: 0.8rem;
  }

  /* More tools: two compact columns on phones, descriptions cut to two lines */
  .more-tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
  .more-tools-grid .tool-card { padding: 0.85rem 0.8rem; border-radius: 1.2rem; }
  .more-tools-grid .tool-icon { font-size: 1.5rem; margin-bottom: 0.35rem; }
  .more-tools-grid .tool-title { font-size: 0.95rem; margin-bottom: 0.25rem; line-height: 1.25; }
  .more-tools-grid .tool-description {
    font-size: 0.76rem; line-height: 1.35; margin-bottom: 0.55rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .more-tools-grid .tool-meta { font-size: 0.7rem; padding-top: 0.45rem; white-space: nowrap; overflow: hidden; }
  .more-tools-grid .tool-meta span { overflow: hidden; text-overflow: ellipsis; display: block; }

  .empty-state {
    padding: 3rem 1.5rem;
  }
  
  .empty-state::before {
    font-size: 3rem;
  }
  
  .empty-state p {
    font-size: 1.1rem;
  }
  
  .toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: none;
  }
}

/* Ensure proper grid placement */
.tool-grid > .loading-state,
.tool-grid > .error-state,
.tool-grid > .empty-state {
  width: 100%;
  margin: 0 auto;
  max-width: 600px;
}

/* Dark mode specific adjustments */
[data-theme="dark"] .empty-state:hover {
  background: rgba(20, 184, 166, 0.1);
}

[data-theme="dark"] .error-state {
  border-color: rgba(220, 38, 38, 0.5);
}

[data-theme="dark"] .error-state p {
  color: #ef4444;
}


/* Login Button Styles */
.btn-login {
  background: transparent;
  border: 1px solid var(--border-light);
  padding: 0.5rem 1.2rem;
  border-radius: 2rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
}

.btn-login:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--accent-soft);
}

.btn-login:active {
  transform: translateY(0);
}

/* Profile Button Styles (already in auth.css, but ensure consistency) */
.btn-profile {
  background: transparent;
  border: 1px solid var(--border-light);
  padding: 0.4rem 0.8rem 0.4rem 0.4rem;
  border-radius: 2rem;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
}

.btn-profile:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--accent-soft);
}

.profile-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-profile:hover .profile-icon {
  background: var(--accent);
  transform: scale(1.05);
}

.profile-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

/* Dropdown Menu */
.profile-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 120%;
  right: 0;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  min-width: 200px;
  box-shadow: var(--shadow-hover);
  z-index: 100;
  display: none;
  overflow: hidden;
  animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  padding: 0.8rem 1.2rem;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
}

.dropdown-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.dropdown-item span {
  font-size: 1.1rem;
}

/* group owners: "My group" box in the profile menu (js/group-info.js) */
.dropdown-group {
  margin: 0.4rem 0.6rem;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
}
.dropdown-group[hidden] { display: none; }
.dropdown-group-label {
  display: block;
  padding: 0.5rem 0.9rem 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 0.3rem 0;
}

/* Mobile responsiveness for buttons */
@media (max-width: 480px) {
  .btn-login {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
  }
  
  .btn-profile {
    padding: 0.3rem 0.3rem 0.3rem 0.3rem;
  }
  
  .profile-name {
    display: none;
  }
  
  .profile-icon {
    width: 36px;
    height: 36px;
  }
  
  .dropdown-menu {
    min-width: 180px;
    right: -10px;
  }
}

/* Animation for button transitions */
.btn-login, .btn-profile {
  animation: buttonAppear 0.3s ease;
}

@keyframes buttonAppear {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}


/* Tool Card Links */
.tool-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.2s ease;
}

.tool-card-link:hover {
  transform: translateY(-4px);
}

.tool-card-link .tool-card {
  height: 100%;
  cursor: pointer;
}

/* Ensure the card takes full height of link */
.tool-card-link {
  height: 100%;
}

/* Optional: Add a subtle indicator that cards are clickable */
.tool-card-link .tool-card::after {
  content: '→';
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  font-size: 1.2rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tool-card-link:hover .tool-card::after {
  opacity: 1;
  transform: translateX(5px);
}

.tool-card {
  position: relative;
  overflow: hidden;
}

/* Adjust padding to accommodate arrow */
.tool-card {
  padding-bottom: 2rem;
}


/* ===== For Healthcare Students Section Header ===== */
.students-section-header {
  text-align: center;
  margin: 3.5rem 0 1.5rem;
  padding: 0 1rem;
  position: relative;
}

.students-section-header::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.students-heading {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.students-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

/* Divider line between sections */
.students-section-header::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 1rem auto 0;
  border-radius: 2px;
  opacity: 0.5;
}

/* ===== Student Tool Grid ===== */
#studentToolGrid {
  margin-bottom: 2rem;
}

/* Student card accent */
#studentToolGrid .tool-card {
  border-left: 3px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

#studentToolGrid .tool-card:hover {
  border-left-color: var(--accent);
}

#studentToolGrid .tool-icon {
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border-radius: 1rem;
  padding: 0.5rem;
  display: inline-block;
}

/* Dark mode adjustments */
[data-theme="dark"] .students-heading {
  background: linear-gradient(135deg, #eef2f6 0%, #14b8a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .students-section-header::before {
  background: radial-gradient(circle, rgba(20, 184, 166, 0.15) 0%, transparent 70%);
  opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
  .students-section-header {
    margin: 2.5rem 0 1rem;
  }
  
  .students-heading {
    font-size: 1.5rem;
  }
  
  .students-subtitle {
    font-size: 0.9rem;
    max-width: 400px;
  }
  
  .students-section-header::before {
    width: 200px;
    height: 200px;
  }
}

@media (max-width: 480px) {
  .students-section-header {
    margin: 2rem 0 0.75rem;
  }
  
  .students-heading {
    font-size: 1.3rem;
  }
  
  .students-subtitle {
    font-size: 0.85rem;
    max-width: 300px;
  }
  
  .students-section-header::after {
    width: 40px;
    height: 2px;
  }
  
  .students-section-header::before {
    width: 150px;
    height: 150px;
  }
}


/* Modern Floating AI Button for AI Page */
.floating-ai-btn {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  z-index: 1000;
  background: linear-gradient(135deg, var(--accent) 0%, #00b8a9 100%);
  border-radius: 3rem;
  padding: 0.8rem 1.8rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 8px 20px rgba(0, 150, 136, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  backdrop-filter: blur(8px);
  overflow: hidden;
  font-family: inherit;
}

.floating-ai-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 28px rgba(0, 150, 136, 0.5);
  color: white;
}

.floating-ai-btn:active {
  transform: translateY(0) scale(0.98);
}

.ai-btn-content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  z-index: 2;
}

.ai-icon {
  font-size: 1.5rem;
  animation: floatIcon 3s ease-in-out infinite;
}

.ai-text {
  font-size: 1rem;
  letter-spacing: 0.3px;
  font-weight: 500;
}

/* Pulse animation */
.ai-pulse {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 3rem;
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
  animation: pulse 2s ease-out infinite;
  pointer-events: none;
}

/* Animations */
@keyframes floatIcon {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  70% {
    transform: scale(1.3);
    opacity: 0;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .floating-ai-btn {
    bottom: 2.5rem;
    right: 2.5rem;
    padding: 0.7rem 1.4rem;
  }
  
  .ai-text {
    font-size: 0.9rem;
  }
  
  .ai-icon {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .floating-ai-btn {
    bottom: 2rem;
    right: 2rem;
    padding: 0.6rem 1.2rem;
  }
  
  .ai-text {
    font-size: 0.85rem;
  }
  
  .ai-icon {
    font-size: 1.2rem;
  }
}

/* Dark mode adjustments */
[data-theme="dark"] .floating-ai-btn {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.4);
}

[data-theme="dark"] .floating-ai-btn:hover {
  box-shadow: 0 12px 28px rgba(20, 184, 166, 0.6);
}



/* ---------- FAQ Section - Premium Redesign ---------- */
.faq-section {
  max-width: 1000px;
  margin: 0 auto 5rem;
  padding: 0 1rem;
  position: relative;
}

/* Subtle background glow */
.faq-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.faq-container {
  position: relative;
  z-index: 1;
  background: transparent;
  border-radius: 2.5rem;
  padding: 3.5rem 3rem;
  transition: all 0.3s ease;
}

.faq-container:hover {
  box-shadow: var(--shadow-hover);
}

/* Header styling */
.faq-header {
  text-align: center;
  margin-bottom: 3rem;
}

.faq-heading {
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.faq-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* FAQ List */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 750px;
  margin: 0 auto;
}

/* Individual FAQ Item */
.faq-item {
  background: var(--card-bg);
  border: 1px solid transparent;
  border-radius: 1.4rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  animation: faqFadeSlide 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

/* Glass highlight line on top */
.faq-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transition: width 0.4s ease;
}

.faq-item:hover::before {
  width: 80%;
}

.faq-item:hover {
  background: var(--accent-soft);
  border-color: rgba(0, 150, 136, 0.15);
  transform: translateX(4px);
}

.faq-item[open] {
  background: var(--accent-soft);
  border-color: rgba(0, 150, 136, 0.25);
  box-shadow: 0 4px 20px rgba(0, 150, 136, 0.08), 0 0 0 1px var(--accent-soft) inset;
  transform: translateX(0);
}

.faq-item[open]:hover {
  transform: translateX(0);
}

/* Staggered animation delays */
.faq-item:nth-child(1) { animation-delay: 0s; }
.faq-item:nth-child(2) { animation-delay: 0.06s; }
.faq-item:nth-child(3) { animation-delay: 0.12s; }
.faq-item:nth-child(4) { animation-delay: 0.18s; }
.faq-item:nth-child(5) { animation-delay: 0.24s; }
.faq-item:nth-child(6) { animation-delay: 0.3s; }

@keyframes faqFadeSlide {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Question styling */
.faq-question {
  padding: 1.3rem 1.6rem;
  font-size: 1.1rem;
  font-weight: 530;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  list-style: none;
  letter-spacing: -0.01em;
  transition: color 0.25s ease;
  position: relative;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::marker {
  display: none;
  content: '';
}

.faq-item:hover .faq-question {
  color: var(--accent);
}

/* Custom icon indicator */
.faq-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 1.2rem;
  position: relative;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  background: var(--accent);
  border-radius: 2px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-icon::before {
  width: 14px;
  height: 2px;
}

.faq-icon::after {
  width: 2px;
  height: 14px;
}

.faq-item[open] .faq-icon {
  transform: rotate(90deg);
}

.faq-item[open] .faq-icon::after {
  transform: scaleY(0);
  opacity: 0;
}

/* Answer styling */
.faq-answer {
  padding: 0 1.6rem 1.6rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.98rem;
  animation: answerReveal 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90%;
}

@keyframes answerReveal {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.faq-answer p {
  margin: 0;
  letter-spacing: 0.01em;
}

.faq-answer strong {
  color: var(--accent);
  font-weight: 600;
}

/* Dark mode refinements */
[data-theme="dark"] .faq-container {
  background: transparent;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-color: rgba(46, 59, 69, 0.5);
}

[data-theme="dark"] .faq-item:hover {
  background: rgba(20, 184, 166, 0.08);
  border-color: rgba(20, 184, 166, 0.2);
}

[data-theme="dark"] .faq-item[open] {
  background: rgba(20, 184, 166, 0.1);
  border-color: rgba(20, 184, 166, 0.3);
}

[data-theme="dark"] .faq-heading {
  background: linear-gradient(135deg, #eef2f6 0%, #14b8a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Responsive */
@media (max-width: 768px) {
  .faq-container {
    padding: 2.5rem 1.5rem;
    border-radius: 2rem;
  }
  
  .faq-heading {
    font-size: 2rem;
  }
  
  .faq-question {
    padding: 1.2rem 1.2rem;
    font-size: 1rem;
  }
  
  .faq-answer {
    padding: 0 1.2rem 1.4rem;
    font-size: 0.93rem;
    max-width: 100%;
  }
  
  .faq-section::before {
    width: 300px;
    height: 300px;
  }
}

@media (max-width: 480px) {
  .faq-container {
    padding: 2rem 1rem;
  }
  
  .faq-heading {
    font-size: 1.7rem;
  }
  
  .faq-subtitle {
    font-size: 0.95rem;
  }
  
  .faq-item:hover {
    transform: translateX(2px);
  }
}



/* ---------- PWA Install Button ---------- */
.floating-install-btn {
  position: fixed;
  bottom: 5.5rem;      /* sits above the AI button */
  left: 2rem;
  z-index: 998;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.5rem;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--border-light);
  border-radius: 2.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  border-color: var(--accent);
}

.floating-install-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.floating-install-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.floating-install-btn .install-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.2s;
}

.floating-install-btn:hover .install-icon {
  transform: translateY(-2px);
}

/* Dark mode tweak */
[data-theme="dark"] .floating-install-btn {
  background: rgba(30, 42, 50, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
}


/* ---------- Floating Ask Me Button ---------- */
.floating-ask-btn {
  position: fixed;
  bottom: 2.8rem;        /* above the AI button (which is at 2rem) */
  right: 2rem;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.5rem;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--border-light);
  border-radius: 2.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  border-color: var(--accent);
  text-decoration: none;
  animation: buttonAppear 0.4s ease forwards;
}

.floating-ask-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.floating-ask-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  color: var(--text-primary);
  text-decoration: none;
}

.floating-ask-btn .ask-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.2s;
}

.floating-ask-btn:hover .ask-icon {
  transform: translateY(-2px);
}

/* Dark mode tweak */
[data-theme="dark"] .floating-ask-btn {
  background: rgba(30, 42, 50, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
}


/* ============ CURRENT PLAN GLASS CARD ============ */
.current-plan-section {
  max-width: 700px;
  margin: 2rem auto 3rem;
  padding: 0 1rem;
}

.plan-glass-card {
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0.15) 40%,
    rgba(255, 255, 255, 0.05) 100%
  );
  /* Was blur(20px) — backdrop-filter cost scales roughly with the square of
     the radius, and this card (plus the navbar and 4 tool cards) all
     compositing their own blur on Workspace's first paint is the likely
     source of the "lags for a moment on first open" complaint. 8px reads
     the same as glassy at this size for a fraction of the paint cost. */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2rem;
  padding: 1.5rem 2rem;
  overflow: hidden;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.plan-glass-card:hover {
  box-shadow: 
    0 12px 40px rgba(0, 150, 136, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

/* Shimmer effect */
.plan-shimmer {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 70%
  );
  animation: shimmer 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Glow orb */
.plan-glow-orb {
  position: absolute;
  top: -60px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(0, 150, 136, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: orbFloat 8s ease-in-out infinite;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-20px, 10px) scale(1.05); }
  66% { transform: translate(10px, -10px) scale(0.95); }
}

/* Card inner layout */
.plan-card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .plan-card-inner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}

/* ===== Left: Plan Icon ===== */
.plan-info-side {
  flex-shrink: 0;
}

.plan-icon-wrapper {
  width: 68px;
  height: 68px;
  border-radius: 1.2rem;
  background: linear-gradient(135deg, rgba(0, 150, 136, 0.15), rgba(0, 150, 136, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 150, 136, 0.2);
}

.plan-icon-large {
  font-size: 2rem;
}

/* ===== Center: Plan Details ===== */
.plan-details-side {
  flex: 1;
  min-width: 200px;
}

.plan-badge-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.plan-status-badge {
  padding: 0.25rem 0.85rem;
  border-radius: 2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.plan-status-badge.free {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fbbf24;
}

.plan-status-badge.student {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #38bdf8;
}

.plan-status-badge.pro {
  background: #fce7f3;
  color: #831843;
  border: 1px solid #f472b6;
}

.plan-status-badge.max {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #a78bfa;
}

.plan-renewal-badge {
  padding: 0.25rem 0.7rem;
  border-radius: 2rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: #059669;
  background: #d1fae5;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.plan-name-display {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.plan-description-display {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.plan-expiry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.plan-expiry i {
  color: #dc2626;
  font-size: 0.8rem;
}

.expiry-days {
  padding: 0.2rem 0.6rem;
  background: #fef2f2;
  color: #dc2626;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 600;
}

/* ===== Right: CTA ===== */
.plan-action-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.plan-upgrade-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.8rem;
  background: linear-gradient(135deg, var(--accent), #0d9488);
  color: white;
  border-radius: 2.5rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 150, 136, 0.3);
  white-space: nowrap;
}

.plan-upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 150, 136, 0.45);
  color: white;
}

.plan-upgrade-btn .btn-arrow {
  transition: transform 0.3s ease;
}

.plan-upgrade-btn:hover .btn-arrow {
  transform: translateX(4px);
}

.plan-manage-link {
  margin: 0;
  font-size: 0.75rem;
}

.plan-manage-link a {
  color: var(--text-secondary);
  text-decoration: underline;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.plan-manage-link a:hover {
  opacity: 1;
  color: var(--accent);
}

/* ===== Dark Mode ===== */
[data-theme="dark"] .plan-glass-card {
  background: linear-gradient(
    135deg,
    rgba(30, 42, 50, 0.6) 0%,
    rgba(30, 42, 50, 0.3) 40%,
    rgba(30, 42, 50, 0.1) 100%
  );
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .plan-glass-card:hover {
  box-shadow: 
    0 12px 40px rgba(20, 184, 166, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .plan-icon-wrapper {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(20, 184, 166, 0.05));
  border-color: rgba(20, 184, 166, 0.3);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .plan-glass-card {
    padding: 1.25rem;
    border-radius: 1.5rem;
  }
  
  .plan-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 1rem;
  }
  
  .plan-icon-large {
    font-size: 1.6rem;
  }
  
  .plan-upgrade-btn {
    width: 100%;
    justify-content: center;
  }
}
/* Welcome toast shown on index.html after joining a center via its link */
.center-welcome-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translate(-50%, -20px);
  background: #22c55e;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0.65rem;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.center-welcome-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==================== Center context: welcome banner + workspace switcher ==================== */
.center-context-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--accent-soft, rgba(0, 150, 136, 0.12));
  color: var(--accent, #009688);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.workspace-switcher {
  position: relative;
}

.workspace-switcher-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.workspace-switcher-btn:hover {
  border-color: var(--accent, #009688);
  color: var(--accent, #009688);
}

.workspace-switcher-icon {
  flex-shrink: 0;
}

.workspace-switcher-text {
  display: none;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.workspace-switcher-caret {
  font-size: 0.7rem;
  opacity: 0.7;
}

@media (min-width: 769px) {
  .workspace-switcher-btn {
    width: auto;
    height: auto;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
  }

  .workspace-switcher-text {
    display: inline-flex;
  }
}

.workspace-switcher-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-hover, 0 12px 30px rgba(0,0,0,0.15));
  padding: 0.4rem;
  display: none;
  flex-direction: column;
  gap: 0.2rem;
  z-index: 500;
}

.workspace-switcher-menu.open {
  display: flex;
}

.workspace-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.6rem;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.workspace-option:hover {
  background: var(--accent-soft, rgba(0, 150, 136, 0.1));
}

.workspace-option.active {
  color: var(--accent, #009688);
  font-weight: 600;
}

.workspace-option-check {
  margin-left: auto;
}

/* Theme toggle lives on Lixa and Workspace only (other pages: Settings). */
body[data-route]:not([data-route="lixa"]):not([data-route="workspace"]) #themeToggle { display: none; }

/* Personal ⇄ center switcher (js/center-switcher.js) — shared pages only */
.center-switch { position: relative; display: inline-flex; }
.center-switch[hidden] { display: none; }
.center-switch-btn { position: relative; }
.center-switch-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface, #fff); }
.center-switch-dot[hidden] { display: none; }
.center-switch-menu { display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 1200; width: 260px; max-width: calc(100vw - 32px);
  background: var(--surface, #fff); border: 1px solid var(--border-light); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,0.16); padding: 6px; }
.center-switch-menu.open { display: block; }
.center-switch-head { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); padding: 8px 10px 4px; }
.center-switch-option { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: var(--text-primary);
  padding: 10px; border-radius: 10px; font: inherit; font-size: 0.9rem; cursor: pointer; text-align: left; }
.center-switch-option:hover, .center-switch-option:focus-visible { background: var(--bg-page); }
.center-switch-option.active { color: var(--accent); font-weight: 600; }
.center-switch-option span { flex: 1; }
.center-switch-note { font-size: 0.72rem; line-height: 1.4; color: var(--text-secondary); padding: 8px 10px 6px; border-top: 1px solid var(--border-light); margin-top: 4px; }
/* In-app announcement banner (js/notifications.js) */
.rx-announcement { position: fixed; left: 50%; transform: translateX(-50%); top: 4.6rem; z-index: 3500; width: min(560px, calc(100vw - 1.5rem)); display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem 0.85rem; border-radius: 0.9rem; background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow-hover); color: var(--text-primary); }
.rx-announcement > i { color: var(--accent); flex-shrink: 0; }
.rx-announcement-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.82rem; line-height: 1.4; }
.rx-announcement-text strong { font-size: 0.88rem; }
.rx-announcement-text span { color: var(--text-secondary); overflow-wrap: anywhere; }
.rx-announcement-open { flex-shrink: 0; border: none; border-radius: 0.6rem; background: var(--accent); color: #fff; font: inherit; font-size: 0.8rem; font-weight: 700; padding: 0.45rem 0.8rem; min-height: 36px; cursor: pointer; }
.rx-announcement-close { flex: 0 0 34px; width: 34px; height: 34px; border: none; background: none; color: var(--text-secondary); border-radius: 50%; cursor: pointer; }

/* "All tools" switcher in the top bar (js/tool-switcher.js) */
.tool-switcher { position: relative; display: inline-flex; }
.tool-switcher[hidden] { display: none; }
.tool-switcher-btn.active { background: var(--accent-soft); color: var(--accent); }
/* The tools open as a sheet over a dimmed page: round coloured icons, three to a
   row, like WhatsApp's attach sheet. It rises from the bottom on phones and sits
   in the middle on wide screens. */
/* Glass: the page behind is blurred, and the sheet itself is frosted, see-through glass. */
.tool-switcher-panel { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: flex-end; justify-content: center; padding: 12px; background: rgba(15, 23, 42, 0); -webkit-backdrop-filter: blur(0px); backdrop-filter: blur(0px); transition: background 0.2s ease, backdrop-filter 0.2s ease, -webkit-backdrop-filter 0.2s ease; }
.tool-switcher-panel.open { background: rgba(15, 23, 42, 0.28); -webkit-backdrop-filter: blur(10px) saturate(120%); backdrop-filter: blur(10px) saturate(120%); }
.tool-switcher-panel[hidden] { display: none; }
.tool-switcher-sheet { position: relative; width: min(420px, 100%); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); display: flex; flex-direction: column; overflow: hidden; border-radius: 1.4rem; background: linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.5)); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); border: 1px solid rgba(255, 255, 255, 0.6); box-shadow: 0 -8px 40px rgba(15, 40, 45, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.7); transform: translateY(24px); opacity: 0; transition: transform 0.22s ease, opacity 0.22s ease; padding-bottom: env(safe-area-inset-bottom, 0px); }
[data-theme="dark"] .tool-switcher-sheet { background: linear-gradient(160deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.55)); border-color: rgba(255, 255, 255, 0.12); box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .tool-switcher-sheet { background: var(--surface); } }
.tool-switcher-panel.open .tool-switcher-sheet { transform: none; opacity: 1; }
@media (min-width: 768px) { .tool-switcher-panel { align-items: center; } }
.tool-switcher-head { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 0.9rem 0.2rem 1.2rem; font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.tool-switcher-close { width: 36px; height: 36px; border: none; border-radius: 50%; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 1rem; }
.tool-switcher-close:hover, .tool-switcher-close:focus-visible { background: var(--accent-soft); color: var(--accent); outline: none; }
.tool-switcher-menu { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem 0.3rem; padding: 0.6rem 0.8rem 1.1rem; }
.tool-switcher-item { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; padding: 0.6rem 0.2rem; border: none; background: none; border-radius: 1rem; font: inherit; font-size: 0.78rem; line-height: 1.25; color: var(--text-primary); text-align: center; cursor: pointer; }
.tool-switcher-icon { width: 54px; height: 54px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.3rem; box-shadow: 0 4px 12px rgba(15, 40, 45, 0.18); transition: transform 0.15s ease; }
.tool-switcher-label { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-switcher-item:hover .tool-switcher-icon, .tool-switcher-item:focus-visible .tool-switcher-icon { transform: scale(1.06); }
.tool-switcher-item:hover, .tool-switcher-item:focus-visible { background: var(--accent-soft); outline: none; }
.tool-switcher-item.active { color: var(--accent); font-weight: 700; background: var(--accent-soft); }
.tool-switcher-item.active .tool-switcher-icon { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }
@media (prefers-reduced-motion: reduce) { .tool-switcher-panel, .tool-switcher-sheet, .tool-switcher-icon { transition: none; } }

/* Bolder type where it carries the brand or a page's main heading */
.logo-lop { font-weight: 800; letter-spacing: 0.2px; }
.empty-chat .empty-chat-greeting { font-weight: 700; }
.tool-title { font-weight: 700; }
.bottom-nav-item.active .bottom-nav-label, .bottom-nav-item.active span { font-weight: 700; }
/* The Rehablix brand typeface (Outfit, SIL Open Font License): the "rehablix" wordmark. */
@font-face { font-family: 'Rehablix Brand'; src: url('../fonts/outfit.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
.logo-lop { font-family: 'Rehablix Brand', system-ui, sans-serif; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; line-height: 1.15; }

/* ==========================================================================
   iPhone / iPad (js/ios.js adds "ios" to <html>; none of this reaches other devices).
   Every selector is wrapped in :where(), which gives it NO extra weight: these
   are defaults, and any rule the pages already have still wins over them.
   ========================================================================== */
/* Text keeps its size when the phone is turned sideways (iOS otherwise enlarges it). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* No grey flash on tap, and no wait for a possible double-tap before a tap counts. */
:where(html.ios) :where(a, button, label, select, input, textarea) {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
/* iOS draws search boxes as its own rounded pill and ignores the site's styling. */
:where(html.ios) :where(input[type="search"]) { -webkit-appearance: none; appearance: none; }
:where(html.ios) input[type="search"]::-webkit-search-decoration,
:where(html.ios) input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
/* An empty date / time box collapses to a thin line on iOS, and its value is centred. */
:where(html.ios) :where(input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"]) { min-height: 2.75em; }
:where(html.ios) input::-webkit-date-and-time-value { text-align: left; }
