:root {
  /* Original Blue Color Palette */
  --color-navy: #1a2a6c;
  --color-dusty-blue: #6382b6;
  --color-steel-blue: #4682b4;
  --color-light-blue: #d6e4f0;
  --color-white: #ffffff;
  --color-bg: #f8fbff;
  --color-text-main: #1e293b;
  --color-text-muted: #475569;
  
  /* Layout constraints */
  --border-color: rgba(99, 130, 182, 0.2);
  --radius: 12px;
  --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
  scroll-behavior: smooth;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

ul {
  list-style: none;
}

/* 3 Column Layout */
.app-container {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 280px;
  gap: 3rem;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
}

/* Sidebar Left */
.sidebar-left {
  padding: 3rem 1.5rem 2rem 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.profile-section {
  text-align: left;
  margin-bottom: 3rem;
}

.profile-pic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 3px solid var(--color-white);
  box-shadow: 0 4px 10px rgba(26, 42, 108, 0.1);
  position: relative;
  cursor: pointer;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.profile-pic:hover {
  box-shadow: 0 6px 18px rgba(26, 42, 108, 0.2);
  transform: scale(1.05);
}

.profile-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Profile pic upload overlay */
.profile-pic-upload-overlay {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: rgba(26, 42, 108, 0.75);
  justify-content: center;
  align-items: center;
}

.admin-mode .profile-pic:hover .profile-pic-upload-overlay {
  display: flex;
}

.profile-pic-upload-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: white;
  line-height: 1;
  padding: 0;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-navy);
}

.profile-title {
  font-size: 0.9rem;
  color: var(--color-dusty-blue);
  font-style: italic;
}

.main-nav {
  margin-bottom: auto;
}

.main-nav li {
  margin-bottom: 0.5rem;
}

.main-nav a {
  display: block;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.main-nav a:hover, .main-nav a.active {
  background-color: var(--color-white);
  color: var(--color-navy);
  box-shadow: 0 2px 10px rgba(99, 130, 182, 0.1);
}

.social-links {
  display: flex;
  gap: 1.25rem;
  padding: 1rem;
  margin-top: 2rem;
}

.social-links a {
  color: var(--color-dusty-blue);
}

.social-links a:hover {
  color: var(--color-navy);
  transform: translateY(-2px);
}

.social-links svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Main Content */
.main-content {
  padding: 3rem 0;
}

.content-section {
  margin-bottom: 5rem;
}

.section-title {
  font-size: 2rem;
  color: var(--color-navy);
  margin-bottom: 2rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background-color: var(--color-steel-blue);
  margin-top: 0.5rem;
  border-radius: 2px;
}

/* Hero */
.hero-section {
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 3rem;
}

.greeting {
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--color-navy);
  margin-bottom: 0.5rem;
}

.greeting .highlight {
  color: var(--color-steel-blue);
}

.professional-title {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--color-dusty-blue);
  font-weight: 500;
  margin-bottom: 1rem;
}

/* Notes Section */
.note-card {
  position: relative;
  display: flex;
  background-color: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(99, 130, 182, 0.08);
  margin-bottom: 1.5rem;
  transition: transform var(--transition), box-shadow var(--transition);
  min-height: 150px;
}

.note-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(26, 42, 108, 0.15);
}

