/* ── HEADER ──────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10,12,16,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 0; /* Remove parent gap so flex distribution is mathematically perfect */
}

/* Left group: fixed size, never grows */
.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
  justify-content: flex-start;
}

/* Centre group: takes ALL remaining space so search bar can fill it */
.header-centre {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 0%;
  min-width: 0;
  padding: 0 12px;
}
/* Right group: fixed size, never grows */
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 0;
}

.site-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: 1px;
  color: var(--text);
  flex-shrink: 0;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}
/* Only colour the innermost accent spans (letters), not the logo-full/logo-short wrappers */
.site-logo .logo-full > span,
.site-logo .logo-short > span { color: var(--accent); }
/* logo-short hidden on desktop, shown on mobile */
.logo-short { display: none; }
@media (max-width: 700px) {
  .logo-full  { display: none; }
  .logo-short { display: inline; }
}
@media (hover: hover) and (pointer: fine) {
  .site-logo:hover {
    color: var(--accent);
  }
}
.site-logo:active { opacity: 0.6; }

.header-ad-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
[data-theme="light"] .site-header {
  background: rgba(242,244,247,0.92);
}


/* Mobile search icon: hidden on desktop, visible on mobile */
.mobile-search-btn { display: none !important; }
@media (max-width: 760px) {
  .mobile-search-btn { display: flex !important; }
  /* Desktop search bar hides on mobile; mobile icon takes its place */
  .header-centre .header-search-wrap { display: none; }
}


/* Adjust Sort Extra Info color logic */
.sort-extra { color: var(--text-muted); font-weight: 600; }
.header-sort-btn:hover .sort-extra,
.header-sort-btn.filter-active .sort-extra { color: inherit; }
/* sort-arrow is inline by default; stacked layout makes it block at small sizes */
.sort-arrow { display: inline; color: var(--text-muted); }
.sort-badge { display: inline; color: var(--text-muted); }
/* sep shown on single-line layout only — hides at 440px when button switches to 2-line stack */
.sort-sep   { display: none; color: var(--text-muted); font-weight: 400; }
@media (min-width: 441px) { .sort-sep { display: inline; } }

.header-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  font-size: 18px;
}
@media (hover: hover) and (pointer: fine) {
  .header-btn:hover { color: var(--text); border-color: var(--border-light); }
}
.header-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }
.header-btn.panel-open { color: var(--text); border-color: var(--border-light); background: var(--bg-elevated); }
/* Lock all header action buttons to their strict dimensions */
.header-btn, 
.header-auth-btn, 
.header-premium-btn,
.header-grid-wrap, 
.header-avatar {
  flex-shrink: 0 !important;
}
/* Menu button — always in DOM, animates in/out with sidebar collapse on desktop.
   Uses max-width (not width) so the gap between header items doesn’t shift.
   margin-right compensates for gap-16 already included by flexbox. */
.menu-btn {
  max-width: 0;
  width: 36px;          /* full size always; clipped by max-width */
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  flex-shrink: 0;
  /* No margin — gap from .site-header handles spacing when visible */
  transition: max-width 0.3s ease, opacity 0.3s ease;
}
.menu-btn .svg-icon {
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}
body.sidebar-collapsed .menu-btn {
  max-width: 36px;
  overflow: hidden;
  opacity: 1;
  pointer-events: auto;
}
body.sidebar-collapsed .menu-btn .svg-icon {
  opacity: 1;
  transform: scale(1);
}
@media (max-width: 1100px) {
  .menu-btn {
    max-width: 36px;
    overflow: visible;
    opacity: 1;
    pointer-events: auto;
    transition: none;
  }
  .menu-btn .svg-icon {
    opacity: 1;
    transform: scale(1);
    transition: none;
  }
}

/* ── LAYOUT ──────────────────────────────────────────────────── */
.site-body {
  display: flex;
  min-height: calc(100vh - var(--header-h));
  overflow-x: clip; /* clip horizontal overflow here, not on html/body (would break sticky) */
}

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow: visible;
  transition: transform var(--trans), width 0.3s ease;
}

.sidebar-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 0;
  opacity: 1;
  transition: opacity 0.12s ease;
}
.sidebar-footer {
  padding: 14px 16px 20px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--border);
}
.sidebar-footer a {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}
.sidebar-footer a:hover { opacity: 1; }
.sidebar-affiliation-note {
  display: block;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.78;
  line-height: 1.5;
}

