/* ==========================================================================
   markwise — Design System
   Warm, editorial, clean. Terracotta accent on warm neutrals.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces */
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-2: #f4f1ec;

  /* Ink */
  --ink: #1c1917;
  --ink-2: #57534e;
  --ink-3: #716d67;   /* WCAG AA: >=4.5:1 auf bg/surface/surface-2 */
  --ink-4: #c9c4bc;   /* nur Dekor (Rahmen/Scrollbalken) — zu kontrastarm fuer Text */

  /* Accent — Terracotta */
  --accent: #d97757;
  --accent-strong: #c05f3e;
  --accent-deep: #a34d30;
  --accent-soft: #f9ebe4;
  --accent-softer: #fdf6f2;

  /* Semantic */
  --success: #4f7a5f;
  --danger: #b3402f;
  --danger-soft: #fae9e6;

  /* Lines & rings */
  --border: #e9e5dd;
  --border-strong: #dbd5ca;
  --ring: rgba(217, 119, 87, 0.38);

  /* Radii */
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Shadows — soft, low opacity */
  --sh-xs: 0 1px 2px rgba(28, 25, 23, 0.05);
  --sh-sm: 0 1px 2px rgba(28, 25, 23, 0.04), 0 1px 3px rgba(28, 25, 23, 0.06);
  --sh-md: 0 2px 5px rgba(28, 25, 23, 0.04), 0 10px 24px rgba(28, 25, 23, 0.07);
  --sh-lg: 0 4px 10px rgba(28, 25, 23, 0.05), 0 24px 56px rgba(28, 25, 23, 0.14);

  /* Type */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Rhythm */
  --topbar-h: 64px;
  --sidebar-w: 264px;
  --maxw: 1440px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05" 1, "ss01" 1;
}
img, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 650; letter-spacing: -0.012em; }

::selection { background: rgba(217, 119, 87, 0.22); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--ink-4) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.input:focus-visible, .field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible {
  outline: none;
}

/* x-cloak (Alpine) */
[x-cloak] { display: none !important; }

/* ---------- Utilities ---------- */
.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;
}
.icon {
  width: 18px; height: 18px; flex: none;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.kbd {
  display: inline-flex; align-items: center; gap: 2px;
  font-family: var(--font); font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink-3); background: var(--surface-2);
  border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 6px; line-height: 1.5;
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 550; letter-spacing: 0.002em;
  padding: 9px 16px; border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
              color 0.16s var(--ease), box-shadow 0.16s var(--ease), transform 0.12s var(--ease);
  white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(163, 77, 48, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary {
  background: var(--surface); border-color: var(--border-strong); color: var(--ink);
  box-shadow: var(--sh-xs);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--ink-4); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--r-sm);
  color: var(--ink-2);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.btn-icon:hover { background: var(--surface-2); color: var(--ink); }
.btn-icon.btn-danger-hover:hover { background: var(--danger-soft); color: var(--danger); }
.btn-icon-sm { width: 28px; height: 28px; }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.005em; }
.field-label .req { color: var(--accent-deep); }
.field-hint { font-size: 12px; color: var(--ink-3); }
.field-error { font-size: 12.5px; color: var(--danger); font-weight: 500; }

.input, .field input[type="text"], .field input[type="url"], .field input[type="password"],
.field input[type="email"], .field textarea, .field select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 9px 13px;
  font-size: 14px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.input:hover, .field input:hover, .field textarea:hover, .field select:hover { border-color: var(--ink-4); }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--ring);
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.field input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2357534e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 38px;
}

/* Input with leading icon / spinner */
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .icon { position: absolute; left: 12px; color: var(--ink-3); pointer-events: none; }
.input-wrap .input, .field .input-wrap input { padding-left: 38px; }
.field .input-wrap input[type="password"], .field .input-wrap input[type="url"] { padding-right: 42px; }
.input-wrap .input-spinner { position: absolute; right: 12px; display: flex; }

