/* ─────────────────────────────────────────────────────────────
   Bookmarks — Modern Dark UI (Monochrome White Accent · Sharp Tiles)
   Tight Masonry Layout · Less Rounder Geometric Edges · Pure White
   ───────────────────────────────────────────────────────────── */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Surface colors (Pure Dark / Zinc hierarchy) */
  --bg-base:        #090a0f;
  --bg-surface:     #11131a;
  --bg-card:        #141722;
  --bg-card-hover:  #1a1e2b;
  --bg-elevated:    #1c202e;
  --bg-input:       #0d0f17;
  --bg-glass:       rgba(9, 10, 15, 0.82);

  /* Borders */
  --border-subtle:  rgba(255, 255, 255, 0.08);
  --border-card:    rgba(255, 255, 255, 0.09);
  --border-hover:   rgba(255, 255, 255, 0.22);
  --border-active:  rgba(255, 255, 255, 0.6);

  /* Typography */
  --text-primary:   #f4f5f8;
  --text-secondary: #9da4b4;
  --text-muted:     #636b7e;
  --text-inverse:   #090a0f;

  /* Accent: Pure Crisp White (No purple) */
  --accent:         #ffffff;
  --accent-hover:   #e5e7eb;
  --accent-subtle:  rgba(255, 255, 255, 0.10);
  --accent-border:  rgba(255, 255, 255, 0.30);
  --accent-glow:    rgba(255, 255, 255, 0.16);

  /* Platforms */
  --reddit:         #ff4500;
  --reddit-bg:      rgba(255, 69, 0, 0.12);
  --reddit-border:  rgba(255, 69, 0, 0.3);

  --twitter:        #ffffff;
  --twitter-bg:     rgba(255, 255, 255, 0.08);
  --twitter-border: rgba(255, 255, 255, 0.2);

  --instagram:      #f43f8e;
  --instagram-bg:   rgba(244, 63, 142, 0.12);
  --instagram-border: rgba(244, 63, 142, 0.3);

  --youtube:        #e20402;
  --youtube-bg:     rgba(226, 4, 2, 0.14);
  --youtube-border: rgba(226, 4, 2, 0.36);

  --tiktok:         #25f4ee;
  --tiktok-bg:      rgba(37, 244, 238, 0.12);
  --tiktok-border:  rgba(37, 244, 238, 0.3);

  --success:        #10b981;
  --danger:         #f43f5e;
  --danger-bg:      rgba(244, 63, 94, 0.14);

  /* Geometry: LESS ROUNDER (Geometric, sharp, crisp) */
  --radius-xs:      2px;
  --radius-sm:      3px;
  --radius-md:      4px;
  --radius-lg:      6px;

  --font-sans:      'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono:      ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --ease-spring:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth:    cubic-bezier(0.4, 0, 0.2, 1);

  --shadow-sm:      0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md:      0 6px 20px -2px rgba(0, 0, 0, 0.45);
  --shadow-lg:      0 16px 36px -4px rgba(0, 0, 0, 0.6);
}

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

html {
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--bg-base);
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  letter-spacing: -0.012em;
  overflow-x: hidden;
}

::selection {
  background: #ffffff;
  color: #090a0f;
}

/* Thin modern scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-xs);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* ── Top Header Bar ────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
}

.header-top,
.header-sub {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-top {
  height: 56px;
}

.header-sub {
  height: 44px;
  border-top: 1px solid var(--border-subtle);
}

/* Brand */
.brand-group {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.025em;
  white-space: nowrap;
  user-select: none;
}

.brand-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #090a0f;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.brand-name {
  font-weight: 700;
  color: #ffffff;
}

.brand-count-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-feature-settings: "tnum";
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
}

.brand-badge:hover,
.brand-badge[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--border-hover);
}

.brand-badge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.stats-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 220;
  min-width: 205px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transform: translateX(var(--stats-shift-x, 0px));
}

/* Transparent hover bridge across the 8px gap below the count box */
.stats-popover::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

.stats-popover[hidden] {
  display: none;
}

.stats-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 8px 7px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stats-popover-total {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
}

.stats-popover-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  color: var(--text-primary);
}

.stats-row.is-zero {
  color: var(--text-muted);
}

.stats-row-platform {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.stats-row-platform .platform-mark {
  width: 14px;
  justify-content: center;
}

.stats-row-count {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  font-feature-settings: "tnum";
  color: var(--text-secondary);
}

.stats-row.is-zero .stats-row-count {
  color: var(--text-muted);
}

.stats-other-dot {
  width: 7px;
  height: 7px;
  margin: 0 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

@property --nav-fade-start {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --nav-fade-end {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

.header-tools {
  position: relative;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-tools::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  right: 100%;
  width: 20px;
  margin-right: 4px;
  pointer-events: none;
  background: radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.58), transparent);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.header-sub.nav-more-end .header-tools::before {
  opacity: 1;
}

/* Navigation Filter Pills */
.nav {
  --nav-fade-size: 28px;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding-inline-end: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-padding-inline: var(--nav-fade-size);
}
.nav::-webkit-scrollbar { display: none; }

@supports (animation-timeline: scroll()) and (mask: linear-gradient(black, black) no-clip subtract) {
  .nav {
    mask:
      linear-gradient(black, black) no-clip subtract,
      linear-gradient(to right, black, transparent) 0 0 / var(--nav-fade-start) 100% no-repeat no-clip,
      linear-gradient(to right, transparent, black) 100% 0 / var(--nav-fade-end) 100% no-repeat no-clip;
    animation: nav-reveal-fade-start linear both, nav-hide-fade-end linear both;
    animation-timeline: scroll(self inline);
    animation-range: 0 var(--nav-fade-size), calc(100% - var(--nav-fade-size)) 100%;
  }
}

@supports not ((animation-timeline: scroll()) and (mask: linear-gradient(black, black) no-clip subtract)) {
  .nav {
    -webkit-mask-image: linear-gradient(to right, transparent 0, black var(--nav-fade-start), black calc(100% - var(--nav-fade-end)), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, black var(--nav-fade-start), black calc(100% - var(--nav-fade-end)), transparent 100%);
    transition: --nav-fade-start 0.2s ease, --nav-fade-end 0.2s ease;
  }

  .nav.more-start {
    --nav-fade-start: var(--nav-fade-size);
  }

  .nav.more-end {
    --nav-fade-end: var(--nav-fade-size);
  }
}

@keyframes nav-reveal-fade-start {
  to {
    --nav-fade-start: var(--nav-fade-size);
  }
}

@keyframes nav-hide-fade-end {
  from {
    --nav-fade-end: var(--nav-fade-size);
  }
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.14s var(--ease-smooth);
  white-space: nowrap;
}

.nav-btn svg {
  opacity: 0.75;
  transition: opacity 0.14s;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}
.nav-btn:hover svg {
  opacity: 1;
}

.nav-btn.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 600;
}
.nav-btn.active svg {
  opacity: 1;
  color: #ffffff;
}

.nav-folders {
  display: contents;
}

.nav-add-folder {
  padding: 5px 8px;
  flex-shrink: 0;
  color: var(--text-muted);
}
.nav-add-folder:hover {
  color: #ffffff;
}

/* Header Right Actions */
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

/* Search bar with kbd */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.mobile-search-toggle {
  display: none;
}

.mobile-search-close {
  display: none;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-wrap input {
  width: 200px;
  padding: 7px 44px 7px 32px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.18s var(--ease-spring);
}

.search-wrap input::placeholder {
  color: var(--text-muted);
}

.search-wrap input:focus {
  width: 260px;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
  background: var(--bg-surface);
}

.search-kbd {
  position: absolute;
  right: 8px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}

.search-clear[hidden] {
  display: none;
}

.search-clear:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.search-clear:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.search-wrap.has-value .search-kbd {
  display: none;
}

.search-wrap.has-value input {
  padding-right: 34px;
}

/* Icon action buttons */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.14s var(--ease-smooth);
}

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

.icon-btn.active-mode {
  color: #090a0f;
  background: #ffffff;
  border-color: #ffffff;
}

/* Primary Add Button (in header) - Pure White */
.btn-header-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  color: #090a0f;
  background: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.14s var(--ease-smooth);
}

.btn-header-add:hover {
  background: var(--accent-hover);
}

/* Dropdown Menu */
.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 212px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 4px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  z-index: 200;
}
.dropdown.open {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-align: left;
  transition: all 0.1s;
}