/* Sidebar skyscraper ad — centered, separated from content */
.ad-slot.ad-skyscraper {
  display: none;            /* hidden by default, shown at wide breakpoint */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 0 8px;
  width: 100%;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.ad-slot.ad-skyscraper iframe,
.ad-slot.ad-skyscraper ins {
  display: block;
  max-width: 100%;
}

/* Desktop collapsed state */
.sidebar.collapsed {
  width: 0;
  border-right: none;
}
.sidebar.collapsed .sidebar-scroll,
.sidebar.content-hidden .sidebar-scroll {
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
.sidebar.is-animating .sidebar-collection-pill {
  max-height: 0 !important;
  opacity: 0 !important;
  transform: translateY(-8px) !important;
  padding-bottom: 0 !important;
  pointer-events: none !important;
}
.sidebar.content-hidden .sidebar-collection-overlay.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none !important;
}
.sidebar.content-hidden .sidebar-collection-overlay.is-visible .sidebar-collection-overlay-card {
  opacity: 0 !important;
  transform: translateY(-8px) scale(0.98) !important;
  pointer-events: none !important;
}
.sidebar.collapsed .sidebar-collapse-tab { opacity: 1; pointer-events: auto; }
.sidebar.collapsed .sidebar-collection-pill {
  max-height: 0 !important;
  opacity: 0 !important;
  transform: translateY(-8px) !important;
  padding-bottom: 0 !important;
  pointer-events: none !important;
}
.sidebar.collapsed .sidebar-collection-overlay {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Pull-tab */
.sidebar-collapse-tab {
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.15s ease, background 0.15s ease;
  z-index: 10;
  padding: 0;
}
.sidebar-collapse-tab:hover { background: var(--bg-hover, rgba(255,255,255,0.05)); color: var(--text); }
.sidebar-collapse-tab .material-icons { font-size: 14px; }
/* Hide pull-tab on mobile — not needed there */
@media (max-width: 1100px) { .sidebar-collapse-tab { display: none; } }

.sidebar-section { margin-bottom: 28px; padding: 0 16px; }
.sidebar-section-sticky-search {
  position: sticky;
  top: -20px;
  z-index: 12;
  margin-top: -20px;
  padding-top: 22px;
  padding-bottom: 10px;
  margin-bottom: 18px;
  background:
    linear-gradient(to bottom, var(--bg-card) 0%, var(--bg-card) 84%, rgba(10,12,16,0) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 10px 18px -18px rgba(0,0,0,0.55);
}
.sidebar-section-sticky-search::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(to right, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  pointer-events: none;
}
.sidebar-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 4px;
}
.sidebar-headline-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sidebar-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 10px;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 0;
  padding: 0;
}
.sidebar-label-active {
  color: var(--accent);
}
.sidebar-tooltip-anchor {
  position: relative;
  cursor: help;
}
.sidebar-tooltip-anchor::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  transform: translateY(-4px);
  min-width: 180px;
  max-width: 240px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(17, 19, 26, 0.96);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  text-align: left;
  box-shadow: 0 14px 32px rgba(0,0,0,0.28);
  opacity: 0;
  pointer-events: none;
  z-index: 40;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.sidebar-tooltip-anchor:hover::after,
.sidebar-tooltip-anchor:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.sidebar-section-title-wrap {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.recent-clear-inline-btn {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-subtle);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
}
.recent-clear-inline-btn .svg-icon {
  width: 11px;
  height: 11px;
}
.recent-clear-inline-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}
.sidebar-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  position: relative;
}
.sidebar-section-count.is-search-affected::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,61,95,0.14);
  position: absolute;
  right: -3px;
  top: -2px;
  animation: sidebar-count-dot-in 0.18s ease;
}
#browseSectionCount.is-loading {
  color: transparent;
}
#browseSectionCount.is-loading::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-top-color: var(--text-subtle);
  position: absolute;
  inset: 0;
  margin: auto;
  animation: sidebar-spin 0.75s linear infinite;
}
#browseSectionCount {
  width: 62px;
  min-width: 62px;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