/* Spinner */
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--ink-4); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
.spinner-lg { width: 26px; height: 26px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Badges & chips ---------- */
.cat-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 550;
  padding: 3px 9px; border-radius: 99px;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--border);
  max-width: 180px;
}
.cat-badge span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-top {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent-deep); background: var(--accent-soft);
  border: 1px solid rgba(217, 119, 87, 0.35);
  padding: 3px 9px; border-radius: 99px;
}
.badge-top .icon { width: 13px; height: 13px; }
.count-chip {
  font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  background: var(--surface-2); border-radius: 99px; padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Topbar
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 clamp(16px, 3vw, 32px);
  background: rgba(250, 249, 247, 0.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, #e08868, var(--accent) 55%, var(--accent-deep));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(163, 77, 48, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.brand-mark svg { width: 19px; height: 19px; stroke: #fff; fill: rgba(255,255,255,0.22); stroke-width: 2; }
.brand-name {
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink);
}
.brand-name em { font-style: normal; color: var(--accent); }

.topbar-search { flex: 1; max-width: 520px; position: relative; }
.topbar-search .input-wrap input {
  background: var(--surface); border-color: var(--border);
  border-radius: 99px; height: 40px; padding-right: 74px;
  box-shadow: var(--sh-xs);
}
.topbar-search .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); cursor: pointer; transition: color 0.14s var(--ease), border-color 0.14s var(--ease); }
.topbar-search .kbd:hover { color: var(--accent-deep); border-color: rgba(217, 119, 87, 0.4); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 550; color: var(--ink-2);
  padding: 5px 10px 5px 6px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface);
}
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
}

/* Hamburger (mobile) */
.nav-toggle { display: none; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: var(--maxw); margin: 0 auto;
  min-height: calc(100vh - var(--topbar-h));
}

/* ---------- Sidebar ---------- */
.sidebar {
  border-right: 1px solid var(--border);
  padding: 22px 14px 40px;
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  background: var(--bg);
}
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px; margin-bottom: 10px;
}
.sidebar-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-3);
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 8px 10px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}
.side-item:hover { background: var(--surface-2); color: var(--ink); }
.side-item.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.side-item.active .count-chip { background: rgba(217, 119, 87, 0.14); color: var(--accent-deep); }
.side-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .icon { width: 16px; height: 16px; color: var(--ink-3); }
.side-item.active .icon { color: var(--accent-deep); }
.side-foot { margin-top: 22px; padding: 0 10px; }

.sidebar-backdrop { display: none; }

/* ---------- Main column ---------- */
.main-col { padding: 26px clamp(16px, 3vw, 34px) 70px; min-width: 0; }

/* ==========================================================================
   Toolbar
   ========================================================================== */
.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.toolbar-title { margin-right: auto; min-width: 0; }
.toolbar-title h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.toolbar-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

.view-toggle {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.view-toggle button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 9px;
  font-size: 13px; font-weight: 550; color: var(--ink-3);
  transition: background 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.view-toggle button:hover { color: var(--ink-2); }
.view-toggle button.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); }
.view-toggle .icon { width: 15px; height: 15px; }

/* Sort dropdown */
.dropdown { position: relative; }
.dropdown-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 70;
  min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--sh-md);
}
.dropdown-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500; color: var(--ink-2); text-align: left;
}
.dropdown-item:hover { background: var(--surface-2); color: var(--ink); }
.dropdown-item.active { color: var(--accent-deep); font-weight: 600; }
.dropdown-item.active .icon { color: var(--accent); }
.dropdown-item .icon { width: 15px; height: 15px; color: var(--ink-4); margin-left: auto; }

/* ==========================================================================
   Loading states (htmx-indicator)
   ========================================================================== */
.htmx-indicator { opacity: 0; transition: opacity 0.25s var(--ease); pointer-events: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

#bookmark-list { position: relative; min-height: 240px; transition: opacity 0.18s var(--ease); }
#bookmark-list.htmx-request > .list-inner { opacity: 0.45; }
.list-progress {
  position: absolute; top: -6px; left: 0; right: 0; height: 2.5px; z-index: 5;
  overflow: hidden; border-radius: 99px; opacity: 0; transition: opacity 0.2s;
}
#bookmark-list.htmx-request .list-progress { opacity: 1; }
.list-progress::before {
  content: ""; position: absolute; inset: 0; width: 40%;
  background: var(--accent); border-radius: 99px;
  animation: indeterminate 1s ease-in-out infinite;
}
@keyframes indeterminate {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(280%); }
}

