:root {
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-size: 14px;
  --radius: 8px;
  --radius-sm: 4px;
  --transition: 150ms ease;
}

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

html {
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--font-size);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  background-color: var(--bg-primary) !important;
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] body,
[data-theme="homebrew"] body,
[data-theme="vscode"] body {
  color-scheme: dark;
}

[data-theme="light"] body {
  color-scheme: light;
}

#app {
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-primary) !important;
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

.screen { display: none; height: 100%; min-height: 100%; flex-direction: column; background-color: var(--bg-primary) !important; background: var(--bg-primary) !important; }
.screen.active { display: flex; }
.hidden { display: none !important; }

input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* ===== Theme: Light ===== */
[data-theme="light"] {
  color-scheme: light;
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-tertiary: #e8e8ed;
  --bg-input: #ffffff;
  --bg-hover: rgba(0,0,0,0.04);
  --bg-card: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #aeaeb2;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --danger: #ff3b30;
  --danger-hover: #ff453a;
  --border: #d2d2d7;
  --border-light: #e8e8ed;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --fab-bg: #0071e3;
  --fab-color: #ffffff;
  --category-note: #0071e3;
  --category-todo: #34c759;
  --category-reminder: #ff9500;
  --category-idea: #af52de;
  --code-bg: #f5f5f7;
  --scrollbar-track: transparent;
  --scrollbar-thumb: #d2d2d7;
  --check-bg: #34c759;
}

/* ===== Theme: Dark ===== */
[data-theme="dark"] {
  color-scheme: dark;
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-tertiary: #0f3460;
  --bg-input: #16213e;
  --bg-hover: rgba(255,255,255,0.06);
  --bg-card: #16213e;
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-tertiary: #52525b;
  --accent: #4cc9f0;
  --accent-hover: #7dd3fc;
  --danger: #f87171;
  --danger-hover: #fca5a5;
  --border: #27272a;
  --border-light: #1e1e2e;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
  --fab-bg: #4cc9f0;
  --fab-color: #1a1a2e;
  --category-note: #4cc9f0;
  --category-todo: #4ade80;
  --category-reminder: #fb923c;
  --category-idea: #c084fc;
  --code-bg: #0f0f23;
  --scrollbar-track: transparent;
  --scrollbar-thumb: #3f3f46;
  --check-bg: #4ade80;
}

/* ===== Theme: Homebrew ===== */
[data-theme="homebrew"] {
  color-scheme: dark;
  --bg-primary: #0a0a0a;
  --bg-secondary: #0d1a0d;
  --bg-tertiary: #112211;
  --bg-input: #0a0a0a;
  --bg-hover: rgba(0,255,0,0.06);
  --bg-card: #0a0a0a;
  --text-primary: #00ff00;
  --text-secondary: #00cc00;
  --text-tertiary: #007700;
  --accent: #00ff00;
  --accent-hover: #33ff33;
  --danger: #ff4444;
  --danger-hover: #ff6666;
  --border: #003300;
  --border-light: #002200;
  --shadow: 0 0 8px rgba(0,255,0,0.1);
  --shadow-lg: 0 0 20px rgba(0,255,0,0.15);
  --fab-bg: #00ff00;
  --fab-color: #0a0a0a;
  --category-note: #00ff00;
  --category-todo: #00ffaa;
  --category-reminder: #aaff00;
  --category-idea: #00aaff;
  --code-bg: #050505;
  --scrollbar-track: transparent;
  --scrollbar-thumb: #003300;
  --check-bg: #00ff00;
}

[data-theme="homebrew"] body {
  font-family: var(--font-mono);
}

[data-theme="homebrew"] .auth-input,
[data-theme="homebrew"] .editor-title,
[data-theme="homebrew"] .editor-content,
[data-theme="homebrew"] .search-input,
[data-theme="homebrew"] .editor-select {
  font-family: var(--font-mono);
}

