/* ═══════════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════════ */
:root {
  --bg: #0f0f11;
  --surface: #18181c;
  --surface2: #222228;
  --border: #2e2e38;
  --text: #e8e8f0;
  --text2: #8888a0;
  --accent: #e8c547;
  --accent2: #5e8bff;
  --tag-bg: #1e2a4a;
  --tag-text: #7aabff;
  --danger: #ff5e6c;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,.45);
  --font-ui: 'DM Sans', sans-serif;
  --font-display: 'Syne', sans-serif;
  --sidebar-w: 220px;
  --inspector-w: 320px;
}
[data-theme="light"] {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface2: #ededea;
  --border: #ddddd8;
  --text: #111118;
  --text2: #666670;
  --tag-bg: #dce8ff;
  --tag-text: #2255bb;
  --shadow: 0 2px 12px rgba(0,0,0,.1);
}

/* ═══════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  display: flex;
  height: 100vh;
  overflow: hidden;
}
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea { font-family: inherit; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }

/* ═══════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════ */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  z-index: 10;
  transition: width .22s ease, min-width .22s ease;
}
#sidebar::-webkit-scrollbar { width: 0; }
#sidebar.collapsed { width: 52px; min-width: 52px; overflow: hidden; }
#sidebar.collapsed .nav-section,
#sidebar.collapsed .sidebar-bottom,
#sidebar.collapsed #tag-filter-mode-bar,
#sidebar.collapsed .coll-add-btn { display: none; }
#sidebar-nav-scroll {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#sidebar-nav-scroll::-webkit-scrollbar { width: 3px; }
#sidebar-nav-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.sidebar-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  padding: 20px 18px 16px;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
  flex-shrink: 0;
}
.sidebar-logo:hover { background: var(--surface2); }
.sidebar-logo svg { width: 22px; height: 22px; flex-shrink: 0; transition: transform .3s ease; }
.sidebar-logo .logo-text { transition: opacity .2s, width .2s; overflow: hidden; white-space: nowrap; }
#sidebar.collapsed .sidebar-logo .logo-text { opacity: 0; width: 0; }
#sidebar.collapsed .sidebar-logo svg { transform: scaleX(-1); }
.nav-section { padding: 12px 0; border-bottom: 1px solid var(--border); }
/* Library section scrollable after 8 items */
.nav-section.library-section .nav-items-wrap {
  max-height: calc(8 * 38px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.nav-section.library-section .nav-items-wrap::-webkit-scrollbar { width: 3px; }
.nav-section.library-section .nav-items-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.nav-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text2);
  padding: 0 18px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  font-size: 0.9rem;
  color: var(--text2);
  cursor: pointer;
  transition: background .15s, color .15s;
  border-radius: 0;
  user-select: none;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--surface2); color: var(--accent); font-weight: 500; }
.nav-item .count {
  margin-left: auto;
  font-size: 0.75rem;
  background: var(--surface2);
  color: var(--text2);
  padding: 1px 7px;
  border-radius: 20px;
}
.nav-item svg { width: 16px; height: 16px; opacity: .7; flex-shrink: 0; }
.sidebar-bottom {
  margin-top: 0;
  flex-shrink: 0;
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.sidebar-bottom .sidebar-action { flex: 1; }

/* Dark mode sidebar toggle */
.sidebar-dark-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text2);
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.sidebar-dark-toggle:hover { background: var(--surface2); color: var(--text); }
.sidebar-dark-icon { pointer-events: none; }
.sidebar-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text2);
  transition: background .15s, color .15s;
  cursor: pointer;
}
.sidebar-action:hover { background: var(--surface2); color: var(--text); }
.sidebar-action svg { width: 15px; height: 15px; }

/* ═══════════════════════════════════════════════════════
   MAIN
═══════════════════════════════════════════════════════ */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
#topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
  position: relative;
}
.topbar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.search-wrap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 360px;
  max-width: 40%;
  z-index: 1;
  display: flex;
  align-items: center;
}
.search-wrap svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--text2); pointer-events: none; }
#search-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px 8px 34px;
  font-size: 0.875rem;
  color: var(--text);
  transition: border-color .2s;
}
#search-input:focus { outline: none; border-color: var(--accent); }
#search-input::placeholder { color: var(--text2); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all .15s;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #0f0f11; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text2); }
.btn svg { width: 14px; height: 14px; }
.kbd {
  font-size: 0.7rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: monospace;
  color: var(--text2);
}

/* ═══════════════════════════════════════════════════════
   FILTER BAR
═══════════════════════════════════════════════════════ */
#filterbar {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  overflow-x: auto;
  align-items: center;
}
#filterbar::-webkit-scrollbar { height: 0; }
.filter-chip {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  flex-shrink: 0;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #0f0f11; font-weight: 500; }
.filter-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
#sort-select {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.8rem;
  color: var(--text2);
  margin-left: auto;
  cursor: pointer;
}
#sort-select option { background: var(--surface); }

/* View toggle */
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
}
.view-toggle-btn {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.view-toggle-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }

/* Sidebar tags list */
.sidebar-tags-list {
  padding: 0 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-tag-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--text2);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.sidebar-tag-item:hover { background: var(--surface2); color: var(--tag-text); }
.sidebar-tag-item .stag-count { font-size: 0.7rem; opacity: .6; }

/* Tag suggestions dropdown */
.tag-suggestions {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 50;
  max-height: 160px;
  overflow-y: auto;
  margin-top: 2px;
}
.tag-suggestion-item {
  padding: 7px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text2);
  transition: background .1s;
}
.tag-suggestion-item:hover, .tag-suggestion-item.focused { background: var(--surface2); color: var(--tag-text); }
.tag-input-container {
  position: relative;
}



/* Inspector copy-link btn */
.insp-copy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 4px;
  color: var(--text2);
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.insp-copy-btn:hover { background: var(--surface2); color: var(--accent); }
.insp-copy-btn svg { width: 12px; height: 12px; }
.insp-url-row { display: flex; align-items: flex-start; gap: 2px; }

/* Disabled view toggle */
.view-toggle-btn.disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Native tweet card (card view) */
.native-tweet {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: var(--surface);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  width: 100%;
}
.native-tweet.dark {
  background: #16202a;
  border-color: #37444c;
  color: #e7e9ea;
}
.native-tweet.light {
  background: #ffffff;
  border-color: #cfd9de;
  color: #0f1419;
}
.native-tweet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.native-tweet-author {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.native-tweet-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface2);
  flex-shrink: 0;
}
.native-tweet-names { display: flex; flex-direction: column; gap: 0; }
.native-tweet-name { font-weight: 700; font-size: 0.95rem; }
.native-tweet-handle { font-size: 0.82rem; opacity: .6; }
.native-tweet.dark .native-tweet-name { color: #e7e9ea; }
.native-tweet.light .native-tweet-name { color: #0f1419; }
.native-tweet-text {
  font-size: 1.05rem;
  line-height: 1.55;
  margin-bottom: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}
.native-tweet.dark .native-tweet-text { color: #e7e9ea; }
.native-tweet.light .native-tweet-text { color: #0f1419; }
.native-tweet-image {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 10px;
  object-fit: cover;
  max-height: 300px;
  border: 1px solid var(--border);
}

/* ── Instagram card specifics ─────────────────────────── */
.ig-avatar-ring {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fd5949 0%, #d6249f 50%, #285AEB 100%);
  padding: 2.5px;
  flex-shrink: 0;
}
.ig-avatar-img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--surface);
}
/* Full-size post image — no height cap, show complete photo */
.ig-full-img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: unset;
  border-radius: 8px;
  margin-bottom: 10px;
  display: block;
  border: 1px solid var(--border);
}
/* Caption truncation + expand */
.ig-caption {
  font-size: .88rem;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  margin-bottom: 4px;
}
.ig-ellipsis { color: var(--text2); }
.ig-expand-btn {
  background: none;
  border: none;
  padding: 2px 0 6px;
  font-size: .78rem;
  color: var(--text2);
  cursor: pointer;
  display: block;
}
.ig-expand-btn:hover { color: var(--text); }
/* Likes / comments / date row */
.ig-stats-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 7px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  margin-bottom: 2px;
}
.ig-stat { font-size: .78rem; color: var(--text2); }
.ig-stat strong { color: var(--text); font-weight: 700; }
.ig-date { margin-left: auto; font-size: .73rem; opacity: .75; }