.note-card-content {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.note-title {
  font-size: 1.2rem;
  color: var(--color-navy);
  margin-bottom: 0.5rem;
}

.note-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.note-meta {
  font-size: 0.8rem;
  color: var(--color-dusty-blue);
  display: flex;
  align-items: center;
  margin-top: auto;
}

.note-meta svg {
  margin-right: 0.5rem;
}

.note-card-cover {
  width: 30%;
  min-width: 200px;
  position: relative;
  overflow: hidden;
}

.note-card-cover .cover-bg {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.4s ease;
}

.note-card:hover .cover-bg {
  transform: scale(1.05);
}

/* Cover Upload Button (admin only) */
.cover-upload-overlay {
  display: none;
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
}

.admin-mode .cover-upload-overlay {
  display: block;
}

.cover-upload-btn {
  background: rgba(26, 42, 108, 0.85);
  color: var(--color-white);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cover-upload-btn:hover {
  background: rgba(70, 130, 180, 0.9);
  border-color: rgba(255,255,255,0.5);
}

/* Right Sidebar */
.sidebar-right {
  padding: 3rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  overflow-y: auto;
}

.widget {
  margin-bottom: 2.5rem;
}

.widget-title {
  font-size: 1rem;
  color: var(--color-navy);
  margin-bottom: 1.2rem;
  font-weight: 600;
}

.widget-list li {
  margin-bottom: 0.8rem;
}

.widget-list a {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  display: block;
}

.widget-list a:hover {
  color: var(--color-steel-blue);
  padding-left: 2px;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#block-tags.markdown-body p, #block-tags.markdown-body ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0;
  padding-left: 0;
  list-style: none;
}

.tag, #block-tags.markdown-body > p a, #block-tags.markdown-body > ul li, #block-tags.markdown-body > p code {
  font-size: 0.8rem;
  color: var(--color-dusty-blue) !important;
  border: 1px solid var(--color-light-blue);
  background-color: var(--color-white);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  text-decoration: none;
  display: inline-block;
}

.tag:hover, #block-tags.markdown-body > p a:hover, #block-tags.markdown-body > ul li:hover, #block-tags.markdown-body > p code:hover {
  background-color: var(--color-navy);
  color: var(--color-white) !important;
  border-color: var(--color-navy);
  cursor: pointer;
}

/* Easter Egg Star */
.easter-egg-star {
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: var(--color-steel-blue);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: spin-pulse 1s forwards ease-in-out;
  pointer-events: none;
  z-index: 1000;
}
@keyframes spin-pulse {
  0% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.5) rotate(180deg); opacity: 1; background-color: var(--color-navy); }
  100% { transform: scale(1) rotate(360deg); opacity: 0; }
}

/* Admin Edit Buttons & UI */
.admin-only-btn {
  display: none;
  background: #28a745;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.admin-only-btn:hover {
  background: #218838;
}

.admin-mode .admin-only-btn {
  display: inline-block;
}

.admin-mode .admin-note-actions {
  display: flex !important;
}

.admin-note-actions {
  display: none;
  position: absolute;
  top: 15px;
  right: 15px;
  gap: 10px;
  z-index: 5;
}

.admin-mode .sidebar-left [id^="block-"],
.admin-mode .sidebar-right [id^="block-"] {
  padding-right: 55px;
}

.admin-mode [id^="block-"]:hover, .admin-mode .note-body:hover {
  outline: 2px dashed var(--color-dusty-blue);
  outline-offset: 4px;
}

.admin-edit-btn {
  display: none;
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--color-navy);
  color: var(--color-white);
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 10;
  font-size: 0.75rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.admin-edit-btn:hover {
  background: var(--color-steel-blue);
}

/* Hide Edit btn by default in admin mode, show only on parent hover */
.admin-mode [id^="block-"]:hover .admin-edit-btn,
.admin-mode .note-body:hover .admin-edit-btn {
  display: block;
}

.admin-mode [id^="block-"]:hover, .admin-mode .note-body:hover {
  outline: 2px dashed var(--color-dusty-blue);
  outline-offset: 4px;
}

/* Ensure Editor fills the dashed box entirely */
.admin-edit-wrapper {
  width: 100% !important;
  display: block !important;
}
.admin-edit-wrapper .editor-toolbar,
.admin-edit-wrapper .CodeMirror {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  display: block !important;
}
.admin-edit-wrapper .CodeMirror {
  min-height: 150px;
}

/* EasyMDE Actions */
.editor-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.save-btn, .cancel-btn {
  padding: 8px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}