/* Skeleton cards */
.skel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.skel-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
}
.skel-card .skel-shot { aspect-ratio: 16 / 9; }
.skel-card .skel-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 9px; }
.skel-line, .skel-shot, .skel-avatar {
  background: linear-gradient(100deg, var(--surface-2) 38%, #f8f5f1 50%, var(--surface-2) 62%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: 7px;
}
.skel-avatar { width: 26px; height: 26px; border-radius: 8px; }
.skel-line { height: 11px; }
.skel-line.w60 { width: 60%; }
.skel-line.w85 { width: 85%; }
.skel-line.w40 { width: 40%; }
.skel-row { display: flex; align-items: center; gap: 10px; }
@keyframes shimmer { to { background-position: -120% 0; } }

.list-summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--ink-2);
  margin-bottom: 16px; padding: 10px 14px;
  background: var(--accent-softer);
  border: 1px solid rgba(217, 119, 87, 0.25);
  border-radius: var(--r-md);
}
.list-summary strong { color: var(--accent-deep); }
.list-reset {
  margin-left: auto;
  font-size: 12.5px; font-weight: 600; color: var(--accent-deep);
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 99px;
  transition: background 0.14s var(--ease);
}
.list-reset:hover { background: var(--accent-soft); text-decoration: underline; }

/* Aktive Filter als Chips */
.filter-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 14px; padding: 0;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border, #e7e0d6);
  color: var(--ink-3); font-size: 12.5px; font-weight: 600;
  padding: 4px 6px 4px 11px; border-radius: 99px;
}
.chip-clear {
  border: none; background: transparent; cursor: pointer;
  color: var(--ink-3); font-size: 15px; line-height: 1;
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.chip-clear:hover { background: var(--accent-soft); color: var(--accent-deep); }

/* ==========================================================================
   Bookmark cards
   ========================================================================== */
.section-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-3); margin: 26px 0 14px;
}
.section-label:first-child { margin-top: 0; }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.bm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}

.bm-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: box-shadow 0.22s var(--ease), transform 0.22s var(--ease), border-color 0.22s var(--ease);
}
.bm-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

