@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

:root {
  --primary: #F8BBD9;
  --primary-light: #FCE4EC;
  --secondary: #F9D5E5;
  --accent: #EA8DB6;
  --accent-hover: #D8709C;
  --lavender: #E9D5FF;
  --lavender-light: #F3E8FF;
  --lavender-deep: #B070EE;
  --bg-main: #FFF9FC;
  --bg-gradient: linear-gradient(135deg, #FFF9FC 0%, #FDF2F8 50%, #F5F3FF 100%);
  --card-bg: rgba(255, 255, 255, 0.82);
  --card-bg-solid: #FFFFFF;
  --card-border: rgba(248, 187, 217, 0.35);
  --text-dark: #2D1A29;
  --text-medium: #5C4556;
  --text-muted: #957A90;
  --success: #6EE7B7;
  --success-bg: #ECFDF5;
  --warning: #FDE047;
  --warning-bg: #FEFCE8;
  --danger: #FCA5A5;
  --danger-bg: #FEF2F2;
  
  --shadow-soft: 0 10px 30px -5px rgba(234, 141, 182, 0.15);
  --shadow-hover: 0 20px 40px -10px rgba(234, 141, 182, 0.25);
  --shadow-glass: 0 8px 32px 0 rgba(248, 187, 217, 0.25);
  --glass-border: 1px solid rgba(255, 255, 255, 0.6);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', 'Poppins', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* App Container Layout */
#app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Glass Sidebar */
.sidebar {
  width: 280px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px 14px;
  position: fixed;
  height: 100vh;
  max-height: 100vh;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(248, 187, 217, 0.15);
  box-sizing: border-box;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 14px 6px;
  border-bottom: 1px solid rgba(248, 187, 217, 0.25);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--lavender-deep) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  box-shadow: 0 6px 16px rgba(234, 141, 182, 0.4);
}

.brand-text h1 {
  font-size: 19px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent) 0%, #9333EA 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-nav-container {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 2px;
  margin-bottom: 10px;
}

.sidebar-nav-container::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav-container::-webkit-scrollbar-thumb {
  background: rgba(248, 187, 217, 0.4);
  border-radius: 4px;
}

/* Nav items */
.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 8px 10px 4px 10px;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.nav-item button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-medium);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.nav-item button:hover {
  background: rgba(248, 187, 217, 0.25);
  color: var(--accent);
  transform: translateX(3px);
}

.nav-item button.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--text-dark);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(248, 187, 217, 0.4);
}

.nav-item button .nav-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

/* User Card Bottom Sidebar */
.user-profile-card {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-top: auto;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--primary);
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.user-info h4 {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-sidebar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.user-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(248, 187, 217, 0.4);
  background: #FFF5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
}

.user-action-btn:hover {
  background: #FFE4EE;
  transform: translateY(-2px);
  border-color: var(--accent);
}

.user-action-btn.logout:hover {
  background: #FEE2E2;
  border-color: #EF4444;
  color: #DC2626;
}

/* Main Content Area */
.main-wrapper {
  margin-left: 280px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 24px 36px 48px 36px;
}

/* Top Header Bar */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 20px;
}

.search-box {
  position: relative;
  width: 380px;
}

.search-box input {
  width: 100%;
  padding: 12px 18px 12px 44px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid var(--card-border);
  border-radius: 30px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-dark);
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(248, 187, 217, 0.1);
}

.search-box input:focus {
  outline: none;
  background: #FFFFFF;
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(234, 141, 182, 0.25);
}

.search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #D946EF 100%);
  color: white;
  box-shadow: 0 6px 18px rgba(234, 141, 182, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(234, 141, 182, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-dark);
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 12px rgba(248, 187, 217, 0.15);
}

.btn-secondary:hover {
  background: var(--secondary);
  color: var(--text-dark);
  transform: translateY(-2px);
}

.btn-pill {
  border-radius: 30px;
}

.btn-icon-only {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--card-border);
  color: var(--text-medium);
  box-shadow: 0 4px 12px rgba(248, 187, 217, 0.15);
}

.btn-icon-only:hover {
  background: var(--primary-light);
  color: var(--accent);
}

/* Glass Card Component */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title-row h3 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-row h3 i {
  color: var(--accent);
}

