/* ── Vega design tokens ────────────────────────────────────── */
:root {
  --background:         oklch(1 0 0);
  --foreground:         oklch(0.145 0 0);
  --card:               oklch(1 0 0);
  --card-foreground:    oklch(0.145 0 0);
  --popover:            oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary:            oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary:          oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted:              oklch(0.97 0 0);
  --muted-foreground:   oklch(0.556 0 0);
  --accent:             oklch(0.97 0 0);
  --accent-foreground:  oklch(0.205 0 0);
  --destructive:        oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.985 0 0);
  --border:             oklch(0.922 0 0);
  --input:              oklch(0.922 0 0);
  --ring:               oklch(0.708 0 0);
  --radius:             0.625rem;
}

.dark {
  --background:         oklch(0.145 0 0);
  --foreground:         oklch(0.985 0 0);
  --card:               oklch(0.205 0 0);
  --card-foreground:    oklch(0.985 0 0);
  --popover:            oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary:            oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary:          oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted:              oklch(0.269 0 0);
  --muted-foreground:   oklch(0.708 0 0);
  --accent:             oklch(0.269 0 0);
  --accent-foreground:  oklch(0.985 0 0);
  --destructive:        oklch(0.704 0.191 22.216);
  --destructive-foreground: oklch(0.985 0 0);
  --border:             oklch(1 0 0 / 10%);
  --input:              oklch(1 0 0 / 15%);
  --ring:               oklch(0.556 0 0);
}

/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif; font-size: 16px; -webkit-font-smoothing: antialiased; }

body { background: var(--background); color: var(--foreground); line-height: 1.6; min-height: 100vh; }

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button { cursor: pointer; font: inherit; }
input, textarea, select { font: inherit; }

/* ── Layout ────────────────────────────────────────────────── */
.container { max-width: 72rem; margin-inline: auto; padding-inline: 1rem; }
.container-sm { max-width: 48rem; margin-inline: auto; padding-inline: 1rem; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.375rem; padding: 0.5rem 1rem; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 500; line-height: 1;
  border: 1px solid transparent; transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap; text-decoration: none;
}
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }

.btn-primary   { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { opacity: 0.9; }

.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-secondary:hover { background: var(--accent); }

.btn-outline   { border-color: var(--border); background: transparent; color: var(--foreground); }
.btn-outline:hover { background: var(--accent); color: var(--accent-foreground); }

.btn-ghost     { background: transparent; color: var(--foreground); }
.btn-ghost:hover { background: var(--accent); color: var(--accent-foreground); }

.btn-destructive { background: var(--destructive); color: var(--destructive-foreground); }
.btn-destructive:hover { opacity: 0.9; }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-icon { padding: 0.5rem; width: 2.25rem; height: 2.25rem; }
.btn-icon.btn-sm { padding: 0.375rem; width: 1.875rem; height: 1.875rem; }

/* ── Inputs ────────────────────────────────────────────────── */
.input, .textarea, .select {
  display: block; width: 100%;
  padding: 0.5rem 0.75rem; border: 1px solid var(--input);
  border-radius: var(--radius); background: var(--background);
  color: var(--foreground); font-size: 0.875rem; line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 20%, transparent);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-foreground); }
.textarea { resize: vertical; min-height: 5rem; }

