/* UNI-WEB-DECK Styles */
:root {
  --color-bg: #0d1117;
  --color-surface: #161b22;
  --color-surface-alt: #21262d;
  --color-border: #30363d;
  --color-text: #e6edf3;
  --color-text-muted: #7d8590;
  --color-accent: #58a6ff;
  --color-accent-hover: #79b8ff;
  --color-danger: #f85149;
  --color-success: #3fb950;
  
  --tile-size: 120px;
  --font-size-base: 14px;
  --radius: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: var(--font-size-base);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app {
  width: 100%;
  max-width: 500px;
  padding: 1rem;
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  gap: 1rem;
}

.top-bar__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 13px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb__item {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.breadcrumb__item:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.breadcrumb__item--current {
  color: var(--color-text);
  font-weight: 600;
}

.breadcrumb__sep {
  color: var(--color-border);
}

/* Buttons */
.btn {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--color-border);
  border-color: var(--color-text-muted);
}

.btn:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn--icon {
  padding: 6px 10px;
  font-size: 16px;
}

.btn--primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #000;
}

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

.btn--danger {
  background: transparent;
  border-color: var(--color-danger);
  color: var(--color-danger);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

/* Tiles */
.tile {
  aspect-ratio: 1;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
  min-height: var(--tile-size);
}

.tile:hover {
  border-color: var(--color-accent);
  background: var(--color-border);
  transform: translateY(-2px);
}

/* Drag & drop feedback */
body.dragging .tile {
  cursor: grabbing;
}

.tile--dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.tile--dragover {
  outline: 2px dashed var(--color-accent);
  outline-offset: 2px;
}

/* Tile context menu */
.ctx-menu {
  position: fixed;
  z-index: 9999;
  display: none;
  min-width: 160px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  padding: 6px;
}

.ctx-menu.visible {
  display: grid;
  gap: 6px;
}

.ctx-menu__item {
  width: 100%;
  text-align: left;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
}

.ctx-menu__item:hover {
  border-color: var(--color-accent);
  background: var(--color-border);
}

.ctx-menu__item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tile:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.tile--empty {
  background: transparent;
  border-style: dashed;
  opacity: 0.5;
}

.tile--empty:hover {
  opacity: 1;
  border-color: var(--color-accent);
  background: rgba(88, 166, 255, 0.1);
}

.tile--back {
  border-color: var(--color-text-muted);
}

.tile--back:hover {
  border-color: var(--color-text);
}

.tile__slot {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
  color: var(--color-text-muted);
  opacity: 0.6;
}

.tile__icon {
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
  object-fit: contain;
  border-radius: 4px;
}

.tile__icon--placeholder {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.tile__title {
  font-size: 12px;
  text-align: center;
  word-break: break-word;
  line-height: 1.2;
  max-height: 2.4em;
  overflow: hidden;
}

.tile__type {
  position: absolute;
  bottom: 4px;
  left: 6px;
  font-size: 9px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tile[data-type="website"] { border-left: 3px solid var(--color-success); }
.tile[data-type="collection"] { border-left: 3px solid var(--color-accent); }
.tile[data-type="note_card"] { border-left: 3px solid #d29922; }

/* Status Bar (removed from main UI) */

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.visible {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal__content {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal__content--wide {
  max-width: 500px;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.modal__header h2 {
  font-size: 16px;
  font-weight: 600;
}

.modal__close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
}

.modal__close:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.modal__body {
  padding: 1rem;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group select {
  cursor: pointer;
}

.form-group input[type="file"] {
  font-size: 12px;
  color: var(--color-text-muted);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.form-actions__right {
  display: flex;
  gap: 0.5rem;
}

/* Icon Preview */
.icon-preview {
  margin-top: 8px;
  min-height: 50px;
}

.icon-preview img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

/* Q Capture */
/* Q Capture - Top version (no label, prominent) */
.q-capture--top {
  margin-bottom: 1.5rem;
}

.q-capture--top input {
  width: 100%;
  padding: 14px 16px;
  background: var(--color-bg);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius);
  color: var(--color-text);
  font-size: 15px;
  font-weight: 500;
}

.q-capture--top input:focus {
  outline: none;
  border-color: var(--color-accent-hover);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.q-capture--top input::placeholder {
  color: var(--color-text-muted);
  font-weight: normal;
}

/* Q Capture - Legacy version (with button) */
.q-capture {
  margin-bottom: 1rem;
}

.q-capture__input {
  display: flex;
  gap: 0.5rem;
}

.q-capture__input input {
  flex: 1;
  padding: 10px 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-size: 14px;
}

.q-capture__input input:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* Q Log */
.q-log {
  margin-bottom: 1rem;
}

.q-log__list {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
}

.q-log__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.q-log__item:hover {
  background: var(--color-surface-alt);
}

.q-log__item:last-child {
  border-bottom: none;
}

.q-log__time {
  color: var(--color-text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.q-log__text {
  flex: 1;
  word-break: break-word;
  line-height: 1.4;
}

.q-log__copy {
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 14px;
  opacity: 0.6;
  border-radius: 4px;
  transition: all 0.15s;
}

.q-log__copy:hover {
  opacity: 1;
  background: rgba(88, 166, 255, 0.1);
}

.q-log__delete {
  background: none;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 16px;
  opacity: 0.6;
  border-radius: 4px;
  transition: all 0.15s;
}

.q-log__delete:hover {
  opacity: 1;
  background: rgba(248, 81, 73, 0.1);
}

.q-log__empty {
  color: var(--color-text-muted);
  font-style: italic;
  font-size: 12px;
  text-align: center;
  padding: 1rem;
}

/* Note Modal Grid (3x3 actions like offline version) */
.note-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 1rem;
}

.note-grid__cell {
  aspect-ratio: 1;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 8px;
  text-align: center;
  min-height: 80px;
  position: relative;
}

.note-grid__cell:hover {
  background: var(--color-border);
  border-color: var(--color-accent);
}

.note-grid__cell:active {
  transform: scale(0.97);
}

.note-grid__cell--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.note-grid__cell--disabled:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-border);
  transform: none;
}

.note-grid__cell--empty {
  background: transparent;
  border: none;
  cursor: default;
}

.note-grid__slot {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
  color: var(--color-text-muted);
  opacity: 0.6;
}

.note-grid__label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.2;
  white-space: pre-line;
}

.note-grid__hint {
  font-size: 8px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 400px) {
  .app {
    padding: 0.5rem;
  }
  
  .top-bar {
    padding: 0.5rem;
    flex-wrap: wrap;
  }
  
  .top-bar__left {
    order: 2;
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .btn {
    padding: 4px 8px;
    font-size: 12px;
  }
  
  .tile__title {
    font-size: 11px;
  }
}

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

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Shortcuts Grid */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 12px;
}

.shortcut-slot {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 6px 8px;
}

.shortcut-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  min-width: 14px;
}

.shortcut-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-accent);
  font-size: 12px;
  font-family: monospace;
  text-align: center;
  min-width: 0;
  cursor: pointer;
  padding: 4px;
}

.shortcut-input:focus {
  outline: none;
  background: var(--color-surface-alt);
  border-radius: 4px;
}

.shortcut-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.5;
}

.shortcut-clear {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.6;
}

.shortcut-clear:hover {
  background: var(--color-danger);
  color: #fff;
  opacity: 1;
}

.form-hint {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
  margin-bottom: 8px;
}

.btn--small {
  font-size: 11px;
  padding: 4px 8px;
}

/* Unsupported tiles */
.tile--unsupported {
  opacity: 0.6;
  border-style: dashed;
  cursor: help;
}

.tile--unsupported:hover {
  opacity: 0.8;
  border-color: var(--color-text-muted);
}

.tile__badge {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 10px;
}

/* Info Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.overlay.visible {
  display: flex;
}

.overlay__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.overlay__content {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.overlay__close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
}

.overlay__close:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

#overlay-body h2 {
  margin-bottom: 12px;
  color: var(--color-text);
}

#overlay-body p {
  margin-bottom: 8px;
  color: var(--color-text-muted);
}

#overlay-body p.warning {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--color-danger);
}

#overlay-body code {
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  word-break: break-all;
}

#overlay-body pre {
  background: var(--color-bg);
  padding: 12px;
  border-radius: var(--radius);
  font-family: monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 150px;
  overflow-y: auto;
}

#overlay-body a {
  color: var(--color-accent);
}

/* Additional tile type colors */
.tile[data-type="action"] { border-left: 3px solid #f43f5e; }
.tile[data-type="info"] { border-left: 3px solid #6b7280; }
.tile[data-type="disabled"] { border-left: 3px solid #374151; }
.tile[data-type="deck_link"] { border-left: 3px solid #8b5cf6; }

/* File System tile type colors */
.tile[data-type="file_pick"] { border-left: 3px solid #10b981; }
.tile[data-type="dir_pick"] { border-left: 3px solid #3b82f6; }
.tile[data-type="file_handle"] { border-left: 3px solid #14b8a6; }
.tile[data-type="dir_handle"] { border-left: 3px solid #6366f1; }
.tile[data-type="save_file"] { border-left: 3px solid #f59e0b; }
.tile[data-type="deeplink"] { border-left: 3px solid #a855f7; }
.tile[data-type="download"] { border-left: 3px solid #06b6d4; }

/* ============================================
   SETTINGS GRID (UNI-DECK Style)
   ============================================ */
.modal__content--settings {
  max-width: 420px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.settings-tile {
  aspect-ratio: 1;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 8px;
  text-align: center;
  min-height: 90px;
}

.settings-tile:hover {
  background: var(--color-border);
  border-color: var(--color-accent);
}

.settings-tile:active {
  transform: scale(0.97);
}

.settings-tile--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-tile--disabled:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-border);
}

.settings-tile--back {
  background: transparent;
  border-style: dashed;
}

.settings-tile__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.2;
}

.settings-tile__hint {
  font-size: 9px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.settings-tile__icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.settings-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.settings-footer .btn--icon {
  font-size: 12px;
  padding: 8px 12px;
  text-align: left;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
}

.settings-deck-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-deck-info label {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.settings-deck-info input {
  flex: 1;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 6px 10px;
  color: var(--color-text);
  font-size: 13px;
}

/* Settings sub-page styles */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-form .form-group {
  margin-bottom: 0;
}

.settings-form .form-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.settings-form .form-row label {
  flex: 1;
  font-size: 13px;
}

.settings-form .form-row input,
.settings-form .form-row select {
  width: 100px;
}

.settings-form .toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}

.settings-form .toggle-row:last-child {
  border-bottom: none;
}

/* Add New Modal */
.add-new-hint {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

/* ============================================
   MD HUB - MARKDOWN BROWSER STYLES
   ============================================ */

.md-viewer {
  max-width: 100%;
  padding: 1rem;
}

.md-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-border);
}

.md-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--color-text);
}

.md-controls {
  display: flex;
  gap: 0.5rem;
}

.md-btn {
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.md-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.md-content {
  max-height: 70vh;
  overflow-y: auto;
  padding: 1rem;
  line-height: 1.7;
  color: var(--color-text);
}

.md-raw {
  max-height: 70vh;
  overflow-y: auto;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Markdown content styling */
.md-content h1,
.md-content h2,
.md-content h3,
.md-content h4,
.md-content h5,
.md-content h6 {
  color: var(--color-text);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.md-content h1 {
  font-size: 2em;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5rem;
}

.md-content h2 {
  font-size: 1.5em;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.4rem;
}

.md-content h3 {
  font-size: 1.25em;
}

.md-content p {
  margin-bottom: 1rem;
  color: var(--color-text);
}

.md-content a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

.md-content a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

.md-content code {
  background: var(--color-surface-alt);
  color: #ff7b72;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.md-content pre {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.md-content pre code {
  background: transparent;
  color: var(--color-text);
  padding: 0;
  border-radius: 0;
}

.md-content blockquote {
  border-left: 4px solid var(--color-accent);
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
}

.md-content ul,
.md-content ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.md-content li {
  margin-bottom: 0.5rem;
}

.md-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

.md-content table th,
.md-content table td {
  border: 1px solid var(--color-border);
  padding: 0.5rem 1rem;
  text-align: left;
}

.md-content table th {
  background: var(--color-surface-alt);
  font-weight: 600;
}

.md-content table tr:nth-child(even) {
  background: var(--color-surface);
}

.md-content hr {
  border: none;
  border-top: 2px solid var(--color-border);
  margin: 2rem 0;
}

.md-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1rem 0;
}

/* File browser */
.md-browser h2 {
  margin-bottom: 1rem;
  color: var(--color-text);
}

.md-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.md-file-item {
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.md-file-item:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-accent);
}

/* Scrollbar styling */
.md-content::-webkit-scrollbar,
.md-raw::-webkit-scrollbar,
.md-file-list::-webkit-scrollbar {
  width: 8px;
}

.md-content::-webkit-scrollbar-track,
.md-raw::-webkit-scrollbar-track,
.md-file-list::-webkit-scrollbar-track {
  background: var(--color-surface);
  border-radius: 4px;
}

.md-content::-webkit-scrollbar-thumb,
.md-raw::-webkit-scrollbar-thumb,
.md-file-list::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.md-content::-webkit-scrollbar-thumb:hover,
.md-raw::-webkit-scrollbar-thumb:hover,
.md-file-list::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}