/* ── Instagram card specifics ─────────────────────────── */
.ig-avatar-ring {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fd5949 0%, #d6249f 50%, #285AEB 100%);
  padding: 2.5px;
  flex-shrink: 0;
}
.ig-avatar-img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--surface);
}
.ig-stats-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 7px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  margin-bottom: 2px;
}
.ig-stat { font-size: .78rem; color: var(--text2); }
.ig-stat strong { color: var(--text); font-weight: 700; }
.ig-date { margin-left: auto; font-size: .73rem; opacity: .75; }

/* Multi-image grid for Bluesky posts */
.bsky-images-grid {
  display: grid;
  gap: 3px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.bsky-images-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bsky-images-1 { grid-template-columns: 1fr; }
.bsky-images-1 img { max-height: 300px; }
.bsky-images-2 { grid-template-columns: 1fr 1fr; }
.bsky-images-2 img { height: 180px; }
.bsky-images-3 { grid-template-columns: 1fr 1fr; }
.bsky-images-3 img { height: 160px; }
.bsky-images-3 img:first-child { grid-column: 1 / -1; height: 200px; }
.bsky-images-4 { grid-template-columns: 1fr 1fr; }
.bsky-images-4 img { height: 160px; }

/* Bluesky article / external link embed card */
.bsky-article-card {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  background: var(--surface2);
  transition: opacity 0.15s, background 0.15s;
}
.bsky-article-card:hover { opacity: 0.85; }
.native-tweet.dark .bsky-article-card { background: rgba(255,255,255,.04); }
.native-tweet.light .bsky-article-card { background: rgba(0,0,0,.03); }
.bsky-article-thumb {
  width: 90px;
  min-width: 90px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.bsky-article-info {
  padding: 9px 11px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.bsky-article-title {
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.native-tweet.dark .bsky-article-title { color: #e7e9ea; }
.native-tweet.light .bsky-article-title { color: #0f1419; }
.bsky-article-desc {
  font-size: 0.74rem;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.native-tweet.dark .bsky-article-desc { color: #8b98a5; }
.native-tweet.light .bsky-article-desc { color: #536471; }
.bsky-article-domain {
  font-size: 0.7rem;
  margin-top: 2px;
}
.native-tweet.dark .bsky-article-domain { color: #6e7a85; }
.native-tweet.light .bsky-article-domain { color: #8899a6; }
.native-tweet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  margin-top: 6px;
}
.native-tweet.dark .native-tweet-footer { color: #71767b; }
.native-tweet.light .native-tweet-footer { color: #536471; }
.native-tweet-link {
  font-size: 0.78rem;
  color: #1d9bf0;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.native-tweet-link:hover { text-decoration: underline; }

/* Tweet embed view */
.tweet-embed-wrapper {
  max-width: 100%;
  overflow: hidden;
}
.tweet-embed-wrapper .twitter-tweet { margin: 0 !important; }


/* Progress bar in modal */
.save-progress {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text2);
}
.save-progress.visible { display: flex; }

/* Data folder info modal */
.info-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 150;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.info-modal-overlay.open { opacity: 1; pointer-events: auto; }
.info-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 16px 60px rgba(0,0,0,.5);
}
.info-modal h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.info-modal p { font-size: 0.875rem; color: var(--text2); line-height: 1.6; margin-bottom: 10px; }
.info-modal code { background: var(--surface2); padding: 2px 6px; border-radius: 4px; font-size: 0.8rem; color: var(--accent); }
.info-modal .modal-footer { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════
   CONTENT AREA + GRID
═══════════════════════════════════════════════════════ */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
/* Forgotten view grid — uses Masonry, mirrors #card-grid sizing */
#card-grid-forgotten {
  position: relative;
  padding-bottom: 24px;
}
#card-grid-forgotten .grid-sizer,
#card-grid-forgotten .card {
  width: calc(33.333% - 11px);
  margin-bottom: 16px;
}
@media (min-width: 1320px) {
  #card-grid-forgotten .grid-sizer,
  #card-grid-forgotten .card { width: calc(25% - 12px); }
}
@media (max-width: 820px) {
  #card-grid-forgotten .grid-sizer,
  #card-grid-forgotten .card { width: calc(50% - 8px); }
}
@media (max-width: 520px) {
  #card-grid-forgotten .grid-sizer,
  #card-grid-forgotten .card { width: 100%; }
}
#card-grid-forgotten .card { cursor: pointer; }
#card-grid-forgotten .card:hover { box-shadow: 0 0 0 2px var(--accent); }

#card-grid {
  position: relative; /* required for Masonry absolute positioning */
  /* Top/bottom breathing room */
  padding-bottom: 24px;
}
/* Masonry column sizer + card widths
   Sidebar ≈ 220px, inspector ≈ 320px.
   We target 4 columns on wide viewports, 3 otherwise.
   Gutter = 16px; n cols need (n-1) gutters distributed.
   4-col: each = 25% - 12px   (3 × 16 / 4 = 12)
   3-col: each = 33.333% - 11px (2 × 16 / 3 ≈ 11)
   2-col: each = 50% - 8px
   1-col: 100%
*/
.grid-sizer,
#card-grid:not(.list-view) .card {
  width: calc(33.333% - 11px);  /* 3 columns — default */
}
/* 4 columns on genuinely wide viewports (content > ~1100px, i.e. viewport > 1320px with sidebar) */
@media (min-width: 1320px) {
  .grid-sizer,
  #card-grid:not(.list-view) .card { width: calc(25% - 12px); }
}
/* 2 columns on mid-small viewports */
@media (max-width: 820px) {
  .grid-sizer,
  #card-grid:not(.list-view) .card { width: calc(50% - 8px); }
}
/* 1 column on tiny viewports */
@media (max-width: 520px) {
  .grid-sizer,
  #card-grid:not(.list-view) .card { width: 100%; }
}
/* Vertical gutter — Masonry only handles horizontal, add margin-bottom for vertical space */
#card-grid:not(.list-view) .card {
  margin-bottom: 16px;
}
/* List view stays as stacked flex */
#card-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  gap: 12px;
  color: var(--text2);
  text-align: center;
}
.empty-state svg { width: 48px; height: 48px; opacity: .3; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.2rem; }
.empty-state p { font-size: 0.875rem; max-width: 280px; }

/* ═══════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color .2s, transform .15s, box-shadow .2s,
              left .28s cubic-bezier(.4,0,.2,1), top .28s cubic-bezier(.4,0,.2,1);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 140px;
}
.card:hover { border-color: var(--accent2); box-shadow: var(--shadow); transform: translateY(-1px); }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(232,197,71,.2); }
.card-content { flex: 1; }
.card-type-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  z-index: 1;
}
.badge-link { background: rgba(94,139,255,.15); color: var(--accent2); }
.badge-tweet { background: rgba(29,161,242,.15); color: #1da1f2; }
.badge-yt { background: rgba(255,70,70,.15); color: #ff4444; }
.badge-insta { background: rgba(225,48,108,.15); color: #e1306c; }
.badge-pin { background: rgba(230,0,35,.15); color: #e60023; }
.badge-reddit { background: rgba(255,69,0,.15); color: #ff4500; }
.badge-bsky { background: rgba(0,133,255,.15); color: #0085ff; }
.badge-tiktok { background: rgba(0,0,0,.12); color: #69c9d0; }
[data-theme="light"] .badge-tiktok { background: rgba(105,201,208,.15); color: #010101; }
.badge-twitch { background: rgba(145,70,255,.15); color: #9146ff; }
.badge-canva { background: rgba(0,196,204,.15); color: #00c4cc; }
.badge-behance { background: rgba(0,87,255,.15); color: #0057ff; }
.badge-google { background: rgba(66,133,244,.15); color: #4285f4; }
/* Google Suite specific badges */
.badge-gdocs   { background: rgba(66,133,244,.15); color: #4285f4; }
.badge-gsheets { background: rgba(15,157,88,.15);  color: #0f9d58; }
.badge-gslides { background: rgba(244,180,0,.15);  color: #c8950a; }
.badge-gmaps   { background: rgba(219,68,55,.15);  color: #db4437; }
/* Scale down font for long badge text (7+ chars) to prevent overflow */
.card-type-badge { contain: layout; }
.list-card .card-type-badge { font-size: .6rem; }
/* If badge text is long (set via JS class), use smaller font */
.badge-text-long { font-size: .52rem !important; letter-spacing: .02em; }
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  padding-right: 60px;
}
.card-favicon {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 2px;
  object-fit: contain;
}
.card-favicon-fallback {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--text2);
  flex-shrink: 0;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
}
.card-url {
  font-size: 0.78rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}
.card-notes {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.45;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.tag {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 4px;
  cursor: pointer;
  transition: filter .15s;
}
.tag:hover { filter: brightness(1.2); }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text2);
  margin-top: auto;
  padding-top: 6px;
  position: relative;
  z-index: 2;
}
.card-meta { display: flex; gap: 10px; align-items: center; }
.card-meta svg { width: 12px; height: 12px; }
.card-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.card:hover .card-actions { opacity: 1; }
.card-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--text2);
  transition: background .15s, color .15s;
}
.card-btn:hover { background: var(--surface2); color: var(--text); }
.card-btn svg { width: 13px; height: 13px; }

/* Tweet card special styles */
.tweet-card { border-left: 3px solid #1da1f2; }
.tweet-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.tweet-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  object-fit: cover;
  flex-shrink: 0;
}
.tweet-author-name { font-weight: 600; font-size: 0.875rem; }
.tweet-author-handle { font-size: 0.78rem; color: var(--text2); }
.tweet-text { font-size: 0.9rem; line-height: 1.5; margin-bottom: 8px; }

/* YouTube card styles */
.yt-card { border-left: 3px solid #ff4444; }
.yt-channel-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-right: 55px;
}
.yt-channel-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface2);
  flex-shrink: 0;
}
.yt-channel-name { font-weight: 600; font-size: 0.85rem; }
.yt-card .yt-channel-name,
.yt-card .yt-video-title,
.playlist-card .yt-channel-name,
.playlist-card .yt-video-title { font-family: 'Roboto', sans-serif; }
[data-theme="dark"] .yt-card .yt-video-title,
[data-theme="dark"] .playlist-card .yt-video-title { color: #fff; }
.yt-thumbnail {
  width: 100%;
  border-radius: 7px;
  aspect-ratio: 16/9;
  object-fit: cover;
  margin-bottom: 8px;
  background: var(--surface2);
}
.yt-video-title {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* YT Channel page style (native YouTube channel look) */
.yt-channel-page {
  width: 100%;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
}
.yt-channel-page-banner {
  width: 100%;
  height: 72px;
  background: linear-gradient(135deg, #282828 0%, #1a1a1a 100%);
  border-radius: 8px 8px 0 0;
  display: block;
  object-fit: cover;
}
[data-theme="light"] .yt-channel-page-banner {
  background: linear-gradient(135deg, #e0e0e0 0%, #c8c8c8 100%);
}
.yt-channel-wrap {
  position: relative;
}
.yt-channel-page-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  background: var(--surface2);
  position: absolute;
  top: 44px;
  left: 14px;
  z-index: 2;
  flex-shrink: 0;
}
.yt-channel-page-info {
  padding: 30px 14px 12px;
}
.yt-channel-page-name {
  font-weight: 700;
  font-size: 1rem;
  font-family: 'Roboto', sans-serif;
}
.yt-channel-page-handle {
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: 2px;
  font-family: 'Roboto', sans-serif;
}

/* ── Enhanced YT Channel card ── */
.yt-channel-card-wrap {
  position: relative;
  margin: -14px -14px 0;
}
.yt-channel-card-art {
  position: relative;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  background: #1a1a1a;
}
.yt-channel-card-banner {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
}
.yt-channel-card-banner-placeholder {
  width: 100%;
  height: 80px;
  background: linear-gradient(135deg, #282828 0%, #1a1a1a 100%);
}
[data-theme="light"] .yt-channel-card-banner-placeholder {
  background: linear-gradient(135deg, #e0e0e0 0%, #c8c8c8 100%);
}
.yt-channel-card-avatar {
  position: absolute;
  top: 56px;
  left: 14px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  background: var(--surface2);
  z-index: 2;
}
.yt-channel-card-info {
  padding: 28px 12px 8px;
  position: relative;
}
.yt-channel-stats {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* YT Channel embed mode wrap */
.yt-channel-wrap {
  position: relative;
}
.yt-channel-page-info {
  padding: 28px 14px 12px;
}

/* Progress bar animation */
@keyframes progress-pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}
#modal-preview-bar-wrap { animation: none; }
#modal-preview-bar:not([style*="100%"]):not([style*="0%"]) {
  animation: progress-pulse 1.5s ease-in-out infinite;
}
.yt-channel-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--text2);
}
.yt-channel-stat svg { flex-shrink: 0; opacity: 0.7; }

/* ── Google Suite card ── */
.google-doc-card {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.google-doc-thumb-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  margin: 0 0 8px;
  background: var(--surface2);
  aspect-ratio: 4/3;
  max-height: 160px;
}
.google-doc-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.google-doc-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  border-radius: inherit;
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
}
.google-doc-thumb-overlay:hover {
  background: rgba(0,0,0,.5);
  opacity: 1;
}
.google-doc-thumb-icon { font-size: 1.4rem; }
.google-doc-open-label { font-size: .75rem; letter-spacing: 0.02em; }
.google-doc-no-thumb {
  border-radius: 8px;
  margin-bottom: 8px;
}
.google-doc-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.google-doc-title {
  flex: 1;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.google-doc-type-badge {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid;
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
  text-transform: uppercase;
}

/* ── Google Maps card ── */
.google-card-maps {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 10px;
}
.google-card-maps-icon { font-size: 1.8rem; flex-shrink: 0; }
.google-card-maps-info { flex: 1; min-width: 0; }
.google-card-maps-place {
  font-weight: 700;
  font-size: .95rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.google-card-maps-label {
  font-size: .74rem;
  margin-top: 2px;
  font-weight: 600;
}

/* YouTube video viewer modal */
#yt-viewer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
#yt-viewer-overlay.open { opacity: 1; pointer-events: auto; }
#yt-viewer-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  max-width: 880px;
  box-shadow: 0 32px 80px rgba(0,0,0,.7);
  display: flex;
  flex-direction: column;
}
#yt-viewer-iframe-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}
#yt-viewer-iframe-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
}
#yt-viewer-info {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
#yt-viewer-info h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}
#yt-viewer-info .yt-viewer-channel {
  font-size: 0.82rem;
  color: var(--text2);
}
#yt-viewer-actions {
  padding: 12px 20px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
#yt-viewer-close-btn {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  background: rgba(0,0,0,.6);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 18px;
  cursor: pointer;
  z-index: 5;
  transition: background .15s;
}
#yt-viewer-close-btn:hover { background: rgba(255,70,70,.8); }

/* ── SHORT-FORM VIDEO OVERLAY (TikTok, Reels, Shorts) ── */
.badge-hidden { display: none !important; }

/* ── SHORT-FORM VIDEO VIEWER ── */
#short-viewer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(20px);
  z-index: 112;
  display: flex;
  align-items: stretch;
  justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
#short-viewer-overlay.open { opacity: 1; pointer-events: auto; }

/* Close button - hidden (close by clicking backdrop or Esc) */
#short-viewer-close { display: none; }

/* Main split layout: video left, info panel right */
#short-viewer-container {
  display: flex;
  width: 100%;
  max-width: 900px;
  margin: auto;
  padding: 0 24px;
  gap: 32px;
  align-items: center;
}

/* Video panel */
#short-viewer-phone {
  flex: 0 0 auto;
  width: min(360px, 42vw);
  aspect-ratio: 9/16;
  max-height: 85vh;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.07);
  position: relative;
}
#short-viewer-phone iframe {
  width: 100%;
  height: 100%; border: none;
}
/* YT Shorts iframe has a scrollbar offset — compensate by extending width and shifting left */
#short-viewer-phone[data-platform="yt-shorts"] iframe {
  width: calc(100% + 20px);
  margin-left: -10px;
}