/* ── Labels ────────────────────────────────────────────────── */
.label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.4);
  overflow: hidden;
}
.card-header { padding: 1.25rem 1.25rem 0; }
.card-title { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
.card-description { font-size: 0.875rem; color: var(--muted-foreground); margin-top: 0.25rem; }
.card-content { padding: 1.25rem; }
.card-footer { padding: 0 1.25rem 1.25rem; display: flex; align-items: center; gap: 0.5rem; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.25rem 0.625rem; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 500; line-height: 1; white-space: nowrap;
  border: 1px solid transparent;
}
.badge-default   { background: var(--primary); color: var(--primary-foreground); }
.badge-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.badge-outline   { border-color: var(--border); color: var(--foreground); }
.badge-destructive { background: var(--destructive); color: var(--destructive-foreground); }

/* ── Separator ─────────────────────────────────────────────── */
.sep { border: none; border-top: 1px solid var(--border); }
.sep-v { border: none; border-left: 1px solid var(--border); align-self: stretch; }

/* ── Alert ─────────────────────────────────────────────────── */
.alert {
  padding: 0.875rem 1rem; border-radius: var(--radius);
  border: 1px solid var(--border); font-size: 0.875rem;
}
.alert-destructive { border-color: var(--destructive); background: color-mix(in oklch, var(--destructive) 10%, transparent); color: var(--destructive); }
.alert-warning { border-color: oklch(0.8 0.15 80); background: oklch(0.98 0.05 80); color: oklch(0.5 0.15 60); }

/* ── Switch ────────────────────────────────────────────────── */
.switch {
  position: relative; display: inline-block;
  width: 2.25rem; height: 1.25rem; flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-track {
  position: absolute; inset: 0; background: var(--input);
  border-radius: 9999px; cursor: pointer; transition: background 0.2s;
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch-thumb {
  position: absolute; top: 0.125rem; left: 0.125rem;
  width: 1rem; height: 1rem; background: white;
  border-radius: 50%; transition: transform 0.2s; pointer-events: none;
}
.switch input:checked ~ .switch-thumb { transform: translateX(1rem); }

/* ── Tooltip ───────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 0.5rem); left: 50%; transform: translateX(-50%);
  background: var(--foreground); color: var(--background);
  font-size: 0.75rem; padding: 0.25rem 0.5rem; border-radius: calc(var(--radius) * 0.6);
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.15s;
  z-index: 50;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Dropdown ──────────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 0.375rem); right: 0;
  min-width: 10rem; background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.25rem; box-shadow: 0 4px 16px oklch(0 0 0 / 10%);
  z-index: 50;
}
.dropdown-up .dropdown-menu { top: auto; bottom: calc(100% + 0.375rem); }
.dropdown-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.625rem; border-radius: calc(var(--radius) * 0.6);
  font-size: 0.875rem; cursor: pointer; transition: background 0.1s;
  text-decoration: none; color: inherit;
}
.dropdown-item:hover { background: var(--accent); }
.dropdown-item svg { width: 1rem; height: 1rem; }

/* ── Modal / Dialog ────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: oklch(0 0 0 / 50%);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 1rem; z-index: 100; overflow-y: auto;
}
.modal {
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.4);
  width: 100%; max-width: 42rem;
  margin: auto;
  box-shadow: 0 20px 60px oklch(0 0 0 / 20%);
}
.modal-header { padding: 1.25rem 1.25rem 0; }
.modal-title { font-size: 1.125rem; font-weight: 600; }
.modal-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1.125rem; }
.modal-footer {
  padding: 0 1.25rem 1.25rem;
  display: flex; justify-content: flex-end; gap: 0.5rem;
}

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklch, var(--background) 95%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  display: flex; align-items: center; gap: 0.75rem;
  padding-block: 0.875rem;
}
.site-title-section {
  display: flex; align-items: center; gap: 0.75rem;
}
.profile-photo {
  width: 2.5rem; height: 2.5rem;
  border-radius: 0.375rem;
  object-fit: cover;
  flex-shrink: 0;
}
.site-title { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }

/* ── Search ────────────────────────────────────────────────── */
.search-wrap { position: relative; flex: 1; max-width: 18rem; }
.search-wrap svg { position: absolute; left: 0.625rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: var(--muted-foreground); pointer-events: none; }
.search-wrap .input { padding-left: 2rem; }

/* ── Post grid ─────────────────────────────────────────────── */
.post-grid {
  display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center;
}
.post-card {
  flex: 0 1 22rem; min-width: min(100%, 20rem);
  display: flex; flex-direction: column;
  transition: box-shadow 0.2s;
}
.post-card:hover { box-shadow: 0 4px 20px oklch(0 0 0 / 8%); }

.post-thumb {
  position: relative; aspect-ratio: 16/9;
  overflow: hidden; background: var(--muted);
}
.post-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s;
}
.post-card:hover .post-thumb img { transform: scale(1.04); }
.post-thumb-count {
  position: absolute; bottom: 0.5rem; right: 0.5rem;
  background: oklch(0 0 0 / 55%); color: white;
  font-size: 0.7rem; padding: 0.2rem 0.45rem;
  border-radius: calc(var(--radius) * 0.6);
}

.post-card-body { padding: 1rem 1.25rem; flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.post-card-title { font-size: 1rem; font-weight: 600; line-height: 1.4; }
.post-card-title a:hover { color: var(--muted-foreground); }
.post-card-excerpt { font-size: 0.875rem; color: var(--muted-foreground); line-height: 1.55; flex: 1; }
.post-card-excerpt.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.post-card-meta { display: flex; align-items: center; gap: 0.875rem; font-size: 0.75rem; color: var(--muted-foreground); padding-top: 0.5rem; border-top: 1px solid var(--border); }
.post-card-meta svg { width: 0.875rem; height: 0.875rem; }
.post-card-meta span { display: flex; align-items: center; gap: 0.25rem; }

/* ── Tag filter ────────────────────────────────────────────── */
.tag-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.tag-filter a { text-decoration: none; }

/* ── Single post ───────────────────────────────────────────── */
.post-header { margin-bottom: 2rem; }
.post-h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 1rem; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.875rem; font-size: 0.8125rem; color: var(--muted-foreground); }
.post-meta svg { width: 0.875rem; height: 0.875rem; }
.post-meta span { display: flex; align-items: center; gap: 0.3rem; }

.prose { line-height: 1.75; font-size: 1rem; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-weight: 600; line-height: 1.3; margin-top: 1.75em; margin-bottom: 0.6em; }
.prose h1 { font-size: 1.875rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose p { margin-bottom: 1.25em; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1.25em; }
.prose li { margin-bottom: 0.375em; }
.prose blockquote { border-left: 3px solid var(--border); padding-left: 1rem; color: var(--muted-foreground); margin-bottom: 1.25em; }
.prose pre { background: var(--muted); padding: 1rem; border-radius: var(--radius); overflow-x: auto; margin-bottom: 1.25em; font-size: 0.875rem; }
.prose code { background: var(--muted); padding: 0.15em 0.35em; border-radius: calc(var(--radius) * 0.6); font-size: 0.875em; }
.prose pre code { background: none; padding: 0; }
.prose a { color: var(--foreground); text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: var(--radius); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.prose iframe { width: 100%; border-radius: var(--radius); }

/* ── Media gallery ─────────────────────────────────────────── */
.gallery { margin-bottom: 1.5rem; }
.gallery-grid { display: grid; gap: 0.375rem; }
.gallery-grid.g1 { grid-template-columns: 1fr; }
.gallery-grid.g2 { grid-template-columns: 1fr 1fr; }
.gallery-grid.g3 { grid-template-columns: 1fr 1fr; }
.gallery-grid.g3 .gallery-item:first-child { grid-row: span 2; }
.gallery-grid.g4plus { grid-template-columns: repeat(3, 1fr); }

.gallery-item {
  position: relative; overflow: hidden;
  background: var(--muted); border-radius: var(--radius);
  cursor: zoom-in; aspect-ratio: 1;
}
.gallery-grid.g1 .gallery-item { aspect-ratio: 16/9; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.gallery-item:hover img { transform: scale(1.04); }

.gallery-videos { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.375rem; }
.gallery-videos video { width: 100%; border-radius: var(--radius); max-height: 30rem; background: black; }

/* ── Lightbox ──────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; background: oklch(0 0 0 / 92%);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 1rem;
}
.lightbox img { max-height: 90vh; max-width: 90vw; object-fit: contain; border-radius: var(--radius); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: oklch(1 0 0 / 10%); border: none; color: white;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s;
}
.lightbox-nav:hover { background: oklch(1 0 0 / 20%); }
.lightbox-nav.prev { left: 1rem; }
.lightbox-nav.next { right: 1rem; }
.lightbox-close {
  position: absolute; top: 1rem; right: 1rem;
  background: oklch(1 0 0 / 10%); border: none; color: white;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s;
}
.lightbox-close:hover { background: oklch(1 0 0 / 20%); }
.lightbox-counter { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); color: oklch(1 0 0 / 60%); font-size: 0.875rem; }

/* ── Upload zone ───────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 1.5rem; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--ring); background: var(--muted); }
.upload-zone svg { width: 1.25rem; height: 1.25rem; color: var(--muted-foreground); margin: 0 auto 0.5rem; }
.upload-zone p { font-size: 0.875rem; color: var(--muted-foreground); }

.upload-preview { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.upload-thumb {
  position: relative; width: 4rem; height: 4rem;
  border-radius: var(--radius); overflow: hidden;
  background: var(--muted); border: 1px solid var(--border);
}
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-thumb-label { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 0.625rem; color: var(--muted-foreground); }
.upload-thumb-remove {
  position: absolute; top: -0.25rem; right: -0.25rem;
  width: 1.125rem; height: 1.125rem; border-radius: 50%;
  background: var(--destructive); color: white;
  border: none; display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
.upload-thumb:hover .upload-thumb-remove { opacity: 1; }

/* ── Tags input ────────────────────────────────────────────── */
.tags-wrap { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
.tag-item { display: inline-flex; align-items: center; gap: 0.25rem; }
.tag-item button { background: none; border: none; color: var(--muted-foreground); line-height: 1; padding: 0; display: flex; }
.tag-item button:hover { color: var(--destructive); }
.tags-input { border: none; outline: none; background: transparent; font-size: 0.875rem; min-width: 8rem; flex: 1; color: var(--foreground); }
.tags-field {
  display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center;
  border: 1px solid var(--input); border-radius: var(--radius);
  padding: 0.375rem 0.625rem; min-height: 2.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tags-field:focus-within {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 20%, transparent);
}

/* ── Quill editor ──────────────────────────────────────────── */
.ql-toolbar { border-color: var(--border) !important; border-radius: var(--radius) var(--radius) 0 0 !important; background: var(--muted) !important; }
.ql-container { border-color: var(--border) !important; border-radius: 0 0 var(--radius) var(--radius) !important; font-family: inherit !important; font-size: 0.9375rem !important; }
.ql-editor { min-height: 12rem; }
.ql-editor.ql-blank::before { color: var(--muted-foreground) !important; font-style: normal !important; }

/* ── Settings tabs ─────────────────────────────────────────── */
.tabs { display: flex; flex-direction: column; gap: 1.25rem; }
.tab-list {
  display: flex; gap: 0.125rem; border-bottom: 1px solid var(--border);
  overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none;
}
.tab-list::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 0.625rem 0.875rem; font-size: 0.875rem; font-weight: 500;
  border: none; background: none; color: var(--muted-foreground);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  cursor: pointer; white-space: nowrap; transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--foreground); }
.tab-btn.active { color: var(--foreground); border-bottom-color: var(--foreground); }

/* ── Form field ────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 0.375rem; }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.upload-zone:hover {
  border-color: var(--primary);
  background: color-mix(in oklch, var(--primary) 5%, transparent);
}
.upload-zone.dragover {
  border-color: var(--primary);
  background: color-mix(in oklch, var(--primary) 10%, transparent);
}
.upload-zone svg {
  display: block;
  margin: 0 auto 0.5rem;
  color: var(--muted-foreground);
}
.upload-zone p {
  margin: 0.5rem 0 0 0;
  font-size: 0.875rem;
}
.upload-zone p:last-child {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ── Pagination ────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 0.375rem; margin-top: 2.5rem; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: var(--radius);
  font-size: 0.875rem; border: 1px solid var(--border);
  text-decoration: none; color: var(--foreground); transition: background 0.15s;
}
.page-btn:hover { background: var(--accent); }
.page-btn.active { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }

/* ── Empty state ───────────────────────────────────────────── */
.empty { text-align: center; padding: 4rem 1rem; color: var(--muted-foreground); font-size: 0.9375rem; }

/* ── Post list in settings ─────────────────────────────────── */
.post-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding-block: 0.75rem; border-bottom: 1px solid var(--border);
}
.post-row:last-child { border-bottom: none; }
.post-row-title { flex: 1; min-width: 0; }
.post-row-title a { font-size: 0.9375rem; font-weight: 500; }
.post-row-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.post-row-actions { display: flex; align-items: center; gap: 0.25rem; flex-shrink: 0; }

/* ── Spinner ───────────────────────────────────────────────── */
.spinner {
  width: 1rem; height: 1rem; border: 2px solid currentColor;
  border-top-color: transparent; border-radius: 50%;
  animation: spin 0.6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.25rem; right: 1.25rem;
  display: flex; flex-direction: column; gap: 0.5rem; z-index: 300;
}
.toast {
  padding: 0.75rem 1rem; border-radius: var(--radius);
  background: var(--foreground); color: var(--background);
  font-size: 0.875rem; box-shadow: 0 4px 16px oklch(0 0 0 / 15%);
  animation: toast-in 0.2s ease; max-width: 22rem;
}
.toast.error { background: var(--destructive); color: var(--destructive-foreground); }
@keyframes toast-in { from { opacity: 0; transform: translateY(0.5rem); } }

/* ── Draft banner ──────────────────────────────────────────── */
.draft-banner {
  background: oklch(0.98 0.05 80); border: 1px solid oklch(0.8 0.15 80);
  color: oklch(0.5 0.15 60); border-radius: var(--radius);
  padding: 0.625rem 1rem; font-size: 0.875rem; margin-bottom: 1.5rem;
}

/* ── Login page ────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 1rem;
}

/* ── Utilities ─────────────────────────────────────────────── */
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-6  { gap: 1.5rem; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.w-full { width: 100%; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-10 { margin-top: 2.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.py-10 { padding-block: 2.5rem; }
.py-6  { padding-block: 1.5rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--muted-foreground); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }

/* ── Dark mode toggle ──────────────────────────────────────── */
#theme-toggle svg { pointer-events: none; }
.icon-sun, .icon-moon { width: 1rem; height: 1rem; }
html.dark .icon-sun { display: none; }
html:not(.dark) .icon-moon { display: none; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
  .lightbox-nav { display: none; }
}
