/* ==========================================================================
   Design System & Styling Tokens
   ========================================================================== */

:root {
  /* Colors */
  --bg-dark-base: #070913;
  --bg-dark-accent: #0f1225;
  --panel-bg: rgba(13, 17, 34, 0.7);
  --panel-bg-hover: rgba(22, 28, 54, 0.8);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-hover: rgba(255, 255, 255, 0.15);
  
  --primary: #6366f1;       /* Indigo Glow */
  --primary-rgb: 99, 102, 241;
  --primary-hover: #4f46e5;
  
  --secondary: #a855f7;     /* Purple Glow */
  --secondary-rgb: 168, 85, 247;
  --secondary-hover: #9333ea;
  
  --cyan: #06b6d4;          /* Cyber Cyan */
  --cyan-rgb: 6, 182, 212;
  
  --text-primary: #f8fafc;  /* Ice White */
  --text-secondary: #94a3b8;/* Slate Gray */
  --text-muted: #64748b;    /* Dark Slate */
  
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --note-accent: #3b82f6;

  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Fira Code', 'JetBrains Mono', SFMono-Regular, Consolas, monospace;

  /* Layout Constants */
  --sidebar-width: 320px;
  --graph-panel-width: 420px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  /* View Transition tokens */
  view-transition-name: root;
}

/* ==========================================================================
   Base resets and Layout Setup
   ========================================================================== */

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(13, 17, 34, 0.3);
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

/* ==========================================================================
   Glowing Ambient Orbs
   ========================================================================== */

.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
  mix-blend-mode: screen;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,0.6) 0%, rgba(99,102,241,0) 70%);
  top: -10%;
  left: -10%;
  animation: float 25s infinite alternate ease-in-out;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(168,85,247,0.5) 0%, rgba(168,85,247,0) 70%);
  bottom: -20%;
  right: -10%;
  animation: float 30s infinite alternate-reverse ease-in-out;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(6,182,212,0.4) 0%, rgba(6,182,212,0) 70%);
  top: 40%;
  left: 45%;
  animation: float 20s infinite alternate ease-in-out;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 30px) scale(1.1); }
  100% { transform: translate(-30px, -50px) scale(0.9); }
}

/* ==========================================================================
   Glassmorphism Styles
   ========================================================================== */

.glass {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.glass:hover {
  border-color: var(--panel-border-hover);
}

/* ==========================================================================
   Main Layout Structure
   ========================================================================== */

.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ==========================================================================
   Sidebar Component
   ========================================================================== */

.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--panel-border);
  flex-shrink: 0;
  z-index: 10;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
  width: 0px;
  overflow: hidden;
  border-right-color: transparent;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--panel-border);
  overflow: hidden;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtext {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: -2px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.search-box {
  padding: 16px 20px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  background: rgba(7, 9, 19, 0.6);
  border: 1px solid var(--panel-border);
  padding: 10px 16px 10px 36px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
  background: rgba(7, 9, 19, 0.8);
}

.clear-search-btn {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-search-btn:hover {
  color: var(--text-primary);
}

.notes-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px;
}

.nav-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 12px;
}

.notes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notes-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 2px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notes-item i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.notes-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-left-color: rgba(99, 102, 241, 0.4);
}

.notes-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text-primary);
  border-left-color: var(--primary);
  box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.05);
}

.notes-item.active i {
  color: var(--primary);
}

.notes-item.is-orphan span {
  font-style: italic;
  opacity: 0.75;
}