.dropdown-item svg {
  flex: none;
  opacity: 0.8;
}

.dropdown-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-item:focus-visible,
.dropdown-sort-dir:focus-visible,
.dropdown-sort-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dropdown-item.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 600;
}

.dropdown-item.active::after {
  content: "✓";
  font-size: 11px;
  color: var(--text-primary);
  opacity: 0.9;
}

.dropdown-item.danger {
  color: #fb7185;
}
.dropdown-item.danger:hover {
  background: var(--danger-bg);
  color: #fda4af;
}

.dropdown-item[hidden],
.dropdown-divider[hidden] {
  display: none;
}

.dropdown-divider {
  border: none;
  height: 1px;
  margin: 4px 0;
  background: var(--border-subtle);
}

.dropdown-sort {
  padding: 6px 6px 7px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dropdown-sort-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dropdown-sort-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-inline-start: 4px;
}

.dropdown-sort-dir {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-block-size: 24px;
  padding: 2px 7px;
  font-size: 11.5px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: color 0.12s var(--ease-smooth), background 0.12s var(--ease-smooth), border-color 0.12s var(--ease-smooth);
}

.dropdown-sort-dir:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-subtle);
}

.dropdown-sort-arrow {
  flex: none;
  opacity: 0.85;
}

@media (prefers-reduced-motion: no-preference) {
  .dropdown-sort-arrow {
    transition: transform 0.16s var(--ease-spring);
  }
}

.dropdown-sort-dir[data-order="asc"] .dropdown-sort-arrow {
  transform: rotate(180deg);
}

.dropdown-sort-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.dropdown-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 28px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: color 0.12s var(--ease-smooth), background 0.12s var(--ease-smooth), box-shadow 0.12s var(--ease-smooth);
}

.dropdown-sort-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.dropdown-sort-btn.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 1px 2px rgba(0, 0, 0, 0.35);
}

@media (pointer: coarse) {
  .dropdown-sort-dir {
    min-block-size: 30px;
    padding: 4px 8px;
  }
  .dropdown-sort-btn {
    min-block-size: 34px;
  }
}

/* ── Tags Toolbar ──────────────────────────────────────────── */
.tagbar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 28px 0;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}

.tagbar:empty {
  display: none;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.12s;
}

.tag-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.tag-pill.active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
}

/* ── Main Workspace ────────────────────────────────────────── */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 28px 72px;
}

.feed-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 0 32px;
  color: var(--text-muted);
  font-size: 12px;
}

.feed-pagination[hidden] { display: none; }

/* ── Masonry Tile Feed (Tight interlocking tiles, NO gaps) ──── */
.feed {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
}

.feed-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

/* List View (Single column) */
.feed.list-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 880px;
  margin: 0 auto;
}

.feed.list-view .feed-col {
  display: contents;
}

.feed.list-view .post.has-media {
  flex-direction: row;
  align-items: stretch;
}

.feed.list-view .post.has-media .media-stack,
.feed.list-view .post.has-media > .media-carousel,
.feed.list-view .post.has-media > .media-block,
.feed.list-view .post.has-media > .media-video-thumb {
  width: 220px;
  flex-shrink: 0;
  align-self: flex-start;
}

.feed.list-view .post.has-media > .media-carousel .media-block,
.feed.list-view .post.has-media > .media-carousel .media-video-thumb {
  width: 100%;
  height: 100%;
}

.feed.list-view .post.has-media .media-block:not(.media-video-thumb) img,
.feed.list-view .post.has-media .media-block:not(.media-video-thumb) video {
  height: auto;
  max-height: none;
  object-fit: contain;
}

.feed.list-view .post-copy {
  flex: 1;
  min-width: 0;
  justify-content: center;
}

/* ── Post Card (Sharp Geometric Corners, Compact Padding) ── */
.post {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  transition: border-color 0.14s, background-color 0.14s;
  width: 100%;
  break-inside: avoid;
}

.post-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 10px;
}

.post:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.post.selected {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 1px #ffffff;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 22px;
  position: relative;
}

