/* ═══════════════════════════════════════════════════════
   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 #sidebar-nav-scroll { overflow-x: hidden; }
/* collapsed: hide text labels, section wrappers, dividers, sub-lists */
#sidebar.collapsed .nav-label,
#sidebar.collapsed .organize-divider,
#sidebar.collapsed #tag-filter-mode-bar,
#sidebar.collapsed #tags-collapse-body,
#sidebar.collapsed #coll-collapse-body,
#sidebar.collapsed .coll-add-btn { display: none !important; }
/* collapsed nav-items: center, icon-only — font-size:0 nukes bare text nodes */
#sidebar.collapsed .nav-item {
  padding: 10px 0;
  justify-content: center;
  gap: 0;
  position: relative;
  font-size: 0 !important;
  line-height: 0;
  overflow: hidden;
  white-space: nowrap;
}
/* Keep only the icon (svg or favicon img) visible */
#sidebar.collapsed .nav-item > svg,
#sidebar.collapsed .nav-item > img.nav-favicon {
  display: block !important;
  flex-shrink: 0;
  width: 16px !important;
  height: 16px !important;
  font-size: initial;
  line-height: initial;
  opacity: .8;
}
/* Hide every other direct child (spans, buttons, counts, etc.) */
#sidebar.collapsed .nav-item > *:not(svg):not(img.nav-favicon) { display: none !important; }
/* Tooltip on hover */
#sidebar.collapsed .nav-item[data-view]::after {
  content: attr(aria-label);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .75rem;
  line-height: 1.4;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
#sidebar.collapsed .nav-item[data-view]:hover::after { opacity: 1; }
/* ── Collapsed: show collection icons as icon-only mini items ── */
/* Show coll-collapse-body in collapsed sidebar UNLESS it has .coll-body-hidden */
#sidebar.collapsed #coll-collapse-body:not(.coll-body-hidden) { display: block !important; }
#sidebar.collapsed #coll-collapse-body .sidebar-tags-list { padding: 0; }
#sidebar.collapsed .collection-item {
  display: flex !important;
  justify-content: center;
  align-items: center;
  padding: 6px 0;
  cursor: pointer;
  border-radius: 0;
  position: relative;
  font-size: 0 !important;
}
#sidebar.collapsed .collection-item .coll-icon {
  display: flex !important;
  font-size: 14px !important;
  line-height: 1;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
}
#sidebar.collapsed .collection-item .coll-name,
#sidebar.collapsed .collection-item .coll-count,
#sidebar.collapsed .collection-item .coll-menu-btn { display: none !important; }
/* Tooltip for collapsed collection items */
#sidebar.collapsed .collection-item::after {
  content: attr(data-name);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .75rem;
  line-height: 1.4;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
#sidebar.collapsed .collection-item:hover::after { opacity: 1; }
/* Collapse toggle icon below Collections nav item */
#coll-collapse-icon-btn {
  display: none;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 2px 0 6px;
  cursor: pointer;
  color: var(--text2);
  transition: color .15s;
}
#coll-collapse-icon-btn:hover { color: var(--text); }
#coll-collapse-icon-btn svg { width: 10px; height: 10px; transition: transform .18s; }
#coll-collapse-icon-btn.open svg { transform: rotate(180deg); }
#sidebar.collapsed #coll-collapse-icon-btn { display: flex; }
#sidebar.collapsed .sidebar-bottom {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 2px;
}
/* Dark-mode toggle: keep visible, icon centred */
#sidebar.collapsed .sidebar-dark-toggle {
  display: flex !important;
  justify-content: center;
  padding: 8px 0;
  width: 100%;
}
/* Settings action: keep visible, show icon only */
#sidebar.collapsed .sidebar-bottom .sidebar-action {
  display: flex !important;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
  width: 100%;
  font-size: 0 !important;
  line-height: 0;
  gap: 0;
}
#sidebar.collapsed .sidebar-bottom .sidebar-action > *:not(svg) { display: none !important; }
#sidebar.collapsed .sidebar-bottom .sidebar-action > svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
  opacity: .75;
}
#sidebar-nav-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
#sidebar-nav-scroll::-webkit-scrollbar { display: none; }
.sidebar-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  padding: 20px 18px 15px;
  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); }
#sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  gap: 0;
}
.nav-section { padding: 12px 0; border-bottom: 1px solid var(--border); }
/* Library section scrollable after 14 items */
.nav-section.library-section .nav-items-wrap {
  max-height: calc(14 * 38px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  scrollbar-color: transparent transparent;
}
.nav-section.library-section .nav-items-wrap::-webkit-scrollbar { display: none; }
.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: 10px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
}
.sidebar-bottom .sidebar-action {
  flex: 1;
  justify-content: center;
  padding: 8px 6px;
}
.sidebar-bottom .sidebar-action svg { opacity: .65; }
.sidebar-bottom .sidebar-action:hover svg { opacity: 1; }
.sidebar-bottom .sidebar-action.active { background: var(--surface2); color: var(--accent); }
.sidebar-bottom .sidebar-action.active svg { opacity: 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: 3px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  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;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.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 {
  padding: 4px 0;
  color: var(--text2);
}

/* ═══════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  user-select: none;
  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; }
.badge-gdrive  { background: rgba(66,133,244,.12);  color: #4285f4; }
/* Music / Lyrics */
.badge-spotify          { background: rgba(30,215,96,.15);  color: #1ed760; }
.badge-genius           { background: rgba(255,255,0,.12);  color: #c8a800; }
[data-theme="light"] .badge-genius { background: rgba(255,220,0,.2); color: #8a6f00; }
.badge-azlyrics         { background: rgba(160,50,200,.15); color: #a832c8; }
.badge-lyrical-nonsense { background: rgba(30,30,30,.85); color: #ffffff; }
[data-theme="light"] .badge-lyrical-nonsense { background: rgba(20,20,20,.08); color: #111111; }
.badge-animesonglyrics  { background: rgba(255,120,0,.15);  color: #ff7800; }
/* Info / Reference */
.badge-wikipedia  { background: rgba(200,200,200,.15); color: #aaa; }
[data-theme="light"] .badge-wikipedia { background: rgba(50,50,50,.1); color: #333; }
.badge-imdb       { background: rgba(245,197,24,.2);   color: #c8a008; }
.badge-rt         { background: rgba(250,87,0,.15);    color: #fa5700; }
.badge-ann        { background: rgba(0,100,200,.15);   color: #0064c8; }
/* Social / Community */
.badge-github     { background: rgba(110,118,129,.15); color: #8b949e; }
[data-theme="light"] .badge-github { background: rgba(36,41,47,.1); color: #24292f; }
.badge-patreon    { background: rgba(255,66,77,.15);   color: #ff424d; }
.badge-telegram   { background: rgba(0,136,204,.15);   color: #0088cc; }
.badge-tumblr     { background: rgba(53,114,176,.15);  color: #3572b0; }
.badge-vgen       { background: rgba(46,204,113,.15);  color: #2ecc71; }
/* Anime / Manga / Film */
.badge-anilist    { background: rgba(2,169,255,.15);   color: #02a9ff; }
.badge-mal        { background: rgba(46,81,162,.15);   color: #2e51a2; }
.badge-letterboxd { background: rgba(0,207,98,.15);    color: #00cf62; }
.badge-speedrun   { background: rgba(30,215,96,.15);   color: #1aa34a; }
/* Shopping */
.badge-lazada     { background: rgba(160,20,120,.15);   color: #b01888; }
/* Games / Software */
.badge-steam      { background: rgba(28,100,162,.15);  color: #1c64a2; }
.badge-steamdb    { background: rgba(0,150,220,.15);   color: #0096dc; }
.badge-itchio     { background: rgba(250,94,100,.15);  color: #fa5e64; }
/* Art / Creative */
.badge-artstation { background: rgba(19,119,215,.15);  color: #1377d7; }
.badge-deviantart { background: rgba(0,200,160,.15);   color: #05cc47; }
.badge-newgrounds { background: rgba(255,102,0,.15);   color: #ff6600; }
.badge-sketchfab  { background: rgba(19,186,166,.15);  color: #13baa6; }
.badge-csp        { background: rgba(0,120,200,.15);   color: #0078c8; }
.badge-cgtrader   { background: rgba(0,150,136,.15);   color: #009688; }
.badge-gumroad    { background: rgba(244,165,184,.2);  color: #e07090; }
.badge-kofi       { background: rgba(255,179,138,.2);  color: #d4804a; }
.badge-flippednormals { background: rgba(200,50,200,.15); color: #c832c8; }
.badge-fandom     { background: rgba(0,158,203,.15);   color: #009ecb; }
/* 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 */
/* ── YOUTUBE VIEWER OVERLAY ── */
#yt-viewer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(10px);
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
  overflow-y: auto;
}
#yt-viewer-overlay.open { opacity: 1; pointer-events: auto; }
#yt-viewer-close-btn {
  position: fixed;
  top: 16px; right: 20px;
  width: 38px; height: 38px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  z-index: 120;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  line-height: 1;
}
#yt-viewer-close-btn:hover { background: rgba(255,70,70,.75); }
#yt-viewer-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  width: 100%;
  max-width: 900px;
  max-height: calc(100vh - 60px);
  box-shadow: 0 40px 100px rgba(0,0,0,.75);
  display: flex;
  flex-direction: row;
}
#yt-viewer-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
}
#yt-viewer-iframe-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  flex-shrink: 0;
}
#yt-viewer-iframe-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
}
#yt-viewer-info {
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#yt-viewer-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin: 0;
}
.yt-viewer-meta {
  font-size: 0.75rem;
  color: var(--text2);
}
/* Channel row: avatar + name + pills (overlay only) */
#yt-viewer-info .yt-channel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
#yt-viewer-info .yt-channel-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
}
.yt-channel-info { flex: 1; min-width: 0; }
.yt-viewer-channel {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Action pills */
.yt-action-pills {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;
}
.yt-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text2);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap;
}
.yt-pill:hover { border-color: var(--accent2); color: var(--text); background: var(--border); }
.yt-pill.liked { background: rgba(94,139,255,.15); border-color: var(--accent2); color: var(--accent2); }
.yt-pill.disliked { background: rgba(255,94,108,.13); border-color: var(--danger); color: var(--danger); }
.yt-pill-watch { gap: 6px; }
.yt-pill-danger:hover { border-color: var(--danger); color: var(--danger); }
/* Download dropdown */
.yt-dl-wrap { position: relative; }
.yt-dl-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 20;
  min-width: 90px;
  overflow: hidden;
}
.yt-dl-menu.open { display: block; }
.yt-dl-option {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.yt-dl-option:hover { background: var(--border); }

/* Description */
.yt-desc-wrap {
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: 2px;
}
.yt-desc-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  font-size: 0.78rem;
  font-weight: 600;
}
.yt-desc-toggle:hover { color: var(--text); }
.yt-desc-chevron { transition: transform .2s; }
.yt-desc-wrap.expanded .yt-desc-chevron { transform: rotate(180deg); }
.yt-desc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  font-size: 0.78rem;
  color: var(--text2);
  white-space: pre-wrap;
  line-height: 1.6;
}
.yt-desc-wrap.expanded .yt-desc-body {
  max-height: 280px;
  overflow-y: auto;
  padding: 0 13px 12px;
}

/* ── 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 card accent borders — webs.txt platforms ── */
.wikipedia-card    { border-left: 3px solid #888; }
.imdb-card         { border-left: 3px solid #f5c518; }
.rt-card           { border-left: 3px solid #fa5700; }
.letterboxd-card   { border-left: 3px solid #00cf62; }
.github-card       { border-left: 3px solid #8b949e; }
[data-theme="light"] .github-card { border-left-color: #24292f; }
.patreon-card      { border-left: 3px solid #ff424d; }
.patreon-card > .card-type-badge { display: none; }
.csp-card          > .card-type-badge { display: none; }
.lazada-card       > .card-type-badge { display: none; }
.telegram-card     { border-left: 3px solid #0088cc; }
.tumblr-card       { border-left: 3px solid #3572b0; }
.anilist-card      { border-left: 3px solid #02a9ff; }
.mal-card          { border-left: 3px solid #2e51a2; }
.ann-card          { border-left: 3px solid #0064c8; }
.speedrun-card     { border-left: 3px solid #1aa34a; }
.lazada-card       { border-left: 3px solid #b01888; }
.steam-card        { border-left: 3px solid #1c64a2; }
.steamdb-card      { border-left: 3px solid #0096dc; }
.csp-card          { border-left: 3px solid #0078c8; }
.flippednormals-card { border-left: 3px solid #c832c8; }
.cgtrader-card     { border-left: 3px solid #009688; }
.itchio-card       { border-left: 3px solid #fa5e64; }
.artstation-card   { border-left: 3px solid #1377d7; }
.deviantart-card   { border-left: 3px solid #05cc47; }
.newgrounds-card   { border-left: 3px solid #ff6600; }
.sketchfab-card    { border-left: 3px solid #13baa6; }
.gumroad-card      { border-left: 3px solid #f4a5b8; }
.kofi-card         { border-left: 3px solid #ff5e5b; }
.vgen-card         { border-left: 3px solid #2ecc71; }
/* Lyric platform card accents */
.genius-card             { border-left: 3px solid #c8a800; }
.azlyrics-card           { border-left: 3px solid #a832c8; }
.lyrical-nonsense-card   { border-left: 3px solid #cccccc; }
[data-theme="light"] .lyrical-nonsense-card { border-left-color: #333; }
.animesonglyrics-card    { border-left: 3px solid #ff7800; }
.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 streamer card */
.twitch-streamer-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px;
  cursor: pointer;
  border-radius: 8px;
  transition: background .12s;
}
.twitch-streamer-card:hover { background: rgba(145,70,255,.06); }
.twitch-streamer-left { flex-shrink: 0; }
.twitch-streamer-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a0a2e;
  display: block;
}
.twitch-streamer-avatar-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(145,70,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
}
.twitch-streamer-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.twitch-streamer-name {
  font-weight: 700;
  font-size: .92rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.twitch-streamer-bio {
  font-size: .78rem;
  color: var(--text2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.twitch-streamer-cta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: .72rem;
  color: #9146ff;
  font-weight: 600;
}
/* 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;
  /* Always center to the full viewport regardless of sidebar/inspector */
  left: 0 !important;
  right: 0 !important;
}
.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, max-height .25s ease;
}
.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; }

/* 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; }
.mv-list { display: flex; flex-direction: column; gap: 6px; max-width: 700px; }
.mv-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  transition: background .15s, border-color .15s;
}
.mv-row:hover { background: var(--surface); border-color: var(--accent); }
.mv-rank-col { width: 28px; text-align: center; font-size: 1.1rem; flex-shrink: 0; }
.mv-rank { font-size: .78rem; font-weight: 700; color: var(--text2); }
.mv-favicon { width: 20px; height: 20px; border-radius: 4px; object-fit: contain; flex-shrink: 0; }
.mv-info { flex: 1; min-width: 0; }
.mv-title { font-size: .85rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-bar-wrap { height: 3px; background: var(--border); border-radius: 2px; margin-top: 5px; }
.mv-bar-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width .3s; }
.mv-visits { font-size: .8rem; font-weight: 700; color: var(--accent); flex-shrink: 0; white-space: nowrap; }
.mv-visits-label { font-weight: 400; color: var(--text2); font-size: .72rem; }

/* ── 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; width: 102px;}
.coll-ctx-item {
  padding: 8px 12px; font-size: .82rem; cursor: pointer; color: var(--text2);
  display: flex; align-items: center; gap: 8px; transition: background .1s;
}
.coll-ctx-item svg { flex-shrink: 0; opacity: .7; }
.coll-ctx-item:hover svg { opacity: 1; }
.coll-ctx-item:hover { background: var(--surface2); color: var(--text); }
.coll-ctx-item.danger { color: var(--danger); }
.coll-ctx-item.danger svg { stroke: var(--danger); opacity: .8; }

/* ── 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: 9999; 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 { max-width: 1150px; }
#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; }
/* ── Nav favicon icons (feature 6) ── */
.nav-item .nav-favicon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  filter: grayscale(1);
  opacity: .7;
  border-radius: 2px;
}
.nav-item.active .nav-favicon { filter: none; opacity: 1; }

/* ── Nav label collapsible toggles (feature 4) ── */
.nav-label-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 14px;
  user-select: none;
  transition: color .15s;
}
.nav-label-toggle:hover { color: var(--text); }
.nav-label-arrow {
  font-size: .6rem;
  opacity: .6;
  transition: transform .18s;
}

/* ── Modal wide wrap + side panel ── */
/* The overlay is fixed inset:0 and centers its content.
   The modal itself must ALWAYS stay centered — the side panel
   floats absolutely to its right so it never pushes the modal. */
.modal-wide-wrap {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  max-height: 90vh;
  width: 100%;
  max-width: 540px;
}
.modal-wide-wrap > .modal {
  flex: 0 0 540px;
  max-width: 540px;
  width: 100%;
  margin: 0;
  max-height: 90vh;
}
/* Side panel (right) sits to the right of the modal — fetch log only */
.modal-side-panel {
  position: absolute;
  left: calc(100% + 16px);
  top: 0;
  width: 380px;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  display: none;
  flex-direction: column;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .22s ease, transform .22s ease;
}
.modal-side-panel.visible {
  opacity: 1;
  transform: translateY(0);
}
/* Left panel sits to the left of the modal — card preview only */
.modal-left-panel {
  position: absolute;
  right: calc(100% + 16px);
  top: 0;
  width: 380px;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  display: none;
  flex-direction: column;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .22s ease, transform .22s ease;
}
.modal-left-panel.visible {
  opacity: 1;
  transform: translateY(0);
}
.modal-side-panel-inner { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1199px) {
  .modal-side-panel { display: none !important; }
  .modal-left-panel { display: none !important; }
}

/* ── Global animation kill switch ── */
body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
  transition: none !important;
  animation: none !important;
}
/* Also zero out masonry transition duration (handled in JS via _scheduleLayout) */

/* ── Collapsed sidebar: per-section toggle icon buttons (Fix 4) ── */
.nav-section-collapsed-btn {
  display: none;
  width: 100%;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
  cursor: pointer;
  color: var(--text2);
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: color .15s, background .15s;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
}
.nav-section-collapsed-btn:not(.section-open) { opacity: .4; }
.nav-section-collapsed-btn.section-open { color: var(--accent); opacity: 1; }
.nav-section-collapsed-btn:hover { background: var(--surface2); color: var(--text); opacity: 1; }
/* Tooltip */
.nav-section-collapsed-btn::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .75rem;
  line-height: 1.4;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.nav-section-collapsed-btn:hover::after { opacity: 1; }
/* Only show in collapsed sidebar */
#sidebar.collapsed .nav-section-collapsed-btn { display: flex; }

/* ═══════════════════════════════════════════════════════
   SPOTIFY CARDS & OVERLAY
   ═══════════════════════════════════════════════════════ */

/* Left accent bar for platform cards — Spotify uses border-left like other platform cards */
.spotify-card { border-left: 3px solid #1DB954; }

/* ── Spotify Artist Card ── */
.spotify-artist-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  min-height: 160px;
}
.spotify-artist-banner {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: blur(2px) brightness(0.5);
  transform: scale(1.05);
}
.spotify-artist-banner-placeholder {
  background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
}
.spotify-artist-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.7) 100%);
}
[data-theme="light"] .spotify-artist-banner-overlay {
  background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(255,255,255,.80) 100%);
}
.spotify-artist-avatar {
  position: relative;
  z-index: 2;
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,.15);
  margin: 16px 0 8px 16px;
  display: block;
}
.spotify-artist-info {
  position: relative;
  z-index: 2;
  padding: 0 16px 14px;
}
.spotify-artist-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 3px;
}
.spotify-artist-stats {
  font-size: .72rem;
  color: rgba(255,255,255,.65);
}
.spotify-artist-open-hint {
  position: absolute;
  bottom: 14px; right: 14px;
  z-index: 3;
  opacity: .7;
  transition: opacity .15s;
}
.spotify-artist-card:hover .spotify-artist-open-hint { opacity: 1; }

/* ── Spotify Track/Album/Playlist Card ── */
.spotify-track-card {
  padding: 4px 0;
}
.spotify-track-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.spotify-track-type {
  font-size: .72rem;
  color: #1DB954;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Spotify Overlay ── */
#spotify-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
#spotify-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
#spotify-overlay-box {
  background: #121212;
  border-radius: 16px;
  width: min(820px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,.8);
  border: 1px solid rgba(255,255,255,.08);
}
#spotify-overlay-box::-webkit-scrollbar { width: 6px; }
#spotify-overlay-box::-webkit-scrollbar-track { background: transparent; }
#spotify-overlay-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
#spotify-overlay-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 10;
  background: rgba(0,0,0,.5);
  border: none;
  color: #fff;
  font-size: 1rem;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#spotify-overlay-close:hover { background: rgba(255,255,255,.15); }

/* Artist Header */
#spotify-overlay-header { position: relative; }
.spotify-ov-banner {
  height: 180px;
  background-size: cover;
  background-position: center 20%;
  border-radius: 16px 16px 0 0;
  position: relative;
  overflow: hidden;
}
.spotify-ov-banner-blur {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18,18,18,0) 0%, rgba(18,18,18,1) 100%);
}
.spotify-ov-artist-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 0 24px 16px;
  margin-top: -50px;
  position: relative;
  z-index: 2;
}
.spotify-ov-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid #121212;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.spotify-ov-avatar-placeholder {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.spotify-ov-artist-info { flex: 1; min-width: 0; }
.spotify-ov-badge {
  display: flex; align-items: center; gap: 4px;
  font-size: .68rem;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}
.spotify-ov-artist-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.spotify-ov-open-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .75rem; color: #1DB954;
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid #1DB954;
  border-radius: 20px;
  transition: background .15s;
}
.spotify-ov-open-link:hover { background: rgba(29,185,84,.15); }

#spotify-overlay-embed { margin-bottom: 0; padding: 0 24px; }

/* Embed row — iframe only (actions moved to tabs row) */
.spotify-embed-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
  padding: 10px 12px;
  height: 100px;
}
.spotify-embed-iframe-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.spotify-embed-iframe-wrap iframe {
  flex: 1;
  width: 100%;
  height: 100% !important;
  min-height: 80px;
  border-radius: 8px;
  display: block;
}
/* Actions now live in the tabs row — horizontal layout */
.spotify-embed-actions,
#spotify-embed-actions-slot {
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
#spotify-embed-actions-slot {
  margin-bottom: 5px;
}
.spotify-embed-action-btn {
  background: rgba(255,255,255,.1);
  border: none;
  color: rgba(255,255,255,.7);
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.spotify-embed-open-btn:hover { background: rgba(29,185,84,.3); color: #1DB954; }
.spotify-embed-edit-btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.spotify-embed-delete-btn:hover { background: var(--danger); color: #fff; }
.spotify-embed-close-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Tabs row — list toggle before add btn */
.spotify-overlay-list-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  font-size: .75rem;
  user-select: none;
  padding-bottom: 4px;
}
.spotify-overlay-list-toggle-wrap:hover { color: rgba(255,255,255,.85); }
/* Re-align add btn */
#spotify-overlay-add-btn { margin-left: auto; }

/* Item card active state */
.spotify-item-card.active {
  background: rgba(29,185,84,.18);
  outline: 1.5px solid rgba(29,185,84,.4);
}
.spotify-item-card {
  cursor: pointer;
}

/* List view items in overlay */
.spotify-items-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.spotify-item-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  cursor: pointer;
  transition: background .12s;
}
.spotify-item-list-row:hover { background: rgba(255,255,255,.09); }
.spotify-item-list-row.active { background: rgba(29,185,84,.18); outline: 1.5px solid rgba(29,185,84,.4); }
.spotify-item-list-thumb {
  width: 40px; height: 40px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.spotify-item-list-no-thumb {
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
}
.spotify-item-list-info { flex: 1; min-width: 0; }
.spotify-item-list-title {
  font-size: .83rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotify-item-list-type {
  font-size: .68rem;
  color: #1DB954;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.spotify-item-list-play-icon { flex-shrink: 0; opacity: .5; }
.spotify-item-list-row:hover .spotify-item-list-play-icon { opacity: 1; }

/* Spotify page toggle (Show all cards) */
.spotify-page-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color .15s;
}
.spotify-page-toggle-wrap:hover { border-color: #1DB954; }
.spotify-page-toggle-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  color: var(--text2);
  white-space: nowrap;
}
/* Scale down the .toggle inside the spotify page toggle wrap to match bulk-switch size */
.spotify-page-toggle-wrap .toggle {
  width: 34px;
  height: 18px;
}
.spotify-page-toggle-wrap .toggle-slider {
  border-radius: 9px;
}
.spotify-page-toggle-wrap .toggle-slider::after {
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
}
.spotify-page-toggle-wrap .toggle input:checked ~ .toggle-slider::after { transform: translateX(16px); }

/* Toolbar (list toggle + sort + add) */
#spotify-overlay-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px 8px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-wrap: wrap;
}
/* Tabs */
#spotify-overlay-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 24px 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-wrap: wrap;
}
.spotify-tab-btn {
  display: flex; align-items: center; gap: 6px;
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  letter-spacing: .02em;
}
.spotify-tab-btn:hover { color: rgba(255,255,255,.85); }
.spotify-tab-btn.active { color: #1DB954; border-bottom-color: #1DB954; }
.spotify-add-item-btn {
  margin-left: auto;
  margin-bottom: 5px;
  background: #1DB954;
  color: #000;
  border: none;
  font-size: .78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.spotify-add-item-btn:hover { background: #1ed760; transform: scale(1.03); }

/* Tab Content */
#spotify-overlay-content {
  padding: 20px 24px 24px;
  min-height: 120px;
}
.spotify-empty-tab {
  text-align: center;
  color: rgba(255,255,255,.4);
  font-size: .85rem;
  padding: 40px 0;
}
.spotify-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.spotify-item-card {
  background: rgba(255,255,255,.06);
  border-radius: 8px;
  padding: 12px;
  cursor: default;
  transition: background .15s;
  position: relative;
}
.spotify-item-card:hover { background: rgba(255,255,255,.1); }
.spotify-item-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
  display: block;
}
.spotify-item-no-thumb {
  width: 100%; aspect-ratio: 1;
  background: rgba(255,255,255,.08);
  border-radius: 6px;
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
}
.spotify-item-title {
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 6px;
  line-height: 1.3;
}
.spotify-item-actions {
  display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
}
.spotify-item-play-btn,
.spotify-item-edit-btn,
.spotify-item-delete-btn {
  background: rgba(255,255,255,.1);
  border: none;
  color: rgba(255,255,255,.7);
  font-size: .7rem;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .12s;
}
.spotify-item-play-btn:hover { background: #1DB954; color: #000; }
.spotify-item-edit-btn:hover { background: rgba(255,255,255,.2); }
.spotify-item-delete-btn:hover { background: var(--danger); color: #fff; }
.spotify-item-open-btn {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
  font-size: .7rem;
  padding: 3px 7px;
  border-radius: 4px;
  text-decoration: none;
  transition: background .12s;
}
.spotify-item-open-btn:hover { background: rgba(29,185,84,.3); color: #1DB954; }

/* ════════════════════════════════════════════════════════════════
   LYRICS ARTIST CARD
   ════════════════════════════════════════════════════════════════ */
/* .lyrics-card border-left handled by platform-specific classes:
   .genius-card, .azlyrics-card, .lyrical-nonsense-card, .animesonglyrics-card */

.lyrics-artist-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  min-height: 160px;
}
.lyrics-artist-banner {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: blur(2px) brightness(0.45);
  transform: scale(1.05);
}
.lyrics-artist-banner-placeholder {
  background: linear-gradient(135deg, #1a1400 0%, #3a2a00 100%);
}
.lyrics-artist-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.72) 100%);
}
[data-theme="light"] .lyrics-artist-banner-overlay {
  background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(255,255,255,.80) 100%);
}
.lyrics-artist-avatar {
  position: relative;
  z-index: 2;
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(200,168,0,.35);
  margin: 16px 0 8px 16px;
  display: block;
}
.lyrics-artist-info {
  position: relative;
  z-index: 2;
  padding: 0 16px 14px;
}
.lyrics-artist-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 3px;
}
.lyrics-artist-stats {
  font-size: .72rem;
  color: rgba(255,255,255,.6);
}
.lyrics-artist-open-hint {
  position: absolute;
  bottom: 14px; right: 14px;
  z-index: 3;
  opacity: .6;
  transition: opacity .15s;
}
.lyrics-artist-card:hover .lyrics-artist-open-hint { opacity: 1; }

/* ════════════════════════════════════════════════════════════════
   LYRICS OVERLAY
   ════════════════════════════════════════════════════════════════ */
#lyrics-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
#lyrics-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
#lyrics-overlay-box {
  background: #0f0e0a;
  border-radius: 16px;
  width: min(820px, 96vw);
  max-height: 96vh;
  min-height: min(700px, 90vh);
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,.85);
  border: 1px solid rgba(200,168,0,.12);
}
#lyrics-overlay-box::-webkit-scrollbar { width: 6px; }
#lyrics-overlay-box::-webkit-scrollbar-track { background: transparent; }
#lyrics-overlay-box::-webkit-scrollbar-thumb { background: rgba(200,168,0,.2); border-radius: 3px; }

#lyrics-overlay-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 10;
  background: rgba(0,0,0,.5);
  border: none;
  color: #fff;
  font-size: 1rem;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#lyrics-overlay-close:hover { background: rgba(200,168,0,.2); }

/* Artist header */
#lyrics-overlay-header { position: relative; }
.lyrics-ov-banner {
  height: 180px;
  background-size: cover;
  background-position: center 20%;
  border-radius: 16px 16px 0 0;
  position: relative;
  overflow: hidden;
}
.lyrics-ov-banner-blur {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,14,10,0) 0%, rgba(15,14,10,.82) 100%);
}
.lyrics-ov-artist-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 0 24px 16px;
  margin-top: -50px;
  position: relative;
  z-index: 2;
}
.lyrics-ov-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid #0f0e0a;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.lyrics-ov-avatar-placeholder {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(200,168,0,.1);
  border: 2px solid rgba(200,168,0,.25);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lyrics-ov-artist-info { flex: 1; min-width: 0; }
.lyrics-ov-badge {
  display: flex; align-items: center; gap: 4px;
  font-size: .68rem;
  color: rgba(200,168,0,.8);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}
.lyrics-ov-artist-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.lyrics-ov-open-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .75rem; color: #c8a800;
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid rgba(200,168,0,.4);
  border-radius: 20px;
  transition: background .15s;
}
.lyrics-ov-open-link:hover { background: rgba(200,168,0,.12); }

/* Toolbar */
#lyrics-overlay-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding-bottom: 10px;
  flex-wrap: wrap;
}
.lyrics-back-btn {
  display: flex; align-items: center; gap: 4px;
  background: rgba(200,168,0,.1);
  border: 1px solid rgba(200,168,0,.3);
  color: #c8a800;
  font-size: .8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s;
}
.lyrics-back-btn:hover { background: rgba(200,168,0,.2); }

.lyrics-overlay-list-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  font-size: .75rem;
  user-select: none;
}
.lyrics-overlay-list-toggle-wrap:hover { color: rgba(255,255,255,.85); }

.lyrics-add-song-btn {
  margin-left: auto;
  background: #c8a800;
  color: #000;
  border: none;
  font-size: .78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.lyrics-add-song-btn:hover { background: #e8c900; transform: scale(1.03); }

/* Content area */
#lyrics-overlay-content {
  padding: 20px 24px 28px;
  min-height: 140px;
}
.lyrics-empty-tab {
  text-align: center;
  color: rgba(255,255,255,.35);
  font-size: .85rem;
  padding: 40px 0;
}

/* Song Grid */
.lyrics-songs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.lyrics-song-card {
  background: rgba(255,255,255,.05);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: background .15s, transform .1s;
  position: relative;
  overflow: hidden;
}
.lyrics-song-card:hover { background: rgba(255,255,255,.1); transform: translateY(-1px); }
.lyrics-song-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 7px;
  display: block;
}
.lyrics-song-no-thumb {
  width: 100%; aspect-ratio: 1;
  border-radius: 6px;
  margin-bottom: 7px;
  display: flex; align-items: center; justify-content: center;
}
.lyrics-song-title {
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 3px;
  line-height: 1.3;
}
.lyrics-song-platform {
  font-size: .66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Song List */
.lyrics-songs-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lyrics-song-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  cursor: pointer;
  transition: background .12s;
}
.lyrics-song-list-row:hover { background: rgba(255,255,255,.09); }
.lyrics-song-list-thumb {
  width: 40px; height: 40px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.lyrics-song-list-no-thumb {
  display: flex; align-items: center; justify-content: center;
}
.lyrics-song-list-info { flex: 1; min-width: 0; }
.lyrics-song-list-title {
  font-size: .83rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lyrics-song-list-platform {
  font-size: .68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.lyrics-song-list-icon { flex-shrink: 0; opacity: .5; }
.lyrics-song-list-row:hover .lyrics-song-list-icon { opacity: 1; }

/* Individual song/lyrics view */
.lyrics-song-thumb {
  width: 90px; height: 90px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  border: 2px solid;
  display: block;
}
.lyrics-song-thumb-placeholder {
  width: 90px; height: 90px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid;
}
.lyrics-back-inline {
  font-size: .75rem;
  padding: 4px 10px;
}
.lyrics-song-view-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.lyrics-song-view-meta { flex: 1; min-width: 0; }
.lyrics-song-view-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 4px;
}
.lyrics-song-view-platform {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.lyrics-song-action-btn {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: .75rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,.2);
  background: transparent;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.lyrics-song-action-btn:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Lyrics section tabs */
.lyrics-section-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding-bottom: 2px;
}
.lyrics-section-tab-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.45);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -3px;
  transition: color .15s, border-color .15s;
}
.lyrics-section-tab-btn:hover { color: rgba(255,255,255,.8); }
.lyrics-section-tab-btn.active { color: #c8a800; border-bottom-color: #c8a800; }

.lyrics-section-body.hidden { display: none; }
.lyrics-text {
  font-family: 'DM Sans', 'Roboto', sans-serif;
  font-size: .9rem;
  line-height: 1.85;
  color: rgba(255,255,255,.88);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 18px 20px;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.06);
  max-height: 70vh;
  overflow-y: auto;
}
.lyrics-text::-webkit-scrollbar { width: 5px; }
.lyrics-text::-webkit-scrollbar-thumb { background: rgba(200,168,0,.25); border-radius: 3px; }

/* Song Lyrics page toggle (like spotify-page-toggle-wrap) */
.lyrics-page-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color .15s;
}
.lyrics-page-toggle-wrap:hover { border-color: #c8a800; }
.lyrics-page-toggle-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  color: var(--text2);
  white-space: nowrap;
}
.lyrics-page-toggle-wrap .toggle {
  width: 34px;
  height: 18px;
}
.lyrics-page-toggle-wrap .toggle-slider { border-radius: 9px; }
.lyrics-page-toggle-wrap .toggle-slider::after {
  width: 14px; height: 14px;
  left: 2px; top: 2px;
}
.lyrics-page-toggle-wrap .toggle input:checked ~ .toggle-slider::after { transform: translateX(16px); }

/* ═══════════════════════════════════════════════════════
   OVERLAY SORT SELECT (Spotify + Lyrics)
═══════════════════════════════════════════════════════ */
.overlay-sort-wrap {
  display: flex;
  align-items: center;
}
.overlay-sort-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: .75rem;
  font-family: var(--font-ui);
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: border-color .15s, color .15s;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 22px;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
}
.overlay-sort-select:hover, .overlay-sort-select:focus { border-color: var(--accent); color: var(--text); }

/* ═══════════════════════════════════════════════════════
   LIGHT MODE — SPOTIFY OVERLAY
═══════════════════════════════════════════════════════ */
[data-theme="light"] #spotify-overlay {
  background: rgba(0,0,0,.5);
}
[data-theme="light"] #spotify-overlay-box {
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 16px 60px rgba(0,0,0,.18);
}
[data-theme="light"] #spotify-overlay-box::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); }
[data-theme="light"] #spotify-overlay-close {
  background: rgba(0,0,0,.12);
  color: #111;
}
[data-theme="light"] #spotify-overlay-close:hover { background: rgba(0,0,0,.22); }
[data-theme="light"] .spotify-ov-banner-blur {
  background: linear-gradient(to bottom, transparent 30%, rgba(255,255,255,1));
}
[data-theme="light"] .spotify-ov-artist-name { color: #111118; }
[data-theme="light"] .spotify-ov-badge { color: #333; }
[data-theme="light"] #spotify-overlay-tabs {
  background: rgba(0,0,0,.03);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .spotify-tab-btn { color: #666; }
[data-theme="light"] .spotify-tab-btn.active { color: #1DB954; border-bottom-color: #1DB954; }
[data-theme="light"] .spotify-tab-btn:hover { background: rgba(0,0,0,.06); color: #111; }
[data-theme="light"] #spotify-overlay-content { background: transparent; }
[data-theme="light"] .spotify-empty-tab { color: var(--text2); }
[data-theme="light"] .spotify-items-grid .spotify-item-card {
  background: rgba(0,0,0,.04);
  border: 1px solid var(--border);
}
[data-theme="light"] .spotify-items-grid .spotify-item-card:hover { background: rgba(0,0,0,.08); }
[data-theme="light"] .spotify-item-title { color: #111118; }
[data-theme="light"] .spotify-item-list-row { background: rgba(0,0,0,.04); }
[data-theme="light"] .spotify-item-list-row:hover { background: rgba(0,0,0,.08); }
[data-theme="light"] .spotify-item-list-row.active { background: rgba(29,185,84,.1); }
[data-theme="light"] .spotify-item-list-title { color: #111118; }
[data-theme="light"] .spotify-item-list-type { color: var(--text2); }
[data-theme="light"] .spotify-embed-action-btn {
  background: rgba(0,0,0,.06);
  color: #333;
  border: 1px solid var(--border);
}
[data-theme="light"] .spotify-embed-action-btn:hover { background: rgba(0,0,0,.12); color: #111; }
[data-theme="light"] .spotify-overlay-list-toggle-wrap { color: var(--text2); }
[data-theme="light"] .spotify-overlay-list-toggle-wrap:hover { color: var(--text); }

/* ═══════════════════════════════════════════════════════
   LIGHT MODE — LYRICS OVERLAY
═══════════════════════════════════════════════════════ */
[data-theme="light"] #lyrics-overlay {
  background: rgba(0,0,0,.5);
}
[data-theme="light"] #lyrics-overlay-box {
  background: #fffef8;
  border: 1px solid rgba(200,168,0,.3);
  box-shadow: 0 16px 60px rgba(0,0,0,.15);
}
[data-theme="light"] #lyrics-overlay-box::-webkit-scrollbar-thumb { background: rgba(200,168,0,.3); }
[data-theme="light"] #lyrics-overlay-close {
  background: rgba(0,0,0,.1);
  color: #111;
}
[data-theme="light"] #lyrics-overlay-close:hover { background: rgba(200,168,0,.2); color: #5a4000; }
[data-theme="light"] .lyrics-ov-banner-blur {
  background: linear-gradient(to bottom, transparent 30%, rgba(255,254,248,1));
}
[data-theme="light"] .lyrics-ov-artist-name { color: #111118; }
[data-theme="light"] .lyrics-ov-badge { color: #5a4000; }
[data-theme="light"] .lyrics-ov-open-link { color: #7a5800; border-color: rgba(200,168,0,.4); }
[data-theme="light"] .lyrics-ov-open-link:hover { background: rgba(200,168,0,.12); }
[data-theme="light"] #lyrics-overlay-toolbar {
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .lyrics-back-btn {
  background: rgba(200,168,0,.1);
  border-color: rgba(200,168,0,.4);
  color: #7a5800;
}
[data-theme="light"] .lyrics-back-btn:hover { background: rgba(200,168,0,.2); }
[data-theme="light"] .lyrics-overlay-list-toggle-wrap { color: var(--text2); }
[data-theme="light"] .lyrics-overlay-list-toggle-wrap:hover { color: var(--text); }
[data-theme="light"] .lyrics-add-song-btn { background: #c8a800; color: #000; }
[data-theme="light"] .lyrics-add-song-btn:hover { background: #b89600; }
[data-theme="light"] .lyrics-empty-tab { color: var(--text2); }
[data-theme="light"] .lyrics-song-card {
  background: rgba(0,0,0,.04);
  border: 1px solid var(--border);
}
[data-theme="light"] .lyrics-song-card:hover { background: rgba(0,0,0,.08); }
[data-theme="light"] .lyrics-song-title { color: #111118; }
[data-theme="light"] .lyrics-song-list-row {
  background: rgba(0,0,0,.03);
}
[data-theme="light"] .lyrics-song-list-row:hover { background: rgba(0,0,0,.07); }
[data-theme="light"] .lyrics-song-list-title { color: #111118; }
[data-theme="light"] .lyrics-song-view-title { color: #111118; }
[data-theme="light"] .lyrics-text {
  background: rgba(0,0,0,.03);
  border: 1px solid var(--border);
  color: #222228;
}
[data-theme="light"] .lyrics-text::-webkit-scrollbar-thumb { background: rgba(200,168,0,.3); }
[data-theme="light"] .lyrics-section-tab-btn { color: var(--text2); }
[data-theme="light"] .lyrics-section-tab-btn:hover { color: var(--text); }
[data-theme="light"] .lyrics-section-tab-btn.active { color: #7a5800; border-bottom-color: #c8a800; }
[data-theme="light"] .lyrics-section-tabs { border-bottom-color: var(--border); }
[data-theme="light"] .lyrics-song-action-btn {
  border-color: var(--border);
  color: var(--text2);
}
[data-theme="light"] .lyrics-song-action-btn:hover { background: rgba(0,0,0,.07); color: var(--text); }

/* ════════════════════════════════════════════════════════════════
   SHOP PAGE TOGGLE (Itch.io / Ko-fi / VGen "Show all" toggle)
   ════════════════════════════════════════════════════════════════ */
.shop-page-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color .15s;
}
.shop-page-toggle-wrap:hover { border-color: var(--accent); }
.shop-page-toggle-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  color: var(--text2);
  white-space: nowrap;
}
.shop-page-toggle-wrap .toggle { width: 34px; height: 18px; }
.shop-page-toggle-wrap .toggle-slider { border-radius: 9px; }
.shop-page-toggle-wrap .toggle-slider::after { width: 14px; height: 14px; left: 2px; top: 2px; }
.shop-page-toggle-wrap .toggle input:checked ~ .toggle-slider::after { transform: translateX(16px); }

/* ════════════════════════════════════════════════════════════════
   SHOP PROFILE OVERLAY
   ════════════════════════════════════════════════════════════════ */
#shop-profile-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
#shop-profile-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
#shop-overlay-box {
  background: #0d0d12;
  border-radius: 16px;
  width: min(860px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,.9);
  border: 1px solid rgba(255,255,255,.07);
}
#shop-overlay-box::-webkit-scrollbar { width: 6px; }
#shop-overlay-box::-webkit-scrollbar-track { background: transparent; }
#shop-overlay-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
#shop-overlay-close {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  background: rgba(0,0,0,.55); border: none; color: #fff;
  font-size: 1rem; width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#shop-overlay-close:hover { background: rgba(255,255,255,.18); }

/* Profile header */
#shop-overlay-header { position: relative; }
.shop-ov-banner {
  height: 160px;
  background-size: cover;
  background-position: center 25%;
  border-radius: 16px 16px 0 0;
  position: relative; overflow: hidden;
}
.shop-ov-banner-blur {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,13,18,0) 0%, rgba(13,13,18,1) 100%);
}
.shop-ov-profile-row {
  display: flex; align-items: flex-end; gap: 16px;
  padding: 0 24px 16px; margin-top: -52px; position: relative; z-index: 2;
}
.shop-ov-avatar {
  width: 84px; height: 84px; border-radius: 10px;
  object-fit: cover; flex-shrink: 0;
  border: 3px solid #0d0d12;
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
}
.shop-ov-avatar-placeholder {
  width: 84px; height: 84px; border-radius: 10px;
  background: rgba(255,255,255,.07);
  border: 2px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.shop-ov-profile-info { flex: 1; min-width: 0; }
.shop-ov-badge {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 3px;
}
.shop-ov-profile-name {
  font-size: 1.5rem; font-weight: 800; color: #fff;
  line-height: 1.2; margin-bottom: 3px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.shop-ov-handle {
  font-size: .78rem; margin-bottom: 4px;
}
.shop-ov-bio {
  font-size: .78rem; color: rgba(255,255,255,.6);
  line-height: 1.5; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.shop-ov-socials {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px;
}
.shop-ov-social-chip {
  font-size: .7rem; padding: 3px 9px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.6);
  text-decoration: none; transition: all .12s;
}
.shop-ov-social-chip:hover { border-color: rgba(255,255,255,.4); color: #fff; }
.shop-ov-open-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .73rem; text-decoration: none; padding: 5px 12px;
  border-radius: 20px; border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.65); transition: all .15s;
}
.shop-ov-open-link:hover { border-color: rgba(255,255,255,.5); color: #fff; }

/* Toolbar */
#shop-overlay-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 14px 24px 0;
  border-bottom: 1px solid rgba(255,255,255,.08); padding-bottom: 12px;
  flex-wrap: wrap;
}
.shop-overlay-list-toggle-wrap {
  display: flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,.45); cursor: pointer;
  font-size: .75rem; user-select: none;
}
.shop-overlay-list-toggle-wrap:hover { color: rgba(255,255,255,.8); }
.shop-add-item-btn {
  margin-left: auto; background: #e8c547; color: #000;
  border: none; font-size: .78rem; font-weight: 700;
  padding: 6px 14px; border-radius: 20px; cursor: pointer;
  transition: filter .15s, transform .1s;
}
.shop-add-item-btn:hover { filter: brightness(1.12); transform: scale(1.03); }

/* Content area */
#shop-overlay-content {
  padding: 20px 24px 28px; min-height: 120px;
}
.shop-empty-state {
  text-align: center; color: rgba(255,255,255,.35);
  font-size: .85rem; padding: 48px 0;
}
.shop-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.shop-item-card {
  background: rgba(255,255,255,.05); border-radius: 10px;
  overflow: hidden; cursor: pointer; transition: background .15s, transform .12s;
  position: relative;
}
.shop-item-card:hover { background: rgba(255,255,255,.1); transform: translateY(-2px); }
.shop-item-card img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
}
.shop-item-no-thumb {
  width: 100%; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
}
.shop-item-card-info { padding: 10px; }
.shop-item-card-title {
  font-size: .8rem; font-weight: 600; color: #fff;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; line-height: 1.3; margin-bottom: 4px;
}
.shop-item-card-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.shop-item-price {
  font-size: .75rem; font-weight: 700;
}
.shop-item-rating {
  font-size: .72rem; color: rgba(255,255,255,.55);
}

/* List view */
.shop-items-list { display: flex; flex-direction: column; gap: 4px; }
.shop-item-list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  background: rgba(255,255,255,.04); cursor: pointer;
  transition: background .12s;
}
.shop-item-list-row:hover { background: rgba(255,255,255,.09); }
.shop-item-list-thumb {
  width: 44px; height: 44px; border-radius: 6px;
  object-fit: cover; flex-shrink: 0; display: block;
}
.shop-item-list-no-thumb {
  background: rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: center;
}
.shop-item-list-info { flex: 1; min-width: 0; }
.shop-item-list-title {
  font-size: .84rem; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shop-item-list-price { font-size: .72rem; font-weight: 600; margin-top: 2px; }
.shop-item-list-arrow { flex-shrink: 0; opacity: .5; }
.shop-item-list-row:hover .shop-item-list-arrow { opacity: 1; }

/* ════════════════════════════════════════════════════════════════
   SHOP ITEM DETAIL OVERLAY  (game-store style)
   ════════════════════════════════════════════════════════════════ */
#shop-item-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(12px);
  z-index: 600;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
#shop-item-overlay.open { opacity: 1; pointer-events: auto; }
#shop-item-overlay-box {
  background: #0a0a0f;
  border-radius: 16px;
  width: min(900px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 32px 100px rgba(0,0,0,.95);
  border: 1px solid rgba(255,255,255,.08);
}
#shop-item-overlay-box::-webkit-scrollbar { width: 6px; }
#shop-item-overlay-box::-webkit-scrollbar-track { background: transparent; }
#shop-item-overlay-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

.shop-item-overlay-close {
  position: absolute; top: 14px; right: 14px; z-index: 20;
  background: rgba(0,0,0,.6); border: none; color: #fff;
  font-size: 1rem; width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.shop-item-overlay-close:hover { background: rgba(255,255,255,.2); }

.shop-item-ov-banner {
  height: 140px; background-size: cover; background-position: center;
  border-radius: 16px 16px 0 0; position: relative; overflow: hidden;
}
.shop-item-ov-banner-blur {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(10,10,15,1) 100%);
}
.shop-item-ov-body {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 28px; padding: 24px;
}
@media (max-width: 640px) {
  .shop-item-ov-body { grid-template-columns: 1fr; }
}
.shop-item-ov-gallery { display: flex; flex-direction: column; gap: 10px; }
.shop-item-ov-main-img-wrap {
  border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.05);
  aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
}
.shop-item-ov-main-img-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: opacity .2s;
}
.shop-item-ov-no-img {
  width: 100%; aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
}
.shop-item-ov-thumbs {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.shop-item-ov-thumb {
  width: 56px; height: 56px; border-radius: 7px;
  object-fit: cover; cursor: pointer; opacity: .55;
  border: 2px solid transparent; transition: opacity .12s, border-color .12s;
}
.shop-item-ov-thumb.active, .shop-item-ov-thumb:hover { opacity: 1; border-color: rgba(255,255,255,.4); }

.shop-item-ov-info { display: flex; flex-direction: column; gap: 12px; }
.shop-item-ov-badge {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em;
}
.shop-item-ov-title {
  font-size: 1.35rem; font-weight: 800; color: #fff;
  line-height: 1.25; margin: 0;
}
.shop-item-ov-seller {
  font-size: .8rem; color: rgba(255,255,255,.55);
}
.shop-item-ov-price {
  display: inline-block; font-size: 1.4rem; font-weight: 900;
  padding: 6px 18px; border-radius: 10px; border: 1px solid;
  letter-spacing: .02em;
}
.shop-item-ov-rating-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.shop-item-ov-stars {
  font-size: 1.1rem; color: #f4c542; letter-spacing: .05em;
}
.shop-item-ov-rating-num {
  font-size: .85rem; font-weight: 700; color: rgba(255,255,255,.8);
}
.shop-item-ov-review-count {
  font-size: .78rem; color: rgba(255,255,255,.45);
}
.shop-item-ov-breakdown {
  background: rgba(255,255,255,.04); border-radius: 8px;
  padding: 10px 14px; display: flex; flex-direction: column; gap: 5px;
}
.shop-item-ov-bar-row {
  display: flex; align-items: center; gap: 8px;
}
.shop-item-ov-bar-label { font-size: .72rem; color: rgba(255,255,255,.6); min-width: 22px; }
.shop-item-ov-bar-outer {
  flex: 1; height: 7px; background: rgba(255,255,255,.1);
  border-radius: 4px; overflow: hidden;
}
.shop-item-ov-bar-inner { height: 100%; border-radius: 4px; transition: width .4s; }
.shop-item-ov-bar-count { font-size: .72rem; color: rgba(255,255,255,.5); min-width: 24px; text-align: right; }
.shop-item-ov-desc {
  font-size: .82rem; color: rgba(255,255,255,.6);
  line-height: 1.65;
  background: rgba(255,255,255,.04); border-radius: 8px;
  padding: 12px 14px;
}
.shop-item-ov-actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto;
}
.shop-item-ov-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .82rem; font-weight: 600; padding: 8px 18px;
  border-radius: 8px; border: none; cursor: pointer;
  text-decoration: none; transition: filter .15s, transform .1s;
}
.shop-item-ov-btn:hover { filter: brightness(1.15); transform: scale(1.02); }
.shop-item-ov-btn-primary { }
.shop-item-ov-btn-ghost {
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.75);
}
.shop-item-ov-btn-ghost:hover { background: rgba(255,255,255,.18); }
.shop-item-ov-btn-danger {
  background: rgba(239,68,68,.18); color: #ef4444; border: 1px solid rgba(239,68,68,.3);
}
.shop-item-ov-btn-danger:hover { background: rgba(239,68,68,.35); }

/* ════════════════════════════════════════════════════════════════
   LIGHT MODE — SHOP PAGE TOGGLE
   ════════════════════════════════════════════════════════════════ */
[data-theme="light"] .shop-page-toggle-wrap { border-color: var(--border); background: var(--surface); }
[data-theme="light"] .shop-page-toggle-wrap:hover { border-color: var(--accent); }
[data-theme="light"] .shop-page-toggle-label { color: var(--text2); }

/* ════════════════════════════════════════════════════════════════
   LIGHT MODE — SHOP PROFILE OVERLAY
   ════════════════════════════════════════════════════════════════ */
[data-theme="light"] #shop-profile-overlay {
  background: rgba(0,0,0,.5);
}
[data-theme="light"] #shop-overlay-box {
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 16px 60px rgba(0,0,0,.18);
}
[data-theme="light"] #shop-overlay-box::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); }
[data-theme="light"] #shop-overlay-close {
  background: rgba(0,0,0,.12);
  color: #111;
}
[data-theme="light"] #shop-overlay-close:hover { background: rgba(0,0,0,.22); }
[data-theme="light"] .shop-ov-banner-blur {
  background: linear-gradient(to bottom, transparent 30%, rgba(255,255,255,1));
}
[data-theme="light"] .shop-ov-avatar-placeholder {
  background: rgba(0,0,0,.06);
  border-color: var(--border);
}
[data-theme="light"] .shop-ov-profile-name { color: #111118; }
[data-theme="light"] .shop-ov-handle { }
[data-theme="light"] .shop-ov-bio { color: #555560; }
[data-theme="light"] .shop-ov-social-chip {
  border-color: var(--border);
  color: var(--text2);
}
[data-theme="light"] .shop-ov-social-chip:hover { border-color: #999; color: var(--text); }
[data-theme="light"] .shop-ov-open-link {
  color: var(--text2);
  border-color: var(--border);
}
[data-theme="light"] .shop-ov-open-link:hover { border-color: #999; color: var(--text); }
[data-theme="light"] #shop-overlay-toolbar {
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .shop-overlay-list-toggle-wrap { color: var(--text2); }
[data-theme="light"] .shop-overlay-list-toggle-wrap:hover { color: var(--text); }
[data-theme="light"] #shop-overlay-content { background: transparent; }
[data-theme="light"] .shop-empty-state { color: var(--text2); }
[data-theme="light"] .shop-items-grid .shop-item-card {
  background: rgba(0,0,0,.04);
  border: 1px solid var(--border);
}
[data-theme="light"] .shop-items-grid .shop-item-card:hover { background: rgba(0,0,0,.08); }
[data-theme="light"] .shop-item-card-title { color: #111118; }
[data-theme="light"] .shop-item-rating { color: var(--text2); }
[data-theme="light"] .shop-item-no-thumb { }
[data-theme="light"] .shop-item-list-row {
  background: rgba(0,0,0,.04);
}
[data-theme="light"] .shop-item-list-row:hover { background: rgba(0,0,0,.08); }
[data-theme="light"] .shop-item-list-title { color: #111118; }
[data-theme="light"] .shop-item-list-no-thumb { background: rgba(0,0,0,.06); }

/* ════════════════════════════════════════════════════════════════
   LIGHT MODE — SHOP ITEM DETAIL OVERLAY
   ════════════════════════════════════════════════════════════════ */
[data-theme="light"] #shop-item-overlay {
  background: rgba(0,0,0,.5);
}
[data-theme="light"] #shop-item-overlay-box {
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 16px 60px rgba(0,0,0,.18);
}
[data-theme="light"] #shop-item-overlay-box::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); }
[data-theme="light"] .shop-item-overlay-close {
  background: rgba(0,0,0,.1);
  color: #111;
}
[data-theme="light"] .shop-item-overlay-close:hover { background: rgba(0,0,0,.2); }
[data-theme="light"] .shop-item-ov-banner-blur {
  background: linear-gradient(to bottom, transparent 30%, rgba(255,255,255,1));
}
[data-theme="light"] .shop-item-ov-badge { }
[data-theme="light"] .shop-item-ov-title { color: #111118; }
[data-theme="light"] .shop-item-ov-seller { color: #555560; }
[data-theme="light"] .shop-item-ov-rating-num { color: #222228; }
[data-theme="light"] .shop-item-ov-review-count { color: var(--text2); }
[data-theme="light"] .shop-item-ov-main-img-wrap {
  background: rgba(0,0,0,.05);
}
[data-theme="light"] .shop-item-ov-no-img { background: rgba(0,0,0,.05); }
[data-theme="light"] .shop-item-ov-thumb {
  border-color: transparent;
  opacity: .65;
}
[data-theme="light"] .shop-item-ov-thumb.active,
[data-theme="light"] .shop-item-ov-thumb:hover {
  opacity: 1;
  border-color: rgba(0,0,0,.3);
}
[data-theme="light"] .shop-item-ov-breakdown {
  background: rgba(0,0,0,.04);
  border: 1px solid var(--border);
}
[data-theme="light"] .shop-item-ov-bar-label { color: var(--text2); }
[data-theme="light"] .shop-item-ov-bar-outer { background: rgba(0,0,0,.1); }
[data-theme="light"] .shop-item-ov-bar-count { color: var(--text2); }
[data-theme="light"] .shop-item-ov-desc {
  background: rgba(0,0,0,.04);
  border: 1px solid var(--border);
  color: #444450;
}
[data-theme="light"] .shop-item-ov-btn-ghost {
  background: rgba(0,0,0,.07);
  color: #333;
}
[data-theme="light"] .shop-item-ov-btn-ghost:hover { background: rgba(0,0,0,.13); }
[data-theme="light"] .shop-item-ov-btn-danger {
  background: rgba(239,68,68,.1);
  color: #c0392b;
  border-color: rgba(239,68,68,.25);
}
[data-theme="light"] .shop-item-ov-btn-danger:hover { background: rgba(239,68,68,.2); }

/* ════════════════════════════════════════════════════════════════
   SHOP PROFILE CARD  (in the card grid — like Spotify/Lyrics artist card)
   ════════════════════════════════════════════════════════════════ */
.shop-card {
  padding: 0 !important;
  overflow: hidden;
}
.shop-card .card-content { padding: 0; }
.shop-profile-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  min-height: 160px;
}
.shop-profile-banner {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center top;
  filter: blur(2px) brightness(0.42);
  transform: scale(1.06);
}
.shop-profile-banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.08) 0%, rgba(0,0,0,.75) 100%);
}
.shop-profile-avatar {
  position: relative; z-index: 2;
  width: 60px; height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,.15);
  margin: 16px 0 8px 16px;
  display: block;
}
.shop-profile-avatar-placeholder {
  position: relative; z-index: 2;
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.15);
  margin: 16px 0 8px 16px;
  display: flex; align-items: center; justify-content: center;
}
.shop-profile-info {
  position: relative; z-index: 2;
  padding: 0 16px 14px;
}
.shop-profile-platform-label {
  font-size: .66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 2px; opacity: .9;
}
.shop-profile-name {
  font-size: .95rem; font-weight: 700; color: #fff;
  line-height: 1.25; margin-bottom: 2px;
}
.shop-profile-handle {
  font-size: .72rem; margin-bottom: 2px;
}
.shop-profile-stats {
  font-size: .72rem;
}
.shop-profile-open-hint {
  position: absolute; bottom: 14px; right: 14px;
  z-index: 3; opacity: .6; transition: opacity .15s;
}
.shop-card:hover .shop-profile-open-hint { opacity: 1; }

/* Light mode adjustments */
[data-theme="light"] .shop-profile-banner { filter: blur(2px) brightness(0.55); }
[data-theme="light"] .shop-profile-banner-overlay {
  background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(255,255,255,.80) 100%);
}

/* ════════════════════════════════════════════════════════════════
   FIX: Shop item overlay — image contain + scrollable description
   ════════════════════════════════════════════════════════════════ */
.shop-item-ov-main-img-wrap img {
  width: 100%; height: 100%;
  object-fit: contain;   /* show full image, no cropping */
  display: block;
}
.shop-item-ov-desc {
  font-size: .82rem; color: rgba(255,255,255,.6);
  line-height: 1.65;
  background: rgba(255,255,255,.04); border-radius: 8px;
  padding: 12px 14px;
  max-height: 240px;
  overflow-y: auto;
}
.shop-item-ov-desc::-webkit-scrollbar { width: 5px; }
.shop-item-ov-desc::-webkit-scrollbar-track { background: transparent; }
.shop-item-ov-desc::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
[data-theme="light"] .shop-item-ov-desc {
  color: #444450;
  background: rgba(0,0,0,.04);
  border: 1px solid var(--border);
}
[data-theme="light"] .shop-item-ov-desc::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); }

/* ════════════════════════════════════════════════════════════════
   ART PROFILE CARD (in the card grid)
   ════════════════════════════════════════════════════════════════ */
.art-card {
  padding: 0 !important;
  overflow: hidden;
}
.art-card .card-content { padding: 0; }
.art-card .card-footer,
.shop-card .card-footer {
  padding-left: 15px;
  padding-right: 15px;
  padding-bottom: 6px;
}
.art-profile-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  min-height: 160px;
}
.art-profile-banner {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center top;
  filter: blur(2px) brightness(0.38);
  transform: scale(1.06);
}
.art-profile-banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.78) 100%);
}
.art-profile-avatar {
  position: relative; z-index: 2;
  width: 60px; height: 60px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255,255,255,.15);
  margin: 16px 0 8px 16px; display: block;
}
.art-profile-avatar-placeholder {
  position: relative; z-index: 2;
  width: 60px; height: 60px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.15);
  margin: 16px 0 8px 16px;
  display: flex; align-items: center; justify-content: center;
}
.art-profile-info {
  position: relative; z-index: 2;
  padding: 0 16px 14px;
}
.art-profile-platform-label {
  font-size: .66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 2px;
}
.art-profile-name {
  font-size: .95rem; font-weight: 700; color: #fff;
  line-height: 1.25; margin-bottom: 2px;
}
.art-profile-handle { font-size: .72rem; margin-bottom: 2px; }
.art-profile-stats { font-size: .72rem; }
.art-profile-open-hint {
  position: absolute; bottom: 14px; right: 14px;
  z-index: 3; opacity: .6; transition: opacity .15s;
}
.art-card:hover .art-profile-open-hint { opacity: 1; }

[data-theme="light"] .art-profile-banner { filter: blur(2px) brightness(0.52); }
[data-theme="light"] .art-profile-banner-overlay {
  background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(255,255,255,.80) 100%);
}

/* ════════════════════════════════════════════════════════════════
   ART PROFILE OVERLAY
   ════════════════════════════════════════════════════════════════ */
#art-profile-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.9);
  backdrop-filter: blur(10px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
#art-profile-overlay.open { opacity: 1; pointer-events: auto; }
#art-overlay-box {
  background: #090c12;
  border-radius: 18px;
  width: min(920px, 96vw);
  max-height: 93vh;
  overflow-y: auto;
  position: relative;
  display: flex; flex-direction: column;
  box-shadow: 0 40px 100px rgba(0,0,0,.95);
  border: 1px solid rgba(255,255,255,.07);
}
#art-overlay-box::-webkit-scrollbar { width: 6px; }
#art-overlay-box::-webkit-scrollbar-track { background: transparent; }
#art-overlay-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
#art-overlay-close {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  background: rgba(0,0,0,.6); border: none; color: #fff;
  font-size: 1rem; width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#art-overlay-close:hover { background: rgba(255,255,255,.2); }

#art-overlay-header { position: relative; }
.art-ov-banner {
  height: 170px; background-size: cover; background-position: center 25%;
  border-radius: 18px 18px 0 0; position: relative; overflow: hidden;
}
.art-ov-banner-blur {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(9,12,18,0) 0%, rgba(9,12,18,1) 100%);
}
.art-ov-profile-row {
  display: flex; align-items: flex-end; gap: 16px;
  padding: 0 24px 20px; margin-top: -56px; position: relative; z-index: 2;
}
.art-ov-avatar {
  width: 90px; height: 90px; border-radius: 12px;
  object-fit: cover; flex-shrink: 0;
  border: 3px solid #090c12;
  box-shadow: 0 8px 28px rgba(0,0,0,.7);
}
.art-ov-avatar-placeholder {
  width: 90px; height: 90px; border-radius: 12px;
  background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.art-ov-profile-info { flex: 1; min-width: 0; }
.art-ov-badge { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.art-ov-profile-name { font-size: 1.6rem; font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 2px; }
.art-ov-handle { font-size: .8rem; margin-bottom: 3px; }
.art-ov-location { font-size: .75rem; color: rgba(255,255,255,.5); margin-bottom: 5px; }
.art-ov-bio { font-size: .79rem; color: rgba(255,255,255,.6); line-height: 1.55; margin-bottom: 10px; }
.art-ov-stats {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.art-ov-stat-chip {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(255,255,255,.06); border-radius: 8px;
  padding: 5px 10px; min-width: 60px;
}
.art-ov-stat-val { font-size: .85rem; font-weight: 700; line-height: 1.2; }
.art-ov-stat-label { font-size: .62rem; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .06em; }
.art-ov-links-row {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.art-ov-social-chip {
  font-size: .7rem; padding: 3px 9px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.6);
  text-decoration: none; transition: all .12s;
}
.art-ov-social-chip:hover { border-color: rgba(255,255,255,.4); color: #fff; }
.art-ov-open-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .73rem; text-decoration: none; padding: 5px 13px;
  border-radius: 20px; border: 1px solid;
  transition: opacity .15s;
}
.art-ov-open-link:hover { opacity: .75; }

/* DeviantArt preview strip */
#art-overlay-previews { padding: 0 24px 4px; }
.art-ov-previews-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; opacity: .8; }
.art-ov-previews-strip {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px;
}
.art-ov-previews-strip::-webkit-scrollbar { height: 4px; }
.art-ov-previews-strip::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }
.art-ov-preview-img {
  width: 120px; height: 90px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.1);
}

/* Toolbar */
#art-overlay-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 24px 12px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-wrap: wrap;
}
.art-overlay-toggle-wrap {
  display: flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,.45); cursor: pointer;
  font-size: .75rem; user-select: none;
}
.art-overlay-toggle-wrap:hover { color: rgba(255,255,255,.8); }
.art-add-item-btn {
  margin-left: auto; background: #e8c547; color: #000;
  border: none; font-size: .78rem; font-weight: 700;
  padding: 6px 14px; border-radius: 20px; cursor: pointer;
  transition: filter .15s, transform .1s;
}
.art-add-item-btn:hover { filter: brightness(1.12); transform: scale(1.03); }

/* Content grid/list */
#art-overlay-content { padding: 20px 24px 30px; min-height: 120px; }
.art-empty-state { text-align: center; color: rgba(255,255,255,.35); font-size: .85rem; padding: 48px 0; }
.art-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.art-item-card {
  background: rgba(255,255,255,.05); border-radius: 10px;
  overflow: hidden; cursor: pointer; transition: background .15s, transform .12s;
}
.art-item-card:hover { background: rgba(255,255,255,.1); transform: translateY(-2px); }
.art-item-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.art-item-no-thumb { width: 100%; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; }
.art-item-card-info { padding: 9px 10px; }
.art-item-card-title { font-size: .79rem; font-weight: 600; color: #fff; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; margin-bottom: 4px; }
.art-item-card-meta { display: flex; gap: 5px; flex-wrap: wrap; }
.art-items-list { display: flex; flex-direction: column; gap: 4px; }
.art-item-list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  background: rgba(255,255,255,.04); cursor: pointer; transition: background .12s;
}
.art-item-list-row:hover { background: rgba(255,255,255,.09); }
.art-item-list-thumb { width: 50px; height: 38px; border-radius: 6px; object-fit: cover; flex-shrink: 0; display: block; }
.art-item-list-no-thumb { background: rgba(255,255,255,.06); display: flex; align-items: center; justify-content: center; }
.art-item-list-info { flex: 1; min-width: 0; }
.art-item-list-title { font-size: .84rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-item-list-meta { font-size: .72rem; margin-top: 2px; }
.art-item-list-arrow { flex-shrink: 0; opacity: .5; }
.art-item-list-row:hover .art-item-list-arrow { opacity: 1; }

/* ════════════════════════════════════════════════════════════════
   ART ITEM DETAIL OVERLAY
   ════════════════════════════════════════════════════════════════ */
#art-item-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.93);
  backdrop-filter: blur(14px);
  z-index: 600;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
#art-item-overlay.open { opacity: 1; pointer-events: auto; }
#art-item-overlay-box {
  background: #080a10;
  border-radius: 18px;
  width: min(920px, 96vw);
  max-height: 93vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 40px 110px rgba(0,0,0,.98);
  border: 1px solid rgba(255,255,255,.08);
}
#art-item-overlay-box::-webkit-scrollbar { width: 6px; }
#art-item-overlay-box::-webkit-scrollbar-track { background: transparent; }
#art-item-overlay-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

.art-item-ov-close {
  position: absolute; top: 14px; right: 14px; z-index: 20;
  background: rgba(0,0,0,.65); border: none; color: #fff;
  font-size: 1rem; width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.art-item-ov-close:hover { background: rgba(255,255,255,.22); }

.art-item-ov-body {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 28px; padding: 28px;
}
@media (max-width: 640px) { .art-item-ov-body { grid-template-columns: 1fr; } }
.art-item-ov-body-sketchfab .art-item-ov-media,
.art-item-ov-body-ng .art-item-ov-media { grid-column: span 1; }

.art-item-ov-img-wrap {
  border-radius: 12px; overflow: hidden;
  background: rgba(255,255,255,.05);
  aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
}
.art-item-ov-img-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; }
.art-item-ov-no-thumb { width: 100%; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.art-item-ov-embed-wrap {
  border-radius: 12px; overflow: hidden;
  aspect-ratio: 16/9; background: #000;
  position: relative;
}
.art-item-ov-embed { width: 100%; height: 100%; border: none; display: block; }

.art-item-ov-info { display: flex; flex-direction: column; gap: 12px; }
.art-item-ov-badge { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.art-item-ov-title { font-size: 1.35rem; font-weight: 800; color: #fff; line-height: 1.25; margin: 0; }
.art-item-ov-creator { font-size: .8rem; color: rgba(255,255,255,.55); }
.art-item-ov-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.art-item-ov-stat {
  font-size: .75rem; color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.06); border-radius: 6px;
  padding: 3px 8px;
}
.art-item-ov-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.art-item-ov-tag {
  font-size: .69rem; padding: 2px 8px; border-radius: 20px;
  border: 1px solid; opacity: .8;
}
.art-item-ov-desc {
  font-size: .81rem; color: rgba(255,255,255,.6); line-height: 1.65;
  background: rgba(255,255,255,.04); border-radius: 8px;
  padding: 12px 14px; max-height: 220px; overflow-y: auto;
}
.art-item-ov-desc::-webkit-scrollbar { width: 4px; }
.art-item-ov-desc::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }
/* Sketchfab HTML descriptions */
.sketchfab-desc p { margin: 0 0 8px; }
.sketchfab-desc p:last-child { margin-bottom: 0; }
.sketchfab-desc img { max-width: 100%; border-radius: 6px; margin-top: 6px; }
.sketchfab-desc a { color: #1caad9; text-decoration: none; }
.sketchfab-desc a:hover { text-decoration: underline; }
.art-item-ov-author-comments {
  font-size: .79rem; color: rgba(255,255,255,.55); line-height: 1.6;
  background: rgba(255,255,255,.04); border-radius: 8px;
  padding: 12px 14px; max-height: 180px; overflow-y: auto;
}
.art-item-ov-comments-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.art-item-ov-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.art-item-ov-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .82rem; font-weight: 600; padding: 8px 18px;
  border-radius: 8px; border: none; cursor: pointer;
  text-decoration: none; transition: filter .15s, transform .1s;
}
.art-item-ov-btn:hover { filter: brightness(1.15); transform: scale(1.02); }
.art-item-ov-btn-ghost { background: rgba(255,255,255,.1); color: rgba(255,255,255,.75); }
.art-item-ov-btn-ghost:hover { background: rgba(255,255,255,.18); }
.art-item-ov-btn-danger { background: rgba(239,68,68,.18); color: #ef4444; border: 1px solid rgba(239,68,68,.3); }
.art-item-ov-btn-danger:hover { background: rgba(239,68,68,.35); }

/* ════════════════════════════════════════════════════════════════
   LIGHT MODE — ART OVERLAYS
   ════════════════════════════════════════════════════════════════ */
[data-theme="light"] #art-profile-overlay,
[data-theme="light"] #art-item-overlay { background: rgba(0,0,0,.55); }
[data-theme="light"] #art-overlay-box,
[data-theme="light"] #art-item-overlay-box {
  background: #ffffff; border: 1px solid var(--border);
  box-shadow: 0 20px 70px rgba(0,0,0,.2);
}
[data-theme="light"] .art-ov-banner-blur {
  background: linear-gradient(to bottom, transparent 30%, rgba(255,255,255,1));
}
[data-theme="light"] .art-ov-profile-name { color: #111118; }
[data-theme="light"] .art-ov-bio { color: #555560; }
[data-theme="light"] .art-ov-stat-chip { background: rgba(0,0,0,.05); }
[data-theme="light"] .art-ov-stat-label { color: var(--text2); }
[data-theme="light"] .art-ov-social-chip { border-color: var(--border); color: var(--text2); }
[data-theme="light"] .art-ov-social-chip:hover { border-color: #999; color: var(--text); }
[data-theme="light"] #art-overlay-toolbar { border-bottom: 1px solid var(--border); }
[data-theme="light"] .art-overlay-toggle-wrap { color: var(--text2); }
[data-theme="light"] .art-item-card { background: rgba(0,0,0,.04); border: 1px solid var(--border); }
[data-theme="light"] .art-item-card:hover { background: rgba(0,0,0,.08); }
[data-theme="light"] .art-item-card-title { color: #111118; }
[data-theme="light"] .art-item-list-row { background: rgba(0,0,0,.04); }
[data-theme="light"] .art-item-list-row:hover { background: rgba(0,0,0,.08); }
[data-theme="light"] .art-item-list-title { color: #111118; }
[data-theme="light"] .art-item-ov-title { color: #111118; }
[data-theme="light"] .art-item-ov-creator { color: #555560; }
[data-theme="light"] .art-item-ov-stat { background: rgba(0,0,0,.06); color: #444; }
[data-theme="light"] .art-item-ov-desc { background: rgba(0,0,0,.04); border: 1px solid var(--border); color: #444450; }
[data-theme="light"] .art-item-ov-author-comments { background: rgba(0,0,0,.04); border: 1px solid var(--border); color: #555; }
[data-theme="light"] .art-item-ov-btn-ghost { background: rgba(0,0,0,.07); color: #333; }
[data-theme="light"] .art-item-ov-btn-ghost:hover { background: rgba(0,0,0,.13); }
[data-theme="light"] #art-overlay-close, [data-theme="light"] .art-item-ov-close { background: rgba(0,0,0,.12); color: #111; }
[data-theme="light"] #art-overlay-close:hover, [data-theme="light"] .art-item-ov-close:hover { background: rgba(0,0,0,.22); }
[data-theme="light"] .art-ov-avatar-placeholder { background: rgba(0,0,0,.06); border-color: var(--border); }
[data-theme="light"] .art-item-ov-img-wrap { background: rgba(0,0,0,.05); }

/* ═══════════════════════════════════════════════════════
   PATREON CREATOR CARD
═══════════════════════════════════════════════════════ */
.patreon-creator-card { display:flex; flex-direction:column; border-radius:10px; overflow:hidden; background:var(--surface2); }
.patreon-creator-banner { position:relative; height:64px; background-size:cover; background-position:center; background:linear-gradient(135deg,#1a0a00,#3c1f00); }
.patreon-creator-banner-overlay { position:absolute; inset:0; background:linear-gradient(to bottom, rgba(0,0,0,.05), rgba(0,0,0,.45)); }
.patreon-creator-inline-badge { display:inline-flex; align-items:center; gap:4px; background:rgba(249,104,84,.12); border:1px solid rgba(249,104,84,.3); border-radius:20px; padding:2px 9px; font-size:.7rem; font-weight:700; color:#f96854; margin-bottom:6px; }
.patreon-creator-body { padding:12px 14px 14px; }
.patreon-creator-name { font-size:1rem; font-weight:700; color:var(--text1); margin-bottom:4px; }
.patreon-creator-desc { font-size:.82rem; color:var(--text2); line-height:1.45; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

/* ═══════════════════════════════════════════════════════
   TUMBLR POST CARD
═══════════════════════════════════════════════════════ */
.tumblr-post-card { display:flex; flex-direction:column; gap:8px; }
.tumblr-post-thumb { width:100%; border-radius:8px; object-fit:cover; max-height:200px; display:block; background:var(--surface2); }
.tumblr-post-body { font-size:.88rem; color:var(--text1); line-height:1.5; }
.tumblr-post-stats { display:flex; gap:12px; font-size:.78rem; color:var(--text2); padding-top:4px; border-top:1px solid var(--border); }

/* ═══════════════════════════════════════════════════════
   GITHUB REPO CARD
═══════════════════════════════════════════════════════ */
.github-repo-card { background:var(--surface2); border-radius:10px; padding:14px; border:1px solid #30363d; }
.github-repo-header { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.github-repo-path { font-size:.95rem; font-weight:600; color:#58a6ff; }
.github-repo-desc { font-size:.82rem; color:var(--text2); line-height:1.45; margin-bottom:8px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.github-repo-meta { display:flex; gap:12px; font-size:.78rem; color:#8b949e; flex-wrap:wrap; }
.github-lang-dot { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:4px; vertical-align:middle; }

/* ═══════════════════════════════════════════════════════
   REVIEW CARD (IMDb / RT)
═══════════════════════════════════════════════════════ */
.review-card { display:flex; gap:12px; }
.review-card-poster { flex-shrink:0; width:90px; }
.review-card-poster img { width:100%; border-radius:8px; object-fit:cover; aspect-ratio:2/3; background:var(--surface2); display:block; }
.review-card-info { flex:1; min-width:0; display:flex; flex-direction:column; gap:4px; }
.review-badge-imdb { background:#f5c518; color:#000; font-size:.68rem; font-weight:800; padding:2px 7px; border-radius:4px; display:inline-block; width:fit-content; }
.review-badge-rt { background:#fa320a; color:#fff; font-size:.68rem; font-weight:700; padding:2px 7px; border-radius:4px; display:inline-block; width:fit-content; }
.review-card-title { font-size:.92rem; font-weight:700; color:var(--text1); line-height:1.3; }
.review-card-year { font-size:.78rem; color:var(--text2); }
.review-card-genre { font-size:.78rem; color:var(--text2); }
.review-card-director { font-size:.75rem; color:var(--text2); }
.imdb-rating { font-size:1.1rem; font-weight:800; color:#f5c518; display:flex; align-items:baseline; gap:2px; }
.imdb-rating span { font-size:.75rem; font-weight:400; color:var(--text2); }
.rt-rating { display:flex; align-items:center; gap:6px; font-size:1.1rem; font-weight:700; color:#fa320a; }

/* ═══════════════════════════════════════════════════════
   STEAM GAME CARD
═══════════════════════════════════════════════════════ */
.steam-game-card { display:flex; flex-direction:column; gap:0; border-radius:10px; overflow:hidden; background:var(--surface2); }
.steam-game-img { width:100%; height:120px; object-fit:cover; display:block; border-radius:8px 8px 0 0; background:var(--surface2); }
.steam-game-info { padding:10px 12px 12px; }
.steam-game-badge { background:#1b2838; color:#66c0f4; font-size:.68rem; font-weight:700; padding:2px 8px; border-radius:4px; border:1px solid #4a90d2; }
.steam-metacritic { border:2px solid; border-radius:4px; font-size:.78rem; font-weight:800; padding:1px 6px; margin-left:4px; }
.steam-game-title { font-size:.95rem; font-weight:700; color:var(--text1); margin:6px 0 4px; }
.steam-game-genres { font-size:.78rem; color:var(--text2); }

/* ═══════════════════════════════════════════════════════
   SHOP ITEM PREVIEW CARD (CGTrader / FlippedNormals)
═══════════════════════════════════════════════════════ */
.shop-item-preview-card { display:flex; flex-direction:column; gap:0; border-radius:10px; overflow:hidden; }
.shop-item-preview-img { width:100%; height:180px; object-fit:cover; display:block; border-radius:8px 8px 0 0; background:var(--surface2); }
.shop-item-preview-info { padding:10px 12px 12px; background:var(--surface2); border-radius:0 0 8px 8px; }
.shop-item-preview-badge { font-size:.72rem; font-weight:700; margin-bottom:4px; }
.shop-item-preview-title { font-size:.9rem; font-weight:600; color:var(--text1); line-height:1.35; margin-bottom:6px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.shop-item-preview-meta { display:flex; align-items:center; gap:8px; font-size:.78rem; color:var(--text2); flex-wrap:wrap; }
.shop-item-preview-seller { color:var(--text2); }
.shop-item-preview-price { color:var(--text1); font-weight:600; margin-left:auto; }

/* ═══════════════════════════════════════════════════════
   CODE OVERLAY (GitHub)
═══════════════════════════════════════════════════════ */
#code-overlay {
  display:none; position:fixed; inset:0; z-index:1200;
  background:rgba(0,0,0,.7); backdrop-filter:blur(4px);
  align-items:center; justify-content:center;
}
#code-overlay.open { display:flex; }
#code-overlay-box {
  background:#0d1117; border:1px solid #30363d; border-radius:14px;
  width:min(560px,96vw); max-height:88vh; overflow-y:auto;
  padding:28px 28px 24px; position:relative;
  color:#e6edf3; font-family:monospace;
}
.code-ov-close {
  position:absolute; top:14px; right:14px; background:transparent;
  border:none; color:#8b949e; cursor:pointer; font-size:1.1rem; padding:4px 8px;
  border-radius:6px; transition:background .15s;
}
.code-ov-close:hover { background:#21262d; color:#e6edf3; }
.code-ov-header { display:flex; align-items:center; gap:12px; margin-bottom:12px; padding-bottom:12px; border-bottom:1px solid #21262d; }
.code-ov-user-header { display:flex; align-items:center; gap:14px; margin-bottom:14px; padding-bottom:14px; border-bottom:1px solid #21262d; }
.code-ov-desc { font-size:.88rem; color:#8b949e; margin-bottom:14px; line-height:1.5; font-family:inherit; }
.code-ov-stats-row { display:flex; gap:16px; flex-wrap:wrap; margin-bottom:16px; }
.code-ov-stat { display:flex; align-items:center; gap:5px; font-size:.82rem; color:#8b949e; font-family:inherit; }
.code-ov-profile-row { display:flex; align-items:center; gap:12px; background:#161b22; border:1px solid #30363d; border-radius:8px; padding:10px 14px; margin-bottom:16px; cursor:pointer; transition:background .15s; }
.code-ov-profile-row:hover { background:#21262d; }
.code-ov-repos-list { background:#161b22; border:1px solid #21262d; border-radius:8px; padding:10px; margin-bottom:16px; }
.code-ov-repo-row { display:flex; align-items:center; gap:8px; padding:7px 8px; border-radius:6px; cursor:pointer; transition:background .15s; }
.code-ov-repo-row:hover { background:#21262d; }
.code-ov-lang-tag { font-size:.72rem; color:#8b949e; background:#21262d; border-radius:10px; padding:1px 7px; }
.code-ov-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.code-ov-btn { padding:8px 18px; border-radius:8px; font-size:.85rem; font-weight:600; cursor:pointer; border:none; text-decoration:none; display:inline-flex; align-items:center; transition:opacity .15s; }
.code-ov-btn-primary { background:#238636; color:#fff; }
.code-ov-btn-primary:hover { opacity:.85; }
.code-ov-btn-ghost { background:#21262d; color:#e6edf3; border:1px solid #30363d; }
.code-ov-btn-ghost:hover { background:#30363d; }
.code-ov-btn-danger { background:transparent; color:#f85149; border:1px solid #f8514966; }
.code-ov-btn-danger:hover { background:#f8514918; }

/* ═══════════════════════════════════════════════════════
   CODE PROFILE OVERLAY (GitHub User)
═══════════════════════════════════════════════════════ */
#code-profile-overlay {
  display:none; position:fixed; inset:0; z-index:1200;
  background:rgba(0,0,0,.75); backdrop-filter:blur(4px);
  align-items:flex-start; justify-content:center; overflow-y:auto; padding:32px 12px;
}
#code-profile-overlay.open { display:flex; }
#code-profile-overlay-box {
  background:#0d1117; border:1px solid #30363d; border-radius:14px;
  width:min(700px,98vw); position:relative; color:#e6edf3; font-family:monospace;
  display:flex; flex-direction:column; overflow:hidden;
}
#code-profile-overlay-close {
  position:absolute; top:14px; right:14px; background:transparent;
  border:none; color:#8b949e; cursor:pointer; font-size:1.1rem; padding:4px 8px;
  border-radius:6px; transition:background .15s; z-index:2;
}
#code-profile-overlay-close:hover { background:#21262d; color:#e6edf3; }
#code-profile-overlay-header { position:relative; }
.cpov-banner { display:none; } /* banner removed */
.cpov-profile-row-legacy { display:flex; align-items:flex-end; gap:16px; padding:0 24px 16px; margin-top:-28px; position:relative; border-bottom:1px solid #21262d; }
.cpov-avatar { width:64px; height:64px; border-radius:50%; border:3px solid #0d1117; object-fit:cover; flex-shrink:0; background:#161b22; }
.cpov-info { flex:1; min-width:0; padding-bottom:4px; }
.cpov-platform-label { font-size:.72rem; font-weight:700; color:#238636; font-family:inherit; margin-bottom:2px; }
.cpov-name { font-size:1.1rem; font-weight:700; color:#e6edf3; }
.cpov-handle { font-size:.82rem; color:#8b949e; margin-top:1px; }
.cpov-bio { font-size:.83rem; color:#8b949e; margin-top:4px; line-height:1.45; }
.cpov-stats { display:flex; gap:14px; flex-wrap:wrap; margin-top:8px; }
.cpov-stat { font-size:.8rem; color:#8b949e; }
.cpov-stat strong { color:#e6edf3; }
#code-profile-overlay-toolbar {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 24px; border-bottom:1px solid #21262d;
}
.cpov-toolbar-label { font-size:.78rem; color:#8b949e; font-family:inherit; }
.cpov-show-toggle { display:flex; align-items:center; gap:6px; font-size:.78rem; color:#8b949e; cursor:pointer; user-select:none; font-family:inherit; }
#code-profile-overlay-content { padding:16px 24px 24px; display:grid; grid-template-columns:repeat(auto-fill,minmax(270px,1fr)); gap:12px; }
.cpov-repo-card { background:#161b22; border:1px solid #30363d; border-radius:10px; padding:14px; cursor:pointer; transition:border-color .15s; }
.cpov-repo-card:hover { border-color:#58a6ff55; }
.cpov-open-gh-btn { display:inline-flex; align-items:center; gap:6px; background:#238636; color:#fff; border:none; border-radius:8px; padding:8px 18px; font-size:.85rem; font-weight:600; cursor:pointer; text-decoration:none; transition:opacity .15s; }
.cpov-open-gh-btn:hover { opacity:.85; }
.cpov-empty { color:#8b949e; font-size:.88rem; padding:24px 0; text-align:center; grid-column:1/-1; }

/* ═══════════════════════════════════════════════════════
   GITHUB USER PROFILE CARD
═══════════════════════════════════════════════════════ */
.github-profile-card { background:linear-gradient(135deg,#0d1117,#161b22); border-radius:10px; overflow:hidden; border:1px solid #30363d; }
.github-profile-card-header { display:flex; align-items:center; gap:12px; padding:14px; border-bottom:1px solid #21262d30; }
.github-profile-card-avatar { width:44px; height:44px; border-radius:50%; border:2px solid #238636; object-fit:cover; flex-shrink:0; }
.github-profile-card-info { flex:1; min-width:0; }
.github-profile-card-label { font-size:.68rem; font-weight:700; color:#238636; margin-bottom:1px; font-family:monospace; }
.github-profile-card-name { font-size:.95rem; font-weight:700; color:#e6edf3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.github-profile-card-handle { font-size:.78rem; color:#8b949e; font-family:monospace; }
.github-profile-card-stats { display:flex; gap:0; }
.github-profile-card-stat { flex:1; text-align:center; padding:8px 4px; border-right:1px solid #21262d; }
.github-profile-card-stat:last-child { border-right:none; }
.github-profile-card-stat-val { font-size:.92rem; font-weight:700; color:#e6edf3; display:block; font-family:monospace; }
.github-profile-card-stat-label { font-size:.65rem; color:#8b949e; display:block; }
.github-profile-card-hint { display:flex; align-items:center; justify-content:center; gap:5px; padding:7px; font-size:.73rem; color:#58a6ff88; border-top:1px solid #21262d30; font-family:inherit; }

/* ═══════════════════════════════════════════════════════
   TUMBLR PROFILE CARD
═══════════════════════════════════════════════════════ */
.tumblr-profile-card { background:linear-gradient(135deg,#001429,#002244); border-radius:10px; overflow:hidden; border:1px solid #35465c44; }
.tumblr-profile-card-banner { height:52px; background:linear-gradient(90deg,#35465c,#4a6fa5); background-size:cover; background-position:center; }
.tumblr-profile-card-body { display:flex; align-items:center; gap:10px; padding:0 12px 12px; margin-top:-18px; }
.tumblr-profile-card-avatar { width:44px; height:44px; border-radius:50%; border:2px solid #001429; object-fit:cover; flex-shrink:0; background:#35465c; }
.tumblr-profile-card-info { flex:1; min-width:0; padding-top:20px; }
.tumblr-profile-card-label { font-size:.68rem; font-weight:700; color:#35a7ff; margin-bottom:1px; }
.tumblr-profile-card-name { font-size:.95rem; font-weight:700; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tumblr-profile-card-handle { font-size:.75rem; color:#8b9ab0; }
.tumblr-profile-card-bio { font-size:.75rem; color:#8b9ab0; padding:0 12px 10px; line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.tumblr-profile-card-hint { display:flex; align-items:center; justify-content:center; gap:5px; padding:6px; font-size:.72rem; color:#35a7ff88; border-top:1px solid #35465c44; }

/* ═══════════════════════════════════════════════════════
   TUMBLR PROFILE OVERLAY
═══════════════════════════════════════════════════════ */
#tumblr-profile-overlay {
  display:none; position:fixed; inset:0; z-index:1200;
  background:rgba(0,0,0,.75); backdrop-filter:blur(4px);
  align-items:flex-start; justify-content:center; overflow-y:auto; padding:32px 12px;
}
#tumblr-profile-overlay.open { display:flex; }
#tumblr-profile-overlay-box {
  background:#001429; border:1px solid #35465c; border-radius:14px;
  width:min(680px,98vw); position:relative; color:#e8f0ff;
  display:flex; flex-direction:column; overflow:hidden;
}
#tumblr-profile-overlay-close {
  position:absolute; top:14px; right:14px; background:transparent;
  border:none; color:#8b9ab0; cursor:pointer; font-size:1.1rem; padding:4px 8px;
  border-radius:6px; transition:background .15s; z-index:2;
}
#tumblr-profile-overlay-close:hover { background:#35465c; color:#fff; }
.tpov-banner { display:none; } /* banner removed */
.tpov-profile-row-legacy { display:flex; align-items:flex-end; gap:14px; padding:0 24px 16px; margin-top:-28px; position:relative; border-bottom:1px solid #35465c44; }
.tpov-avatar { width:64px; height:64px; border-radius:50%; border:3px solid #001429; object-fit:cover; flex-shrink:0; background:#35465c; }
.tpov-info { flex:1; min-width:0; padding-bottom:4px; }
.tpov-platform-label { font-size:.72rem; font-weight:700; color:#35a7ff; margin-bottom:2px; }
.tpov-name { font-size:1.1rem; font-weight:700; color:#fff; }
.tpov-handle { font-size:.82rem; color:#8b9ab0; margin-top:1px; }
.tpov-bio { font-size:.83rem; color:#8b9ab0; margin-top:6px; line-height:1.45; }
#tumblr-profile-overlay-toolbar {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 24px; border-bottom:1px solid #35465c44;
}
#tumblr-profile-overlay-content { padding:16px 24px 24px; display:flex; flex-direction:column; gap:10px; }
.tpov-post-card { background:#002244; border:1px solid #35465c44; border-radius:10px; padding:14px; cursor:pointer; transition:border-color .15s; }
.tpov-post-card:hover { border-color:#35a7ff55; }
.tpov-post-thumb { width:100%; max-height:140px; object-fit:cover; border-radius:6px; margin-bottom:8px; display:block; }
.tpov-post-text { font-size:.88rem; color:#ccd8ee; line-height:1.5; margin-bottom:8px; }
.tpov-post-stats { display:flex; gap:10px; font-size:.78rem; color:#8b9ab0; }
.tpov-empty { color:#8b9ab0; font-size:.88rem; padding:24px 0; text-align:center; }

/* ═══════════════════════════════════════════════════════
   TUMBLR POST OVERLAY
═══════════════════════════════════════════════════════ */
#tumblr-post-overlay {
  display:none; position:fixed; inset:0; z-index:1300;
  background:rgba(0,0,0,.8); backdrop-filter:blur(4px);
  align-items:center; justify-content:center;
}
#tumblr-post-overlay.open { display:flex; }
#tumblr-post-overlay-box {
  background:#001e3a; border:1px solid #35465c; border-radius:14px;
  width:min(560px,96vw); max-height:88vh; overflow-y:auto;
  padding:28px 28px 24px; position:relative; color:#e8f0ff;
}

/* ═══════════════════════════════════════════════════════
   REVIEW OVERLAY (IMDb / RT)
═══════════════════════════════════════════════════════ */
/* review-overlay base styles — see full block below */
.review-ov-close {
  position:absolute; top:14px; right:14px; background:transparent;
  border:none; color:var(--text2); cursor:pointer; font-size:1.1rem; padding:4px 8px;
  border-radius:6px; transition:background .15s;
}
.review-ov-close:hover { background:var(--surface2); color:var(--text1); }
.review-ov-body { display:flex; gap:24px; }
.review-ov-poster-col { flex-shrink:0; width:140px; display:flex; flex-direction:column; gap:10px; }
.review-ov-poster { width:100%; border-radius:10px; object-fit:cover; aspect-ratio:2/3; display:block; background:var(--surface2); }
.review-ov-info-col { flex:1; min-width:0; display:flex; flex-direction:column; gap:8px; }
.review-ov-imdb-rating { display:flex; align-items:center; gap:8px; background:#f5c51811; border:1px solid #f5c51844; border-radius:8px; padding:8px 12px; }
.review-ov-imdb-logo { background:#f5c518; color:#000; font-size:.7rem; font-weight:800; padding:2px 6px; border-radius:4px; }
.review-ov-imdb-score { font-size:1.4rem; font-weight:800; color:#f5c518; }
.review-ov-imdb-score small { font-size:.75rem; color:var(--text2); font-weight:400; }
.review-ov-rt-score { display:flex; align-items:center; gap:10px; background:#fa320a11; border:1px solid #fa320a33; border-radius:8px; padding:8px 12px; }
.review-ov-title { font-size:1.25rem; font-weight:800; color:var(--text1); margin:0; line-height:1.25; }
.review-ov-meta-row { display:flex; gap:8px; flex-wrap:wrap; font-size:.82rem; color:var(--text2); }
.review-ov-rated { background:var(--surface2); border:1px solid var(--border); border-radius:4px; padding:1px 6px; font-size:.72rem; }
.review-ov-genre { font-size:.82rem; color:var(--text2); }
.review-ov-detail { font-size:.85rem; color:var(--text2); line-height:1.5; }
.review-ov-director-card { display:flex; gap:12px; background:var(--surface2); border-radius:10px; padding:12px; margin-top:4px; border:1px solid var(--border); }
.review-ov-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.review-ov-btn { padding:8px 18px; border-radius:8px; font-size:.85rem; font-weight:600; cursor:pointer; border:none; text-decoration:none; display:inline-flex; align-items:center; transition:opacity .15s; }
.review-ov-btn-primary { background:#e8af22; color:#000; }
.review-ov-btn-primary:hover { opacity:.85; }
.review-ov-btn-ghost { background:var(--surface2); color:var(--text1); border:1px solid var(--border); }
.review-ov-btn-ghost:hover { background:var(--border); }
.review-ov-btn-danger { background:transparent; color:#e53935; border:1px solid #e5393544; }
.review-ov-btn-danger:hover { background:#e5393514; }

/* ═══════════════════════════════════════════════════════
   STEAM OVERLAY
═══════════════════════════════════════════════════════ */
#steam-overlay {
  display:none; position:fixed; inset:0; z-index:1200;
  background:rgba(0,0,0,.75); backdrop-filter:blur(4px);
  align-items:center; justify-content:center;
}
#steam-overlay.open { display:flex; }
#steam-overlay-box {
  background:#1b2838; border:1px solid #4a90d244; border-radius:14px;
  width:min(600px,96vw); max-height:88vh; overflow-y:auto;
  position:relative; color:#c6d4df;
}
.steam-ov-close {
  position:absolute; top:12px; right:14px; background:rgba(0,0,0,.4);
  border:none; color:#8ba4b4; cursor:pointer; font-size:1.1rem; padding:4px 8px;
  border-radius:6px; z-index:2; transition:background .15s;
}
.steam-ov-close:hover { background:rgba(0,0,0,.7); color:#fff; }
.steam-ov-hero { width:100%; max-height:220px; overflow:hidden; border-radius:12px 12px 0 0; }
.steam-ov-hero img { width:100%; object-fit:cover; display:block; max-height:220px; }
.steam-ov-body { padding:20px 24px 24px; }
.steam-ov-header-row { margin-bottom:10px; }
.steam-ov-badge { background:#1b2838; color:#66c0f4; font-size:.72rem; font-weight:700; padding:2px 9px; border-radius:4px; border:1px solid #4a90d2; }
.steam-ov-metacritic { border:2px solid; border-radius:4px; font-size:.82rem; font-weight:800; padding:2px 8px; vertical-align:middle; }
.steam-ov-title { font-size:1.2rem; font-weight:800; color:#c6d4df; margin:8px 0 0; }
.steam-ov-tags-row { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:14px; }
.steam-ov-tag { background:#4d6a7a; color:#c6d4df; border-radius:12px; padding:4px 12px; font-size:.78rem; }
.steam-ov-desc { font-size:.88rem; color:#acb8c0; line-height:1.6; margin-bottom:16px; }
.steam-ov-details { background:#16202d; border-radius:8px; padding:12px 16px; margin-bottom:16px; display:flex; flex-direction:column; gap:6px; }
.steam-ov-detail-row { display:flex; justify-content:space-between; font-size:.85rem; border-bottom:1px solid #2a475e44; padding-bottom:5px; }
.steam-ov-detail-row:last-child { border-bottom:none; padding-bottom:0; }
.steam-ov-detail-row span:first-child { color:#8ba4b4; }
.steam-ov-detail-row span:last-child { color:#c6d4df; font-weight:500; }
.steam-ov-actions { display:flex; gap:8px; flex-wrap:wrap; }
.steam-ov-btn { padding:9px 18px; border-radius:8px; font-size:.85rem; font-weight:600; cursor:pointer; border:none; text-decoration:none; display:inline-flex; align-items:center; transition:opacity .15s; }
.steam-ov-btn-primary { background:#4c6b22; color:#a4d007; border:1px solid #a4d00766; }
.steam-ov-btn-primary:hover { opacity:.85; }
.steam-ov-btn-steamdb { background:#1b2838; color:#66c0f4; border:1px solid #4a90d2; }
.steam-ov-btn-steamdb:hover { background:#2a475e; }
.steam-ov-btn-ghost { background:#2a475e; color:#c6d4df; border:1px solid #4d6a7a; }
.steam-ov-btn-ghost:hover { background:#4d6a7a; }
.steam-ov-btn-danger { background:transparent; color:#e53935; border:1px solid #e5393544; }
.steam-ov-btn-danger:hover { background:#e5393514; }


/* ═══════════════════════════════════════════════════════
   MOVIE CARD (unified IMDb/RT)
═══════════════════════════════════════════════════════ */
.movie-card { display:flex; gap:10px; }
.movie-card-poster { flex-shrink:0; width:72px; border-radius:6px; overflow:hidden; background:var(--surface2); aspect-ratio:2/3; display:flex; align-items:center; justify-content:center; }
.movie-card-poster img { width:100%; height:100%; object-fit:cover; display:block; border-radius:6px; }
.movie-card-poster-empty { background:linear-gradient(135deg,#f5c51812,#f5c51822); }
.movie-card-info { flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.movie-card-title { font-size:.92rem; font-weight:700; color:var(--text1); line-height:1.3; }
.movie-card-meta { display:flex; gap:6px; font-size:.75rem; color:var(--text2); flex-wrap:wrap; }
.movie-card-director { font-size:.72rem; color:var(--text2); margin-top:2px; }
.badge-movie-pill { background:#f5c51820; color:#f5c518; font-size:.62rem; font-weight:800; padding:2px 6px; border-radius:3px; letter-spacing:.05em; border:1px solid #f5c51840; display:inline-block; flex-shrink:0; }
.movie-card-outer { border-left:3px solid #f5c518; }

/* ═══════════════════════════════════════════════════════
   REVIEW OVERLAY — TMDB (Movies, TV, Anime)
═══════════════════════════════════════════════════════ */
/* ── Review overlay — fade in/out, scrollable ── */
#review-overlay {
  display:flex; position:fixed; inset:0; z-index:1200;
  background:rgba(0,0,0,.88); backdrop-filter:blur(8px);
  align-items:flex-start; justify-content:center;
  overflow-y:auto; padding:24px 16px;
  opacity:0; pointer-events:none; visibility:hidden;
  transition:opacity .25s ease, visibility .25s ease;
}
#review-overlay.open {
  opacity:1; pointer-events:auto; visibility:visible;
}

#review-overlay-box {
  background:var(--surface); border:1px solid var(--border);
  border-radius:20px; width:min(1100px,98vw);
  margin:auto; position:relative;
  overflow-x:hidden; overflow-y:visible;
  transform:translateY(24px) scale(.97);
  opacity:0;
  transition:transform .28s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
}
#review-overlay.open #review-overlay-box {
  transform:translateY(0) scale(1);
  opacity:1;
}

/* Close button */
.rov-close-btn {
  position:absolute; top:16px; right:16px; z-index:10;
  background:rgba(0,0,0,.5); border:1px solid rgba(255,255,255,.12);
  color:#fff; width:34px; height:34px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:all .15s; backdrop-filter:blur(4px);
}
.rov-close-btn:hover { background:rgba(255,255,255,.15); }

/* ── HERO SECTION ── */
.rov-hero {
  position:relative; min-height:320px;
  background:#0f0f16 no-repeat center/cover;
  display:flex; align-items:flex-end;
  border-radius:20px 20px 0 0; overflow:hidden;
}
.rov-hero-overlay {
  position:absolute; inset:0;
  background:linear-gradient(to bottom, rgba(0,0,0,.1) 0%, rgba(0,0,0,.85) 100%);
}
.rov-hero-content {
  position:relative; z-index:1;
  display:flex; gap:24px; align-items:flex-end;
  padding:28px 28px 24px; width:100%; box-sizing:border-box;
}
.rov-poster-wrap {
  flex-shrink:0; width:130px;
}
.rov-poster-img {
  width:100%; aspect-ratio:2/3; object-fit:cover;
  border-radius:10px; display:block;
  box-shadow:0 8px 32px rgba(0,0,0,.6);
  border:2px solid rgba(255,255,255,.1);
}
.rov-poster-empty {
  width:100%; aspect-ratio:2/3; border-radius:10px;
  background:linear-gradient(135deg,#1a1a2e,#16213e);
  border:2px solid rgba(255,255,255,.08);
}
.rov-hero-info {
  flex:1; min-width:0; display:flex; flex-direction:column; gap:8px;
  padding-bottom:4px;
}
.rov-type-badge {
  display:inline-flex; align-items:center;
  font-size:.65rem; font-weight:800; letter-spacing:.1em;
  padding:3px 10px; border-radius:20px; border:1px solid;
  width:fit-content; text-transform:uppercase;
}
.rov-title {
  font-size:clamp(1.4rem,3vw,2rem); font-weight:900;
  color:#fff; margin:0; line-height:1.15;
  text-shadow:0 2px 8px rgba(0,0,0,.5);
}
.rov-original-title {
  font-size:.8rem; color:rgba(255,255,255,.5); font-style:italic;
}
.rov-tagline {
  font-size:.88rem; color:rgba(255,255,255,.6); font-style:italic;
}
.rov-meta-chips {
  display:flex; gap:6px; flex-wrap:wrap; align-items:center;
}
.rov-chip {
  background:rgba(255,255,255,.12); color:rgba(255,255,255,.8);
  border:1px solid rgba(255,255,255,.15); border-radius:20px;
  font-size:.72rem; padding:3px 10px; backdrop-filter:blur(4px);
}
.rov-chip-status {
  background:rgba(34,197,94,.2); color:#4ade80;
  border-color:rgba(34,197,94,.3);
}
.rov-genres-row { display:flex; gap:5px; flex-wrap:wrap; }
.rov-genre-pill {
  font-size:.7rem; padding:2px 9px; border-radius:20px;
  border:1px solid; background:transparent; font-weight:600;
}

/* ── MAIN BODY ── */
.rov-body {
  display:grid; grid-template-columns:260px 1fr; gap:0;
  min-height:500px;
}

/* LEFT COLUMN */
.rov-left-col {
  border-right:1px solid var(--border);
  padding:20px 18px; display:flex; flex-direction:column; gap:16px;
}

/* Scores block */
.rov-scores-block {
  display:flex; gap:10px; flex-wrap:wrap;
}
.rov-score-item {
  flex:1; min-width:70px; background:var(--surface2);
  border:1px solid var(--border); border-radius:10px;
  padding:10px 8px; text-align:center; display:flex;
  flex-direction:column; align-items:center; gap:3px;
}
.rov-score-tmdb { }
.rov-score-logo {
  font-size:.58rem; font-weight:900; letter-spacing:.08em;
  color:var(--text2); text-transform:uppercase;
}
.rov-score-num {
  font-size:1.3rem; font-weight:900; line-height:1;
}
.rov-score-denom { font-size:.65rem; color:var(--text2); font-weight:400; }
.rov-score-sub { font-size:.62rem; color:var(--text2); }
.rov-score-icon img { display:block; }

/* User card */
.rov-user-card {
  background:var(--surface2); border:1px solid var(--border);
  border-radius:12px; padding:14px; display:flex; flex-direction:column; gap:12px;
}
.rov-user-card-title {
  font-size:.7rem; font-weight:800; text-transform:uppercase;
  letter-spacing:.1em; color:var(--text2);
}
.rov-user-field { display:flex; flex-direction:column; gap:5px; }
.rov-user-label {
  font-size:.72rem; font-weight:600; color:var(--text2);
}
.rov-status-grid { display:grid; grid-template-columns:1fr 1fr; gap:4px; }
.rov-status-btn {
  background:var(--surface); border:1px solid var(--border);
  border-radius:6px; padding:4px 6px; font-size:.7rem; font-weight:600;
  cursor:pointer; transition:all .15s; text-align:center;
}
.rov-status-btn:hover { border-color:var(--text2); color:var(--text1); }
.rov-status-btn.active { font-weight:700; }
.rov-rating-row { display:flex; align-items:center; gap:5px; }
.rov-rating-input {
  background:var(--surface); border:1px solid var(--border);
  color:var(--text1); border-radius:6px; padding:5px 8px;
  font-size:.9rem; font-weight:700; width:58px; text-align:center;
}
.rov-rating-input:focus { outline:none; border-color:#e8c547; }
.rov-rating-denom { font-size:.82rem; color:var(--text2); }
.rov-links-list { display:flex; gap:5px; flex-wrap:wrap; align-items:center; margin-bottom:2px; }
.rov-link-chip {
  background:var(--surface); color:var(--text2); border:1px solid var(--border);
  border-radius:6px; padding:3px 9px; font-size:.72rem; font-weight:600;
  text-decoration:none; transition:all .15s;
}
.rov-link-chip:hover { color:var(--text1); border-color:var(--text1); }
.rov-link-del {
  background:transparent; border:none; color:var(--text2);
  cursor:pointer; font-size:.78rem; padding:2px 3px;
  border-radius:4px; transition:color .15s;
}
.rov-link-del:hover { color:#e53935; }
.rov-add-link-btn {
  background:transparent; color:var(--text2);
  border:1px dashed var(--border); border-radius:6px;
  padding:4px 10px; font-size:.72rem; cursor:pointer;
  transition:all .15s; width:100%; text-align:center;
}
.rov-add-link-btn:hover { border-color:var(--text1); color:var(--text1); }
.rov-add-link-form {
  display:flex; flex-direction:column; gap:5px;
  background:var(--surface); border-radius:8px;
  padding:8px; border:1px solid var(--border);
}
.rov-link-input {
  background:var(--surface2); border:1px solid var(--border);
  color:var(--text1); border-radius:6px; padding:5px 8px;
  font-size:.78rem; width:100%; box-sizing:border-box;
}
.rov-link-input:focus { outline:none; border-color:#e8c547; }
.rov-link-form-btns { display:flex; gap:5px; }
.rov-link-save-btn {
  background:#e8c547; color:#000; border:none;
  border-radius:6px; padding:5px 12px; font-size:.75rem; font-weight:700; cursor:pointer;
}
.rov-link-cancel-btn {
  background:transparent; color:var(--text2); border:1px solid var(--border);
  border-radius:6px; padding:5px 10px; font-size:.75rem; cursor:pointer;
}

/* Details card */
.rov-details-card {
  background:var(--surface2); border:1px solid var(--border);
  border-radius:12px; padding:12px; display:flex; flex-direction:column; gap:7px;
}
.rov-detail-row { display:flex; gap:8px; font-size:.78rem; align-items:flex-start; }
.rov-detail-label { color:var(--text2); font-weight:600; min-width:72px; flex-shrink:0; }
.rov-detail-val { color:var(--text1); flex:1; line-height:1.4; }

.rov-actions-bar {
  display:flex; gap:6px; flex-wrap:wrap; margin-top:16px; padding-top:8px;
  border-top:1px solid var(--border);
}
.rov-action-btn {
  padding:7px 14px; border-radius:8px; font-size:.78rem; font-weight:600;
  cursor:pointer; border:none; text-decoration:none;
  display:inline-flex; align-items:center; transition:opacity .15s;
}
.rov-action-primary { background:#e8c547; color:#000; }
.rov-action-primary:hover { opacity:.85; }
.rov-action-rt { background:#fa320a; color:#fff; }
.rov-action-rt:hover { opacity:.85; }
.rov-action-ghost { background:var(--surface2); color:var(--text1); border:1px solid var(--border) !important; }
.rov-action-ghost:hover { background:var(--border); }
.rov-action-danger { background:transparent; color:#e53935; border:1px solid #e5393540 !important; }
.rov-action-danger:hover { background:#e5393512; }

/* RIGHT COLUMN */
.rov-right-col {
  padding:20px 22px; display:flex; flex-direction:column; gap:20px;
  min-width:0;
}
.rov-section-title {
  font-size:.7rem; font-weight:800; text-transform:uppercase;
  letter-spacing:.1em; color:var(--text2); margin-bottom:8px;
}
.rov-section-title-row {
  display:flex; align-items:center; justify-content:space-between; margin-bottom:8px;
}
.rov-synopsis-block {}
.rov-synopsis-text {
  font-size:.88rem; color:var(--text2); line-height:1.75;
  margin:0; border-left:3px solid var(--border); padding-left:12px;
}

/* Cast grid — horizontal scroll row */
.rov-cast-block {}
.rov-cast-grid {
  display:flex; flex-direction:row; flex-wrap:nowrap;
  overflow-x:auto; gap:8px;
  padding-bottom:6px;
  scrollbar-width:thin;
}
.rov-cast-grid::-webkit-scrollbar { height:4px; }
.rov-cast-grid::-webkit-scrollbar-thumb { background:var(--border); border-radius:4px; }
.rov-cast-item {
  background:var(--surface2); border:1px solid var(--border);
  border-radius:8px; padding:8px 10px;
  flex-shrink:0; min-width:110px; max-width:150px;
}
.rov-cast-name { font-size:.78rem; font-weight:700; color:var(--text1); line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rov-cast-char { font-size:.7rem; color:var(--text2); margin-top:2px; font-style:italic; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:default; }

/* Review block */
.rov-review-block {}
.rov-review-tabs { display:flex; gap:3px; background:var(--surface2); border-radius:6px; padding:2px; }
.rov-review-tab {
  background:transparent; border:none; color:var(--text2);
  padding:4px 12px; border-radius:5px; font-size:.75rem; font-weight:600;
  cursor:pointer; transition:all .15s;
}
.rov-review-tab.active { background:var(--bg); color:var(--text1); }
.rov-review-ta {
  background:var(--surface2); border:1px solid var(--border);
  color:var(--text1); border-radius:8px; padding:10px 12px;
  font-size:.86rem; line-height:1.65; min-height:130px;
  resize:none; font-family:inherit; width:100%; box-sizing:border-box;
}
.rov-review-ta:focus { outline:none; border-color:#e8c54766; }
.rov-review-preview {
  background:var(--surface2); border-radius:8px; padding:12px 14px;
  font-size:.86rem; line-height:1.7; color:var(--text1); min-height:80px;
  border:1px solid var(--border);
}

/* Keywords */
.rov-keywords-block {}
.rov-keywords-wrap { display:flex; gap:5px; flex-wrap:wrap; }
.rov-keyword-pill {
  background:var(--surface2); color:var(--text2);
  border:1px solid var(--border); border-radius:20px;
  font-size:.68rem; padding:2px 9px; transition:all .15s;
}
.rov-keyword-pill:hover { color:var(--text1); border-color:var(--text1); }

/* Trailer */
.rov-trailer-block {}
.rov-trailer-link {
  display:inline-flex; align-items:center; gap:7px;
  background:var(--surface2); color:var(--text1);
  border:1px solid var(--border); border-radius:8px;
  padding:8px 14px; font-size:.82rem; font-weight:600;
  text-decoration:none; transition:all .15s;
}
.rov-trailer-link:hover { border-color:var(--text1); }

/* Responsive */
@media (max-width:700px) {
  .rov-body { grid-template-columns:1fr; }
  .rov-left-col { border-right:none; border-bottom:1px solid var(--border); }
  .rov-hero-content { flex-direction:column; align-items:flex-start; gap:16px; }
  .rov-poster-wrap { width:100px; }
}

/* TMDB card tweaks */
.tmdb-card { }
.movie-card-rt-scores { display:flex; gap:5px; flex-wrap:wrap; margin-top:3px; }
.movie-card-rt-pill { font-size:.68rem; background:var(--surface2); border:1px solid var(--border); border-radius:4px; padding:1px 6px; color:var(--text2); }
.badge-tmdb-anime { background:rgba(129,140,248,.2); color:#818cf8; }

/* ═══════════════════════════════════════════════════════
   TUMBLR POST CARD (redesigned)
═══════════════════════════════════════════════════════ */
.tumblr-post-card { background:var(--surface2); border-radius:10px; overflow:hidden; border:1px solid #35465c44; display:flex; flex-direction:column; }
.tumblr-post-header { display:flex; align-items:center; gap:8px; padding:10px 12px 8px; background:transparent; }
.tumblr-post-avatar { width:28px; height:28px; border-radius:50%; object-fit:cover; flex-shrink:0; background:#35465c; }
.tumblr-post-blogname { font-size:.82rem; font-weight:700; color:var(--text1); flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tumblr-post-dot { color:var(--text2); font-size:.75rem; }
.tumblr-post-follow { font-size:.72rem; font-weight:700; color:#35a7ff; }
.tumblr-post-image { width:100%; max-height:220px; object-fit:cover; display:block; background:var(--surface2); }
.tumblr-post-body { padding:10px 12px; font-size:.85rem; color:var(--text1); line-height:1.55; flex:1; }
.tumblr-post-footer { padding:6px 12px 10px; border-top:1px solid #35465c33; margin-top:2px; }
.tumblr-post-stats { display:flex; gap:12px; }
.tumblr-stat { display:flex; align-items:center; gap:4px; font-size:.75rem; color:var(--text2); }

/* ═══════════════════════════════════════════════════════
   GITHUB + TUMBLR OVERLAY TOOLBAR BUTTONS
═══════════════════════════════════════════════════════ */
.cpov-add-repo-btn { background:#238636; color:#fff; border:none; border-radius:8px; padding:7px 14px; font-size:.8rem; font-weight:600; cursor:pointer; transition:opacity .15s; }
.cpov-add-repo-btn:hover { opacity:.85; }
.tpov-add-post-btn { background:#35a7ff; color:#fff; border:none; border-radius:8px; padding:7px 14px; font-size:.8rem; font-weight:600; cursor:pointer; transition:opacity .15s; }
.tpov-add-post-btn:hover { opacity:.85; }
.cpov-profile-row { display:flex; align-items:flex-end; gap:16px; padding:0 24px 16px; position:relative; border-bottom:1px solid #21262d; }
.tpov-profile-row { display:flex; align-items:flex-end; gap:14px; padding:0 24px 16px; position:relative; border-bottom:1px solid #35465c44; }