/* Force homebrew input/textarea colors - override browser defaults */
[data-theme="homebrew"] input,
[data-theme="homebrew"] textarea,
[data-theme="homebrew"] select {
  background-color: #0a0a0a !important;
  color: #00ff00 !important;
  border-color: #003300 !important;
  -webkit-text-fill-color: #00ff00 !important;
}

[data-theme="homebrew"] input::placeholder,
[data-theme="homebrew"] textarea::placeholder {
  color: #007700 !important;
  -webkit-text-fill-color: #007700 !important;
}

[data-theme="homebrew"] input:focus,
[data-theme="homebrew"] textarea:focus {
  border-color: #00ff00 !important;
  box-shadow: 0 0 4px rgba(0,255,0,0.3) !important;
}

[data-theme="homebrew"] select option {
  background: #0a0a0a;
  color: #00ff00;
}

[data-theme="homebrew"] .entry-card {
  border-style: solid;
  border-width: 1px;
  border-color: #003300;
  background: #0a0a0a;
}

/* ===== Theme: VS Code ===== */
[data-theme="vscode"] {
  color-scheme: dark;
  --bg-primary: #1e1e1e;
  --bg-secondary: #252526;
  --bg-tertiary: #2d2d2d;
  --bg-input: #3c3c3c;
  --bg-hover: rgba(255,255,255,0.05);
  --bg-card: #252526;
  --text-primary: #d4d4d4;
  --text-secondary: #969696;
  --text-tertiary: #606060;
  --accent: #007acc;
  --accent-hover: #1a8ad4;
  --danger: #f44747;
  --danger-hover: #f87171;
  --border: #3c3c3c;
  --border-light: #333333;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
  --fab-bg: #007acc;
  --fab-color: #ffffff;
  --category-note: #569cd6;
  --category-todo: #6a9955;
  --category-reminder: #dcdcaa;
  --category-idea: #c586c0;
  --code-bg: #1e1e1e;
  --scrollbar-track: #1e1e1e;
  --scrollbar-thumb: #424242;
  --check-bg: #6a9955;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

/* ===== Auth Screen ===== */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  background-color: var(--bg-primary) !important;
  background: var(--bg-primary) !important;
}

.auth-logo {
  color: var(--accent);
  margin-bottom: 16px;
  font-size: 56px;
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.auth-subtitle {
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.auth-form {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-input {
  background-color: var(--bg-input) !important;
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 16px;
  text-align: center;
  letter-spacing: 2px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color var(--transition);
}

.auth-input:focus {
  border-color: var(--accent);
}

.auth-separator {
  color: var(--text-tertiary);
  text-align: center;
  font-size: 12px;
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  min-height: 20px;
}

/* ===== Buttons ===== */
.btn {
  border: none;
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: var(--fab-color);
}

.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.btn-secondary:hover { background: var(--bg-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

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

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover { background: var(--danger-hover); }

.btn-sm { padding: 6px 12px; font-size: 12px; }

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 16px;
}

.icon-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.icon-btn-sm { padding: 4px; font-size: 14px; }
.icon-btn-danger:hover { color: var(--danger); }

/* ===== Header ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: var(--bg-primary) !important;
  background: var(--bg-primary) !important;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  z-index: 10;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.sync-badge {
  display: flex;
  align-items: center;
  padding: 2px;
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  transition: background var(--transition);
}

.sync-dot.synced { background: #34c759; }
.sync-dot.syncing { background: var(--accent); animation: pulse 1s infinite; }
.sync-dot.error { background: var(--danger); }
.sync-dot.offline { background: #ff9500; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== Search ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: var(--bg-primary) !important;
  background: var(--bg-primary) !important;
  border-bottom: 1px solid var(--border-light);
}

.search-input {
  flex: 1;
  background-color: var(--bg-tertiary) !important;
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  outline: none;
  transition: border-color var(--transition);
}

.search-input:focus { border-color: var(--accent); }

/* ===== Category Tabs ===== */
.category-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  background-color: var(--bg-primary) !important;
  background: var(--bg-primary) !important;
}

.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cat-tab i { font-size: 11px; }

.cat-tab:hover { background: var(--bg-hover); }

.cat-tab.active {
  background: var(--accent);
  color: var(--fab-color);
}

/* ===== Entries List ===== */
.entries-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  padding-bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--bg-primary) !important;
  background: var(--bg-primary) !important;
}

.entry-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.entry-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.entry-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.entry-card[data-cat="note"]::before { background: var(--category-note); }
.entry-card[data-cat="todo"]::before { background: var(--category-todo); }
.entry-card[data-cat="reminder"]::before { background: var(--category-reminder); }
.entry-card[data-cat="idea"]::before { background: var(--category-idea); }

.entry-card.pinned {
  border-color: var(--accent);
}

.entry-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.entry-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.entry-pin {
  color: var(--accent);
  flex-shrink: 0;
}

.entry-preview {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}

.entry-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 8px;
}