.platform-mark {
  display: inline-flex;
  flex-shrink: 0;
  opacity: 0.9;
}
.platform-mark.reddit { color: var(--reddit); }
.platform-mark.twitter { color: #e8e8e8; }
.platform-mark.instagram { color: var(--instagram); }
.platform-mark.youtube { color: var(--youtube); }
.platform-mark.tiktok { color: var(--tiktok); }

.post-source {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.post-source + .post-author::before {
  content: "·";
  margin-right: 6px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Platform badge (detail view) */
.post-platform {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.post-platform.reddit {
  color: var(--reddit);
  background: var(--reddit-bg);
  border: 1px solid var(--reddit-border);
}

.post-platform.twitter {
  color: var(--twitter);
  background: var(--twitter-bg);
  border: 1px solid var(--twitter-border);
}

.post-platform.instagram {
  color: #f472b6;
  background: var(--instagram-bg);
  border: 1px solid var(--instagram-border);
}

.post-platform.youtube {
  color: var(--youtube);
  background: var(--youtube-bg);
  border: 1px solid var(--youtube-border);
}

.post-platform.tiktok {
  color: var(--tiktok);
  background: var(--tiktok-bg);
  border: 1px solid var(--tiktok-border);
}

/* Author */
.post-author {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Time ago */
.post-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  font-feature-settings: "tnum";
  white-space: nowrap;
  flex-shrink: 0;
}

.post-time.is-posted {
  color: var(--text-secondary);
}

/* Card Body Content */
.post-parent-title {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-body {
  font-size: 13.5px;
  line-height: 1.45;
  color: #e7e9ee;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.post-body-empty {
  display: block;
  color: var(--text-muted);
  font-style: italic;
  font-size: 12.5px;
}

/* ── Media Blocks (Tight, Sharp Corners) ───────────────────── */
.media-stack {
  position: relative;
}

.media-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 650;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 999px;
  pointer-events: none;
}

/* ── Media Carousel ────────────────────────────────────────── */
.media-carousel {
  position: relative;
  overflow: hidden;
  background: #07080c;
  user-select: none;
}

.media-carousel .carousel-track {
  position: relative;
  width: 100%;
}

.media-carousel .carousel-slide {
  display: none;
  width: 100%;
}

.media-carousel .carousel-slide.active {
  display: block;
}

.media-carousel .carousel-slide .media-block {
  margin: 0;
}

/* Subtle, sleek, unobtrusive arrow buttons that only appear on hover */
.media-carousel .carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.2s ease, background 0.15s ease, transform 0.15s ease;
  opacity: 0;
  pointer-events: none;
}

.media-carousel .carousel-btn svg {
  pointer-events: none;
}

/* Fade in on hover over card or carousel */
.post:hover .media-carousel .carousel-btn,
.detail-carousel:hover .carousel-btn,
.media-carousel:hover .carousel-btn {
  opacity: 0.78;
  pointer-events: auto;
}

.media-carousel .carousel-btn:hover {
  opacity: 1 !important;
  background: rgba(0, 0, 0, 0.75);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-50%) scale(1.08);
}

.media-carousel .prev-btn {
  left: 6px;
}

.media-carousel .next-btn {
  right: 6px;
}

.media-carousel .carousel-counter {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  pointer-events: none;
  z-index: 4;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Detail modal carousel adjustments */
.detail-carousel {
  flex-shrink: 0;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-carousel .carousel-slide {
  display: none;
  width: 100%;
}

.detail-carousel .carousel-slide.active {
  display: block;
}

.detail-carousel .detail-media {
  margin-bottom: 0;
  border: none;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-carousel .detail-media img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.detail-carousel .carousel-btn {
  width: 36px;
  height: 36px;
  opacity: 0;
  pointer-events: none;
}

.detail-carousel .prev-btn {
  left: 10px;
}

.detail-carousel .next-btn {
  right: 10px;
}

.detail-carousel:hover .carousel-btn {
  opacity: 0.85;
  pointer-events: auto;
}

.detail-carousel .carousel-counter {
  right: 12px;
  bottom: 12px;
  font-size: 11.5px;
  padding: 3px 9px;
}

@media (hover: none) {
  .media-carousel .carousel-btn {
    opacity: 0.55;
    pointer-events: auto;
  }
}

@media (hover: none) {
  .media-carousel .carousel-btn {
    opacity: 0.8;
  }
}

.media-outlink-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-block-size: 28px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: rgba(9, 10, 15, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 0.14s var(--ease-smooth), border-color 0.14s var(--ease-smooth);
}

.media-outlink-btn:hover {
  background: rgba(9, 10, 15, 0.92);
  border-color: rgba(255, 255, 255, 0.48);
}

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

.media-outlink-tag {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
}

.media-outlink-sep {
  color: rgba(255, 255, 255, 0.42);
}

.media-ig-highlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(244, 63, 142, 0.12), rgba(20, 23, 34, 0.96) 55%);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}

.detail-media.media-ig-highlight {
  border: 1px solid rgba(244, 63, 142, 0.28);
  border-radius: var(--radius-sm);
  cursor: default;
}

.detail-media.media-video-thumb.is-external-video {
  cursor: default;
}

.media-video-thumb.is-external-video:hover .media-play-btn {
  transform: translate(-50%, -50%);
  background: rgba(16, 18, 26, 0.78);
  border-color: rgba(255, 255, 255, 0.4);
}

.media-video-thumb.is-external-video:hover .media-play-btn::after {
  border-left-color: #ffffff;
}

.ig-highlight-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.ig-highlight-avatar {
  flex: none;
  width: 46px;
  height: 46px;
  padding: 2px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #f43f8e 55%, #a855f7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ig-highlight-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--bg-card);
  display: block;
}

.ig-highlight-avatar.is-fallback {
  color: #ffffff;
  background: var(--instagram-bg);
  border: 1px solid var(--instagram-border);
}

.ig-highlight-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ig-highlight-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f472b6;
}

.ig-highlight-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-highlight-author {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-highlight-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-block-size: 30px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.14s var(--ease-smooth), border-color 0.14s var(--ease-smooth);
}

.ig-highlight-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
}

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

.ig-ext-tip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  margin-bottom: 14px;
  padding: 11px 13px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.ig-ext-tip-text {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-secondary);
  flex: 1 1 180px;
  min-width: 0;
}

.ig-ext-tip-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.ig-ext-tip-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-block-size: 30px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.14s var(--ease-smooth), border-color 0.14s var(--ease-smooth);
}

.ig-ext-tip-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.38);
}

.ig-ext-tip-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ig-ext-tip.is-feed {
  margin: 0;
  padding: 9px 14px;
  gap: 8px 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
}

.ig-ext-tip.is-feed .ig-ext-tip-text {
  font-size: 12px;
  flex: 1 1 150px;
}

.ig-ext-tip.is-feed .ig-ext-tip-btn {
  min-block-size: 28px;
  padding: 4px 9px;
  font-size: 11px;
}

.media-hidden {
  display: none !important;
}

.media-block {
  overflow: hidden;
  background: #07080c;
  position: relative;
}

.media-video-plain {
  aspect-ratio: 16 / 10;
  min-height: 140px;
  background:
    radial-gradient(circle at 50% 42%, #242a38 0%, #0b0d12 68%);
}

/* Images */
.media-block.media-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #07080c;
}

.media-block.media-image img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
}

/* Video Containers */
.media-block.media-video {
  aspect-ratio: 16 / 9;
  background: #000;
}

.media-block.media-video video {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
  background: #000;
  border-radius: var(--radius-sm);
}

/* Video Thumbnail with Glass Play Button */
.media-video-thumb {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  background: #050608;
  aspect-ratio: 16 / 9;
}

.media-video-thumb.media-yt-short {
  aspect-ratio: 9 / 16;
}

.media-video-thumb img,
.media-video-thumb video:not(.media-warm-hidden) {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
}