.save-btn { background: #28a745; color: white; }
.save-btn:hover { background: #218838; }
.cancel-btn { background: #dc3545; color: white; }
.cancel-btn:hover { background: #c82333; }

/* Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-content {
  background: var(--color-white);
  padding: 2rem;
  border-radius: var(--radius);
  width: 90%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.modal-content h3 {
  color: var(--color-navy);
  margin-bottom: 0.5rem;
}
.modal-content input {
  padding: 12px;
  border: 1px solid var(--color-light-blue);
  border-radius: 4px;
  font-size: 1rem;
}
.modal-content input:focus {
  outline: none;
  border-color: var(--color-steel-blue);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 1rem;
}
.modal-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}
#do-login-btn { background: var(--color-navy); color: var(--color-white); }
#close-modal-btn { background: var(--color-light-blue); color: var(--color-text-main); }

/* Cat Secret Modal */
.cat-secret-content {
  max-width: 500px !important;
  position: relative;
  text-align: center;
  padding-top: 2.5rem !important;
}

.cat-secret-image-wrapper {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-light-blue), var(--color-dusty-blue));
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-secret-image-wrapper img {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.cat-secret-image-wrapper img:hover {
  transform: scale(1.02);
}

.cat-chat-toggle {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  background: var(--color-white);
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10;
}

.cat-chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.cat-chat-toggle:active {
  transform: scale(0.95);
}

.cat-chat-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff4757;
  color: white;
  font-size: 0.65rem;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-weight: 700;
  border: 2px solid var(--color-white);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cat-chat-count:not(:empty) {
  opacity: 1;
}

.cat-secret-image-wrapper img[src=""] {
  display: none;
}

.cat-secret-text {
  text-align: left;
  padding: 0.5rem 0;
  min-height: 2rem;
}

/* Cat Comments Modal */
.cat-comments-modal-content {
  max-width: 450px !important;
  min-height: 500px;
  display: flex !important;
  flex-direction: column;
  padding-top: 2.5rem !important;
}

.cat-comments-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.cat-comments-title {
  font-size: 1.1rem;
  color: var(--color-navy);
  margin-bottom: 1rem;
  font-weight: 700;
  text-align: center;
}

.cat-comments-list {
  flex: 1;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding-right: 8px;
}

.cat-comments-list::-webkit-scrollbar {
  width: 4px;
}
.cat-comments-list::-webkit-scrollbar-thumb {
  background: var(--color-light-blue);
  border-radius: 4px;
}

.cat-comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.cat-comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-dusty-blue), var(--color-navy));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

.cat-comment-bubble {
  background: var(--color-bg);
  border: 1px solid var(--color-light-blue);
  border-radius: 10px 10px 10px 2px;
  padding: 8px 12px;
  flex: 1;
  min-width: 0;
}

.cat-comment-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-navy);
}

.cat-comment-time {
  font-size: 0.6rem;
  color: var(--color-text-muted);
  margin-left: 6px;
  font-weight: 400;
}

.cat-comment-msg {
  font-size: 0.82rem;
  color: var(--color-text-main);
  margin-top: 2px;
  word-break: break-word;
}

.cat-comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cat-comment-form input,
.cat-comment-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--color-light-blue);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  resize: none;
  transition: border-color 0.2s ease;
}

.cat-comment-form input:focus,
.cat-comment-form textarea:focus {
  outline: none;
  border-color: var(--color-steel-blue);
}

#cat-comment-submit {
  align-self: flex-end;
  padding: 8px 20px;
  background: var(--color-navy);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

#cat-comment-submit:hover {
  background: var(--color-steel-blue);
  transform: translateY(-1px);
}

#cat-comment-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.cat-comment-empty {
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding: 1rem 0;
  font-style: italic;
}

/* Markdown styling cleanup */
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    color: var(--color-navy);
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}
.markdown-body p {
    margin-bottom: 1rem;
}
.markdown-body ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.markdown-body ol {
    list-style: decimal;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.markdown-body li {
    margin-bottom: 0.4rem;
}

/* PDF Preview Card */
.pdf-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0f4fa 0%, #e8edf5 100%);
  border: 1px solid var(--color-light-blue);
  border-radius: 8px;
  margin: 1rem 0;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none !important;
  color: var(--color-text-main) !important;
}