@keyframes sidebar-spin {
  to { transform: rotate(360deg); }
}
@keyframes sidebar-count-dot-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.sidebar-section-chevron {
  color: var(--text-subtle);
  transition: transform 0.25s ease, color 0.15s ease;
  flex-shrink: 0;
}
.sidebar-section-toggle.is-context-active .sidebar-label,
.sidebar-section-toggle.is-context-active .sidebar-section-count {
  color: var(--accent);
}
.sidebar-section-toggle.is-search-match .sidebar-label,
.sidebar-section-toggle.is-search-match .sidebar-section-count {
  color: var(--accent);
}
.sidebar-section-toggle.is-context-active .sidebar-section-count {
  background: var(--accent-glow);
}
.sidebar-section-toggle.is-search-match .sidebar-section-count {
  background: var(--accent-glow);
}
.sidebar-section-toggle:hover .sidebar-section-chevron { color: var(--text); }
.sidebar-section-toggle.active .sidebar-section-chevron { transform: rotate(180deg); }
.sidebar-section-content {
  height: 0;
  opacity: 0;
  transition: height 0.28s ease, opacity 0.2s ease;
  overflow: hidden;
}
.sidebar-section-content > .sidebar-section-inner {
  overflow: hidden;
  padding: 0;
  min-height: 0;
}
.sidebar-section-content.is-open { opacity: 1; }
.sidebar-section-content.expanded,
.sidebar-section-content.expanded > .sidebar-section-inner {
  overflow: visible;
}
.sidebar-utility-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.sidebar-utility-btn:hover {
  color: var(--text);
  border-color: var(--border-light);
}
.sidebar-utility-btn .material-icons { font-size: 15px !important; }
.sidebar-utility-btn-text {
  width: auto;
  min-width: 0;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sidebar-utility-btn-text .svg-icon {
  margin-right: 4px;
}
.sidebar-utility-btn.confirm-state {
  color: #f0a500;
  border-color: rgba(240,165,0,0.4);
  background: rgba(240,165,0,0.08);
}
.sidebar-utility-btn.success-state {
  color: #3ecf8e;
  border-color: rgba(62,207,142,0.4);
  background: rgba(62,207,142,0.08);
}
.sidebar-group-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.sidebar-group-action-btn {
  padding: 3px 8px;
}
.sidebar-group-action-btn#currentViewSaveBtn {
  border-color: rgba(255,61,95,0.24);
  background: rgba(255,61,95,0.08);
  color: var(--accent);
}
.sidebar-group-action-btn#currentViewSaveBtn:hover {
  color: var(--accent-hover);
  border-color: rgba(255,61,95,0.36);
  background: rgba(255,61,95,0.12);
}
.sidebar-utility-btn:disabled,
.sidebar-group-action-btn:disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.sidebar-current-view-save-panel {
  margin: 0 0 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.01) 100%), var(--bg-elevated);
}
.sidebar-current-view-save-label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.sidebar-current-view-save-input {
  width: 100%;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sidebar-current-view-save-input:focus {
  border-color: rgba(255,61,95,0.3);
  box-shadow: 0 0 0 2px rgba(255,61,95,0.08);
}
.sidebar-current-view-save-input::placeholder {
  color: var(--text-subtle);
}
.sidebar-current-view-save-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.sidebar-current-view-save-confirm,
.sidebar-current-view-save-cancel {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.sidebar-current-view-save-confirm {
  border: 1px solid rgba(255,61,95,0.24);
  background: rgba(255,61,95,0.1);
  color: var(--accent);
}
.sidebar-current-view-save-confirm:hover {
  border-color: rgba(255,61,95,0.36);
  background: rgba(255,61,95,0.14);
}
.sidebar-current-view-save-cancel {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
}
.sidebar-current-view-save-cancel:hover {
  color: var(--text);
  border-color: var(--border-light);
  background: rgba(255,255,255,0.03);
}
.sidebar-current-view-save-confirm:disabled,
.sidebar-current-view-save-cancel:disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
.sidebar-current-view-save-status {
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-subtle);
}
.sidebar-current-view-save-status[data-state="error"] {
  color: var(--accent);
}
.sidebar-current-view-save-status[data-state="success"] {
  color: #6fd7a4;
}
@media (max-width: 1100px) {
  .sidebar-group-action-btn {
    flex: 1 1 auto;
  }
}
.sidebar-filter-block {
  margin-top: 12px;
}
.sidebar-filter-label {
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.participant-chip-groups {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.participant-chip-groups-compact {
  gap: 6px;
}
.participant-chip-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.participant-chip-group-compact {
  gap: 3px;
}
.participant-chip-group + .participant-chip-group {
  padding-top: 5px;
}
.participant-chip-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 12px;
}
.participant-chip-group-head-compact {
  gap: 5px;
}
.participant-chip-group-head::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: rgba(255,255,255,0.05);
}
.participant-chip-group-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
  flex-shrink: 0;
}
.participant-chip-group-label-compact {
  font-size: 8px;
  letter-spacing: 0.11em;
}
.participant-group-toggle {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
}
.participant-group-toggle:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}
.participant-group-toggle.is-active {
  color: var(--text-subtle);
  background: transparent;
}
.participant-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.participant-chip-row-compact {
  gap: 5px;
}
.participant-chip {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 5px 9px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.participant-chip:hover {
  color: var(--text);
  border-color: var(--border-light);
}
.participant-chip.is-active {
  color: var(--accent);
  border-color: rgba(255,61,95,0.32);
  background: var(--accent-glow);
}
.participant-chip:active {
  transform: translateY(1px);
}
.participant-chip-icon {
  display: inline-flex;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
}
.participant-chip-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}
.participant-chip-icon-female {
  color: #ff6f97;
}
.participant-chip-icon-male {
  color: #72a9ff;
}
.participant-chip-icon-mixed {
  color: #d8b3c5;
}
.participant-chip-icon-group {
  color: #d6b37a;
}
.participant-chip-icon-trans {
  color: #8ed9d0;
}
.participant-chip-icon-neutral {
  color: var(--text-subtle);
}
.sidebar-scope-note {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text-subtle);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.sub-action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 4px;
  width: 100%;
  box-sizing: border-box;
}
.sub-action-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.sub-action-row--secondary {
  margin-bottom: 0;
}
.sub-action-row--secondary .sub-action-actions {
  margin-left: auto;
}
.sidebar-control-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  flex-shrink: 0;
}
.sidebar-browse-search-note {
  margin: -2px 4px 10px;
  font-size: 10px;
  line-height: 1.4;
}
.browse-facet-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: -2px 0 10px;
  padding: 0 4px;
  width: 100%;
  box-sizing: border-box;
}
.browse-facet-chip {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 4px 8px;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.browse-facet-chip:hover {
  color: var(--text);
  border-color: var(--border-light);
}
.browse-facet-chip.is-active {
  color: var(--accent);
  border-color: rgba(255,61,95,0.3);
  background: var(--accent-glow);
}
#browseFormatFacetRow .sidebar-control-label,
#browseAudienceFacetRow .sidebar-control-label {
  font-size: 7px;
}
.sub-action-actions {
  display: flex;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}