.media-video-thumb .media-poster {
  position: relative;
  z-index: 1;
}

.media-video-thumb .media-warm-hidden {
  position: absolute;
  inset: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.media-play-btn {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(16, 18, 26, 0.78);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-sm); /* Sharp boxy play button */
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s, background-color 0.15s;
}

.media-video-thumb:hover .media-play-btn {
  transform: translate(-50%, -50%) scale(1.08);
  background: #ffffff;
  border-color: #ffffff;
}
.media-video-thumb:hover .media-play-btn::after {
  border-left-color: #090a0f;
}

.media-play-btn::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 14px solid #ffffff;
  margin-left: 2px;
  transition: border-left-color 0.15s;
}

/* Embeds (YouTube / X embed) */
.media-block.media-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  background: #000;
}

.media-block.media-embed.media-yt-short,
.media-block.media-embed.media-tt-embed {
  padding-bottom: 0;
  height: auto;
  aspect-ratio: 9 / 16;
}

.media-block.media-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.media-block.media-ig-embed {
  position: relative;
  height: 440px;
  background: #0d0f17;
}
.media-block.media-ig-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #ffffff;
}

.detail-media.media-ig-embed {
  background: #0d0f17;
  padding: 0;
}
.detail-media.media-ig-embed iframe {
  width: 100%;
  max-width: 480px;
  height: 560px;
  max-height: 74vh;
  aspect-ratio: auto;
  border: none;
  display: block;
  margin: 0 auto;
  background: #ffffff;
}

/* Article Card (Rich Link Preview) */
.media-block.media-article {
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: all 0.14s;
  overflow: hidden;
}

.media-block.media-article:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}

.media-article-thumb {
  width: 110px;
  min-height: 0;
  flex-shrink: 0;
  overflow: hidden;
  background: #0d0f17;
  align-self: flex-start;
}

.media-article-thumb img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.media-article-info {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.media-article-domain {
  font-size: 10.5px;
  font-weight: 600;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.8;
}

.media-article-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-article-arrow {
  font-size: 11px;
  color: var(--text-muted);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.post-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.post-actions {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 1px;
  opacity: 0;
  pointer-events: none;
  padding-left: 18px;
  background: linear-gradient(90deg, rgba(20, 23, 34, 0), var(--bg-card) 16px);
  transition: opacity 0.12s;
}

.post:hover .post-actions,
.post:focus-within .post-actions,
.post.menu-open .post-actions {
  opacity: 1;
  pointer-events: auto;
}

.post:hover {
  --bg-card: var(--bg-card-hover);
}

.post-action {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
}

.post-action svg {
  width: 14px;
  height: 14px;
}

.post-action:hover,
.post-action[aria-expanded="true"] {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.post-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Favorite heart active */
.post-action.fav {
  color: #f43f5e;
}
.post-action.fav svg {
  fill: #f43f5e;
}

.btn-ghost.fav {
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.10);
}
.btn-ghost.fav:hover {
  color: #fecdd3;
  border-color: rgba(244, 63, 94, 0.55);
  background: rgba(244, 63, 94, 0.16);
}
.btn-ghost.fav svg {
  color: #f43f5e;
  fill: #f43f5e;
}

/* ── Select Mode Checkbox ──────────────────────────────────── */
.post-check {
  display: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--text-muted);
  border-radius: var(--radius-xs);
  background: #0d0f17;
  cursor: pointer;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  scroll-margin-top: 112px;
  transition: all 0.12s;
}

body.selecting .post-check {
  display: block;
}

.post-check:checked {
  background: #ffffff;
  border-color: #ffffff;
}

.post-check:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #090a0f;
}

body.selecting .post {
  cursor: default;
}