/* Screenshot with hover zoom */
.bm-shot {
  position: relative; display: block;
  aspect-ratio: 16 / 9.4;
  overflow: hidden;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.bm-shot img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transition: transform 0.5s var(--ease);
  background: var(--surface-2);
}
.bm-card:hover .bm-shot img, .bm-shot:focus-visible img { transform: scale(1.05); }
.bm-shot::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(to top, rgba(28, 25, 23, 0.16), transparent 38%);
  opacity: 0; transition: opacity 0.25s var(--ease);
  pointer-events: none;
}
.bm-card:hover .bm-shot::after { opacity: 1; }
.shot-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 700; letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.92);
  text-transform: uppercase;
}
.shot-open {
  position: absolute; right: 10px; bottom: 10px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(28, 25, 23, 0.68);
  backdrop-filter: blur(6px);
  padding: 5px 11px; border-radius: 99px;
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.shot-open .icon { width: 13px; height: 13px; }
.bm-card:hover .shot-open { opacity: 1; transform: translateY(0); }

.bm-body { padding: 14px 16px 13px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.bm-title-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
/* Favicon-Chip: das Bild ueberlagert den Globus-Platzhalter, sobald es laedt. */
.bm-favicon {
  position: relative;
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.bm-favicon img {
  position: absolute; inset: 0; margin: auto;
  width: 14px; height: 14px;
  border-radius: 4px; background: var(--surface);
}
.bm-favicon .icon { width: 13px; height: 13px; color: var(--ink-3); }
.bm-name {
  font-size: 14.5px; font-weight: 600; letter-spacing: -0.008em; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
a.bm-name-link:hover .bm-name { color: var(--accent-deep); }
.bm-desc {
  font-size: 13px; color: var(--ink-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em;
}
.bm-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: auto; padding-top: 6px;
  font-size: 12px; color: var(--ink-3);
}
.bm-meta .meta-stat { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.bm-meta .icon { width: 13px; height: 13px; }
.bm-meta .spacer { flex: 1; }
.bm-meta time { white-space: nowrap; }

/* Status-Overlay auf dem Screenshot (Verarbeitung läuft / Fehler) */
.shot-status {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(31, 28, 25, 0.78); color: #fff;
  padding: 5px 11px; border-radius: 99px;
  font-size: 12px; font-weight: 600; backdrop-filter: blur(3px);
}
.shot-status .spinner {
  width: 13px; height: 13px; border-width: 2px;
  border-color: rgba(255,255,255,.35); border-top-color: #fff;
}
.shot-status-error { background: rgba(179, 64, 47, 0.92); }

.bm-error {
  margin: 6px 0 0; font-size: 12px; color: var(--danger, #b3402f);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bm-match {
  margin: 4px 0 0; font-size: 12px; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 5px;
}

/* Verarbeitungsstatus: leichtes Pulsieren der Karte */
.bm-card[hx-get] .shot-status { animation: mw-pulse 1.6s var(--ease) infinite; }
@keyframes mw-pulse { 0%,100%{opacity:.85} 50%{opacity:1} }

/* Card action buttons (appear on hover) */
.bm-actions {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  display: flex; gap: 5px;
  opacity: 0; transform: translateY(-3px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.bm-card:hover .bm-actions, .bm-card:focus-within .bm-actions { opacity: 1; transform: translateY(0); }
.bm-actions .btn-icon {
  width: 30px; height: 30px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
}
.bm-actions .btn-icon:hover { background: var(--surface); }
.bm-actions .btn-icon.btn-danger-hover:hover { background: var(--danger-soft); border-color: rgba(179, 64, 47, 0.3); }
@media (hover: none) { .bm-actions { opacity: 1; transform: none; } }

/* ---------- Hero card (most visited) ---------- */
.bm-hero {
  display: grid; grid-template-columns: minmax(0, 44%) minmax(0, 1fr);
  grid-column: 1 / -1;
  border: 1px solid rgba(217, 119, 87, 0.4);
  background: linear-gradient(120deg, var(--accent-softer), var(--surface) 46%);
  box-shadow: 0 2px 6px rgba(217, 119, 87, 0.08), var(--sh-sm);
}
.bm-hero .bm-shot { aspect-ratio: auto; min-height: 218px; border-bottom: 0; border-right: 1px solid var(--border); }
.bm-hero .bm-body { padding: 24px 26px 20px; gap: 11px; }
.bm-hero .bm-name { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; white-space: normal; }
.bm-hero .bm-favicon { width: 30px; height: 30px; border-radius: 9px; }
.bm-hero .bm-favicon img { width: 18px; height: 18px; }
.bm-hero .bm-desc { font-size: 14px; -webkit-line-clamp: 3; min-height: 0; }
.hero-eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-deep);
}
.hero-eyebrow .icon { width: 14px; height: 14px; }
.bm-hero .bm-meta { font-size: 12.5px; }

/* ==========================================================================
   Bookmark table
   ========================================================================== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow-x: auto;
  box-shadow: var(--sh-sm);
}
.bm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 880px; table-layout: fixed; }
.bm-table th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-3); padding: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
}
.bm-table th .th-sort {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 12px 16px; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit;
  transition: color 0.14s var(--ease), background 0.14s var(--ease);
  /* Kopftexte duerfen umbrechen: mit dem geerbten `nowrap` liefen lange
     Bezeichnungen bei fixem Tabellenlayout in die Nachbarspalte. */
  white-space: normal; text-align: left;
}
.bm-table th .th-sort .icon { flex: none; }
.bm-table th .th-sort:hover { color: var(--ink); background: var(--accent-softer); }
.bm-table th .th-sort .icon { width: 13px; height: 13px; color: var(--ink-3); transition: color 0.14s; }
.bm-table th.sorted .th-sort { color: var(--accent-deep); }
.bm-table th.sorted .th-sort .icon { color: var(--accent); }
.bm-table th.th-static { padding: 12px 16px; }

/* Filter row */
.bm-table .filter-row th { padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.bm-table .filter-row input {
  width: 100%; min-width: 0; font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0;
  padding: 6px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  transition: border-color 0.14s, box-shadow 0.14s;
}
/* Spalten mit zwei Filterfeldern (Aufrufe von/bis, Datum von/bis) stapeln
   diese untereinander — nebeneinander wurden beide unlesbar schmal. */
.bm-table .filter-row input { display: block; }
.bm-table .filter-row input + input { margin-top: 6px; }
.bm-table .filter-row input::placeholder { color: var(--ink-3); }
.bm-table .filter-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); outline: none; }

.bm-table td {
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  vertical-align: middle; color: var(--ink-2);
}
.bm-table tbody tr:last-child td { border-bottom: 0; }
.bm-table tbody tr { transition: background 0.12s var(--ease); cursor: pointer; }
.bm-table tbody tr:hover { background: var(--accent-softer); }
.td-name { min-width: 200px; max-width: 300px; }
.td-name .cell-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.td-name .name-text {
  font-weight: 600; color: var(--ink); font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
tr:hover .td-name .name-text { color: var(--accent-deep); }
.td-url { max-width: 220px; }
.td-url .url-text {
  font-family: var(--mono); font-size: 12px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
}
.td-desc { max-width: 260px; }
.td-desc .desc-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; font-size: 13px;
}
.td-visits { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); white-space: nowrap; }
.td-visits .icon { width: 13px; height: 13px; color: var(--accent); display: inline; vertical-align: -2px; margin-right: 5px; }
.td-date { white-space: nowrap; font-size: 12.5px; color: var(--ink-3); }
.td-actions { white-space: nowrap; text-align: right; }
.row-top .td-visits { color: var(--accent-deep); }

/* Treffergrund im Tabellen-Namen */
.match-reason {
  margin-left: 6px; font-size: 10.5px; font-weight: 600;
  color: var(--accent-deep); background: var(--accent-soft);
  padding: 1px 7px; border-radius: 99px; white-space: nowrap;
}

/* Table name link */
.td-name .name-link { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 28px; flex-wrap: wrap;
}
.page-btn {
  min-width: 36px; height: 36px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); font-size: 13.5px; font-weight: 550; color: var(--ink-2);
  border: 1px solid transparent;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
  font-variant-numeric: tabular-nums;
}
.page-btn:hover { background: var(--surface); border-color: var(--border-strong); }
.page-btn.active {
  background: var(--accent); color: #fff; font-weight: 650;
  box-shadow: 0 1px 2px rgba(163, 77, 48, 0.3);
}
.page-btn[disabled] { opacity: 0.4; pointer-events: none; }
.page-info { font-size: 12.5px; color: var(--ink-3); margin: 0 10px; }

/* ==========================================================================
   Empty state
   ========================================================================== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 72px 24px 80px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-xl);
  background: var(--surface);
}
.empty-art {
  width: 76px; height: 76px; border-radius: 22px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  box-shadow: inset 0 0 0 1px rgba(217, 119, 87, 0.22);
}
.empty-art .icon { width: 32px; height: 32px; color: var(--accent); stroke-width: 1.5; }
.empty-state h3 { font-size: 17px; font-weight: 650; margin-bottom: 6px; }
.empty-state p { font-size: 14px; color: var(--ink-2); max-width: 380px; margin-bottom: 20px; }

/* ==========================================================================
   Modal system  (#modal-root:empty hides everything — CSS-driven)
   ========================================================================== */
#modal-root:empty { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(28, 25, 23, 0.42);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(16px, 6vh, 72px) 16px 24px;
  overflow-y: auto;
  animation: fade-in 0.18s var(--ease);
}
.modal {
  width: 100%; max-width: 540px;
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--sh-lg);
  animation: modal-in 0.24s var(--ease);
  margin: auto 0;
}
.modal-wide { max-width: 620px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 20px 22px 0;
}
.modal-title { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; }
/* Zeigt im Edit-Modal die URL: lange Pfade ohne Leerzeichen muessen umbrechen,
   sonst schiebt sich das Modal horizontal auf. */