/* Page Views */
.page-view {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.page-view.active {
  display: block;
}

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

/* Hero Greeting Section */
.hero-banner {
  background: linear-gradient(135deg, rgba(248, 187, 217, 0.6) 0%, rgba(233, 213, 255, 0.6) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-glass);
}

.hero-content h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #2E1065;
}

.hero-content p {
  font-size: 14px;
  color: #5B21B6;
  max-width: 520px;
  line-height: 1.5;
}

.quote-pill {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-hover);
}

.hero-illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  font-size: 56px;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.8);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.grid-main-sidebar {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 24px;
}

/* Stat Widgets */
.stat-widget {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
}

.stat-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.pink-theme {
  background: #FCE4EC;
  color: var(--accent);
}

.lavender-theme {
  background: #F3E8FF;
  color: var(--lavender-deep);
}

.mint-theme {
  background: #D1FAE5;
  color: #059669;
}

.yellow-theme {
  background: #FEF3C7;
  color: #D97706;
}

.stat-info h3 {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.stat-info p {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

/* Health Gauge Card */
.health-score-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

.gauge-circle {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0% 86%, #F3E8FF 86% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(234, 141, 182, 0.3);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-inner {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-score {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-hover);
}

.gauge-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Friend Cards Grid */
.friend-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.friend-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.friend-card-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #DC2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.friend-card-delete-btn:hover {
  background: #DC2626;
  color: white;
  transform: scale(1.15);
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.35);
}

.profile-delete-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: #DC2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.profile-delete-btn:hover {
  background: #DC2626;
  color: white;
  transform: scale(1.15);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
}

.friend-card-avatar-wrapper {
  position: relative;
  margin-bottom: 14px;
}

.friend-card-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  box-shadow: 0 6px 16px rgba(248, 187, 217, 0.4);
}

.tier-badge {
  position: absolute;
  bottom: 0;
  right: -4px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  border: 2px solid white;
}

.friend-card h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.friend-card .relation-type {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 12px;
}

.friend-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 16px;
}

.tag-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--bg-main);
  color: var(--text-medium);
  border: 1px solid rgba(248, 187, 217, 0.4);
}

.friend-card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  width: 100%;
}

.friend-card-actions .btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
}

/* Friend Profile View Styling */
.profile-header-banner {
  background: linear-gradient(135deg, #FCE4EC 0%, #F3E8FF 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 28px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
}

.profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 30px;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: 0 10px 24px rgba(234, 141, 182, 0.3);
}

.profile-main-info h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
}

.profile-main-info p {
  font-size: 14px;
  color: var(--text-medium);
  margin-top: 4px;
}

.profile-actions-bar {
  margin-left: auto;
  display: flex;
  gap: 12px;
}

.topic-box {
  padding: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.safe-topic-box {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}

.avoid-topic-box {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
}

/* Modal Popup Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(45, 26, 41, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  padding: 32px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--primary);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--card-border);
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-dark);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--accent);
}

/* Floating AI Chat Assistant Widget */
.ai-floating-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 500;
}

.ai-fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #A855F7 100%);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(234, 141, 182, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.ai-fab:hover {
  transform: scale(1.1) rotate(6deg);
  box-shadow: 0 14px 36px rgba(234, 141, 182, 0.6);
}