.sub-action-actions .icon-btn {
  flex: 1 1 0;
  min-width: 0;
}
.sub-action-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  opacity: 0.9;
  flex-shrink: 0;
}
.sidebar-collection-pill {
  padding: 0 16px;
  --sidebar-collection-frame-w: min(320px, calc(100vw - 32px), calc(var(--sidebar-w) - 32px));
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    max-height 0.22s ease,
    opacity 0.18s ease,
    transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1),
    padding-bottom 0.22s ease;
}
.sidebar-collection-pill.is-visible {
  max-height: 52px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  padding-bottom: 14px;
}
.sidebar-collection-pill-btn {
  width: var(--sidebar-collection-frame-w);
  min-width: var(--sidebar-collection-frame-w);
  max-width: var(--sidebar-collection-frame-w);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,61,95,0.22);
  background: rgba(255,61,95,0.08);
  color: var(--accent);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
#sidebarCollectionPillLabel {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-collection-pill-btn:hover {
  background: rgba(255,61,95,0.12);
  border-color: rgba(255,61,95,0.34);
}
.sidebar-collection-pill-btn .svg-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.sidebar-collection-overlay {
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 18px 16px 18px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  background:
    linear-gradient(180deg, rgba(8,10,14,0.84) 0%, rgba(8,10,14,0.68) 20%, rgba(8,10,14,0.42) 54%, rgba(8,10,14,0.18) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}
.sidebar-collection-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.18s ease;
}
.sidebar-collection-overlay-card {
  position: relative;
  width: var(--sidebar-collection-frame-w);
  min-width: var(--sidebar-collection-frame-w);
  max-width: var(--sidebar-collection-frame-w);
  margin-top: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(16,18,24,0.94);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
  color: var(--text);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.18s ease;
}
.sidebar-collection-overlay.is-visible .sidebar-collection-overlay-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.sidebar-collection-overlay-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.sidebar-collection-overlay-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.sidebar-collection-overlay-actions {
  display: flex;
  gap: 8px;
}
.sidebar-collection-overlay-action {
  flex: 1;
  min-height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255,61,95,0.26);
  background: rgba(255,61,95,0.1);
  color: var(--accent);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.sidebar-collection-overlay-action:hover {
  background: rgba(255,61,95,0.15);
  border-color: rgba(255,61,95,0.36);
}
.sidebar-collection-overlay-action-secondary {
  border-color: var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
}
.sidebar-collection-overlay-action-secondary:hover {
  color: var(--text);
  border-color: var(--border-light);
  background: rgba(255,255,255,0.08);
}
.icon-btn {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-light); }
.sub-action-view-actions {
  margin-left: 0;
}
.sub-action-row .icon-btn.is-active {
  color: var(--accent);
  border-color: rgba(255,61,95,0.3);
  background: var(--accent-glow);
}
@media (max-width: 480px) {
  .sub-action-row {
    flex-wrap: wrap;
  }
  .sub-action-actions {
    width: auto;
  }
  .sub-action-view-actions {
    flex-wrap: nowrap;
  }
}
.icon-btn.is-disabled,
.icon-btn:disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