.modal-sub { font-size: 13px; color: var(--ink-3); margin-top: 3px; overflow-wrap: anywhere; }
.modal-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 15px; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 0 22px 20px;
}
.modal-foot .spacer { flex: 1; }

/* ==========================================================================
   Bookmark form specifics
   ========================================================================== */
.prefill-note {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-3);
  min-height: 18px;
}
.prefill-note .icon { width: 13px; height: 13px; color: var(--success); }
.shot-preview {
  border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
  background: var(--surface-2);
}
.shot-preview img { width: 100%; aspect-ratio: 16 / 8.6; object-fit: cover; object-position: top; }
.shot-preview .shot-preview-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  padding: 7px 11px; border-top: 1px solid var(--border); background: var(--surface);
}
.shot-preview .shot-preview-label .icon { width: 13px; height: 13px; }

/* Aktionen im Screenshot-Formular (Refresh / Entfernen) */
.shot-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ==========================================================================
   Category manager
   ========================================================================== */
.cat-list { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.cat-row {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--r-sm);
  transition: background 0.13s var(--ease);
}
.cat-row:hover { background: var(--surface-2); }
.cat-row .dot { width: 12px; height: 12px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.cat-row .cat-name { flex: 1; font-weight: 550; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-empty { text-align: center; color: var(--ink-3); font-size: 13.5px; padding: 26px 12px; }

/* Color picker */
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-swatch {
  width: 30px; height: 30px; border-radius: 10px;
  border: 2px solid transparent; cursor: pointer; position: relative;
  transition: transform 0.13s var(--ease), box-shadow 0.13s var(--ease);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.selected { border-color: var(--surface); box-shadow: 0 0 0 2.5px var(--accent); }
.color-swatch.selected::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
}
.color-custom { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.color-custom input[type="color"] {
  width: 38px; height: 30px; padding: 2px; border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); background: var(--surface); cursor: pointer;
}

/* ==========================================================================
   Command palette
   ========================================================================== */
.palette-backdrop {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(28, 25, 23, 0.38);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(60px, 14vh, 140px) 16px 24px;
  animation: fade-in 0.15s var(--ease);
}
.palette {
  width: 100%; max-width: 600px;
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--sh-lg);
  overflow: hidden;
  animation: modal-in 0.2s var(--ease);
}
.palette-input-row {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}
.palette-input-row .icon { width: 19px; height: 19px; color: var(--ink-3); }
.palette-input-row input {
  flex: 1; border: 0; outline: none; background: transparent;
  font-size: 16px; letter-spacing: -0.005em;
}
.palette-input-row input::placeholder { color: var(--ink-3); }
.palette-list { max-height: 380px; overflow-y: auto; padding: 8px; }
.palette-group {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); padding: 10px 12px 5px;
}
.palette-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-sm);
  font-size: 14px; color: var(--ink-2); cursor: pointer;
  border-left: 2.5px solid transparent;
}
.palette-item .icon { width: 16px; height: 16px; color: var(--ink-3); }
.palette-item .item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .item-hint { font-size: 12px; color: var(--ink-3); }
.palette-item.selected {
  background: var(--accent-soft); color: var(--accent-deep);
  border-left-color: var(--accent);
}
.palette-item.selected .icon { color: var(--accent-deep); }
.palette-empty { padding: 26px 16px; text-align: center; color: var(--ink-3); font-size: 13.5px; }
.palette-foot {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px; border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px; color: var(--ink-3);
}
.palette-foot .hint { display: flex; align-items: center; gap: 6px; }