.ai-chat-drawer {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 380px;
  height: 520px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(45, 26, 41, 0.2);
  border: 1px solid var(--card-border);
  display: none;
  flex-direction: column;
  z-index: 500;
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-drawer.active {
  display: flex;
}

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

.ai-chat-header {
  background: linear-gradient(135deg, var(--accent) 0%, #A855F7 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-chat-header h4 {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #FFF9FC;
}

.chat-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.4;
}

.chat-bubble.ai {
  background: white;
  color: var(--text-dark);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 12px rgba(248, 187, 217, 0.15);
  align-self: flex-start;
  border: 1px solid rgba(248, 187, 217, 0.3);
  font-size: 13.5px;
  line-height: 1.6;
}

.chat-bubble.ai h2,
.chat-bubble.ai h3,
.chat-bubble.ai h4 {
  color: #1E293B;
  font-weight: 700;
  margin-top: 14px;
  margin-bottom: 6px;
  line-height: 1.35;
}

.chat-bubble.ai h2:first-child,
.chat-bubble.ai h3:first-child,
.chat-bubble.ai h4:first-child {
  margin-top: 0;
}

.chat-bubble.ai h4 {
  font-size: 14px;
}

.chat-bubble.ai h3 {
  font-size: 15px;
}

.chat-bubble.ai h2 {
  font-size: 16px;
}

.chat-bubble.ai p {
  margin-bottom: 8px;
  line-height: 1.6;
}

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

.chat-bubble.ai ul,
.chat-bubble.ai ol {
  margin: 6px 0 10px 18px;
  padding: 0;
}

.chat-bubble.ai li {
  margin-bottom: 6px;
  line-height: 1.55;
}

.chat-bubble.ai strong {
  color: #0F172A;
  font-weight: 700;
}

.chat-bubble.user {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.ai-chat-input-row {
  padding: 12px;
  background: white;
  border-top: 1px solid var(--card-border);
  display: flex;
  gap: 8px;
}

.ai-chat-input-row input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  font-family: inherit;
  font-size: 13px;
}

.ai-chat-input-row input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Canvas Graph Styling */
#knowledge-graph-canvas {
  width: 100%;
  height: 480px;
  background: #FFFFFF;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-medium);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-dark);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(234, 141, 182, 0.2);
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

/* Tabs */
.tab-row {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 18px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.tab-btn.active {
  color: var(--accent);
  font-weight: 700;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
}

/* ==========================================
   AUTHENTICATION GLASS OVERLAY SCREEN
   ========================================== */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, rgba(255, 249, 252, 0.95) 0%, rgba(245, 243, 255, 0.95) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.auth-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.auth-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(248, 187, 217, 0.5);
  box-shadow: 0 20px 50px rgba(234, 141, 182, 0.25);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 36px 32px;
  position: relative;
  animation: authSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand-icon {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--lavender-deep) 100%);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  margin: 0 auto 14px auto;
  box-shadow: 0 8px 20px rgba(234, 141, 182, 0.4);
}

.auth-header h2 {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent) 0%, #9333EA 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.auth-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.auth-nav-tabs {
  display: flex;
  background: var(--bg-main);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--card-border);
}

.auth-tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.auth-tab-btn.active {
  background: white;
  color: var(--text-dark);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(234, 141, 182, 0.15);
}

.auth-input-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.auth-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 15px;
}

.auth-input {
  padding-left: 44px !important;
}

.auth-btn-submit {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 16px;
  margin-top: 8px;
}

.auth-btn-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.auth-message {
  margin: 4px 0 8px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}

