:root {
  /* Catppuccin Macchiato Palette */
  --ctp-sapphire: #7dc4e4;
  --ctp-blue: #8aadf4;
  --ctp-text: #cad3f5;
  --ctp-subtext1: #b8c0e0;
  --ctp-subtext0: #a5adcb;
  --ctp-surface2: #5b6078;
  --ctp-surface1: #494d64;
  --ctp-surface0: #363a4f;
  --ctp-base: #24273a;
  --ctp-mantle: #1e2030;
  --ctp-crust: #181926;
  --ctp-peach: #f5a97f;

  /* LeafWiki Global UI Overrides */
  --color-background: var(--ctp-base);
  --color-page-bg: var(--ctp-base);
  --color-foreground: var(--ctp-text);
  --color-page-text: var(--ctp-text);
  
  --color-surface: var(--ctp-mantle);
  --color-surface-alt: var(--ctp-crust);
  --color-interface-text: var(--ctp-subtext1);
  
  --color-border: var(--ctp-surface0);
  --color-surface-border: var(--ctp-surface0);
  --color-markdown-toolbar-border: var(--ctp-surface0);
  
  --color-primary: var(--ctp-sapphire);
  --color-brand: var(--ctp-sapphire);
  --color-brand-dark: var(--ctp-blue);
  --color-brand-light: var(--ctp-sapphire);
  
  --color-muted: var(--ctp-surface0);
  --color-muted-foreground: var(--ctp-subtext0);
  
  --color-popover: var(--ctp-mantle);
  --color-popover-foreground: var(--ctp-text);
  
  --color-secondary: var(--ctp-surface0);
  --color-secondary-foreground: var(--ctp-text);
  
  --color-accent: var(--ctp-surface1);
  --color-accent-foreground: var(--ctp-text);

  --color-markdown-toolbar: var(--ctp-mantle);
  --color-markdown-toolbar-text: var(--ctp-text);
  
  --color-tree-node-hover: var(--ctp-surface0);
  --color-table-header-bg: var(--ctp-surface0);
  --color-avatar-bg: var(--ctp-surface1);
}

/* Markdown Content Overrides */
a { 
  color: var(--ctp-sapphire); 
  text-decoration: none;
}

a:hover { 
  text-decoration: underline; 
}

pre, code {
  background-color: var(--ctp-surface0);
  color: var(--ctp-text);
  border: 1px solid var(--ctp-surface1);
  border-radius: 4px;
}

blockquote {
  border-left: 2px solid var(--ctp-sapphire);
  background-color: var(--ctp-surface0);
  color: var(--ctp-subtext0);
  padding: 0.5rem 1rem;
}

table, th, td {
  border: 1px solid var(--ctp-surface1);
  border-collapse: collapse;
}

th { 
  background-color: var(--ctp-surface0); 
  font-weight: 600;
}

hr { 
  border: 1px solid var(--ctp-surface0); 
}

input[type="checkbox"] { 
  accent-color: var(--ctp-sapphire); 
}

.footnotes {
  border-top: 1px solid var(--ctp-surface0);
  color: var(--ctp-subtext1);
  font-size: 0.9em;
}

.callout.info, .callout[data-type="info"] {
  background-color: var(--ctp-surface0);
  border-left: 2px solid var(--ctp-sapphire);
  color: var(--ctp-text);
}

.callout.warning, .callout[data-type="warning"] {
  background-color: var(--ctp-surface0);
  border-left: 2px solid var(--ctp-peach);
  color: var(--ctp-text);
}

details {
  background-color: var(--ctp-surface0);
  border: 1px solid var(--ctp-surface1);
  border-radius: 4px;
}

summary { 
  color: var(--ctp-text); 
  font-weight: 600;
}