/* Info + controls panel */
#short-viewer-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: white;
  min-width: 0;
}

/* Counter + nav row */
#short-viewer-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
#short-viewer-counter {
  font-size: .75rem;
  opacity: .5;
  font-variant-numeric: tabular-nums;
  min-width: 40px;
}

.short-nav-btn {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s, transform .1s;
  color: white;
}
.short-nav-btn:hover { background: rgba(255,255,255,.22); transform: scale(1.05); }
.short-nav-btn svg { width: 18px; height: 18px; }

#short-viewer-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.01em;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: rgba(255,255,255,.95);
}
#short-viewer-author {
  font-size: .82rem;
  color: rgba(255,255,255,.6);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#short-viewer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.short-action-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  color: rgba(255,255,255,.9);
  font-size: .78rem;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  letter-spacing: .01em;
}
.short-action-btn:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.3); }

@media (max-width: 640px) {
  #short-viewer-container { flex-direction: column; padding: 16px; gap: 16px; }
  #short-viewer-phone { width: 100%; max-height: 55vh; }
  #short-viewer-info { width: 100%; }
}

/* Most visited grid - compact responsive sizing */
.most-visited-grid .card { font-size: .82rem; }
.most-visited-grid .og-image, .most-visited-grid .yt-thumbnail { max-height: 120px; }
@media (max-width: 900px) {
  .most-visited-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 600px) {
  .most-visited-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ── GENERIC MEDIA VIEWER OVERLAY (Twitch, Canva, Google) ── */
#media-viewer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  z-index: 111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
#media-viewer-overlay.open { opacity: 1; pointer-events: auto; }
#media-viewer-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  max-width: 960px;
  box-shadow: 0 32px 80px rgba(0,0,0,.7);
  display: flex;
  flex-direction: column;
}
#media-viewer-iframe-wrap {
  position: relative;
  width: 100%;
  background: #000;
}
#media-viewer-iframe-wrap.aspect-16-9 { aspect-ratio: 16/9; }
#media-viewer-iframe-wrap.aspect-4-3 { aspect-ratio: 4/3; }
#media-viewer-iframe-wrap.aspect-tall { aspect-ratio: 3/4; max-height: 70vh; }
#media-viewer-iframe-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
}
#media-viewer-info {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
#media-viewer-title {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#media-viewer-close {
  position: fixed;
  top: 20px; right: 20px;
  width: 36px; height: 36px;
  background: rgba(0,0,0,.6);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 18px;
  cursor: pointer;
  z-index: 5;
  transition: background .15s;
}
#media-viewer-close:hover { background: rgba(255,255,255,.2); }
#media-viewer-actions {
  padding: 12px 20px;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── PLATFORM-SPECIFIC CARD STYLES ── */