.auth-message-error {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.auth-message-info {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

.auth-divider span {
  padding: 0 10px;
}

.auth-demo-btn {
  width: 100%;
  background: rgba(248, 187, 217, 0.15);
  border: 1px dashed var(--accent);
  color: var(--accent-hover);
  padding: 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-demo-btn:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

/* Custom Glassmorphism Toast Notification System */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  /* Above the login overlay (999999) and confirm popup (1000000) */
  z-index: 1000001;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast-message {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(248, 187, 217, 0.6);
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: 0 10px 30px rgba(147, 51, 234, 0.18), 0 4px 12px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dark);
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
}

.toast-message.toast-exit {
  animation: toastSlideOut 0.3s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

.toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  background: #ECFDF5;
  color: #059669;
}

.toast-error .toast-icon {
  background: #FEF2F2;
  color: #EF4444;
}

.toast-warning .toast-icon {
  background: #FFFBEB;
  color: #D97706;
}

.toast-info .toast-icon {
  background: #F3E8FF;
  color: #9333EA;
}

.toast-content {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.toast-close:hover {
  opacity: 1;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(50px) scale(0.95);
  }
}

/* Mobile Top Bar & Responsive Drawer Styles */
.mobile-top-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
  z-index: 1000;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  color: var(--text-dark);
}

.mobile-menu-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--accent-hover);
  cursor: pointer;
  padding: 8px;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(45, 26, 41, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* Diary Tab Switcher */
.diary-tab-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.diary-tab-btn {
  padding: 10px 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 13.5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.diary-tab-btn.active {
  background: var(--primary-light);
  color: var(--accent-hover);
  border-color: var(--accent);
}

.diary-tab-btn:hover {
  background: rgba(248, 187, 217, 0.2);
}

/* Responsive Breakpoints & Zoom Scaling */
@media (max-width: 1024px) {
  .mobile-top-bar {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -290px;
    width: 280px;
    z-index: 1050;
    transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .main-wrapper {
    margin-left: 0;
    padding-top: 80px;
    padding-left: 16px;
    padding-right: 16px;
    width: 100%;
  }

  .grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-main-sidebar {
    grid-template-columns: 1fr;
  }

  .profile-header-banner {
    flex-direction: column;
    text-align: center;
  }

  .profile-actions-bar {
    margin-top: 16px;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }

  .modal-card {
    padding: 20px;
    border-radius: 18px;
    margin: 10px;
  }

  .hero-banner {
    padding: 20px;
  }

  .hero-banner h2 {
    font-size: 20px;
  }
}

/* Admin Console & Role Badge Styling */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.role-badge-admin {
  background: rgba(147, 51, 234, 0.15);
  color: #7E22CE;
  border: 1px solid rgba(147, 51, 234, 0.3);
}

.role-badge-user {
  background: rgba(234, 141, 182, 0.15);
  color: var(--accent-hover);
  border: 1px solid rgba(234, 141, 182, 0.3);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

.admin-table th {
  background: var(--bg-main);
  color: var(--text-medium);
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--card-border);
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-dark);
}

.admin-table tr:hover {
  background: rgba(248, 187, 217, 0.08);
}

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

.status-dot-active {
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

.status-dot-warning {
  background: #F59E0B;
  box-shadow: 0 0 8px #F59E0B;
}

.status-dot-error {
  background: #EF4444;
  box-shadow: 0 0 8px #EF4444;
}

.access-denied-box {
  background: rgba(254, 242, 242, 0.9);
  border: 1px solid #FCA5A5;
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  margin: 40px auto;
  max-width: 540px;
  box-shadow: var(--shadow-soft);
}

/* ==========================================================================
   AUTHENTICATION FULL-SCREEN OVERLAY / LOGIN PAGE
   ========================================================================== */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at top right, rgba(248, 187, 217, 0.5), transparent 60%),
              radial-gradient(circle at bottom left, rgba(233, 213, 255, 0.5), transparent 60%),
              rgba(255, 245, 249, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  box-sizing: border-box;
}

.auth-overlay.active {
  display: flex !important;
}

.auth-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--card-border);
  box-shadow: 0 24px 60px rgba(248, 187, 217, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  width: 100%;
  max-width: 440px;
  padding: 36px 32px;
  text-align: center;
  box-sizing: border-box;
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-header {
  margin-bottom: 24px;
}

.auth-brand-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px auto;
  background: linear-gradient(135deg, var(--accent) 0%, var(--lavender-deep) 100%);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 26px;
  box-shadow: 0 10px 24px rgba(234, 141, 182, 0.4);
}

.auth-header h2 {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent) 0%, #9333EA 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.auth-header p {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.auth-nav-tabs {
  display: flex;
  background: rgba(248, 187, 217, 0.15);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 22px;
}