/* ── Bulk Action Floating Bar ──────────────────────────────── */
.bulk-bar {
  display: none;
  position: sticky;
  top: 100px;
  z-index: 95;
  background: rgba(16, 18, 26, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

body.selecting .bulk-bar {
  display: block;
}

.bulk-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.bulk-count {
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  min-width: 90px;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.bulk-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.bulk-actions > button svg {
  width: 13px;
  height: 13px;
  flex: none;
  transition: fill 0.14s, stroke 0.14s;
}

.bulk-actions > button.fav svg {
  fill: #f43f5e;
  stroke: #f43f5e;
}

/* ── Common Button Styles (Sharp, Less Rounder) ────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  color: #090a0f;
  background: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.14s;
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
}

.btn-sm {
  padding: 4px 10px !important;
  font-size: 11.5px !important;
  border-radius: var(--radius-xs) !important;
}

.btn-danger {
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: var(--danger);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: filter 0.14s;
}
.btn-danger:hover {
  filter: brightness(1.15);
}

.btn-danger-ghost {
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  color: #fb7185;
  background: var(--danger-bg);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
}
.btn-danger-ghost:hover {
  color: #ffffff;
  background: rgba(244, 63, 94, 0.25);
  border-color: var(--danger);
}

/* ── Empty & No Results States ─────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 28px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  max-width: 480px;
  margin: 52px auto;
}

.empty[hidden] {
  display: none;
}

.empty-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
}

.empty-heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-sub {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 330px;
  margin-bottom: 22px;
  line-height: 1.5;
}

.empty-actions {
  display: flex;
  gap: 8px;
}

.empty-onboarding {
  display: block;
  container: onboarding / inline-size;
  inline-size: 100%;
  max-inline-size: 1080px;
  margin-block: clamp(18px, 4vh, 44px);
  margin-inline: auto;
  padding: 0;
  text-align: left;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.onboarding-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.onboarding-main {
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px 20px;
}

.onboarding-header {
  inline-size: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-block-end: 16px;
}

.onboarding-eyebrow,
.extension-pane-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.empty-onboarding .empty-heading {
  max-inline-size: 26ch;
  margin: 0 0 12px;
  font-size: clamp(22px, 3cqi, 30px);
  line-height: 1.22;
  letter-spacing: -0.028em;
}

.empty-onboarding .empty-sub {
  max-inline-size: 56ch;
  margin-block-end: 24px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.empty-onboarding .empty-actions {
  inline-size: 100%;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-end: 28px;
}

.empty-onboarding .empty-actions button {
  min-block-size: 38px;
}

.onboarding-highlights {
  inline-size: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-block-start: auto;
}

.onboarding-feature {
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.onboarding-feature-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-inline-size: 0;
}

.onboarding-feature-icon {
  inline-size: 24px;
  block-size: 24px;
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
}

.onboarding-feature-head h2 {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.onboarding-feature p {
  font-size: 11.5px;
  line-height: 1.56;
  color: var(--text-secondary);
}

.extension-pane {
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.extension-pane-head {
  inline-size: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-end: 16px;
}

.extension-desktop-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-xs);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.extension-pane-title {
  margin-block-end: 10px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.extension-pane-desc {
  margin-block-end: 20px;
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.58;
}

.onboarding-steps {
  inline-size: 100%;
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
}

.onboarding-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.step-note {
  color: var(--text-secondary);
}

.step-number {
  inline-size: 20px;
  block-size: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  font-feature-settings: "tnum";
}

.extension-pane-actions {
  inline-size: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-block-start: auto;
  padding-block-start: 18px;
  border-top: 1px solid var(--border-subtle);
}

.extension-get-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-block-size: 34px;
  padding: 7px 12px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.extension-get-link:hover {
  color: var(--text-inverse);
  background: var(--accent);
  border-color: var(--accent);
}

.extension-listing-link {
  color: var(--text-secondary);
  font-size: 11.5px;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.22);
  text-underline-offset: 3px;
}

.extension-listing-link:hover {
  color: var(--text-primary);
  text-decoration-color: currentColor;
}

.onboarding-more-btn {
  display: none;
}

.empty-onboarding button:focus-visible,
.empty-onboarding a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@container onboarding (inline-size >= 560px) {
  .onboarding-main {
    padding: 34px 36px;
  }

  .extension-pane {
    padding: 32px;
  }

  .onboarding-highlights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@container onboarding (inline-size >= 780px) {
  .onboarding-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.9fr);
  }

  .extension-pane {
    border-top: none;
    border-inline-start: 1px solid var(--border-subtle);
  }
}

@container onboarding (inline-size < 560px) {
  .onboarding-main,
  .extension-pane {
    padding: 24px 20px;
  }

  .onboarding-header {
    margin-block-end: 14px;
  }

  .empty-onboarding .empty-heading {
    margin-block-end: 12px;
    line-height: 1.24;
    letter-spacing: -0.025em;
  }

  .empty-onboarding .empty-sub {
    margin-block-end: 22px;
    line-height: 1.62;
  }

  .empty-onboarding .empty-actions {
    gap: 10px;
    margin-block-end: 14px;
  }

  .onboarding-highlights {
    gap: 10px;
  }

  .onboarding-feature {
    padding: 14px 15px;
    gap: 8px;
  }

  .onboarding-feature p {
    line-height: 1.56;
  }

  .onboarding-more-btn {
    inline-size: 100%;
    min-block-size: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.14s, border-color 0.14s, color 0.14s;
  }

  .onboarding-more-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--border-hover);
  }

  .onboarding-more-btn[aria-expanded="true"] {
    color: var(--text-primary);
    margin-block-end: 18px;
  }

  .onboarding-more-btn[aria-expanded="true"] .onboarding-more-open,
  .onboarding-more-btn[aria-expanded="false"] .onboarding-more-close {
    display: none;
  }

  .onboarding-more-btn svg {
    flex: none;
  }

  .onboarding-more-btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }

  @media (prefers-reduced-motion: no-preference) {
    .onboarding-more-btn svg {
      transition: transform 0.2s ease;
    }

    .empty-onboarding.mobile-more-open .onboarding-highlights,
    .empty-onboarding.mobile-more-open .extension-pane {
      animation: onboardingReveal 0.18s ease-out;
    }
  }

  .empty-onboarding:not(.mobile-more-open) .onboarding-highlights,
  .empty-onboarding:not(.mobile-more-open) .extension-pane {
    display: none;
  }
}

@keyframes onboardingReveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@container onboarding (inline-size < 420px) {
  .onboarding-main,
  .extension-pane {
    padding: 22px 18px;
  }

  .empty-onboarding .empty-actions .btn-primary {
    flex: 1 1 100%;
  }

  .empty-onboarding .empty-actions .btn-ghost {
    flex: 1 1 0;
    white-space: nowrap;
  }
}

/* ── Context Menu ──────────────────────────────────────────── */
.ctx-menu {
  display: none;
  position: fixed;
  z-index: 500;
  min-width: 180px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 4px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
}
.ctx-menu.open {
  display: block;
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-align: left;
  transition: all 0.1s;
}

.ctx-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.ctx-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ctx-item[hidden] {
  display: none;
}

@media (pointer: coarse) {
  .post-action {
    min-width: 30px;
    min-height: 30px;
  }
  .ctx-item {
    min-block-size: 36px;
  }
}

.ctx-item.danger {
  color: #fb7185;
}
.ctx-item.danger:hover {
  background: var(--danger-bg);
  color: #fda4af;
}

/* ── Shared Keyboard Focus Indicators ─────────────────────── */
:where(
  .icon-btn,
  .btn-primary,
  .btn-ghost,
  .btn-danger,
  .btn-danger-ghost,
  .btn-header-add,
  .nav-btn,
  .brand-badge,
  .search-clear,
  .mobile-search-close,
  .carousel-btn,
  .folder-chip,
  .folder-picker-pick,
  .folder-picker-move,
  .folder-picker-edit,
  .folder-picker-delete,
  .folder-rename-save,
  .folder-rename-cancel
):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Native Dialog Base & Scroll Containment ──────────────── */
dialog:modal {
  overscroll-behavior: contain;
}

dialog:focus {
  outline: none;
}

@media (hover: none) and (pointer: coarse) {
  html:not(.using-keyboard) :is(button, a, [role="button"], [role="menuitem"]):focus-visible {
    outline: none;
  }
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
}

/* ── Overlays & Side Drawers (Sharp, Less Rounder) ─────────── */
dialog.drawer {
  position: fixed;
  top: var(--drawer-vv-top, 0px);
  right: 0;
  bottom: auto;
  left: auto;
  margin: 0 0 0 auto;
  padding: 0;
  width: 420px;
  max-width: 94vw;
  height: 100vh;
  height: var(--drawer-vv-height, 100dvh);
  max-height: var(--drawer-vv-height, 100dvh);
  background: var(--bg-surface);
  color: var(--text-primary);
  border: none;
  border-left: 1px solid var(--border-card);
  overflow: hidden;
  overscroll-behavior: contain;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  will-change: transform, opacity;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  transition-behavior: allow-discrete;
}

@media (prefers-reduced-motion: no-preference) {
  dialog.drawer {
    transform: translate3d(100%, 0, 0);
  }
}

dialog.drawer[open] {
  display: flex;
  flex-direction: column;
}

dialog.drawer[open]:where(:not([data-closing])) {
  opacity: 1;
}

@starting-style {
  dialog.drawer[open]:where(:not([data-closing])) {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  dialog.drawer[open]:where(:not([data-closing])) {
    transform: translate3d(0, 0, 0);
  }

  @starting-style {
    dialog.drawer[open]:where(:not([data-closing])) {
      transform: translate3d(100%, 0, 0);
    }
  }
}

dialog.drawer::backdrop {
  background-color: rgba(0, 0, 0, 0);
  transition-property: background-color, display, overlay;
  transition-duration: 0.22s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

dialog.drawer[open]:where(:not([data-closing]))::backdrop {
  background-color: rgba(0, 0, 0, 0.72);
}

@starting-style {
  dialog.drawer[open]:where(:not([data-closing]))::backdrop {
    background-color: rgba(0, 0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog.drawer,
  dialog.drawer::backdrop {
    transition-duration: 0.1s;
  }
}

.drawer-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.drawer-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  padding-top: max(16px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  z-index: 10;
}

.drawer-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.drawer-title-group {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.drawer-beta {
  padding: 3px 6px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: var(--radius-xs);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  line-height: 1.2;
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (max-width: 768px) {
  .drawer-body input,
  .drawer-body textarea,
  .drawer-body select {
    font-size: 16px;
  }
}

.drawer-body label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.url-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.url-input-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.url-input-row input {
  flex: 1;
  min-width: 0;
}

.url-paste-btn {
  flex-shrink: 0;
  padding: 0 12px;
  white-space: nowrap;
}

.drawer-body input.is-duplicate,
.drawer-body input.is-duplicate:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.duplicate-warning {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.36);
}

.duplicate-warning[hidden],
.link-drop-overlay[hidden] {
  display: none;
}

.duplicate-warning-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.duplicate-warning-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.duplicate-warning-meta {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.duplicate-warning-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.duplicate-warning-actions .btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-border);
  color: var(--text-primary);
}

.duplicate-warning-actions .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.5);
}

.ig-import-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.ig-import-prompt[hidden] {
  display: none;
}

.ig-import-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ig-import-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.ig-import-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.ig-import-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.link-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 450;
  background: rgba(9, 10, 15, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}

.link-drop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 34px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1.5px dashed rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  text-align: center;
}

.link-drop-title {
  font-size: 15px;
  font-weight: 700;
}

.link-drop-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.folder-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.folder-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.folder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.folder-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s var(--ease-smooth);
}

.folder-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.06);
}

.folder-chip[aria-pressed="true"] {
  color: var(--accent);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--border-active);
}