.entry-category {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.entry-category i { font-size: 10px; }

.entry-date {
  font-size: 11px;
  color: var(--text-tertiary);
}

.entry-pending {
  font-size: 10px;
  color: var(--category-reminder);
  font-style: italic;
}

/* ===== Markdown Preview in Cards ===== */
.md-preview {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  overflow: hidden;
}

.md-preview h1, .md-preview h2, .md-preview h3 {
  color: var(--text-primary);
  font-weight: 600;
  margin: 0;
}

.md-preview h1 { font-size: 15px; }
.md-preview h2 { font-size: 14px; }
.md-preview h3 { font-size: 13px; }

.md-preview p {
  margin: 2px 0;
}

.md-preview strong {
  color: var(--text-primary);
  font-weight: 600;
}

.md-preview em {
  font-style: italic;
}

.md-preview code {
  font-family: var(--font-mono);
  background: var(--code-bg);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 12px;
  color: var(--accent);
}

.md-preview pre {
  background: var(--code-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin: 4px 0;
  overflow-x: auto;
}

.md-preview pre code {
  background: none;
  padding: 0;
}

.md-preview ul, .md-preview ol {
  padding-left: 16px;
  margin: 2px 0;
}

.md-preview li {
  margin: 1px 0;
  line-height: 1.4;
}

/* Todo checkboxes in markdown */
.md-preview .todo-item {
  list-style: none;
  margin-left: -16px;
  padding-left: 4px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.md-preview .todo-checkbox {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.md-preview .todo-checkbox.checked {
  background: var(--check-bg);
  border-color: var(--check-bg);
  color: var(--fab-color);
}

.md-preview .todo-checkbox.checked::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 9px;
  line-height: 1;
}

.md-preview .todo-text.done {
  text-decoration: line-through;
  opacity: 0.5;
}

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--fab-bg);
  color: var(--fab-color);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition);
  z-index: 20;
  font-size: 24px;
}

.fab:hover { transform: scale(1.05); }
.fab:active { transform: scale(0.95); }

/* ===== Editor ===== */
.editor-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  background-color: var(--bg-primary) !important;
  background: var(--bg-primary) !important;
}

.editor-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.editor-select {
  background-color: var(--bg-tertiary) !important;
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 500;
}

.editor-date {
  font-size: 12px;
  color: var(--text-tertiary);
}

.editor-title {
  background-color: transparent !important;
  background: transparent !important;
  border: none;
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  font-size: 22px;
  font-weight: 700;
  padding: 0;
  margin-bottom: 8px;
  outline: none;
  width: 100%;
}

.editor-title::placeholder { color: var(--text-tertiary) !important; -webkit-text-fill-color: var(--text-tertiary) !important; }

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 8px;
}

.toolbar-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.toolbar-sep {
  width: 1px;
  height: 16px;
  background: var(--border-light);
  margin: 0 4px;
}

.editor-format-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: auto;
  padding-right: 4px;
}

.editor-content {
  flex: 1;
  background-color: var(--bg-primary) !important;
  background: var(--bg-primary) !important;
  border: none;
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  font-family: var(--font-mono);
  font-size: var(--font-size);
  line-height: 1.6;
  padding: 0;
  resize: none;
  outline: none;
  width: 100%;
  tab-size: 2;
}