.auth-tab-btn {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.auth-tab-btn.active {
  background: white;
  color: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.auth-input-wrapper {
  position: relative;
  margin-bottom: 16px;
  text-align: left;
}

.auth-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 15px;
}

.auth-input {
  width: 100%;
  padding: 13px 16px 13px 44px !important;
  border-radius: 14px;
  border: 1px solid rgba(248, 187, 217, 0.4);
  background: #FFF9FC;
  font-size: 14px;
  box-sizing: border-box;
  transition: var(--transition);
}

.auth-input:focus {
  background: white;
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(248, 187, 217, 0.3);
}

.auth-btn-submit {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  margin-top: 8px;
  cursor: pointer;
}

/* ==========================================================================
   Calm redesign layer: one accent colour, plain surfaces, no gradients/glass.
   Overrides the original pastel theme above.
   ========================================================================== */
:root {
  --primary: #F3E4E8;
  --primary-light: #F8EEF1;
  --secondary: #F3E4E8;
  --accent: #B14F69;
  --accent-hover: #933D55;
  --lavender: #EEE9F2;
  --lavender-light: #F6F3F8;
  --lavender-deep: #6E5D80;
  --bg-main: #FAF7F4;
  --bg-gradient: #FAF7F4;
  --card-bg: #FFFFFF;
  --card-bg-solid: #FFFFFF;
  --card-border: #ECE5DF;
  --text-dark: #221C1A;
  --text-medium: #4D4440;
  --text-muted: #82766F;
  --shadow-soft: 0 1px 2px rgba(34, 28, 26, 0.04);
  --shadow-hover: 0 4px 14px rgba(34, 28, 26, 0.07);
  --shadow-glass: none;
  --glass-border: 1px solid var(--card-border);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;
}

body { background: var(--bg-main); }

.sidebar { background: #FFFFFF; backdrop-filter: none; -webkit-backdrop-filter: none; }
.brand-icon { background: var(--accent); box-shadow: none; }
.brand-text h1 { background: none; -webkit-text-fill-color: currentColor; color: var(--text-dark); }
.nav-item button:hover { background: var(--bg-main); color: var(--text-dark); transform: none; }
.nav-item button.active { background: var(--primary-light); color: var(--accent-hover); box-shadow: none; }

.btn-primary { background: var(--accent); box-shadow: none; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: none; transform: none; }
.btn-secondary { background: #FFFFFF; box-shadow: none; }
.btn-secondary:hover { background: var(--bg-main); transform: none; }
.btn-small { padding: 6px 12px; font-size: 12.5px; }
.btn-icon-only { background: #FFFFFF; box-shadow: none; }

.glass-card {
  background: var(--card-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--card-border);
}
.card-title-row { align-items: flex-start; gap: 12px; }
.card-title-row h3 { font-size: 15px; }
.card-subtitle { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }

.ai-fab, .ai-chat-header { background: var(--accent); }
.profile-header-banner { background: var(--primary-light); }
.auth-overlay { background: var(--bg-main); }
.auth-brand-icon { background: var(--accent); box-shadow: none; }
.auth-header h2 { background: none; -webkit-text-fill-color: currentColor; color: var(--text-dark); }

.gauge-circle { box-shadow: none !important; }
.gauge-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 14px; line-height: 1.5; }

/* Dashboard */
.dash-header { margin: 4px 0 24px; }
.dash-date {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
}
#dash-greeting-heading {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.15;
  margin: 6px 0 8px;
  color: var(--text-dark);
}
.dash-summary { font-size: 15px; color: var(--text-medium); line-height: 1.55; max-width: 640px; }
.dash-summary a, .empty-note a { color: var(--accent); font-weight: 600; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #FFFFFF;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.stat { display: flex; flex-direction: column; gap: 4px; padding: 18px 22px; }
.stat + .stat { border-left: 1px solid var(--card-border); }
.stat-value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-dark); }
.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }

.dash-column { display: flex; flex-direction: column; gap: 20px; }

.empty-note { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; }

.news-topics { list-style: none; counter-reset: topic; }
.news-topic {
  counter-increment: topic;
  position: relative;
  padding: 12px 0 12px 34px;
  border-bottom: 1px solid var(--card-border);
}
.news-topic:first-child { padding-top: 0; }
.news-topic::before {
  content: counter(topic);
  position: absolute;
  left: 0;
  top: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.news-topic:first-child::before { top: 0; }
.news-topic-text { font-size: 14.5px; font-weight: 600; color: var(--text-dark); line-height: 1.45; }
.news-topic-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.45; }
.news-topic-meta strong { color: var(--text-medium); }

.news-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.news-sources span { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-right: 2px; }
.news-sources a {
  font-size: 12px;
  color: var(--text-medium);
  text-decoration: none;
  padding: 3px 10px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  max-width: 220px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.news-sources a:hover { border-color: var(--accent); color: var(--accent); }
.news-search-entry { margin-top: 12px; }

.subsection-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 18px 0 6px;
}
.saved-topics { list-style: none; }
.saved-topics li { font-size: 13.5px; color: var(--text-medium); padding: 6px 0; }