.tiktok-card { border-left: 3px solid #69c9d0; }
.insta-card { border-left: 3px solid #e1306c; }
.twitch-card { border-left: 3px solid #9146ff; }
.canva-card { border-left: 3px solid #00c4cc; }
.behance-card { border-left: 3px solid #0057ff; }
.reddit-card { border-left: 3px solid #ff4500; }
.bluesky-card { border-left: 3px solid #0085ff; }
/* Native Reddit card */
.native-reddit {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  width: 100%;
}
.native-reddit.dark { background: #0d1117; border-color: #30363d; color: #e6edf3; }
.native-reddit.light { background: #ffffff; border-color: #d0d7de; color: #24292f; }
.native-reddit-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.native-reddit-sub {
  display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit;
}
.native-reddit-icon {
  width: 32px; height: 32px; border-radius: 50%; background: #ff4500;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.native-reddit-icon svg { width: 20px; height: 20px; }
.native-reddit-sub-info { display: flex; flex-direction: column; }
.native-reddit-subname { font-weight: 700; font-size: .88rem; }
.native-reddit.dark .native-reddit-subname { color: #e6edf3; }
.native-reddit.light .native-reddit-subname { color: #24292f; }
.native-reddit-poster { font-size: .72rem; opacity: .55; }
.native-reddit-title {
  font-size: .95rem; font-weight: 600; line-height: 1.4; margin-bottom: 10px; word-break: break-word;
}
.native-reddit.dark .native-reddit-title { color: #e6edf3; }
.native-reddit.light .native-reddit-title { color: #24292f; }
.native-reddit-image {
  width: 100%; border-radius: 8px; margin-bottom: 10px; object-fit: cover;
  max-height: 280px; border: 1px solid var(--border);
}
.native-reddit-footer {
  display: flex; align-items: center; justify-content: space-between; font-size: .75rem; margin-top: 4px;
}
.native-reddit.dark .native-reddit-footer { color: #8b949e; }
.native-reddit.light .native-reddit-footer { color: #57606a; }
.native-reddit-link {
  font-size: .75rem; color: #ff4500; text-decoration: none;
  display: flex; align-items: center; gap: 4px;
}
.native-reddit-link:hover { text-decoration: underline; }
.pinterest-card { border-left: 3px solid #e60023; }
.google-card { border-left: 3px solid #4285f4; }
.platform-thumbnail {
  width: 100%;
  border-radius: 7px;
  aspect-ratio: 16/9;
  object-fit: cover;
  margin-bottom: 8px;
  background: var(--surface2);
}
.platform-thumbnail-reel {
  width: 100%;
  border-radius: 7px;
  aspect-ratio: 9/16;
  object-fit: cover;
  margin-bottom: 8px;
  background: var(--surface2);
  max-height: 300px;
}
.platform-card-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-right: 55px;
}
.platform-card-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface2);
  flex-shrink: 0;
}
.platform-card-name { font-weight: 600; font-size: .85rem; }
.platform-card-title {
  font-size: .82rem;
  color: var(--text2);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Play overlay for short-form thumbnails */
.short-thumb-wrap {
  position: relative;
  width: 100%;
  cursor: pointer;
}
.short-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.25);
  border-radius: 7px;
  transition: background .15s;
}
.short-thumb-play:hover { background: rgba(0,0,0,.4); }
.short-thumb-play svg { width: 40px; height: 40px; color: white; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
/* Behance native card */
.behance-native {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.behance-native img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.behance-native-body { padding: 10px 12px; }
.behance-native-title { font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
.behance-native-meta { font-size: .75rem; color: var(--text2); display: flex; align-items: center; gap: 4px; }
/* Twitch card click overlay cue */
.twitch-click-cue {
  width: 100%;
  aspect-ratio: 16/9;
  background: #18181b;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: background .15s;
  margin-bottom: 8px;
}
.twitch-click-cue:hover { background: #222226; }
.twitch-click-cue svg { width: 40px; height: 40px; color: #9146ff; }
.twitch-click-cue span { font-size: .78rem; color: #9146ff; font-weight: 500; }
/* Canva/Google click overlay */
.media-click-cue {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--surface2);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: background .15s;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.media-click-cue:hover { border-color: var(--accent2); }
.media-click-cue.media-click-cue-sm { aspect-ratio: unset; padding: 12px 8px; min-height: 60px; }
.media-click-cue.media-click-cue-sm .cue-icon { font-size: 1.4rem; }
.media-click-cue.media-click-cue-sm span { font-size: .72rem; }
.media-click-cue .cue-icon { font-size: 2rem; }
.media-click-cue span { font-size: .78rem; color: var(--text2); font-weight: 500; }

/* Highlight */
mark { background: rgba(232,197,71,.25); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ═══════════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  transform: translateY(12px);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--text2);
  transition: background .15s;
}
.modal-close:hover { background: var(--surface2); }
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 6px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.form-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color .2s;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input::placeholder { color: var(--text2); }
textarea.form-input { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }
.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  min-height: 44px;
  cursor: text;
  transition: border-color .2s;
}
.tag-input-wrap:focus-within { border-color: var(--accent); }
.tag-input-wrap .tag { cursor: default; }
.tag-input-wrap .tag-remove {
  margin-left: 3px;
  color: var(--tag-text);
  opacity: .6;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.tag-input-inner {
  border: none;
  background: transparent;
  font-size: 0.875rem;
  color: var(--text);
  flex: 1;
  min-width: 80px;
  padding: 2px 4px;
}
.tag-input-inner:focus { outline: none; }
.form-hint { font-size: 0.75rem; color: var(--text2); margin-top: 5px; }
.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.tweet-capture-opts {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.capture-btn {
  flex: 1;
  min-width: 100px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 0.8rem;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
}
.capture-btn:hover, .capture-btn.active { border-color: #1da1f2; color: #1da1f2; background: rgba(29,161,242,.08); }

/* ═══════════════════════════════════════════════════════
   INSPECTOR PANEL
═══════════════════════════════════════════════════════ */
#inspector {
  width: 0;
  min-width: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: width .28s cubic-bezier(.4,0,.2,1), min-width .28s cubic-bezier(.4,0,.2,1);
}
#inspector.open {
  width: var(--inspector-w);
  min-width: var(--inspector-w);
  overflow-y: auto;
}
.inspector-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.inspector-header h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}
.inspector-close { color: var(--text2); }
.inspector-body { padding: 16px; flex: 1; overflow-y: auto; }
.inspector-section { margin-bottom: 16px; }
.inspector-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text2); margin-bottom: 6px; }
.inspector-value { font-size: 0.875rem; word-break: break-word; }
.inspector-actions {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inspector-actions .btn { justify-content: center; }

/* ═══════════════════════════════════════════════════════
   KEYBOARD HELP OVERLAY
═══════════════════════════════════════════════════════ */
#kbd-help {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#kbd-help.open { display: flex; }
.kbd-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.kbd-panel h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kbd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.kbd-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  padding: 6px 8px;
  border-radius: 6px;
}
.kbd-row:hover { background: var(--surface2); }
.kbd-row span { flex: 1; color: var(--text2); }
.kbd-keys { display: flex; gap: 3px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  animation: toastIn .2s ease;
  pointer-events: none;
}
.toast.success { border-color: #4caf7d; color: #4caf7d; }
.toast.error { border-color: var(--danger); color: var(--danger); }
@keyframes toastIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: none; } }

/* ═══════════════════════════════════════════════════════
   TAGS PAGE
═══════════════════════════════════════════════════════ */
#tags-page { display: none; padding: 20px; }
#tags-page.active { display: block; }
#content.tags-view #card-grid { display: none; }
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0;
}
.tag-cloud-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.tag-cloud-item:hover { border-color: var(--accent); }
.tag-cloud-item .count { font-size: 0.75rem; color: var(--text2); }

/* ═══════════════════════════════════════════════════════
   SETTINGS PAGE
═══════════════════════════════════════════════════════ */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.settings-section h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 14px;
  font-size: 0.95rem;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row label { font-size: 0.875rem; }
.settings-row small { font-size: 0.78rem; color: var(--text2); display: block; margin-top: 2px; }
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: background .2s;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
}
.toggle input:checked ~ .toggle-slider { background: var(--accent); }
.toggle input:checked ~ .toggle-slider::after { transform: translateX(18px); }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; --inspector-w: 100%; }
  #sidebar { position: fixed; left: -220px; transition: left .25s; width: 220px; z-index: 50; }
  #sidebar.mobile-open { left: 0; }
  #inspector { position: fixed; right: 0; top: 0; z-index: 40; }
  .topbar-title { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Loading spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* OG Image preview */
.og-image { width: 100%; height: 120px; object-fit: cover; border-radius: 6px; margin-bottom: 10px; }

/* Edit Tags Modal */
.tag-editor-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.tag-editor-row:last-child { border-bottom: none; }
.tag-editor-preview {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 4px;
  min-width: 80px;
  text-align: center;
  flex-shrink: 0;
}
.tag-editor-name { flex: 1; font-size: 0.875rem; font-weight: 500; }
.tag-editor-colors { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.tag-color-swatch {
  position: relative;
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 2px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}
.tag-color-swatch input[type="color"] {
  position: absolute; inset: -4px;
  width: calc(100% + 8px); height: calc(100% + 8px);
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}
.tag-color-swatch:hover { border-color: var(--accent); }
.tag-color-label { font-size: 0.65rem; color: var(--text2); text-align: center; margin-top: 1px; }
.tag-editor-delete {
  width: 24px; height: 24px;
  border-radius: 4px;
  color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
.tag-editor-delete:hover { background: rgba(255,94,108,.12); }
.tag-editor-delete svg { width: 13px; height: 13px; }
.tag-colon-btn {
  width: 18px; height: 18px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .15s;
  color: var(--text2);
  flex-shrink: 0;
  opacity: 0;
}
.nav-item-tags:hover .tag-colon-btn { opacity: 1; }
.tag-colon-btn:hover { background: var(--border); color: var(--text); }
.tags-collapse-body-hidden { display: none; }
.tags-collapse-arrow.open { transform: rotate(180deg); }
.tags-collapse-arrow-btn {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 4px;
  color: var(--text2);
  opacity: .5;
  transition: opacity .15s, background .15s;
}
.tags-collapse-arrow-btn:hover { opacity: 1; background: var(--border); }
.tags-collapse-arrow-btn.collapsed .tags-collapse-arrow { transform: rotate(180deg); }
.tags-collapse-arrow { transition: transform .2s; }
.organize-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 12px;
  opacity: .5;
}
/* Collections page */
.coll-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
}
.coll-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.coll-page-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.coll-page-card:hover { background: var(--surface2); border-color: var(--accent); transform: translateY(-1px); }
.coll-page-card.active { border-color: var(--accent); background: rgba(232,197,71,.06); }
.coll-page-icon { font-size: 1.5rem; line-height: 1; }
.coll-page-name { font-size: .9rem; font-weight: 500; color: var(--text); }
.coll-page-count { font-size: .75rem; color: var(--text2); }

/* Playlist card */
.playlist-card { border-left: 3px solid #8b0000; }
.badge-playlist { background: rgba(139,0,0,.18); color: #c0392b; }

/* YT viewer like/dislike active states */
.yt-viewer-action-icon.liked { background: rgba(94,139,255,.18); border-color: var(--accent2); color: var(--accent2); }
.yt-viewer-action-icon.disliked { background: rgba(255,94,108,.15); border-color: var(--danger); color: var(--danger); }

/* YT viewer extra info */
.yt-viewer-meta { font-size: 0.78rem; color: var(--text2); margin-top: 3px; }
.yt-viewer-desc {
  font-size: 0.8rem;
  color: var(--text2);
  margin-top: 8px;
  line-height: 1.5;
  max-height: 80px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.yt-viewer-action-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
  background: var(--surface2);
  flex-shrink: 0;
}
.yt-viewer-action-icon:hover { border-color: var(--accent2); color: var(--text); }
.yt-viewer-action-icon svg { width: 15px; height: 15px; }
.yt-viewer-info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.yt-viewer-info-text { flex: 1; min-width: 0; }
.yt-viewer-info-btns { display: flex; gap: 6px; align-items: center; flex-shrink: 0; margin-top: 2px; }
.yt-like-count { font-size: 0.65rem; text-align: center; color: var(--text2); margin-top: 1px; }

/* Embed mode image tags extra margin */
.card[data-viewmode="embed"] .badge-tweet { display: none; }

/* ── PIN BADGE ── */
.pin-badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 13px; line-height: 1; opacity: .8;
  z-index: 2; pointer-events: none;
}
.card.pinned { border-color: var(--accent); }

/* ── WATCH STATUS DOT ── */
.watch-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 5px; flex-shrink: 0;
}
.watch-unwatched { background: var(--text2); }
.watch-watching  { background: var(--accent); }
.watch-watched   { background: #4caf50; }
.watch-status-btn {
  display: inline-flex; align-items: center;
  font-size: .72rem; color: var(--text2); cursor: pointer;
  padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border);
  background: transparent; transition: border-color .15s;
}
.watch-status-btn:hover { border-color: var(--accent2); color: var(--text); }

/* list-view grid class handled via JS toggle */
#card-grid.list-view {
  display: flex; flex-direction: column; gap: 2px;
}
#card-grid.list-view .card-url,
#card-grid.list-view .card-notes,
#card-grid.list-view .og-image,
#card-grid.list-view .yt-thumbnail,
#card-grid.list-view .yt-channel-row,
#card-grid.list-view .native-tweet-text,
#card-grid.list-view .native-tweet-image { display: none !important; }
#card-grid.list-view .card-type-badge { position: static; font-size: .6rem; }
#card-grid.list-view .pin-badge { position: static; font-size: 11px; }

/* ── BULK SELECT ── */
#bulk-bar {
  display: none; align-items: center; gap: 10px;
  padding: 9px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: .85rem; flex-shrink: 0;
}
#bulk-bar.visible { display: flex; }
#bulk-bar .bulk-info { flex: 1; color: var(--text2); }
.card-checkbox {
  display: none; position: absolute; top: 10px; left: 10px; z-index: 3;
  width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent);
}
body.bulk-mode .card-checkbox { display: block; }
body.bulk-mode .pin-badge { display: none; }
body.bulk-mode .card { padding-left: 32px; }

/* ── DATE FILTER CHIPS ── */
.date-chips { display: flex; gap: 4px; flex-shrink: 0; }
.date-chip {
  padding: 3px 9px; border-radius: 20px; font-size: .75rem;
  border: 1px solid var(--border); color: var(--text2); cursor: pointer;
  white-space: nowrap; transition: all .15s;
}
.date-chip:hover { border-color: var(--accent2); color: var(--accent2); }
.date-chip.active { background: var(--accent2); border-color: var(--accent2); color: #fff; }

/* ── MULTI-TAG FILTER ── */
.tag-filter-mode {
  font-size: .72rem; padding: 2px 7px; border-radius: 4px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text2); cursor: pointer; transition: all .15s;
}
.tag-filter-mode:hover { border-color: var(--accent); color: var(--accent); }
.sidebar-tag-item.selected-filter { background: rgba(232,197,71,.12); color: var(--accent); }
.sidebar-tag-item .tag-filter-check { margin-right: 4px; font-size: 10px; opacity: 0; }
.sidebar-tag-item.selected-filter .tag-filter-check { opacity: 1; }

/* ── STATS VIEW — FULL REWRITE ── */
#stats-view { padding: 0; }
.stats-hero {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px;
}
.stat-hero-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 16px; position: relative; overflow: hidden;
}
.stat-hero-card::before {
  content: ''; position: absolute; top: -20px; right: -20px;
  width: 70px; height: 70px; border-radius: 50%;
  background: currentColor; opacity: .05;
}
.stat-hero-num {
  font-size: 2rem; font-weight: 800; font-family: var(--font-display);
  line-height: 1; margin-bottom: 4px;
}
.stat-hero-label { font-size: .72rem; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; opacity: .6; }
.stat-hero-card.c-all .stat-hero-num { color: var(--accent); }
.stat-hero-card.c-link .stat-hero-num { color: var(--accent2); }
.stat-hero-card.c-tweet .stat-hero-num { color: #1da1f2; }
.stat-hero-card.c-yt .stat-hero-num { color: #ff4444; }
.stat-hero-card.c-tag .stat-hero-num { color: #a78bfa; }
.stat-hero-card.c-pin .stat-hero-num { color: #1da1f2; }
.stat-hero-card.c-visits .stat-hero-num { color: #10b981; }
.stats-streak-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
  padding: 14px 18px; background: linear-gradient(135deg, rgba(232,197,71,.08), rgba(232,197,71,.02));
  border: 1px solid rgba(232,197,71,.2); border-radius: 14px;
}
.streak-flame { font-size: 2rem; line-height: 1; }
.streak-text { flex: 1; }
.streak-title { font-size: 1rem; font-weight: 700; color: var(--accent); }
.streak-sub { font-size: .78rem; color: var(--text2); margin-top: 2px; }
.streak-close-btn {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2); margin-left: auto;
  transition: background .12s, color .12s;
}
.streak-close-btn:hover { background: rgba(255,255,255,.1); color: var(--text); }
.stats-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stats-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px;
}
.stats-panel-title {
  font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text2); margin-bottom: 14px; display: flex; align-items: center; gap: 6px;
}
.stats-panel-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.stat-bar-item { margin-bottom: 10px; }
.stat-bar-item:last-child { margin-bottom: 0; }
.stat-bar-header { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 4px; }
.stat-bar-name { font-size: .8rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.stat-bar-count { font-size: .72rem; color: var(--text2); font-weight: 600; }
.stat-bar-track { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.stat-bar-fill.domain { background: linear-gradient(90deg, var(--accent2), #818cf8); }
.stat-bar-fill.tagbar { background: linear-gradient(90deg, var(--accent), #f59e0b); }
@media (max-width: 680px) { .stats-two-col { grid-template-columns: 1fr; } .stats-hero { grid-template-columns: repeat(2,1fr); } }

/* ── YT STATS CAROUSEL ── */
.stats-yt-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-top: 16px;
}
.stats-yt-section { margin-bottom: 20px; }
.stats-yt-section:last-child { margin-bottom: 0; }
.yt-carousel {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.yt-carousel::-webkit-scrollbar { height: 4px; }
.yt-carousel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.yt-carousel-card {
  flex-shrink: 0; width: 160px; scroll-snap-align: start;
  border-radius: 10px; overflow: hidden; border: 1px solid var(--border);
  background: var(--surface2); cursor: pointer; transition: border-color .15s;
}
.yt-carousel-card:hover { border-color: var(--accent2); }
.yt-carousel-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #000; display: block; }
.yt-carousel-info { padding: 8px; display: flex; gap: 6px; align-items: flex-start; }
.yt-carousel-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.yt-carousel-text { flex: 1; min-width: 0; }
.yt-carousel-title { font-size: .72rem; font-weight: 600; color: var(--text); line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.yt-carousel-channel { font-size: .65rem; color: var(--text2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── MOST VISITED ── */
.stats-most-visited { margin-top: 16px; }
.stats-most-visited .stats-panel-title { margin-bottom: 12px; }
.most-visited-card-wrap { pointer-events: none; }
.most-visited-card-wrap .card { cursor: default; transform: none !important; }

/* ── COLLECTION GROUPS ── */
.coll-group-section { margin-bottom: 8px; }
.coll-group-subgrid {
  position: relative;
  padding: 8px 0 4px;
  min-height: 40px;
}
.coll-group-subgrid-list {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  position: static;
}
.coll-group-subgrid-list .card {
  width: 100% !important;
  margin-bottom: 0 !important;
}
/* Masonry sizing — same columns as main grid */
.coll-group-subgrid .grid-sizer,
.coll-group-subgrid .card {
  width: calc(33.333% - 11px);
  margin-bottom: 16px;
}
@media (min-width: 1320px) {
  .coll-group-subgrid .grid-sizer,
  .coll-group-subgrid .card { width: calc(25% - 12px); }
}
@media (max-width: 820px) {
  .coll-group-subgrid .grid-sizer,
  .coll-group-subgrid .card { width: calc(50% - 8px); }
}
@media (max-width: 520px) {
  .coll-group-subgrid .grid-sizer,
  .coll-group-subgrid .card { width: 100%; }
}
.coll-group-subgrid:empty::after {
  content: 'No items — drag cards here';
  font-size: .78rem; color: var(--text2); padding: 12px 4px;
  grid-column: 1/-1;
}
.coll-group-subgrid.drag-over-group { background: rgba(232,197,71,.04); border-radius: 8px; outline: 2px dashed var(--accent); }
.coll-group-header {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px 4px; font-size: .7rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--text2);
  border-top: 1px solid var(--border); margin-top: 4px;
  user-select: none; cursor: default;
}
.coll-group-header:first-child { border-top: none; margin-top: 0; }
.coll-group-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.coll-group-actions { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.coll-group-header:hover .coll-group-actions { opacity: 1; }
.coll-group-collapse-btn {
  width: 18px; height: 18px; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2); flex-shrink: 0;
  transition: background .1s, color .1s, transform .2s;
}
.coll-group-collapse-btn:hover { background: var(--border); color: var(--text); }
.coll-group-section.coll-group-collapsed .coll-group-subgrid { display: none; }
.coll-group-section.coll-group-collapsed .coll-group-collapse-btn { transform: rotate(-90deg); }
.coll-group-action-btn {
  width: 18px; height: 18px; border-radius: 3px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2); font-size: .7rem; transition: background .1s;
}
.coll-group-action-btn:hover { background: var(--border); color: var(--text); }
/* Group action toolbar buttons */
#coll-groups-add-btn:hover,
#coll-groups-collapse-all-btn:hover,
#coll-groups-expand-all-btn:hover {
  background: var(--surface2) !important;
  color: var(--text) !important;
}

/* ── DRAG-AND-DROP FEEDBACK ── */
.card.drag-dragging { opacity: .4; border-style: dashed; }
.card.drag-over { border-color: var(--accent) !important; box-shadow: 0 0 0 2px rgba(232,197,71,.3) !important; }
.coll-group-drop-zone {
  min-height: 40px; border: 2px dashed transparent; border-radius: var(--radius);
  transition: border-color .15s, background .15s; margin: 4px 0;
}
.coll-group-drop-zone.drag-active { border-color: var(--accent); background: rgba(232,197,71,.05); }
.card[draggable="true"] { cursor: grab; }
.card[draggable="true"]:active { cursor: grabbing; }

/* ── LOAD MORE ── */
#load-more-btn {
  display: block; margin: 20px auto 0; padding: 10px 28px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; font-size: .85rem; color: var(--text2);
  cursor: pointer; transition: all .15s;
}
#load-more-btn:hover { border-color: var(--accent2); color: var(--text); }

/* ── RELATED FLASH ANIMATION ── */
@keyframes relatedFlash {
  0%   { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,197,71,.4); }
  60%  { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,197,71,.2); }
  100% { border-color: var(--border); box-shadow: none; }
}
.card.related-flash { animation: relatedFlash 1.2s ease forwards; }

/* ── ENHANCED RELATED ITEMS ── */
.related-items { display: flex; flex-direction: column; gap: 6px; }
.related-item {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  border-radius: 8px; cursor: pointer; border: 1px solid var(--border);
  background: var(--surface2); transition: border-color .15s;
}
.related-item:hover { border-color: var(--accent2); }
.related-favicon { width: 16px; height: 16px; border-radius: 3px; flex-shrink: 0; }
.related-thumb { width: 48px; height: 32px; border-radius: 5px; object-fit: cover; flex-shrink: 0; margin-left: auto; }
.related-item-body { flex: 1; min-width: 0; }
.related-item-title { font-size: .8rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.related-item-tags { display: flex; gap: 3px; margin-top: 3px; flex-wrap: wrap; }

/* ── COLLECTIONS ── */
.collection-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 6px; font-size: .78rem;
  color: var(--text2); cursor: pointer; transition: background .12s; position: relative;
}
.collection-item:hover { background: var(--surface2); color: var(--text); }
.collection-item.active { background: var(--surface2); color: var(--accent); }
.collection-item .coll-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.collection-item .coll-count { font-size: .7rem; opacity: .6; flex-shrink: 0; }
.collection-item .coll-menu-btn {
  opacity: 0; width: 18px; height: 18px; border-radius: 4px; display: flex;
  align-items: center; justify-content: center; color: var(--text2); flex-shrink: 0;
}
.collection-item:hover .coll-menu-btn { opacity: 1; }
.collection-item .coll-menu-btn:hover { background: var(--border); color: var(--text); }
.coll-icon { width: 16px; height: 16px; border-radius: 3px; object-fit: cover; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.coll-add-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 8px; border-radius: 6px; font-size: .78rem;
  color: var(--text2); cursor: pointer; transition: background .12s; width: 100%;
}
.coll-add-btn:hover { background: var(--surface2); color: var(--accent); }

/* ── COLLECTION CONTEXT MENU ── */
.coll-context-menu {
  position: absolute; right: 8px; top: 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); z-index: 200; min-width: 140px; overflow: hidden;
  display: none;
}
.coll-context-menu.open { display: block; }
.coll-ctx-item {
  padding: 8px 12px; font-size: .78rem; cursor: pointer; color: var(--text2);
  display: flex; align-items: center; gap: 8px; transition: background .1s;
}
.coll-ctx-item:hover { background: var(--surface2); color: var(--text); }
.coll-ctx-item.danger { color: var(--danger); }

/* ── ICON PICKER ── */
.icon-picker-grid {
  display: grid; grid-template-columns: repeat(8,1fr); gap: 6px; margin: 12px 0;
}
.icon-picker-item {
  width: 36px; height: 36px; border-radius: 8px; display: flex;
  align-items: center; justify-content: center; font-size: 18px;
  cursor: pointer; border: 2px solid transparent; transition: all .15s;
}
.icon-picker-item:hover { background: var(--surface2); }
.icon-picker-item.selected { border-color: var(--accent); background: rgba(232,197,71,.1); }

/* ── CUSTOM CONFIRM MODAL ── */
#custom-confirm-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
#custom-confirm-overlay.open { opacity: 1; pointer-events: auto; }
.custom-confirm-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 28px 20px; max-width: 380px; width: 90%; box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.custom-confirm-icon { font-size: 2.2rem; margin-bottom: 12px; }
.custom-confirm-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; font-family: var(--font-display); }
.custom-confirm-body { font-size: .875rem; color: var(--text2); margin-bottom: 20px; line-height: 1.5; }
.custom-confirm-input {
  width: 100%; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  font-family: inherit; font-size: .875rem; margin-bottom: 16px;
}
.custom-confirm-input:focus { outline: none; border-color: var(--accent); }
.custom-confirm-btns { display: flex; gap: 8px; justify-content: flex-end; }

/* ── RELATED ITEMS ── */
.related-items { margin-top: 12px; }
.related-label { font-size: .68rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--text2); margin-bottom: 6px; }
.related-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 6px; font-size: .8rem;
  cursor: pointer; color: var(--text2); transition: background .12s;
}
.related-item:hover { background: var(--surface2); color: var(--text); }
.related-item img { width: 14px; height: 14px; border-radius: 2px; flex-shrink: 0; }
.related-item-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── UNDO SNACKBAR ── */
#undo-bar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px; font-size: .875rem;
  z-index: 300; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
#undo-bar.visible { opacity: 1; pointer-events: auto; }
#undo-bar button { color: var(--accent); font-weight: 600; font-size: .875rem; }

/* ── ACTIVITY LOG ── */
#log-view { padding: 4px 0; }
.log-entry { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .82rem; }
.log-entry:last-child { border-bottom: none; }
.log-entry .log-time { color: var(--text2); white-space: nowrap; flex-shrink: 0; min-width: 80px; }
.log-entry .log-msg { color: var(--text); flex: 1; }
.log-entry .log-icon { flex-shrink: 0; }

/* ── SIDEBAR TAG LEFT-ALIGN ── */
.sidebar-tag-item { justify-content: flex-start !important; gap: 0; }
.sidebar-tag-item .tag-filter-check { margin-right: 4px; }
.sidebar-tag-item .stag-count { margin-left: auto; }
.sidebar-tag-group { }
.sidebar-tag-parent {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: 6px; font-size: .78rem;
  color: var(--text2); cursor: pointer; transition: background .12s;
}
.sidebar-tag-parent:hover { background: var(--surface2); color: var(--tag-text); }
.sidebar-tag-parent.selected-filter { background: rgba(232,197,71,.12); color: var(--accent); }
.sidebar-tag-parent .stag-arrow { transition: transform .15s; font-size: 9px; margin-right: 2px; }
.sidebar-tag-parent.open .stag-arrow { transform: rotate(90deg); }
.sidebar-tag-children { display: none; padding-left: 16px; }
.sidebar-tag-children.open { display: block; }
.sidebar-tag-children .sidebar-tag-item { padding-left: 8px; }

/* ── INSPECTOR HEADER ICON BUTTONS ── */
.inspector-header { position: relative; display: flex; align-items: center; gap: 4px; padding: 14px 16px 12px; border-bottom: 1px solid var(--border); }
.inspector-header h3 { flex: 1; font-size: .85rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text2); margin: 0; }
.insp-header-btn {
  width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  color: var(--text2); transition: background .15s, color .15s; flex-shrink: 0;
}
.insp-header-btn:hover { background: var(--surface2); color: var(--text); }
.insp-header-btn svg { width: 15px; height: 15px; }
.insp-header-btn.pinned-active { color: var(--accent); }

/* ── BULK SLIDER TOGGLE ── */
.bulk-toggle-wrap {
  display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--text2);
  padding: 0 4px;
}
.bulk-switch {
  position: relative; width: 34px; height: 18px; cursor: pointer;
}
.bulk-switch input { opacity: 0; width: 0; height: 0; }
.bulk-switch-track {
  position: absolute; inset: 0; background: var(--border); border-radius: 9px;
  transition: background .2s;
}
.bulk-switch input:checked + .bulk-switch-track { background: var(--accent2); }
.bulk-switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; background: white; border-radius: 50%;
  transition: left .2s; pointer-events: none;
}
.bulk-switch input:checked ~ .bulk-switch-thumb { left: 18px; }

/* ── EMBED VIEW YT CHANNEL ROW ── */
.embed-yt-meta {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding-right: 0;
}
.embed-yt-meta img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--surface2); flex-shrink: 0; }
.embed-yt-meta-name { font-size: .82rem; font-weight: 600; }

/* ── EMBED VIEW PIN BUTTON ── */
.embed-pin-btn {
  display: flex; align-items: center; gap: 4px; padding: 4px 8px;
  border-radius: 6px; font-size: .75rem; color: var(--text2);
  border: 1px solid var(--border); background: none; cursor: pointer; transition: all .15s;
}
.embed-pin-btn:hover { background: var(--surface2); color: var(--accent); border-color: var(--accent); }
.embed-pin-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(232,197,71,.08); }
.embed-pin-btn svg { width: 12px; height: 12px; }

/* ── STAR PIN BADGE (replacing 📌) ── */
.pin-badge {
  position: absolute; top: 12px; left: 12px;
  width: 18px; height: 18px; z-index: 2;
  color: var(--accent); display: flex; align-items: center; justify-content: center;
}
.pin-badge svg { width: 14px; height: 14px; fill: var(--accent); stroke: none; }

/* ── LIST VIEW IMPROVEMENTS ── */
.list-card {
  display: flex !important; flex-direction: row !important; align-items: center !important;
  min-height: unset !important; padding: 6px 12px !important; gap: 0;
}
.list-card .card-type-badge {
  position: static !important; flex-shrink: 0;
  width: 54px; text-align: center; margin-right: 10px;
  white-space: nowrap; overflow: hidden; padding: 2px 4px;
}
.list-card .card-content {
  display: flex; align-items: center; flex: 1; min-width: 0; gap: 0;
  overflow: hidden;
}
.list-card .list-icon {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; margin-right: 8px; align-self: center;
}
/* Main text block — title row + optional snippet */
.list-card .list-main {
  flex: 1; min-width: 0; margin-right: 10px; display: flex; flex-direction: column; justify-content: center; gap: 1px;
}
.list-card .list-title-row {
  display: flex; align-items: baseline; gap: 6px; min-width: 0;
}
.list-card .list-title {
  font-size: .82rem; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex-shrink: 1; min-width: 0;
}
.list-card .list-subtitle {
  font-size: .70rem; color: var(--text2); white-space: nowrap; flex-shrink: 0;
}
.list-card .list-snippet {
  font-size: .70rem; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* domain col */
.list-domain-wrap {
  display: flex; align-items: center; gap: 5px;
  flex: 0 0 100px; flex-shrink: 0; padding: 0 0 0 2px;
}
.list-domain {
  font-size: .72rem; color: var(--text2); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  max-width: 90px; text-align: left;
}
.list-watch-slot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.list-watch-slot.visible { display: inline-block; }
.list-watch-slot.hidden { visibility: hidden; }
/* tags col */
.list-card .list-tags {
  display: flex; align-items: center; gap: 4px; flex: 0 0 160px;
  overflow: hidden; flex-wrap: nowrap; padding: 0 8px;
}
.list-card .list-tags .tag { font-size: .65rem; padding: 1px 5px; white-space: nowrap; flex-shrink: 0; }
/* footer */
.list-card .card-footer {
  flex-shrink: 0; padding-top: 0; margin-top: 0;
  display: flex; align-items: center; gap: 6px;
}
.list-card .list-date { font-size: .72rem; color: var(--text2); white-space: nowrap; width: 54px; text-align: right; }
.list-card .card-actions { opacity: 0; display: flex; gap: 2px; transition: opacity .15s; }
.list-card:hover .card-actions { opacity: 1; }
.list-card .pin-badge { position: static !important; flex-shrink: 0; margin-right: 4px; }
.list-card .card-checkbox { position: static !important; flex-shrink: 0; margin-right: 6px; }
/* Hide old card-header / card-tags inside list cards (we use new elements) */
.list-card .card-header { display: none !important; }
.list-card .card-tags { display: none !important; }

/* ── PLAYLIST SIDEBAR ── */
#yt-viewer-box.has-playlist { flex-direction: row; max-width: 1100px; }
#yt-viewer-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#yt-playlist-panel {
  width: 240px; flex-shrink: 0; background: var(--surface2); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
#yt-playlist-panel-header {
  padding: 12px 14px 8px; font-size: .78rem; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text2); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
#yt-playlist-items { overflow-y: auto; flex: 1; padding: 6px; }
.yt-playlist-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px; border-radius: 8px;
  cursor: pointer; transition: background .12s;
}
.yt-playlist-item:hover { background: var(--border); }
.yt-playlist-item.active { background: rgba(232,197,71,.12); }
.yt-playlist-item-num { width: 20px; text-align: center; font-size: .72rem; color: var(--text2); flex-shrink: 0; }
.yt-playlist-item-thumb { width: 60px; height: 34px; border-radius: 5px; object-fit: cover; background: var(--border); flex-shrink: 0; }
.yt-playlist-item-info { flex: 1; min-width: 0; }
.yt-playlist-item-title { font-size: .75rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yt-playlist-item-ch { font-size: .68rem; color: var(--text2); }
.yt-playlist-item.active .yt-playlist-item-num { color: var(--accent); font-weight: 700; }

/* ── Native Pinterest card ──────────────────────────────────────────────────── */
.native-pin {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  width: 100%;
  position: relative;
}
.native-pin-img-wrap { overflow: hidden; }
.native-pin-img {
  width: 100%; display: block;
  object-fit: cover; max-height: 320px;
  background: var(--surface2);
  transition: transform .3s ease;
}
.native-pin:hover .native-pin-img { transform: scale(1.02); }
.native-pin-body { padding: 10px 12px 8px; }
.native-pin-title {
  font-weight: 700; font-size: .88rem; line-height: 1.35;
  margin-bottom: 5px; word-break: break-word;
  color: var(--text);
}
.native-pin-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; gap: 6px; flex-wrap: wrap;
}
.native-pin-attribution {
  display: flex; align-items: center; gap: 5px;
  font-size: .74rem; color: #e60023; text-decoration: none; font-weight: 600;
}
.native-pin-attribution:hover { text-decoration: underline; }
.native-pin-saves {
  font-size: .72rem; color: var(--text2); font-weight: 500;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 8px; white-space: nowrap;
}
.badge-pinterest { background: rgba(230,0,35,.15); color: #e60023; }

/* ── Native Twitch card ──────────────────────────────────────────────────────── */
.native-twitch {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  width: 100%;
  position: relative;
  padding: 12px 12px 10px;
}
.native-twitch-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.native-twitch-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid rgba(145,70,255,.4);
  background: var(--surface2);
}
.native-twitch-info { flex: 1; min-width: 0; }
.native-twitch-name {
  font-weight: 700; font-size: .9rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.native-twitch-followers { font-size: .72rem; color: var(--text2); margin-top: 1px; }
.native-twitch-game-badge {
  flex-shrink: 0; font-size: .68rem; font-weight: 700;
  background: rgba(145,70,255,.15); color: #9146ff;
  border: 1px solid rgba(145,70,255,.3); border-radius: 4px;
  padding: 2px 7px; white-space: nowrap; max-width: 90px;
  overflow: hidden; text-overflow: ellipsis;
}

/* ── Native Canva card ───────────────────────────────────────────────────────── */
.native-canva {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  width: 100%;
  position: relative;
}
.native-canva-thumb-wrap {
  position: relative; overflow: hidden; cursor: pointer;
  background: var(--surface2);
}
.native-canva-thumb {
  width: 100%; display: block; max-height: 200px;
  object-fit: cover; transition: transform .3s ease;
}
.native-canva-thumb-wrap:hover .native-canva-thumb { transform: scale(1.02); }
.native-canva-play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 6px;
  background: rgba(0,0,0,.4);
  color: white; opacity: 0; transition: opacity .2s;
  font-size: .75rem; font-weight: 600;
}
.native-canva-thumb-wrap:hover .native-canva-play-overlay { opacity: 1; }
.native-canva-no-thumb {
  width: 100%; padding: 32px 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px; cursor: pointer;
  color: #00c4cc; background: rgba(0,196,204,.06);
  border-bottom: 1px solid var(--border);
  font-size: .78rem; font-weight: 600; transition: background .15s;
}
.native-canva-no-thumb:hover { background: rgba(0,196,204,.12); }
.native-canva-info {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px 10px; flex-wrap: wrap;
}
.native-canva-title {
  font-size: .85rem; font-weight: 600; color: var(--text);
  flex: 1; min-width: 0; word-break: break-word;
}
.native-canva-creator {
  font-size: .72rem; color: #00c4cc; flex-shrink: 0;
  white-space: nowrap;
}

/* ── Reddit stats row ────────────────────────────────────────────────────────── */
.native-reddit-stats {
  display: flex; align-items: center; gap: 10px;
  margin: 8px 0 2px; flex-wrap: wrap;
}
.reddit-stat {
  font-size: .75rem; font-weight: 600; display: flex; align-items: center; gap: 3px;
}
.reddit-stat-up { color: #ff4500; }
.reddit-stat-cmt { color: var(--text2); }
.reddit-stat-ratio {
  font-size: .68rem; font-weight: 400; color: var(--text2);
  background: var(--surface2); border-radius: 3px; padding: 0 4px;
}