.editor-content::placeholder { color: var(--text-tertiary) !important; -webkit-text-fill-color: var(--text-tertiary) !important; }

/* ===== Settings ===== */
.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background-color: var(--bg-primary) !important;
  background: var(--bg-primary) !important;
}

.settings-section {
  margin-bottom: 28px;
}

.settings-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-label i { font-size: 12px; }

.settings-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 8px;
}

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

.theme-btn {
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 12px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
  color: var(--text-secondary);
  font-size: 12px;
}

.theme-btn:hover { border-color: var(--border); }
.theme-btn.active { border-color: var(--accent); }

.theme-preview {
  width: 32px;
  height: 32px;
  border-radius: 4px;
}

.theme-preview-light { background: #ffffff; border: 1px solid #d2d2d7; }
.theme-preview-dark { background: #1a1a2e; border: 1px solid #0f3460; }
.theme-preview-homebrew { background: #0a0a0a; border: 1px solid #003300; }
.theme-preview-vscode { background: #1e1e1e; border: 1px solid #3c3c3c; }

.font-size-control {
  display: flex;
  align-items: center;
  gap: 16px;
}

.font-size-display {
  color: var(--text-primary);
  font-family: var(--font-mono);
  min-width: 40px;
  text-align: center;
}

.code-display {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.code-display code {
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 2px;
  font-size: 18px;
  flex: 1;
}

/* ===== Empty State ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
  text-align: center;
  gap: 12px;
}

.empty-state i { font-size: 48px; }

.empty-hint {
  font-size: 13px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  transition: all 300ms ease;
  opacity: 1;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}

/* ===== Responsive ===== */
@media (min-width: 600px) {
  .entries-list {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }
  .editor-container {
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
  }
  .settings-content {
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (max-width: 380px) {
  .theme-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.entry-card {
  animation: fadeIn 200ms ease;
}

/* ===== Admin Panel ===== */
.admin-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-tab:hover { background: var(--bg-hover); }

.admin-tab.active {
  background: var(--accent);
  color: var(--fab-color);
}

.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-primary) !important;
}

.admin-panel { display: none; }
.admin-panel.active { display: block; }

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  white-space: nowrap;
}

.admin-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table tr:hover td {
  background: var(--bg-hover);
}

.admin-table .code-cell {
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 1px;
}

.sql-editor {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.sql-input {
  flex: 1;
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
  outline: none;
  width: 100%;
}

.sql-input:focus { border-color: var(--accent); }

.sql-result {
  overflow-x: auto;
}

.sql-error {
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
}

.sql-row-count {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ===== About Screen ===== */
.about-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
  background: var(--bg-primary) !important;
}

.about-hero {
  text-align: center;
  padding: 32px 0 24px;
}

.about-logo {
  font-size: 56px;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}

.about-hero h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.about-version {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 13px;
  margin-top: 4px;
}

.about-section {
  margin-bottom: 28px;
}

.about-section h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.about-section p {
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 14px;
}

.about-section ul {
  list-style: none;
  padding: 0;
}

.about-section li {
  color: var(--text-primary);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.about-section li i {
  color: var(--accent);
  width: 20px;
  text-align: center;
  font-size: 14px;
}

.about-code {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--code-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.about-code code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
}

.about-footer {
  text-align: center;
  padding: 32px 0 16px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.about-footer i.fa-heart { color: var(--danger); }

.about-hint {
  margin-top: 4px;
  font-size: 12px;
}

/* ===== Notifications ===== */
.notif-status {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
}

.notif-status.granted { color: var(--category-todo); }
.notif-status.denied { color: var(--danger); }
.notif-status.unavailable { color: var(--text-tertiary); }

.notif-upcoming { margin-top: 12px; }

.notif-upcoming-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.notif-upcoming-item {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-upcoming-item i { color: var(--text-tertiary); font-size: 11px; }