.folder-chip svg {
  flex: none;
}

.folder-chip-add {
  border-style: dashed;
  color: var(--text-muted);
}

.folder-chip-add:hover {
  color: var(--text-primary);
  border-style: solid;
}

.drawer-body input,
.drawer-body select,
.drawer-body textarea {
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: all 0.14s;
}

.drawer-body input:focus,
.drawer-body select:focus,
.drawer-body textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
  background: var(--bg-surface);
}

.drawer-body textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.drawer-body select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239da4b4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 11px;
}

.link {
  color: #ffffff;
  cursor: pointer;
  text-decoration: underline;
}

.form-divider {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 4px;
}

.supported-platforms {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: -4px;
  margin-bottom: 2px;
}

.supported-platforms-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.supported-platforms-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.supported-platforms-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.supported-platforms-note {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.fetch-media-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -4px;
}

.drawer.url-only-add .advanced-bookmark-fields,
.drawer.url-only-add #fetchMediaBtn {
  display: none;
}

.drawer.url-only-add .fetch-media-row {
  min-height: 20px;
}

.drawer-actions {
  flex: none;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

dialog.drawer.keyboard-open .drawer-actions {
  padding-top: 10px;
  padding-bottom: 10px;
}

/* File Drop Zone (Import) */
.file-drop {
  border: 1.5px dashed var(--border-card);
  border-radius: var(--radius-sm);
  padding: 28px 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
}
.file-drop.dragover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

/* ── Full Detail Modal Overlay ─────────────────────────────── */
dialog.detail-dialog {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow: visible;
}

dialog.detail-dialog[open] {
  display: flex;
  justify-content: center;
  align-items: center;
}

dialog.detail-dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.detail-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md); /* 4px */
  width: 620px;
  max-width: 95vw;
  max-height: 86vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.detail-panel > * {
  flex-shrink: 0;
}

.detail-media-slot:empty {
  display: none;
}

.detail-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.detail-content {
  font-size: 15px;
  line-height: 1.65;
  color: #e5e7eb;
  white-space: pre-wrap;
  margin-bottom: 18px;
  word-break: break-word;
}

.detail-media {
  flex-shrink: 0;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-media img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.detail-media.media-image {
  width: 100%;
}
.detail-media.media-image img {
  width: 100%;
  height: auto;
  max-height: none;
}
.detail-media.media-video {
  width: 100%;
  aspect-ratio: 16 / 9;
}
.detail-media.media-video.is-portrait {
  max-width: 360px;
  max-height: 74vh;
  margin-left: auto;
  margin-right: auto;
}
.detail-media video {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
}
.detail-media.media-video.is-portrait video {
  height: 100%;
}
.detail-media iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  display: block;
}

.detail-media.media-yt-short,
.detail-media.media-tt-embed.is-portrait {
  width: 100%;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: 9 / 16;
  max-height: 74vh;
}
.detail-media.media-yt-short iframe,
.detail-media.media-tt-embed iframe {
  width: 100%;
  height: 100%;
}
.detail-media.media-yt-short iframe,
.detail-media.media-tt-embed.is-portrait iframe {
  aspect-ratio: 9 / 16;
}

.detail-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-meta a {
  color: #ffffff;
  text-decoration: underline;
}

.detail-posted {
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.detail-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.detail-delete-btn {
  margin-left: auto;
}

/* ── Modern Confirm Dialog ─────────────────────────────────── */
dialog.confirm-dialog {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow: visible;
}

dialog.confirm-dialog[open] {
  display: flex;
  justify-content: center;
  align-items: center;
}

dialog.confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.confirm-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 24px;
  width: 380px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
}

.confirm-msg {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.confirm-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-box.folder-modal {
  width: 420px;
  max-width: 94vw;
}

.confirm-box.cache-modal {
  width: 460px;
  max-width: 94vw;
}

.cache-manage-list {
  max-height: 300px;
}

.cache-row-thumb {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.cache-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cache-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.cache-row-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-feature-settings: "tnum";
}

.cache-row-unused {
  color: #fbbf24;
}

.cache-manage-actions {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.cache-manage-bulk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cache-manage-bulk button[hidden] {
  display: none;
}

.folder-input {
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 18px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: all 0.14s;
}
.folder-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: rgba(255, 255, 255, 0.5);
  background: var(--bg-surface);
}

.folder-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 18px;
}

.folder-picker-empty {
  padding: 14px 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  background: var(--bg-input);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
}