/* ==========================================================================
   Toasts
   ========================================================================== */
.toast-stack {
  position: fixed; bottom: 22px; right: 22px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #f5f4f2;
  font-size: 13.5px; font-weight: 500;
  padding: 11px 16px; border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  pointer-events: auto;
  animation: toast-in 0.3s var(--ease);
  max-width: 380px;
}
.toast.leaving { animation: toast-out 0.25s var(--ease) forwards; }
.toast .icon { width: 17px; height: 17px; }
.toast-success .icon { color: #8fd0a8; }
.toast-error .icon { color: #f2a294; }
.toast-info .icon { color: #eec9a8; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(0.97); } }

/* ==========================================================================
   Auth pages (login / register) — split screen
   ========================================================================== */
.auth-shell { display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 1fr); min-height: 100vh; }

/* Visual side — CSS-only artwork */
.auth-visual {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 700px at 12% -8%, rgba(224, 136, 104, 0.32), transparent 60%),
    radial-gradient(900px 640px at 108% 108%, rgba(163, 77, 48, 0.28), transparent 55%),
    linear-gradient(158deg, #f6ede6 0%, #efdfd2 48%, #e6cfbc 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(28px, 5vh, 56px) clamp(28px, 4vw, 60px);
}
.auth-visual::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(163, 77, 48, 0.14) 1px, transparent 1.4px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,0.5) 30%, rgba(0,0,0,0.5) 70%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,0.5) 30%, rgba(0,0,0,0.5) 70%, transparent);
}
.auth-brand { position: relative; display: flex; align-items: center; gap: 11px; }
.auth-brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
.auth-brand .brand-name { font-size: 20px; }