.pdf-preview-card:hover {
  border-color: var(--color-steel-blue);
  box-shadow: 0 4px 12px rgba(70, 130, 180, 0.15);
  transform: translateY(-1px);
}

.pdf-preview-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #dc3545, #c82333);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

.pdf-preview-info {
  flex: 1;
  min-width: 0;
}

.pdf-preview-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-preview-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Clickable inline images in markdown */
.markdown-body img {
  cursor: pointer;
  border-radius: 8px;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  max-width: 100%;
}

.markdown-body img:hover {
  box-shadow: 0 4px 16px rgba(26, 42, 108, 0.2);
  transform: scale(1.01);
}

/* Lightbox Overlay */
.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  animation: lightbox-fade-in 0.3s ease;
}

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

@keyframes lightbox-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-close-btn {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.5rem;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2001;
  line-height: 1;
  transition: transform 0.2s ease;
}

.lightbox-close-btn:hover {
  transform: scale(1.2) rotate(90deg);
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.lightbox-content iframe {
  width: 80vw;
  height: 85vh;
  border: none;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  background: white;
}

/* =============================================
   INTERACTIVE CAT WIDGET
   ============================================= */
.cat-widget {
  position: fixed;
  bottom: 20px;
  right: 25px;
  z-index: 999;
  cursor: pointer;
  transition: transform 0.3s ease;
  user-select: none;
}

.cat-widget:hover {
  transform: scale(1.1);
}

.cat-widget.pet {
  animation: cat-pet-bounce 0.4s ease;
}

.cat-widget.surprised {
  animation: cat-surprised 0.5s ease;
}

@keyframes cat-pet-bounce {
  0% { transform: scale(1.1); }
  30% { transform: scale(1.25) rotate(-5deg); }
  60% { transform: scale(1.15) rotate(3deg); }
  100% { transform: scale(1.1); }
}

@keyframes cat-surprised {
  0% { transform: scale(1.1); }
  20% { transform: scale(1.3) translateY(-8px); }
  50% { transform: scale(1.2) translateY(-4px); }
  100% { transform: scale(1.1) translateY(0); }
}

/* Cat Body */
.cat-body {
  width: 60px;
  height: 55px;
  position: relative;
}

/* Ears */
.cat-ears {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  display: flex;
  justify-content: space-between;
}

.cat-ear {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 14px solid var(--color-navy);
  transition: transform 0.3s ease;
}

.cat-ear.left { transform: rotate(-8deg); }
.cat-ear.right { transform: rotate(8deg); }
.cat-widget:hover .cat-ear.left { transform: rotate(-15deg); }
.cat-widget:hover .cat-ear.right { transform: rotate(15deg); }

/* Face */
.cat-face {
  width: 48px;
  height: 40px;
  background: var(--color-navy);
  border-radius: 50% 50% 45% 45%;
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  overflow: visible;
}

/* Eyes */
.cat-eyes {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding-top: 12px;
}

.cat-eye {
  width: 7px;
  height: 7px;
  background: var(--color-light-blue);
  border-radius: 50%;
  position: relative;
  animation: cat-blink 4s infinite;
  transition: all 0.2s ease;
}

.cat-eye::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  top: 1px;
  left: 1px;
}

.cat-widget.surprised .cat-eye {
  width: 10px;
  height: 10px;
  background: #ffd700;
}

.cat-widget.sleeping .cat-eye {
  width: 8px;
  height: 2px;
  border-radius: 0 0 8px 8px;
  background: var(--color-light-blue);
}

@keyframes cat-blink {
  0%, 90%, 100% { height: 7px; border-radius: 50%; }
  95% { height: 1px; border-radius: 4px; }
}

/* Nose */
.cat-nose {
  width: 5px;
  height: 4px;
  background: #f0a0b0;
  border-radius: 50% 50% 40% 40%;
  margin: 3px auto 0;
}

/* Mouth */
.cat-mouth {
  width: 10px;
  height: 5px;
  border-bottom: 2px solid var(--color-dusty-blue);
  border-radius: 0 0 50% 50%;
  margin: 0 auto;
}