/* Search */
.sidebar-search {
  position: relative;
  margin-bottom: 0;
}
.sidebar-search input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 34px 8px 34px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.sidebar-search input:focus { border-color: var(--border-light); }
.sidebar-search.search-active input {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.sidebar-search input::placeholder { color: var(--text-subtle); }
.sidebar-search .search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  font-size: 15px;
  pointer-events: none;
}
.sidebar-search .header-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}
[data-theme="light"] .sidebar-section-sticky-search {
  background:
    linear-gradient(to bottom, var(--bg-card) 0%, var(--bg-card) 84%, rgba(242,244,247,0) 100%);
}
[data-theme="light"] .sidebar-section-sticky-search::after {
  background: linear-gradient(to right, rgba(17,24,39,0.1), rgba(17,24,39,0.02));
}

/* Subreddit list */
.subreddit-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
}

.sub-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  user-select: none;
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
}
.sub-item input[type="checkbox"] { display: none; }
.sub-item:hover { background: var(--bg-elevated); color: var(--text); }
.sub-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: rgba(255,61,95,0.2);
}
.sidebar .sub-item.is-all-excluded {
  opacity: 0.72;
  border-style: dashed;
}
.sidebar .sub-item.is-all-excluded .sub-dot {
  width: 8px;
  height: 8px;
  background: transparent;
  border: 1px solid currentColor;
  opacity: 0.78;
  position: relative;
}
.sidebar .sub-item.is-all-excluded .sub-dot::after {
  content: '';
  position: absolute;
  left: 0px;
  right: 0px;
  top: 50%;
  height: 1px;
  background: currentColor;
  transform: rotate(-45deg);
  transform-origin: center;
}
.sidebar .sub-item.is-all-excluded.active {
  opacity: 1;
}
.sub-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-subtle);
  flex-shrink: 0;
  transition: background var(--trans);
}
.sub-name {
  min-width: 0;
  flex: 1 1 auto;
  width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sub-name-link {
  color: inherit;
  text-decoration: none;
}
.sub-pin-btn {
  width: 18px;
  height: 18px;
  padding: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--text-subtle);
  opacity: 0.78;
  transition: color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.sub-pin-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
  opacity: 1;
}
.sub-pin-btn.is-active {
  color: var(--accent);
  background: rgba(255,61,95,0.12);
  opacity: 1;
}
.sub-item.active .sub-dot { background: var(--accent); }
.sidebar.is-collection-mode .sub-item {
  color: var(--text-subtle);
}
.sidebar.is-collection-mode .sub-item.active {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.sidebar.is-collection-mode .sub-item.active .sub-dot {
  background: var(--text-subtle);
}
.sidebar.is-collection-mode .sub-item:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
[data-theme="light"] .sidebar-collection-pill-btn {
  background: rgba(255,61,95,0.06);
}
[data-theme="light"] .sidebar-collection-overlay {
  background:
    linear-gradient(180deg, rgba(244,246,250,0.82) 0%, rgba(244,246,250,0.64) 18%, rgba(244,246,250,0.4) 42%, rgba(244,246,250,0.12) 100%);
}
[data-theme="light"] .sidebar-collection-overlay-card {
  background: rgba(255,255,255,0.96);
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 16px 36px rgba(0,0,0,0.14);
}
[data-theme="light"] .sidebar-collection-overlay-action-secondary {
  background: rgba(0,0,0,0.03);
}
[data-theme="light"] .sidebar.is-collection-mode .sub-item.active .sub-dot {
  background: var(--text-subtle);
}

/* Custom groups */
.sidebar-quick-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar-pinned-list .group-load-btn {
  padding-right: 6px;
}
.sidebar-auth-teaser {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.sidebar-auth-teaser-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-auth-teaser-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}
.sidebar-auth-teaser-text {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-subtle);
}
.sidebar-auth-teaser-btn {
  width: 100%;
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255,61,95,0.26);
  background: rgba(255,61,95,0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sidebar-auth-teaser-btn:hover {
  background: rgba(255,61,95,0.15);
  border-color: rgba(255,61,95,0.36);
}
[data-theme="light"] .sidebar-auth-teaser-btn {
  background: rgba(255,61,95,0.08);
}
.sidebar-mini-note {
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.sub-pin-btn .svg-icon {
  width: 12px;
  height: 12px;
}
.sidebar-section-helper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 7px 9px;
  font-size: 10px;
  line-height: 1.4;
}
.sidebar-section-helper-copy {
  min-width: 0;
  flex: 1 1 auto;
}
.sidebar-section-helper-close {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-subtle);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
}
.sidebar-section-helper-close:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}
.sidebar-search-empty {
  margin-top: 8px;
  border-style: dashed;
  text-align: center;
}
.sidebar-selected-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 6px;
  padding: 0 8px;
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
}
.group-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px;
  border-radius: 10px;
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.18s ease, transform 0.18s ease, max-height 0.18s ease, margin 0.18s ease;
  transform-origin: top center;
  max-height: 520px;
  opacity: 1;
}
.group-item.recent-item-enter {
  animation: recent-item-enter 360ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.group-item.is-filter-hidden {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  margin-top: -2px;
}
.group-item.is-active-context {
  background: rgba(255,255,255,0.03);
  box-shadow: inset 0 0 0 1px rgba(255,61,95,0.14);
}
.group-item.is-expanded {
  max-height: none;
}
.group-item-head {
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
}
.group-detail-toggle--pin {
  color: var(--accent);
}
.group-detail-toggle--pin:hover {
  color: var(--accent-hover);
  background: rgba(255,61,95,0.12);
}
.group-load-btn {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-load-btn:hover { color: var(--accent); border-color: rgba(255,61,95,0.3); background: var(--accent-glow); }
.group-load-btn.is-active {
  color: var(--accent);
  border-color: rgba(255,61,95,0.35);
  background: var(--accent-glow);
}
.group-detail-toggle {
  width: 28px;
  min-width: 28px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}
.group-detail-toggle:hover {
  color: var(--text);
  border-color: var(--border-light);
}
.group-detail-toggle[aria-expanded="true"] {
  color: var(--accent);
  border-color: rgba(255,61,95,0.35);
  background: var(--accent-glow);
}
.group-detail-chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.18s ease;
}
.group-item.is-expanded .group-detail-chevron {
  transform: rotate(180deg);
}
.group-item-details-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
}
.group-item.is-expanded .group-item-details-wrap {
  grid-template-rows: 1fr;
}
.group-item-details-inner {
  overflow: hidden;
  max-height: min(260px, 46vh);
  padding-right: 2px;
}
.group-item.is-expanded .group-item-details-inner {
  overflow: auto;
}
.group-item-details {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.16s ease, transform 0.16s ease, padding 0.16s ease;
}
.group-item.is-expanded .group-item-details {
  padding: 2px 0 4px;
  opacity: 1;
  transform: translateY(0);
}
.group-detail-summary {
  width: 100%;
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: 2px;
}
.group-detail-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.group-detail-pill:hover {
  color: var(--accent);
  border-color: rgba(255,61,95,0.28);
  background: var(--accent-glow);
  transform: translateY(-1px);
}
.group-del-btn {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, background 0.15s ease;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.group-del-btn:hover { color: var(--accent); border-color: var(--accent); }

@keyframes recent-item-enter {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
  }
  55% {
    opacity: 1;
    transform: translateY(0) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Display toggles */
.toggle-list { display: flex; flex-direction: column; gap: 6px; }
.toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px;
  font-size: 13px;
  color: var(--text-muted);
}
.toggle-row-stack { align-items: stretch; flex-direction: column; }
.toggle-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}
.toggle-title {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.toggle-title-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.toggle-help {
  margin-top: 1px;
  color: var(--text-subtle);
  font-size: 10.5px;
  line-height: 1.3;
}
.drawer-select {
  width: 100%;
  min-height: 38px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.drawer-select:focus { border-color: var(--border-light); }
.drawer-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.default-feed-participant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.default-feed-participant-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.default-feed-participant-option:hover {
  border-color: var(--border-light);
  color: var(--text);
}
.default-feed-participant-option.is-hidden-global {
  border-color: rgba(255, 61, 95, 0.28);
  background: linear-gradient(180deg, rgba(255, 61, 95, 0.06), rgba(255, 61, 95, 0.025));
  box-shadow: 0 0 0 1px rgba(255, 61, 95, 0.1);
  color: var(--accent);
  cursor: not-allowed;
}
.default-feed-participant-option.is-hidden-global:hover {
  border-color: rgba(255, 61, 95, 0.34);
  color: var(--accent);
}
.default-feed-participant-option input {
  margin: 0;
}
.default-feed-participant-option.is-hidden-global input {
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  border: 1px solid rgba(255, 61, 95, 0.5);
  background: linear-gradient(135deg, transparent 42%, rgba(255, 61, 95, 0.72) 43%, rgba(255, 61, 95, 0.72) 57%, transparent 58%);
  opacity: 0.58;
}
.default-feed-participant-option input:disabled {
  cursor: not-allowed;
}
.default-feed-participant-hidden-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 61, 95, 0.36);
  background: var(--bg);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 61, 95, 0.1);
  pointer-events: none;
}
@media (max-width: 520px) {
  .default-feed-participant-grid {
    grid-template-columns: 1fr;
  }
}
.drawer-inline-link,
.drawer-inline-btn {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.drawer-inline-link {
  color: var(--text-muted);
  background: transparent;
}
.drawer-inline-link:hover {
  color: var(--text);
  border-color: var(--border-light);
}
.drawer-title-link {
  flex: 0 0 auto;
  min-height: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9.5px;
  line-height: 1.2;
}
@keyframes drawerLinkFlash {
  0% { box-shadow: 0 0 0 0 rgba(255, 61, 95, 0); background: transparent; }
  18% { box-shadow: 0 0 0 4px rgba(255, 61, 95, 0.32); background: rgba(255, 61, 95, 0.12); border-color: rgba(255, 61, 95, 0.55); color: var(--accent); }
  100% { box-shadow: 0 0 0 0 rgba(255, 61, 95, 0); background: transparent; }
}
.drawer-link-flash {
  animation: drawerLinkFlash 1.2s ease-out;
}
.drawer-inline-btn {
  color: var(--accent);
  background: var(--accent-glow);
  border-color: rgba(255,61,95,0.3);
  cursor: pointer;
}
.drawer-inline-btn:hover {
  border-color: rgba(255,61,95,0.45);
  background: rgba(255,61,95,0.12);
}

/* Pill toggle switch */
.pill-toggle {
  position: relative;
  width: 34px; height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.pill-toggle input { opacity: 0; width: 0; height: 0; }
.pill-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  transition: background 0.2s ease;
  cursor: pointer;
}
.pill-slider::before {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  left: 2px; top: 50%;
  transform: translateY(-50%);
  background: var(--text-subtle);
  border-radius: 50%;
  transition: transform 0.2s ease;
}
.pill-toggle input:checked + .pill-slider {
  background: var(--accent);
  border-color: var(--accent);
}
.pill-toggle input:checked + .pill-slider::before {
  transform: translate(16px, -50%);
  background: #fff;
}

.grid-cols-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}
.grid-sizer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
}
.grid-slider-min, .grid-slider-max {
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 600;
  min-width: 14px;
  text-align: center;
  flex-shrink: 0;
}
.grid-slider {
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--pct, 50%), var(--border) var(--pct, 50%), var(--border) 100%);
  outline: none;
  cursor: pointer;
}
.grid-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.grid-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 5px var(--accent-glow);
}
.grid-slider:active::-webkit-slider-thumb { transform: scale(1.15); }
.grid-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}
.grid-slider::-moz-range-progress { background: var(--accent); border-radius: 2px; }