.upcoming-list { list-style: none; }
.upcoming-list li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--card-border); font-size: 13.5px; }
.upcoming-list li:last-child { border-bottom: none; }
.upcoming-when { min-width: 64px; font-weight: 700; color: var(--accent); }
.upcoming-what { color: var(--text-dark); }

.memory-item { padding: 12px 0; border-bottom: 1px solid var(--card-border); }
.memory-item:first-child { padding-top: 0; }
.memory-item:last-child { border-bottom: none; padding-bottom: 0; }
.memory-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.memory-head strong { font-size: 14px; color: var(--text-dark); }
.memory-head span { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.memory-item p {
  font-size: 13px;
  color: var(--text-medium);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-list { display: flex; flex-direction: column; gap: 2px; }
.tool-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dark);
  text-align: left;
  cursor: pointer;
}
.tool-item:hover { background: var(--bg-main); }
.tool-item i { width: 18px; color: var(--accent); }

@media (max-width: 768px) {
  #dash-greeting-heading { font-size: 26px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--card-border); }
}

/* Login: forgot / new password */
.auth-links { display: flex; justify-content: flex-end; margin: -2px 0 8px; }
.auth-link {
  background: none;
  border: none;
  padding: 2px 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.auth-link:hover { text-decoration: underline; }
.auth-mode-hint { font-size: 13.5px; color: var(--text-medium); line-height: 1.5; margin-bottom: 14px; text-align: left; }

/* ---------- English vocabulary ---------- */
.vocab-search { display: flex; gap: 10px; margin-bottom: 20px; max-width: 640px; }
.vocab-search .form-control { flex: 1; font-size: 15px; }
.vocab-search .btn:disabled { opacity: .6; cursor: wait; }

.vocab-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.vocab-saved { position: sticky; top: 16px; }

.vocab-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.vocab-word { font-family: 'Fraunces', Georgia, serif; font-size: 34px; font-weight: 600; color: var(--text-dark); line-height: 1.1; display: flex; align-items: center; gap: 10px; }
.vocab-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; font-size: 13.5px; color: var(--text-muted); }
.vocab-level { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--primary-light); color: var(--accent-hover); }
.vocab-corrected { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #FEF3C7; color: #92400E; }
.vocab-meaning { font-size: 16px; color: var(--text-medium); margin-top: 8px; }
.vocab-actions { display: flex; gap: 8px; align-items: flex-start; }

.vocab-speak { border: none; background: none; color: var(--text-muted); cursor: pointer; padding: 2px 4px; font-size: .55em; vertical-align: middle; }
.vocab-forms .vocab-speak, .vocab-examples .vocab-speak { font-size: 12px; }
.vocab-speak:hover { color: var(--accent); }

.vocab-forms { width: 100%; border-collapse: collapse; }
.vocab-forms td { padding: 9px 0; border-bottom: 1px solid var(--card-border); vertical-align: top; font-size: 14px; }
.vocab-forms tr:last-child td { border-bottom: none; }
.vocab-pos { width: 96px; font-size: 12px !important; font-weight: 700; color: var(--accent); text-transform: lowercase; padding-top: 11px !important; }
.vocab-forms strong { color: var(--text-dark); }
.vocab-form-meaning { color: var(--text-medium); }
.vocab-form-example { font-size: 13px; color: var(--text-muted); font-style: italic; margin-top: 3px; }

.vocab-verbforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.vocab-verbforms div { border: 1px solid var(--card-border); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.vocab-verbforms span { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.vocab-verbforms strong { font-size: 15px; color: var(--text-dark); }

.vocab-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.vocab-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vocab-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 1px solid var(--card-border); background: #FFFFFF; border-radius: 10px; padding: 6px 10px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-dark); cursor: pointer; text-align: left; }
.vocab-chip span { font-size: 11.5px; font-weight: 500; color: var(--text-muted); }
.vocab-chip:hover { border-color: var(--accent); color: var(--accent); }
.vocab-colloc { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--bg-main); color: var(--text-medium); }

.vocab-examples { list-style: none; }
.vocab-examples li { padding: 9px 0 9px 14px; border-left: 2px solid var(--primary-light); margin-bottom: 6px; }
.vocab-examples p { font-size: 14.5px; color: var(--text-dark); line-height: 1.5; }
.vocab-examples span { font-size: 13px; color: var(--text-muted); }

.vocab-tip { margin-top: 18px; padding: 12px 14px; border-radius: 10px; background: var(--bg-main); font-size: 13.5px; color: var(--text-medium); line-height: 1.55; }
.vocab-tip i { color: #B7791F; margin-right: 4px; }

.vocab-list { list-style: none; max-height: 60vh; overflow-y: auto; }
.vocab-list-item { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: none; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; font: inherit; }
.vocab-list-item:hover { background: var(--bg-main); }
.vocab-list-item.active { background: var(--primary-light); }
.vocab-list-word { font-size: 14px; font-weight: 600; color: var(--text-dark); }
.vocab-list-word i { color: #2F855A; font-size: 11px; }
.vocab-list-meaning { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

@media (max-width: 900px) {
  .vocab-layout { grid-template-columns: 1fr; }
  .vocab-saved { position: static; }
  .vocab-two { grid-template-columns: 1fr; gap: 0; }
  .vocab-word { font-size: 28px; }
}
.vocab-none { font-size: 13px; color: var(--text-muted); font-style: italic; }
.vocab-alt { margin-top: 3px; font-size: 14px; color: var(--text-medium); }
.vocab-alt strong { color: var(--text-dark); }

/* Vocab senses (one block per meaning, thesaurus style) */
.vocab-senses { display: flex; flex-direction: column; }
.vocab-sense { padding: 14px 0; border-bottom: 1px solid var(--card-border); }
.vocab-sense:first-child { padding-top: 4px; }
.vocab-sense:last-child { border-bottom: none; }
.vocab-sense-head { display: flex; gap: 12px; align-items: flex-start; }
.vocab-sense-num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #FFFFFF; font-size: 12.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.vocab-sense-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 3px; }
.vocab-pos-tag { font-size: 12px; font-weight: 700; color: var(--accent); }
.vocab-grammar { font-size: 11.5px; color: var(--text-muted); border: 1px solid var(--card-border); border-radius: 6px; padding: 0 6px; cursor: help; }
.vocab-sense-def { font-size: 15px; font-weight: 600; color: var(--text-dark); line-height: 1.4; }
.vocab-sense-example { margin: 8px 0 0 36px; padding-left: 12px; border-left: 2px solid var(--primary-light); }
.vocab-sense-example p { font-size: 14px; color: var(--text-dark); font-style: italic; line-height: 1.5; }
.vocab-sense-example .vocab-speak { font-size: 12px; font-style: normal; }
.vocab-sense-example span { font-size: 12.5px; color: var(--text-muted); }
.vocab-sense-row { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 0 36px; }
.vocab-row-label { flex: none; width: 58px; font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; padding-top: 7px; }
.vocab-opp { color: #2563A8; }
.vocab-chip b { font-weight: 600; }
.vocab-register { font-style: normal; font-size: 10.5px; font-weight: 600; color: #6E5D80; background: #F1ECF6; border-radius: 4px; padding: 0 5px; margin-left: 3px; vertical-align: 1px; }
.vocab-patterns { list-style: none; display: flex; flex-direction: column; gap: 4px; padding-top: 5px; }
.vocab-patterns li { font-size: 13.5px; color: var(--text-dark); }
.vocab-patterns li::before { content: '▸'; color: var(--accent); margin-right: 6px; }

.vocab-compare { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: #EEF4FB; border: 1px solid #D6E4F5; }
.vocab-compare-title { font-size: 13px; font-weight: 800; color: #2563A8; text-transform: uppercase; letter-spacing: .3px; }
.vocab-compare p { font-size: 13.5px; color: var(--text-medium); line-height: 1.55; margin-top: 6px; }
.vocab-compare ul { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.vocab-compare li { font-size: 13.5px; font-style: italic; }
.vocab-compare li i { font-style: normal; width: 14px; }
.vocab-compare li.ok { color: #276749; }
.vocab-compare li.bad { color: #9B2C2C; }

@media (max-width: 900px) {
  .vocab-sense-row, .vocab-sense-example { margin-left: 0; }
  .vocab-sense-row { flex-direction: column; gap: 4px; }
  .vocab-row-label { padding-top: 0; }
}