.cat-widget.pet .cat-mouth {
  border-bottom-color: #f0a0b0;
  width: 14px;
}

/* Whiskers */
.cat-whiskers {
  position: absolute;
  top: 22px;
  width: 18px;
  height: 0;
  border-top: 1.5px solid var(--color-dusty-blue);
}

.cat-whiskers.left {
  left: -12px;
  transform: rotate(-5deg);
}

.cat-whiskers.right {
  right: -12px;
  transform: rotate(5deg);
}

.cat-whiskers::before,
.cat-whiskers::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 0;
  border-top: 1.5px solid var(--color-dusty-blue);
  left: 0;
}

.cat-whiskers.left::before { top: -5px; transform: rotate(-10deg); }
.cat-whiskers.left::after { top: 5px; transform: rotate(10deg); }
.cat-whiskers.right::before { top: -5px; transform: rotate(10deg); }
.cat-whiskers.right::after { top: 5px; transform: rotate(-10deg); }

/* Tail */
.cat-tail {
  position: absolute;
  bottom: 5px;
  right: -10px;
  width: 28px;
  height: 18px;
  border: 3px solid var(--color-navy);
  border-color: var(--color-navy) var(--color-navy) transparent transparent;
  border-radius: 0 18px 0 0;
  animation: tail-wag 2s ease-in-out infinite;
}

@keyframes tail-wag {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(15deg); }
}

.cat-widget:hover .cat-tail {
  animation-duration: 0.6s;
}

/* Speech Bubble */
.cat-speech {
  position: absolute;
  bottom: 65px;
  right: 0;
  background: var(--color-white);
  color: var(--color-navy);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(26, 42, 108, 0.15);
  opacity: 0;
  transform: translateY(5px) scale(0.9);
  transition: all 0.3s ease;
  pointer-events: none;
}

.cat-speech.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.cat-speech::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--color-white);
}

/* Floating Hearts */
.cat-hearts {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.cat-heart {
  position: absolute;
  font-size: 1rem;
  animation: heart-float 1.2s ease forwards;
  opacity: 0;
}

@keyframes heart-float {
  0% { opacity: 1; transform: translateY(0) scale(0.5); }
  50% { opacity: 1; transform: translateY(-25px) scale(1); }
  100% { opacity: 0; transform: translateY(-50px) scale(0.8); }
}

/* Sleeping Zzz */
.cat-zzz {
  position: absolute;
  top: -10px;
  right: -5px;
  font-size: 0.7rem;
  color: var(--color-dusty-blue);
  pointer-events: none;
  opacity: 0;
}

.cat-widget.sleeping .cat-zzz {
  animation: zzz-float 2s ease-in-out infinite;
}

@keyframes zzz-float {
  0% { opacity: 0; transform: translateY(0) scale(0.8); content: 'z'; }
  25% { opacity: 1; }
  50% { opacity: 1; transform: translateY(-12px) scale(1.1); }
  75% { opacity: 0.5; transform: translateY(-20px) scale(0.9); }
  100% { opacity: 0; transform: translateY(-28px) scale(0.7); }
}

/* Cat Hint Text */
.cat-hint {
  text-align: center;
  font-size: 0.6rem;
  color: var(--color-dusty-blue);
  opacity: 0;
  transition: opacity 0.4s ease;
  margin-top: 4px;
  letter-spacing: 0.3px;
  pointer-events: none;
}

.cat-widget:hover .cat-hint {
  opacity: 0.7;
}

@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .sidebar-right {
    display: none;
  }
}
@media (max-width: 768px) {
  .app-container {
    display: flex;
    flex-direction: column;
  }
  .sidebar-left {
    height: auto;
    position: relative;
    padding: 1.5rem;
  }
  .main-nav ul {
    display: flex;
    overflow-x: auto;
  }
  .main-nav li {
    margin-right: 0.5rem;
  }
  .note-card {
    flex-direction: column-reverse;
  }
  .note-card-cover {
    width: 100%;
    height: 150px;
  }
}