.folder-picker-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  transition: border-color 0.12s, background 0.12s;
}
.folder-picker-row:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.folder-picker-pick {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.folder-picker-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.folder-row-icon {
  flex: none;
  color: var(--text-muted);
  transition: color 0.12s;
}

.folder-picker-pick:hover .folder-row-icon {
  color: var(--accent);
}

.folder-picker-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-picker-meta {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.folder-picker-meta.in-folder {
  color: #ffffff;
  font-weight: 600;
}

.folder-picker-delete,
.folder-picker-edit,
.folder-picker-move,
.folder-rename-cancel {
  flex: none;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
}

.folder-picker-edit:hover,
.folder-picker-move:hover:not(:disabled),
.folder-rename-cancel:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-subtle);
}

.folder-picker-move:disabled {
  opacity: 0.28;
  cursor: default;
}

.folder-picker-delete:hover {
  color: #fb7185;
  background: var(--danger-bg);
  border-color: rgba(244, 63, 94, 0.25);
}

.folder-picker-actions {
  justify-content: space-between;
}

.folder-manage-create {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.folder-manage-create .folder-input {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.folder-manage-create .btn-primary {
  flex-shrink: 0;
  padding: 9px 14px;
}

.folder-manage-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-left: 6px;
  border-left: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.folder-rename-form {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 2px;
}

.folder-rename-input {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  padding: 6px 10px;
}

.folder-rename-save {
  flex: none;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #090a0f;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.12s;
}
.folder-rename-save:hover {
  background: var(--accent-hover);
}

@media (pointer: coarse) {
  .folder-picker-delete,
  .folder-picker-edit,
  .folder-picker-move,
  .folder-rename-save,
  .folder-rename-cancel {
    min-width: 34px;
    min-height: 34px;
  }
}

/* ── Toast Notifications (Pure White Left Stripe) ──────────── */
.toasts {
  position: fixed;
  inset: auto 20px 20px auto;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  overflow: visible;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toasts[popover]:not(:popover-open) {
  display: none;
}

.toast {
  pointer-events: auto;
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-left: 3px solid #ffffff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.ok {
  border-left-color: #ffffff;
}
.toast.err {
  border-left-color: var(--danger);
}

/* ── Responsive Refinements ────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner,
  .tagbar {
    padding-left: 14px;
    padding-right: 14px;
  }
  .brand-name {
    display: none;
  }
  .search-wrap input,
  .search-wrap input:focus {
    width: 120px;
  }
  .header-sub {
    gap: 8px;
  }
  .header-top,
  .header-right {
    align-items: center;
  }
  .brand-icon {
    width: 36px;
    height: 36px;
  }
  .header-right,
  .search-wrap {
    height: 36px;
    min-height: 36px;
  }
  .search-wrap input,
  .search-wrap input:focus {
    display: block;
    box-sizing: border-box;
    height: 36px;
    min-height: 36px;
    font-size: 16px;
    line-height: 20px;
    padding-top: 0;
    padding-bottom: 0;
    -webkit-appearance: none;
    appearance: none;
  }
  .btn-header-add {
    height: 36px;
    min-height: 36px;
    box-sizing: border-box;
    padding-top: 0;
    padding-bottom: 0;
  }
  .header-right > .icon-btn {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    min-height: 36px;
    box-sizing: border-box;
  }
  .nav {
    flex: 1;
  }
  .nav-btn {
    padding: 7px 10px;
  }
  .header-tools {
    gap: 5px;
  }
  .search-kbd,
  .search-clear,
  .btn-header-add span {
    display: none;
  }
  .btn-header-add {
    padding: 7px 9px;
  }
  .main {
    padding: 12px 14px 50px;
  }
  .feed {
    gap: 12px;
  }
  .feed.list-view .post.has-media {
    flex-direction: column;
  }
  .feed.list-view .post.has-media .media-stack,
  .feed.list-view .post.has-media > .media-carousel,
  .feed.list-view .post.has-media > .media-block,
  .feed.list-view .post.has-media > .media-video-thumb {
    width: 100%;
    max-height: none;
  }
  .feed.list-view .post.has-media .media-carousel,
  .feed.list-view .post.has-media .carousel-track,
  .feed.list-view .post.has-media .carousel-slide {
    height: auto;
  }
  .feed.list-view .post.has-media .media-block:not(.media-video-thumb) img,
  .feed.list-view .post.has-media .media-block:not(.media-video-thumb) video {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
  }
  .feed.list-view .post.has-media .media-video-thumb { min-height: 0; }
  .feed.list-view .post.has-media .media-video-plain {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }
  .post-meta .post-time {
    margin-left: 0;
  }
  .post-meta .post-author + .post-time::before {
    content: "·";
    margin-right: 6px;
    color: var(--text-muted);
  }
  .post-actions {
    position: static;
    top: auto;
    right: auto;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    padding-left: 0;
    background: none;
    margin-left: auto;
    flex-shrink: 0;
  }
  .post-action-desktop {
    display: none;
  }
  .bulk-inner {
    padding: 8px 14px;
    flex-wrap: wrap;
    gap: 6px 10px;
  }
  .bulk-count {
    min-width: 0;
  }
  .bulk-actions {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .drawer {
    width: min(460px, 100vw);
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .drawer-body input,
  .drawer-body select,
  .drawer-body textarea,
  .folder-input {
    font-size: 16px;
  }
  dialog.detail-dialog,
  dialog.confirm-dialog {
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }
  .detail-panel {
    width: 100%;
    max-width: 100%;
    max-height: 94vh;
    max-height: 94dvh;
    padding: 18px;
    -webkit-overflow-scrolling: touch;
  }
  .toasts {
    inset: auto 12px max(12px, env(safe-area-inset-bottom)) 12px;
    width: auto;
  }
  .toast {
    max-width: 100%;
  }
}

@media (max-width: 520px) {
  .header-inner {
    padding-left: 10px;
    padding-right: 10px;
  }
  .header-top {
    height: 54px;
    gap: 8px;
  }
  .brand-group,
  .brand {
    gap: 6px;
  }
  .brand-icon {
    width: 36px;
    height: 36px;
  }
  .brand-badge {
    padding: 2px 5px;
  }
  .header-right {
    min-width: 0;
    flex: 1;
    gap: 6px;
    height: 36px;
  }
  .search-wrap {
    flex: 1;
    min-width: 0;
    height: 36px;
    min-height: 36px;
  }
  .search-wrap input,
  .search-wrap input:focus {
    width: 100%;
    min-width: 0;
    height: 36px;
    min-height: 36px;
    padding-right: 8px;
  }
  .btn-header-add {
    min-width: 34px;
    min-height: 36px;
    height: 36px;
    box-sizing: border-box;
    justify-content: center;
  }
  .header-right > .icon-btn {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    min-height: 36px;
    box-sizing: border-box;
  }
  .header-sub {
    height: 46px;
    gap: 4px;
  }
  .nav {
    gap: 0;
  }
  .nav-btn {
    padding: 7px 8px;
    gap: 4px;
    font-size: 11.5px;
  }
  .header-tools {
    gap: 4px;
  }
  .header-tools .icon-btn {
    width: 30px;
    height: 30px;
  }
  .main {
    padding: 10px 10px 40px;
  }
  .tagbar {
    padding: 10px 10px 0;
  }
  .feed,
  .feed-col {
    gap: 10px;
  }
  .post-copy {
    padding: 12px;
  }
  .drawer-head {
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .drawer-body {
    padding: 14px 16px;
    gap: 11px;
  }
  .drawer-actions {
    padding: 10px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  dialog.drawer.keyboard-open .drawer-head {
    padding: 10px 16px;
  }
  dialog.drawer.keyboard-open .drawer-body {
    padding: 12px 16px;
    gap: 10px;
  }
  dialog.drawer.keyboard-open .drawer-actions {
    padding: 9px 16px;
  }
  .detail-panel {
    padding: 14px;
  }
  .detail-top {
    position: sticky;
    top: -14px;
    z-index: 3;
    margin: -14px 0 16px;
    padding: 8px 0 6px;
    background: var(--bg-surface);
  }
  .detail-close-btn {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    margin-left: 0;
  }
  .detail-footer {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }
  .detail-footer button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 7px 4px;
    justify-content: center;
    font-size: 11.5px;
    white-space: nowrap;
  }
  .detail-footer .btn-primary {
    grid-column: 1 / -1;
    min-height: 44px;
  }
  .detail-delete-btn {
    margin-left: 0;
  }
  .detail-footer .btn-primary,
  .detail-footer .btn-ghost,
  .drawer-actions .btn-primary,
  .drawer-actions .btn-ghost {
    min-height: 38px;
  }
}

@media (max-width: 768px) {
  .brand-name {
    display: inline-block;
    max-width: 160px;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 240ms ease, opacity 180ms ease;
  }
  .mobile-search-toggle {
    display: inline-flex;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    min-height: 36px;
    box-sizing: border-box;
  }
  .header-right {
    flex: 0 0 auto;
    gap: 6px;
  }
  .header-right .search-wrap {
    display: flex;
    flex: 0 0 0;
    width: 0;
    min-width: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: flex-basis 280ms cubic-bezier(.2,.75,.25,1), width 280ms cubic-bezier(.2,.75,.25,1), opacity 180ms ease;
  }
  .header-top.search-expanded .brand {
    gap: 0;
  }
  .header-top.search-expanded .brand-name {
    max-width: 0;
    opacity: 0;
  }
  .header-top.search-expanded .header-right {
    flex: 1 1 auto;
    min-width: 0;
  }
  .header-top.search-expanded .search-wrap {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    opacity: 1;
    pointer-events: auto;
  }
  .header-top.search-expanded .mobile-search-toggle {
    display: none;
  }
  .header-top.search-expanded .mobile-search-close {
    position: absolute;
    top: 50%;
    right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    color: var(--text-muted);
    background: transparent;
    transform: translateY(-50%);
  }
  .header-top.search-expanded .mobile-search-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,.08);
  }
  .header-top.search-expanded .search-wrap input,
  .header-top.search-expanded .search-wrap input:focus {
    width: 100%;
    min-width: 0;
    padding-right: 38px;
  }
}

/* Mobile grid is a media-only gallery; mobile list stays a readable stack. */
@media (max-width: 719px) {
  .feed.mobile-grid-view {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 6px;
  }
  .feed.mobile-grid-view > .post:not(.has-media) {
    display: none;
  }
  .feed.mobile-grid-view > .post.has-media {
    min-width: 0;
    border-radius: 5px;
    align-self: start;
    aspect-ratio: 1 / 1;
    overflow: hidden;
  }
  .feed.mobile-grid-view > .post.has-media > .post-copy {
    display: none;
  }
  .feed.mobile-grid-view > .post.has-media > .media-stack,
  .feed.mobile-grid-view > .post.has-media > .media-carousel,
  .feed.mobile-grid-view > .post.has-media > .media-block,
  .feed.mobile-grid-view > .post.has-media > .media-video-thumb {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1 !important;
    min-height: 0;
  }
  .feed.mobile-grid-view .media-carousel,
  .feed.mobile-grid-view .carousel-track,
  .feed.mobile-grid-view .carousel-slide,
  .feed.mobile-grid-view .carousel-slide .media-block,
  .feed.mobile-grid-view .carousel-slide .media-video-thumb,
  .feed.mobile-grid-view .media-block {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1 !important;
    min-height: 0;
  }
  .feed.mobile-grid-view .media-block.media-embed {
    padding-bottom: 0;
  }
  .feed.mobile-grid-view .media-block.media-image img,
  .feed.mobile-grid-view .media-video-thumb img,
  .feed.mobile-grid-view .media-video-thumb video:not(.media-warm-hidden),
  .feed.mobile-grid-view .media-block.media-video video {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    object-position: center;
  }
  .feed.mobile-grid-view .media-block.media-article {
    height: 100%;
  }
  .feed.mobile-grid-view .media-article-thumb,
  .feed.mobile-grid-view .media-article-thumb img {
    width: 100%;
    height: 100%;
  }
  .feed.mobile-grid-view .media-article-thumb img {
    object-fit: cover;
  }
  .feed.mobile-grid-view .media-article-info,
  .feed.mobile-grid-view .post-actions,
  .feed.mobile-grid-view .media-outlink-btn,
  .feed.mobile-grid-view .ig-ext-tip {
    display: none;
  }
  .feed.mobile-grid-view .media-play-btn {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 768px) {
  .bulk-bar {
    position: sticky;
    top: 100px;
    background: rgba(16, 18, 26, 0.96);
    border-bottom: 1px solid var(--border-subtle);
  }
  .bulk-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px 8px;
    padding: 6px 12px 7px;
  }
  .bulk-count {
    min-width: 0;
    font-size: 11.5px;
  }
  .bulk-inner > #bulkCancel {
    grid-column: 2;
    grid-row: 1;
    min-height: 24px;
    padding: 2px 10px;
    font-size: 11px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
  }
  .bulk-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.12fr) minmax(0, 1.32fr) minmax(0, 0.85fr) minmax(0, 0.85fr);
    gap: 4px;
    min-width: 0;
    overflow: hidden;
    padding: 0;
  }
  .bulk-actions > button {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 4px 2px !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    line-height: 1.1;
    overflow: hidden;
    white-space: nowrap;
  }
  .bulk-actions > button span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .bulk-actions > button svg {
    width: 13px;
    height: 13px;
  }
}

@media (max-width: 520px) {
  .bulk-bar {
    top: 101px;
  }
  .bulk-inner {
    padding: 5px 10px 6px;
  }
}

@media (max-width: 390px) {
  .bulk-actions > button {
    font-size: 9.5px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .drawer-body input,
  .drawer-body select,
  .drawer-body textarea,
  .folder-input {
    font-size: 16px;
  }
}