.auth-hero-copy { position: relative; max-width: 460px; }
.auth-hero-copy h1 {
  font-size: clamp(28px, 3.2vw, 40px); font-weight: 750; letter-spacing: -0.03em;
  line-height: 1.14; color: #3a2417;
}
.auth-hero-copy h1 em { font-style: normal; color: var(--accent-deep); }
.auth-hero-copy p { margin-top: 14px; font-size: 15.5px; color: #6b4a37; line-height: 1.6; }

/* Floating mock bookmark cards */
.auth-cards { position: relative; height: 240px; margin-top: 8px; }
.mock-card {
  position: absolute;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(120, 62, 36, 0.18);
  padding: 14px 16px;
  width: 250px;
  animation: float 7s ease-in-out infinite;
}
.mock-card .mc-shot {
  height: 64px; border-radius: 10px; margin-bottom: 11px;
  background: linear-gradient(120deg, #e9b096, #d97757);
}
.mock-card:nth-child(2) .mc-shot { background: linear-gradient(120deg, #d8c8b2, #b9a284); }
.mock-card:nth-child(3) .mc-shot { background: linear-gradient(120deg, #e4c3ab, #c98a63); }
.mock-card .mc-line { height: 9px; border-radius: 6px; background: #e8ded3; margin-bottom: 7px; }
.mock-card .mc-line.w60 { width: 60%; }
.mock-card .mc-line.w80 { width: 80%; background: #efe6db; }
.mock-card .mc-meta { display: flex; align-items: center; gap: 7px; margin-top: 10px; }
.mock-card .mc-dot { width: 8px; height: 8px; border-radius: 50%; }
.mock-card .mc-chip { height: 8px; width: 44px; border-radius: 6px; background: #efe6db; }
.mock-card:nth-child(1) { top: 0; left: 6%; animation-delay: 0s; z-index: 2; }
.mock-card:nth-child(2) { top: 74px; left: 38%; animation-delay: 1.6s; width: 230px; }
.mock-card:nth-child(3) { top: 150px; left: 10%; animation-delay: 3.1s; width: 215px; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-0.4deg); }
  50% { transform: translateY(-12px) rotate(0.5deg); }
}
.auth-visual-foot { position: relative; font-size: 12.5px; color: #8a5f47; letter-spacing: 0.02em; }

/* Form side */
.auth-form-side {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px clamp(20px, 5vw, 80px);
  background: var(--bg);
}
.auth-box { width: 100%; max-width: 400px; }
.auth-box .brand { justify-content: center; margin-bottom: 26px; display: none; }
.auth-box h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; text-align: center; }
.auth-box .auth-sub { text-align: center; color: var(--ink-2); font-size: 14px; margin: 7px 0 26px; }
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-form .btn-primary { padding: 11px 16px; font-size: 14.5px; margin-top: 4px; }
.auth-alt {
  margin-top: 22px; text-align: center; font-size: 13.5px; color: var(--ink-2);
}
.auth-alt a { color: var(--accent-deep); font-weight: 600; }
.auth-alt a:hover { text-decoration: underline; }

/* Alert */
.alert {
  display: flex; align-items: flex-start; gap: 9px;
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid rgba(179, 64, 47, 0.25);
  border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 500;
  padding: 11px 14px;
}
.alert .icon { width: 17px; height: 17px; flex: none; margin-top: 1px; }

/* Password visibility toggle */
.pw-toggle { position: absolute; right: 8px; display: flex; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .bm-hero { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; z-index: 90; top: 0; left: 0; bottom: 0;
    width: 280px; height: 100vh;
    background: var(--bg);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.26s var(--ease);
    padding-top: 26px;
    box-shadow: none;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--sh-lg); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 85;
    background: rgba(28, 25, 23, 0.35);
    opacity: 0; pointer-events: none; transition: opacity 0.22s var(--ease);
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .topbar { gap: 10px; }
  .topbar-search .kbd { display: none; }
  .user-chip .user-name { display: none; }
  .bm-hero { grid-template-columns: 1fr; }
  .bm-hero .bm-shot { border-right: 0; border-bottom: 1px solid var(--border); min-height: 0; aspect-ratio: 16 / 8.5; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-box .brand { display: flex; }
}

@media (max-width: 560px) {
  .toolbar { gap: 8px; }
  .toolbar-title { width: 100%; }
  .view-toggle button span { display: none; }
  .topbar-search { max-width: none; }
  .brand-name { display: none; }
  .modal-backdrop { padding-top: 20px; }
  .pagination { gap: 3px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