.notes-item.is-orphan .orphan-indicator-icon {
  color: #f59e0b !important;
  opacity: 0.8 !important;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--panel-border);
  overflow: hidden;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.app-credits {
  margin-top: 12px;
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-credits a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.app-credits a:hover {
  color: var(--primary);
}

/* Sidebar Trigger floating button */
.sidebar-trigger {
  position: absolute;
  left: 20px;
  top: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9;
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  animation: floatIn 0.3s ease;
}

@keyframes floatIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Main Content Panels
   ========================================================================== */

.main-content {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Prevents flex items from expanding beyond parent */
}

.content-header {
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
  background: rgba(7, 9, 19, 0.4);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.breadcrumb-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.breadcrumb-item:hover {
  color: var(--primary);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

.breadcrumb-separator {
  color: var(--text-muted);
}

.btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--panel-border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.btn-secondary i {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

/* ==========================================================================
   Note View Styling
   ========================================================================== */

.note-container {
  flex: 1;
  overflow-y: auto;
  padding: 40px 48px;
  margin: 20px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

.note-header-wrap {
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.note-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  outline: none;
  width: fit-content; /* Critical for view transitions */
}

.note-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 10px;
}

.meta-icon {
  width: 14px;
  height: 14px;
}

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 16px;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(99, 102, 241, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Markdown Body Engine Style
   ========================================================================== */

.markdown-body {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.75;
  color: #e2e8f0;
  flex: 1;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  letter-spacing: -0.01em;
}

.markdown-body h1 { font-size: 1.6rem; border-bottom: 1px solid var(--panel-border); padding-bottom: 8px; }
.markdown-body h2 { font-size: 1.35rem; }
.markdown-body h3 { font-size: 1.15rem; }

.markdown-body p {
  margin-bottom: 1.25em;
}

/* Lists and items */
.markdown-body ul,
.markdown-body ol {
  margin-bottom: 1.25em;
  padding-left: 24px;
}

.markdown-body li {
  margin-bottom: 0.5em;
}

.markdown-body li::marker {
  color: var(--primary);
  font-weight: 700;
}

/* Alerts and Quotes */
.markdown-body blockquote {
  border-left: 4px solid var(--primary);
  background: rgba(99, 102, 241, 0.05);
  padding: 12px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 1.25em;
  color: #cbd5e1;
  font-style: italic;
}

.markdown-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Code blocks & highlight */
.markdown-body pre {
  background: #090b16 !important;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 16px 20px !important;
  margin-bottom: 1.5em;
  overflow-x: auto;
  position: relative;
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: #f1f5f9;
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* Inline Images and Obsidian Embeds */
.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  margin: 1.5em 0;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.markdown-body img:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15);
}

/* Custom Wikilink Class */
.wikilink {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed rgba(99, 102, 241, 0.4);
  transition: all 0.2s ease;
  cursor: pointer;
}

.wikilink:hover {
  color: #818cf8;
  border-bottom-color: var(--primary);
  background: rgba(99, 102, 241, 0.06);
  border-radius: 2px;
  padding: 0 2px;
}

/* Code copy button */
.code-block-wrapper {
  position: relative;
}

.code-copy-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 5;
}

.code-block-wrapper:hover .code-copy-btn {
  opacity: 1;
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  border-color: var(--primary);
}

.code-copy-btn.copied {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border-color: var(--success);
}

/* ==========================================================================
   Note Footer (Backlinks & Links)
   ========================================================================== */

.note-footer {
  margin-top: 48px;
  border-top: 1px solid var(--panel-border);
  padding-top: 32px;
}

.relations-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}

.relation-column h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-icon {
  width: 16px;
  height: 16px;
}

.text-indigo { color: var(--primary); }
.text-purple { color: var(--secondary); }

.relation-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.relation-item-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.relation-item-link:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  color: var(--text-primary);
  transform: translateX(4px);
}

.relation-item-link i {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.empty-state {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed var(--panel-border);
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Graph Visualization Panel
   ========================================================================== */

.graph-panel {
  width: var(--graph-panel-width);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--panel-border);
  flex-shrink: 0;
  z-index: 10;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.graph-panel.collapsed {
  width: 0px;
  overflow: hidden;
  border-left-color: transparent;
  transform: translateX(100%);
}

.graph-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--panel-border);
  overflow: hidden;
  white-space: nowrap;
}

.graph-title-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.graph-header-icon {
  width: 22px;
  height: 22px;
  color: var(--secondary);
  filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.4));
}

.graph-header h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.graph-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.canvas-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: rgba(5, 7, 15, 0.8);
}

#graphCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#graphCanvas:active {
  cursor: grabbing;
}

/* Legend Overlay */
.graph-legend {
  position: absolute;
  bottom: 16px;
  left: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  pointer-events: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.active {
  background-color: var(--secondary);
  box-shadow: 0 0 6px var(--secondary);
}

.legend-dot.link {
  background-color: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}

.legend-dot.default {
  background-color: var(--text-muted);
}

.graph-zoom-indicator {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 8px;
  background: rgba(13, 17, 34, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  pointer-events: none;
}

/* ==========================================================================
   Image Lightbox Component
   ========================================================================== */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 15, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 3rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

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

.lightbox-content {
  max-width: 90%;
  max-height: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-caption {
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ==========================================================================
   Responsive and Mobile Adaptability
   ========================================================================== */

@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: 320px;
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
  }
  
  .graph-panel {
    width: 100%;
    height: 300px;
    border-left: none;
    border-top: 1px solid var(--panel-border);
  }
  
  .note-container {
    padding: 24px;
    margin: 12px;
  }
}

/* Accessibility Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .glow-orb {
    animation: none !important;
  }
  
  .relation-item-link:hover {
    transform: none !important;
  }
  
  .markdown-body img:hover {
    transform: none !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
