:root {
  --bg: #101311;
  --panel: #171c19;
  --panel-2: #202720;
  --panel-3: #111613;
  --input: #0f1412;
  --text: #edf5ef;
  --muted: #9cac9f;
  --line: #2f3a34;
  --accent: #35c988;
  --accent-dark: #22a66d;
  --red: #ff6b68;
  --amber: #f2bf5a;
  --blue: #7ab8ff;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

a {
  color: inherit;
}

.login-body {
  display: grid;
  place-items: center;
  background: var(--bg);
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
}

.login-panel {
  display: grid;
  gap: 18px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel label,
.field {
  display: grid;
  gap: 7px;
}

.login-panel label span,
.field span,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-panel input,
.field input,
.field select,
.field textarea,
.folder-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.field textarea {
  resize: vertical;
}

.clearable-field {
  position: relative;
  min-width: 0;
}

.clearable-field input,
.clearable-field textarea {
  padding-right: 40px;
}

.clear-field-button {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  transform: translateY(-50%);
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.clear-field-button:hover {
  color: var(--text);
  border-color: var(--line);
  background: #283229;
}

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

.textarea-clear .clear-field-button {
  top: 10px;
  transform: none;
}

.date-clear .clear-field-button {
  right: 34px;
}

.date-clear input {
  padding-right: 64px;
}

.login-panel input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.folder-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(53, 201, 136, 0.14);
}

.login-error {
  border: 1px solid rgba(255, 107, 104, 0.35);
  background: rgba(255, 107, 104, 0.08);
  color: var(--red);
  border-radius: 6px;
  padding: 10px 12px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-row.compact h1,
.brand-row h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
}

.brand-row.compact h1 {
  font-size: 18px;
}

.brand-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: #06120d;
  font-weight: 800;
}

.brand-home {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.brand-home:hover {
  background: var(--accent-dark);
}

.primary-button,
.ghost-button,
.icon-button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

/* CSS tooltip — data-tooltip attribute'u olan tum butonlarda calisir */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-3, #1e2924);
  color: var(--text, #e0e0e0);
  border: 1px solid var(--line, #2e3e36);
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 200;
}
[data-tooltip]:hover::after {
  opacity: 1;
}

.primary-button {
  background: var(--accent);
  color: #06120d;
  padding: 11px 15px;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 700;
}

.ghost-button:hover,
.icon-button:hover {
  border-color: rgba(53, 201, 136, 0.42);
  background: rgba(53, 201, 136, 0.1);
  color: var(--accent);
  transform: translateY(-1px);
}

.ghost-button:disabled,
.icon-button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.primary-button.is-loading:not(.gsb-search-btn),
.ghost-button.is-loading:not(.gsb-search-btn),
.icon-button.is-loading:not(.gsb-search-btn) {
  position: relative;
  pointer-events: none;
  opacity: 0.82;
}

.primary-button.is-loading:not(.gsb-search-btn),
.ghost-button.is-loading:not(.gsb-search-btn) {
  color: transparent;
}

.primary-button.is-loading:not(.gsb-search-btn)::after,
.ghost-button.is-loading:not(.gsb-search-btn)::after,
.icon-button.is-loading:not(.gsb-search-btn)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  animation: btn-spin 0.65s linear infinite;
}

.primary-button.is-loading:not(.gsb-search-btn)::after {
  border: 2px solid rgba(6, 18, 13, 0.22);
  border-top-color: #06120d;
}

.ghost-button.is-loading:not(.gsb-search-btn)::after,
.icon-button.is-loading:not(.gsb-search-btn)::after {
  border: 2px solid rgba(53, 201, 136, 0.22);
  border-top-color: var(--accent);
}

.icon-button.is-loading:not(.gsb-search-btn) {
  color: transparent;
}

.icon-button.is-loading:not(.gsb-search-btn) svg {
  visibility: hidden;
}

body.is-busy {
  cursor: progress;
}

body.is-busy a,
body.is-busy button:not(.is-loading):not(:disabled) {
  cursor: progress;
}

.danger-button {
  border-color: rgba(255, 107, 104, 0.26);
  background: rgba(255, 107, 104, 0.08);
  color: #ffc2c0;
}

.danger-button:hover {
  border-color: rgba(255, 107, 104, 0.44);
  background: rgba(255, 107, 104, 0.14);
  color: #fff;
}

.icon-button {
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 900;
}

.language-select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  transition: grid-template-columns 0.28s ease;
  overflow-x: clip;
}

.history-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  background: #0b0f0d;
  color: #fff;
  padding: 18px;
  overflow-y: auto;
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    padding 0.28s ease;
}

body.history-collapsed .app-shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

body.history-collapsed .history-panel {
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-28px);
  overflow: hidden;
}

.history-panel .eyebrow,
.history-panel p {
  color: #aeb9bd;
}

.history-rail-toggle {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(53, 201, 136, 0.38);
  border-radius: 8px;
  background: rgba(53, 201, 136, 0.1);
  color: #9cf2c6;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.history-rail-toggle:hover {
  background: rgba(53, 201, 136, 0.22);
  border-color: rgba(53, 201, 136, 0.6);
  color: #d0ffe6;
}

/* Single visible toggle at a time (desktop):
   - History OPEN  -> rail toggle hidden, in-panel toggle (left chevron) closes it; logo shifts left.
   - History CLOSED-> rail toggle visible with a history/clock icon to reopen. */
.history-panel-toggle {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.history-panel-toggle:hover {
  background: rgba(53, 201, 136, 0.22);
  border-color: rgba(53, 201, 136, 0.6);
  color: #d0ffe6;
}

@media (min-width: 981px) {
  body:not(.history-collapsed) .history-rail-toggle {
    display: none;
  }
}

.sidebar-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-self: start;
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}

.sidebar-panel-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.sidebar-slot {
  position: relative;
  min-width: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-rail-toggle {
  flex-shrink: 0;
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(53, 201, 136, 0.38);
  border-radius: 8px;
  background: rgba(53, 201, 136, 0.1);
  color: #9cf2c6;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  position: sticky;
  top: 12px;
  z-index: 3;
}

body.sidebar-collapsed .sidebar-rail-toggle {
  display: grid;
}

.sidebar-rail-toggle:hover {
  background: rgba(53, 201, 136, 0.22);
  border-color: rgba(53, 201, 136, 0.6);
  color: #d0ffe6;
}

.sidebar-panel-toggle {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.sidebar-panel-toggle:hover {
  background: rgba(53, 201, 136, 0.22);
  border-color: rgba(53, 201, 136, 0.6);
  color: #d0ffe6;
}

@media (min-width: 981px) {
  body:not(.sidebar-collapsed) .sidebar-rail-toggle {
    display: none;
  }
}

.panel-head,
.section-head,
.topbar,
.top-actions,
.source-row,
.similar-row,
.url-save-row,
.folder-form {
  display: flex;
  align-items: center;
}

.panel-head,
.section-head,
.topbar {
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2,
.section-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  font-size: 18px;
  min-width: 0;
}

.panel-head h2 span:last-child,
.section-head h2 span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.result-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.title-icon,
.drawer-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 7px;
  color: var(--accent);
  background: rgba(53, 201, 136, 0.1);
}

.drawer-icon {
  width: 24px;
  height: 24px;
}

.title-icon svg,
.drawer-icon svg,
.icon-only-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bulk-merge-button {
  color: #8ce0b5;
}

.bulk-split-button {
  color: #ffb36b;
}

.bulk-merge-button:hover:not(:disabled) {
  background: rgba(53, 201, 136, 0.12);
  border-color: rgba(53, 201, 136, 0.34);
}

.bulk-split-button:hover:not(:disabled) {
  background: rgba(255, 179, 107, 0.12);
  border-color: rgba(255, 179, 107, 0.34);
}

.main-shell {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 18px;
  min-width: 0;
}

.topbar {
  min-height: 58px;
  min-width: 0;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: center;
  position: relative;
  justify-content: flex-end;
}

/* Hamburger toggle — only shown on tablet & below */
.menu-toggle {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.menu-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* VR/Oculus (Wolvic/Quest) browsers close the soft keyboard when a focused input
   inherits user-select:none — the keyboard can't place a caret. Force editable fields
   to keep text selection so the virtual keyboard stays open. */
input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}

/* Search bar grows on focus by collapsing the menu's width (flow-based, never overlaps) */
.top-actions {
  flex: 0 0 auto;
  max-width: 640px;
  overflow: hidden;
  transition:
    max-width 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease 0.05s,
    margin-left 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
.topbar:has(.global-search-bar.focused) .top-actions {
  max-width: 0;
  opacity: 0;
  margin-left: -12px;
  pointer-events: none;
  transition:
    max-width 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.18s ease;
}
/* Let the account dropdown escape the clipping container while it's open */
.top-actions:has(#userChipMenu:not([hidden])) {
  overflow: visible;
}

/* ── Global Search Bar ─────────────────────────────────────── */
.global-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  z-index: 50;
  isolation: isolate;
}

.global-search-bar.focused {
  z-index: 60;
}

.gsb-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  position: relative;
}

.gsb-logo {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #0b0f0d;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: -0.5px;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    background 0.15s,
    box-shadow 0.15s;
  box-shadow: 0 2px 12px rgba(53, 201, 136, 0.35);
}

.gsb-logo:hover {
  background: #41e09a;
  box-shadow: 0 4px 18px rgba(53, 201, 136, 0.55);
}

.gsb-form {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.065);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  overflow: visible;
  position: relative;
  transition:
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
  padding: 3px 4px 3px 12px;
  min-height: 44px;
  gap: 4px;
}

.gsb-form .gsb-input + * {
  border-radius: 0;
}

.global-search-bar.focused .gsb-form {
  border-color: var(--accent);
  background: rgba(53, 201, 136, 0.07);
  box-shadow:
    0 0 0 4px rgba(53, 201, 136, 0.18),
    0 2px 16px rgba(53, 201, 136, 0.12);
}

.gsb-input {
  flex: 1;
  min-width: 80px;
  padding: 6px 8px;
  background: transparent;
  border: 0;
  outline: 0;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.gsb-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
  font-size: 14px;
}

/* Homepage (Recent VR feed) hint: accent-colored placeholder. */
.gsb-input.vr-home-hint::placeholder {
  color: #6aa8ff;
  opacity: 1;
}

.gsb-input.vr-home-hint::-webkit-input-placeholder {
  color: #6aa8ff;
  opacity: 1;
}

.gsb-clear-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition:
    background 0.15s,
    color 0.15s;
  margin-right: 4px;
}
.gsb-clear-btn:hover {
  background: var(--danger, #e55);
  color: #fff;
}

.gsb-search-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    background 0.15s,
    box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(53, 201, 136, 0.3);
}

.gsb-search-btn:hover {
  background: #41e09a;
  box-shadow: 0 4px 14px rgba(53, 201, 136, 0.5);
}

.search-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.search-status-bar:not(:has(.gsb-status:not(:empty))):not(
    :has(.gsb-status[data-cache-hint])
  ):not(:has(.search-refresh-banner:not([hidden]))) {
  display: none;
}

.search-refresh-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(229, 85, 85, 0.35);
  border-radius: 8px;
  background: rgba(229, 85, 85, 0.1);
}

.search-refresh-banner[hidden] {
  display: none !important;
}

.search-refresh-banner-text {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #ffb4b4;
  line-height: 1.35;
}

.search-refresh-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search-refresh-banner .compact-button {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.search-status-bar:has(.search-refresh-banner:not([hidden])) {
  flex-direction: column;
  align-items: stretch;
}

.gsb-status {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
  min-width: 0;
}

.gsb-status:empty:not([data-cache-hint]) {
  display: none;
}

.gsb-status::after {
  content: attr(data-cache-hint);
  display: block;
  margin-top: 2px;
  color: var(--red);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

/* Site Health */
.site-health-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
}
.site-health-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-2);
}
.site-health-row.is-disabled {
  opacity: 0.6;
}
.site-health-score {
  flex: 0 0 auto;
  width: 52px;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  border-radius: 8px;
  padding: 6px 0;
}
.site-health-score.health-good {
  background: rgba(53, 201, 136, 0.18);
  color: #35c988;
}
.site-health-score.health-warn {
  background: rgba(230, 180, 40, 0.18);
  color: #e6b428;
}
.site-health-score.health-bad {
  background: rgba(220, 50, 50, 0.18);
  color: #e55;
}
.site-health-score.health-unknown {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 11px;
}
.site-health-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.site-health-name {
  font-weight: 600;
  font-size: 14px;
}
.site-health-sub {
  color: var(--muted);
  font-size: 11px;
}
.site-health-badge {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 10px;
}
.badge-ok {
  background: rgba(53, 201, 136, 0.18);
  color: #35c988;
}
.badge-disabled {
  background: rgba(220, 50, 50, 0.18);
  color: #e55;
}
.site-health-toggle {
  font-size: 12px;
}

.blocklist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.blocklist-loading,
.blocklist-list .empty-state {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  padding: 8px 4px;
}

.blocklist-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.blocklist-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.blocklist-copy strong {
  font-size: 14px;
  line-height: 1.35;
}

.blocklist-copy small {
  color: var(--muted);
  font-size: 11px;
}

.blocklist-link {
  color: var(--accent);
  font-size: 11px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blocklist-reason-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.blocklist-analysis-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 12px;
}

.blocklist-reason-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.block-reason-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 80, 80, 0.25);
  border-radius: 999px;
  background: rgba(255, 80, 80, 0.08);
  color: #ffb4b4;
  font-size: 12px;
  cursor: pointer;
}

.block-reason-filter small {
  color: rgba(255, 180, 180, 0.85);
  font-size: 11px;
}

.block-reason-filter.active {
  border-color: rgba(255, 80, 80, 0.55);
  background: rgba(255, 80, 80, 0.18);
  color: #ffd6d6;
}

.block-reason-filter:hover {
  background: rgba(255, 80, 80, 0.14);
}

.blocklist-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.block-reason-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 80, 80, 0.12);
  color: #ffb4b4;
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
}

.block-reason-pill.muted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  cursor: default;
}

.block-reason-pill:hover:not(.muted) {
  background: rgba(255, 80, 80, 0.2);
}

.blocklist-unblock {
  flex-shrink: 0;
  align-self: center;
}

/* Pills row inside GSB form */
.gsb-pills-row {
  display: contents; /* pills flow inline in the form */
}
.gsb-pills-row:empty {
  display: none;
}
.gsb-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(53, 201, 136, 0.14);
  border: 1px solid rgba(53, 201, 136, 0.38);
  border-radius: 20px;
  padding: 2px 4px 2px 3px;
  font-size: 12px;
  max-width: 200px;
  white-space: nowrap;
  transition:
    background 0.12s,
    border-color 0.12s;
}
.gsb-pill:hover {
  background: rgba(53, 201, 136, 0.24);
  border-color: rgba(53, 201, 136, 0.6);
}
.gsb-pill-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--line);
}
.gsb-pill-thumb--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(53, 201, 136, 0.2);
}
.gsb-pill-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: default;
}
.gsb-pill-name--link {
  cursor: pointer;
  color: var(--accent);
  text-decoration: underline dotted;
}
.gsb-pill-name--link:hover {
  color: #fff;
}
.gsb-pill-arrow {
  background: none;
  border: none;
  padding: 0 2px;
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.1s;
}
.gsb-pill-arrow:hover {
  opacity: 1;
  color: #fff;
}
.gsb-pill-remove {
  cursor: pointer;
  color: var(--muted);
  border: none;
  background: none;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.1s;
}
.gsb-pill-remove:hover {
  color: #e55;
}

.gsb-suggestions,
.person-suggestions.gsb-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 100;
}

@keyframes gsb-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(53, 201, 136, 0.6);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(53, 201, 136, 0);
  }
}

.gsb-search-btn.is-loading {
  animation: gsb-pulse 1s ease-in-out infinite;
  opacity: 0.75;
}

/* Background-refresh state: cache shown, live results still loading. */
.gsb-icon-refresh {
  display: none;
}
.gsb-search-btn.is-refreshing,
.gsb-search-btn.is-refreshing:hover {
  background: var(--danger, #e55);
  box-shadow: 0 4px 14px rgba(229, 85, 85, 0.5);
  animation: none;
  opacity: 1;
  cursor: progress;
}
.gsb-search-btn.is-refreshing .gsb-icon-search {
  display: none;
}
.gsb-search-btn.is-refreshing .gsb-icon-refresh {
  display: block;
  animation: gsb-spin 0.8s linear infinite;
}
@keyframes gsb-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Full-screen search overlay ────────────────────────────────
   The focused search covers the page instead of reflowing it. The input and the
   Search Filters board are moved into here by JS while open. */
.gsb-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(56px, 11vh, 112px) 16px 32px;
  overflow-y: auto;
  background: var(--bg);
}
.gsb-overlay[hidden] {
  display: none;
}
.gsb-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 19, 17, 0.94);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: gsb-overlay-fade 0.18s ease;
}
@keyframes gsb-overlay-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.gsb-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(1520px, calc(100vw - 24px));
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: none;
  animation: gsb-overlay-rise 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes gsb-overlay-rise {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.gsb-overlay-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.gsb-overlay-search {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}
.gsb-overlay-head .gsb-body {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}
/* Focused overlay search: full panel width, taller spotlight input. */
.gsb-overlay-head .gsb-form {
  width: 100%;
  min-height: 62px;
  padding: 8px 10px 8px 20px;
  border-radius: 34px;
  border-color: var(--accent);
  background: rgba(53, 201, 136, 0.07);
  box-shadow:
    0 0 0 4px rgba(53, 201, 136, 0.18),
    0 2px 16px rgba(53, 201, 136, 0.12);
}
.gsb-overlay-head .gsb-input {
  font-size: 19px;
  padding: 9px 12px;
}
.gsb-overlay-head .gsb-input::placeholder {
  font-size: 18px;
}
.gsb-overlay-head .gsb-search-btn {
  width: 46px;
  height: 46px;
}
.gsb-overlay-head .gsb-clear-btn {
  width: 28px;
  height: 28px;
}
.gsb-overlay-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.gsb-overlay-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.gsb-overlay-filters {
  width: 100%;
  overflow: visible;
  min-height: 0;
}
.gsb-overlay-filters .search-board {
  margin: 0;
  gap: 14px;
  padding: 14px;
}
/* Mega search: always show the full filter board (never the collapsed strip). */
.gsb-overlay-filters #searchForm.search-board--collapsed .source-row,
.gsb-overlay-filters #searchForm.search-board--collapsed .filter-grid {
  display: grid;
}
.gsb-overlay-filters #searchForm.search-board--collapsed .details-panel {
  display: block;
}
.gsb-overlay-filters #searchForm.search-board--collapsed {
  gap: 14px;
  padding: 14px;
}
.gsb-overlay-filters .search-filters-toggle,
.gsb-overlay-filters .board-count {
  display: none;
}
.gsb-overlay-filters .search-board-header {
  cursor: default;
}
body.gsb-overlay-open #searchStatusBar {
  display: none !important;
}
/* The leftover (now-empty) inline bar must not reserve space behind the overlay. */
body.gsb-overlay-open .global-search-bar.focused {
  visibility: hidden;
}
/* ──────────────────────────────────────────────────────────── */

.top-actions {
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-actions .url-save-open-button {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
}

.top-actions .ghost-button {
  gap: 7px;
}

.top-actions .ghost-button.active {
  color: #06120d;
  background: var(--accent);
  border-color: var(--accent);
}

.user-chip,
.count-pill,
.source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}

.user-chip-wrap {
  position: relative;
}
.user-chip {
  cursor: pointer;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
}
.user-chip:hover {
  background: var(--panel-3);
}
.user-chip-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 140px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 200;
  overflow: hidden;
  padding: 4px 0;
}
.user-chip-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.user-chip-item:hover {
  background: var(--panel-2);
}

.search-board,
.results-panel,
.folder-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-board {
  display: grid;
  gap: 14px;
  padding: 14px;
  min-width: 0;
}

/* Search form collapsed — only show header + source-row, hide filter-grid */
/* Collapsed: only the header (icon + title + count + chevron) stays visible — like the editor */
#searchForm.search-board--collapsed .source-row,
#searchForm.search-board--collapsed .filter-grid,
#searchForm.search-board--collapsed .details-panel {
  display: none;
}
#searchForm.search-board--collapsed {
  gap: 8px;
  padding: 8px 14px 10px;
}

.search-filter-summary {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

#searchForm.search-board--collapsed .search-filter-summary:not([hidden]) {
  display: flex;
}

.search-filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(53, 201, 136, 0.35);
  background: rgba(53, 201, 136, 0.12);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.search-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.search-board-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.folder-filter-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
}

.folder-filter-toolbar .search-board-header-actions {
  width: 100%;
  justify-content: flex-end;
}

.board-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  min-width: 0;
}
.board-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  opacity: 0.75;
  white-space: nowrap;
}
.board-count:empty {
  display: none;
}

.search-filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: none;
  padding: 2px 0;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.search-filters-toggle:hover {
  color: var(--accent);
}
.search-filters-toggle svg {
  transition: transform 0.2s;
  flex-shrink: 0;
}
.search-filters-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.app-view {
  display: grid;
  gap: 16px;
}

.app-view[hidden] {
  display: none;
}

/* search-board display:grid, [hidden] native stilini eziyor — explicit override */
#searchForm[hidden],
#folderFilterBar[hidden],
#bulkToolbar[hidden] {
  display: none !important;
}

.source-row {
  display: grid;
  grid-template-columns: minmax(180px, 300px) auto;
  align-items: end;
  gap: 12px;
}

.folder-filter-board .source-row {
  grid-template-columns: minmax(160px, 280px) minmax(180px, 1fr);
}

.url-save-open-button {
  align-self: end;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(53, 201, 136, 0.36);
  background: rgba(53, 201, 136, 0.12);
  color: var(--accent);
  box-shadow: 0 10px 24px rgba(53, 201, 136, 0.1);
}

.url-save-open-button:hover {
  border-color: rgba(53, 201, 136, 0.58);
  background: rgba(53, 201, 136, 0.2);
  color: #92f0c1;
}

.url-save-open-button svg,
.modal-head .icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field.wide {
  width: auto;
  min-width: 0;
}

.query-field {
  position: relative;
  flex: 1 1 260px;
  min-width: 220px;
}

.search-button {
  width: 100%;
  min-width: 120px;
  height: 42px;
}

.search-action-stack {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 5px;
  align-self: end;
  white-space: nowrap;
}

.search-action-stack .search-button {
  flex-shrink: 0;
}

.search-action-stack .sweep-button,
.search-board-header-actions .sweep-button {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-color: var(--line);
}
.search-action-stack .sweep-button:hover,
.search-board-header-actions .sweep-button:hover {
  color: var(--accent);
  border-color: rgba(53, 201, 136, 0.45);
  background: rgba(53, 201, 136, 0.08);
}
.search-action-stack .sweep-button svg,
.search-board-header-actions .sweep-button svg,
.sweep-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.last-history-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}

.last-history-hint[hidden] {
  display: none;
}

.filter-grid,
.details-grid {
  display: grid;
  gap: 12px;
}

.filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.details-panel {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.details-panel summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}

.details-grid {
  grid-template-columns: 2fr 1fr 1fr;
  margin-top: 12px;
}

.span-two {
  grid-column: span 1;
}

.similar-row {
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.url-save-row {
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.similar-field {
  flex: 1;
  min-width: 220px;
}

.url-save-field {
  flex: 1;
  min-width: 220px;
}

.url-folder-field {
  width: 180px;
}

.url-rating-field {
  min-width: 150px;
}

.similar-button {
  min-width: 140px;
}

.url-save-button {
  min-width: 110px;
}

.url-save-card {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-3);
}

.import-card {
  margin-top: 14px;
}

.import-bridge-panel {
  display: grid;
  gap: 12px;
}

.import-bridge-lead {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.import-bridge-steps {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.import-bridge-steps li + li {
  margin-top: 6px;
}

.import-bridge-settings {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 4px;
  padding: 10px;
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.03));
  border-radius: 6px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.import-bridge-settings-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.import-bridge-options {
  display: grid;
  gap: 6px;
}

.import-bridge-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text, #eee);
}

.import-bridge-option input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.import-bridge-panel .primary-button {
  width: 100%;
}

.import-progress-banner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(53, 201, 136, 0.35);
  border-radius: 8px;
  background: rgba(53, 201, 136, 0.1);
}

.import-progress-banner[hidden] {
  display: none !important;
}

.import-progress-banner-text {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #9ef0c8;
  line-height: 1.35;
}

.import-progress-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.import-progress-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #35c988, #41e09a);
  transition: width 0.35s ease;
}

.modal-tabs button.import-progress-active {
  color: #9ef0c8;
  box-shadow: inset 0 -2px 0 #35c988;
}

.import-result {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(126, 211, 134, 0.08);
  color: var(--muted);
  border: 1px solid rgba(126, 211, 134, 0.16);
  font-size: 12px;
  line-height: 1.35;
}

.import-result strong {
  color: var(--text);
  font-size: 12px;
}

.import-result.is-copied-flash {
  animation: import-copied-blink 0.75s ease-in-out 7;
  border-color: rgba(126, 211, 134, 0.55);
  background: rgba(126, 211, 134, 0.16);
}

.import-result.is-copied-flash .import-copied-flash-label {
  color: #9ee6a8;
  font-size: 13px;
}

@keyframes import-copied-blink {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(126, 211, 134, 0.35);
  }

  50% {
    opacity: 0.55;
    box-shadow: 0 0 14px 2px rgba(126, 211, 134, 0.45);
  }
}

.import-error {
  color: #f2a6a6;
}

.mini-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.speed-view {
  align-items: start;
}

.speed-form {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.speed-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.speed-results {
  margin-top: 12px;
  overflow-x: auto;
}

.speed-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 13px;
}

.speed-table th,
.speed-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.speed-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.speed-table td strong,
.speed-table td span {
  display: block;
}

.speed-table td span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.speed-table tr.ok td:first-child {
  color: var(--accent);
}

.speed-table tr.bad td:first-child {
  color: var(--red);
}

.speed-table tr.muted td {
  color: rgba(156, 172, 159, 0.58);
}

.speed-table tr.muted td:first-child {
  color: rgba(156, 172, 159, 0.72);
}

.speed-muted-dash {
  display: inline-block;
  width: 18px;
  height: 1px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(156, 172, 159, 0.45);
  color: transparent;
  vertical-align: middle;
}

.probe-panel {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.probe-panel[hidden] {
  display: none;
}

.probe-thumb {
  width: 160px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: var(--panel-3);
}

.probe-thumb-wrap,
.probe-thumb-wrap img {
  display: block;
  width: 160px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
}

.probe-thumb-wrap.ep-wide-thumb,
.probe-thumb-wrap.ep-wide-thumb img,
.url-save-preview .ep-wide-thumb img {
  aspect-ratio: 2 / 1;
}

.probe-thumb-wrap img {
  object-fit: cover;
  background: var(--panel-3);
}

.probe-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.compact-head h2 {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
  min-width: 0;
  transition: grid-template-columns 0.28s ease;
}

body.sidebar-collapsed .workspace {
  grid-template-columns: minmax(0, 1fr) 40px;
}

body.sidebar-collapsed .sidebar-panel {
  display: none;
}

body.sidebar-collapsed .sidebar-slot > .bulk-floating-bar:not([hidden]) {
  display: flex;
}

body.sidebar-collapsed .sidebar-slot {
  display: flex;
  justify-content: center;
}

.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  align-self: start;
}

/* On the Pornstars page, show My Fav Stars list above the Folders list */
body.pornstars-view .sidebar-column > .folder-panel:not(.fav-stars-panel) {
  order: 2;
}
body.pornstars-view .sidebar-column > #favStarsSidebar {
  order: 1;
}

.folder-control-surface {
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
}

.folder-control-surface[hidden] {
  display: none;
}

.folder-control-surface .control-drawer {
  margin-top: 0;
}

.folder-view-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  flex-wrap: nowrap;
}

.folder-view-header[hidden] {
  display: none;
}

.folder-view-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: var(--accent);
  background: rgba(53, 201, 136, 0.12);
  border: 1px solid rgba(53, 201, 136, 0.2);
}

.folder-view-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.folder-view-icon.fav-stars-mark {
  color: #e85d8a;
  background: rgba(232, 93, 138, 0.14);
  border-color: rgba(232, 93, 138, 0.25);
}
.folder-view-icon.fav-stars-mark svg {
  fill: currentColor;
  stroke: none;
}

.folder-view-title-block {
  flex: 1;
  min-width: 0;
}

.folder-view-header h2 {
  margin: 1px 0 0;
  font-size: 20px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

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

.pornstar-header-actions[hidden] {
  display: none;
}

.pornstar-header-actions .person-fav-button,
.pornstar-header-actions .person-kill-button,
.pornstar-header-actions .icon-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.12s;
}

.pornstar-header-actions .person-fav-button svg,
.pornstar-header-actions .person-kill-button svg,
.pornstar-header-actions .icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pornstar-header-actions .person-fav-button.faved {
  background: rgba(232, 93, 138, 0.15);
  border-color: rgba(232, 93, 138, 0.35);
  color: #e85d8a;
}

.pornstar-header-actions .person-fav-button.faved svg {
  fill: #e85d8a;
  stroke: #e85d8a;
}

.results-panel,
.folder-panel {
  padding: 14px;
  min-width: 0;
}

.fav-stars-panel {
  flex-shrink: 0;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.control-drawer {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-3);
  font-size: 12px;
  overflow: hidden;
}

.control-drawer[open] {
  overflow: visible;
}

.control-drawer[hidden] {
  display: none;
}

.control-drawer > :not(summary) {
  animation: drawer-open 0.22s ease;
}

@keyframes drawer-open {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.control-drawer-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.control-drawer-summary::-webkit-details-marker {
  display: none;
}

.control-drawer-summary:hover {
  background: rgba(255, 255, 255, 0.03);
}

.drawer-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.drawer-subtitle {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-chevron {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: auto;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 20px;
  line-height: 1;
  transition:
    transform 0.16s ease,
    color 0.16s ease,
    background 0.16s ease;
}

.control-drawer[open] .drawer-chevron {
  transform: rotate(90deg);
  color: var(--text);
  background: rgba(53, 201, 136, 0.16);
}

.bulk-toolbar-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 16px;
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  overflow: visible;
}

.bulk-group {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.bulk-group + .bulk-group {
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.bulk-vr-button {
  min-width: 42px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #8fdcff;
  border: 1px solid rgba(143, 220, 255, 0.28);
  background: rgba(143, 220, 255, 0.08);
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.12s ease;
}

.bulk-vr-button:hover {
  color: #c8efff;
  border-color: rgba(143, 220, 255, 0.55);
  background: rgba(143, 220, 255, 0.16);
  transform: translateY(-1px);
}

.bulk-group--danger {
  margin-left: auto;
}

/* folderFilterBar: searchForm ile ayni .search-board yapisi */
.sweep-button {
  align-self: end;
  color: var(--text-muted, #8a9bb5);
}
.sweep-button:hover {
  color: var(--accent);
}

.folder-filter-toolbar .compact-button {
  min-height: 36px;
  padding: 0 12px;
}

/* Yildiz iconlu min rating label */
.folder-rating-field > span {
  display: flex;
  align-items: center;
  gap: 3px;
}

.person-filter-context {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 0;
}

.person-filter-context[hidden] {
  display: none;
}

.active-filter-pill {
  border-color: rgba(53, 201, 136, 0.28);
  background: rgba(53, 201, 136, 0.1);
  color: var(--text);
}

.control-drawer .field span,
.control-drawer .eyebrow {
  font-size: 10.5px;
}

.control-drawer .field input,
.control-drawer .field select {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.control-drawer .ghost-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.icon-only-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 38px;
}

.control-drawer .icon-only-button {
  min-width: 34px;
  padding: 0;
}

.bulk-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
}

.bulk-status strong {
  color: var(--text);
}

.pager-mini,
.pager {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pager-mini[hidden],
.pager[hidden] {
  display: none;
}

.pager-mini span {
  min-width: 42px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.pager-button {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.pager-button:hover:not(:disabled),
.pager-button.active {
  border-color: rgba(53, 201, 136, 0.42);
  color: var(--accent);
  background: rgba(53, 201, 136, 0.1);
}

.pager-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.bottom-pager {
  justify-content: center;
  margin-top: 16px;
}

.pager-gap {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 2px;
}

.control-drawer .toggle-control {
  height: 34px;
}

.control-drawer .clear-field-button {
  width: 22px;
  height: 22px;
  right: 7px;
  font-size: 12px;
}

.bulk-toolbar[hidden] {
  display: none !important;
}

.bulk-floating-bar {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 0;
  border: 1px solid rgba(78, 221, 167, 0.58);
  border-radius: 14px;
  background: linear-gradient(
    155deg,
    rgba(53, 201, 136, 0.96),
    rgba(24, 96, 68, 0.98) 55%,
    rgba(16, 58, 42, 0.98)
  );
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(78, 221, 167, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: visible;
  animation: bulk-bar-in 0.24s ease;
  flex-shrink: 0;
}

.bulk-floating-bar.is-docked {
  position: fixed;
  top: var(--bulk-dock-top, 84px);
  right: var(--bulk-dock-right, 18px);
  bottom: var(--bulk-dock-bottom, 18px);
  width: var(--bulk-dock-width, 280px);
  z-index: 38;
  margin: 0;
  display: flex;
  flex-direction: column;
  max-height: none;
}

.bulk-floating-bar.is-docked .bulk-toolbar-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@keyframes bulk-bar-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.bulk-floating-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px 4px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.12);
}

.bulk-floating-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bulk-floating-bar .drawer-title {
  color: #ecfff5;
  letter-spacing: 0.04em;
}

.bulk-floating-bar .drawer-icon svg {
  fill: currentColor;
  color: #b8f5d6;
}

.bulk-floating-bar .bulk-status strong {
  color: #ffffff;
  font-size: 13px;
}

.bulk-floating-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  color: #ecfff5;
  font-size: 22px;
  line-height: 1;
}

.bulk-floating-close:hover {
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 255, 255, 0.36);
  color: #fff;
}

.bulk-floating-bar .bulk-toolbar-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  border-top: none;
  padding: 5px 8px 7px;
  overflow: visible;
}

.bulk-floating-bar .bulk-group {
  width: 100%;
  flex-wrap: wrap;
  align-items: flex-end;
}

.bulk-floating-bar .bulk-group--stacked {
  align-items: stretch;
}

.bulk-floating-bar .bulk-group--stacked > .field {
  flex: 1;
  min-width: 0;
}

.bulk-floating-bar .bulk-group + .bulk-group {
  padding-left: 0;
  border-left: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 4px;
}

.bulk-floating-bar .bulk-rating-field,
.bulk-floating-bar .bulk-folder-field,
.bulk-floating-bar .bulk-watch-field {
  flex: 1;
  min-width: 0;
}

.bulk-floating-bar .bulk-group--editor {
  gap: 6px;
}

.bulk-floating-bar .bulk-group--editor > .field {
  width: 100%;
}

.bulk-field-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
}

.bulk-field-actions .ghost-button {
  width: 100%;
  min-height: 38px;
  justify-content: center;
}

.bulk-floating-bar .bulk-person-field,
.bulk-floating-bar .bulk-tag-field {
  position: relative;
}

.bulk-floating-bar .tag-entry-row input {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.18);
  color: #f4fff9;
  min-height: 38px;
  font-size: 14px;
}

.bulk-floating-bar .tag-entry-row .icon-button {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.18);
  color: #ecfff5;
}

.bulk-floating-bar .tag-entry-row .icon-button:hover {
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
}

.bulk-floating-bar .person-row,
.bulk-floating-bar .user-tag-row {
  margin-top: 6px;
  max-height: 96px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.bulk-floating-bar .field span,
.bulk-floating-bar .drawer-title {
  color: rgba(236, 255, 245, 0.82);
}

.bulk-floating-bar .field select,
.bulk-floating-bar .field input,
.bulk-floating-bar .ghost-button {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.18);
  color: #f4fff9;
}

.bulk-floating-bar .ghost-button:hover {
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
}

.bulk-floating-bar .ghost-button:disabled {
  opacity: 0.45;
}

.bulk-floating-bar .danger-button {
  border-color: rgba(255, 120, 120, 0.45);
  background: rgba(120, 20, 20, 0.35);
  color: #ffd8d8;
}

.bulk-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
}

.bulk-status strong {
  color: var(--text);
  font-size: 12px;
}

.bulk-status span {
  color: var(--muted);
  font-size: 11px;
}

.bulk-folder-field,
.bulk-person-field,
.bulk-tag-field {
  min-width: 0;
  position: relative;
}

/* Confirm / generic modals */
.confirm-modal-panel {
  width: min(440px, calc(100vw - 36px));
  gap: 16px;
}

.changelog-modal-panel {
  width: min(640px, calc(100vw - 32px));
  max-height: min(78vh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.changelog-list {
  overflow: auto;
  display: grid;
  gap: 12px;
  padding-right: 4px;
}

.changelog-loading,
.changelog-list .empty-state {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.changelog-entry {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--panel-3);
}

.changelog-entry-head {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.changelog-entry-head time {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.changelog-entry-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.changelog-notes {
  margin: 0;
  color: #d7e0dc;
  font-size: 13px;
  line-height: 1.45;
}

.changelog-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.changelog-meta + .changelog-meta,
.changelog-meta + .changelog-notes,
.changelog-notes + .changelog-meta {
  margin-top: 6px;
}

.changelog-meta span {
  color: #aeb9bd;
  font-weight: 700;
}

.confirm-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.confirm-head-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.confirm-head-icon svg {
  width: 20px;
  height: 20px;
}
.confirm-head-icon.danger {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.confirm-modal-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.confirm-modal-desc strong {
  color: #fff;
  font-weight: 600;
}
.confirm-modal-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}
.confirm-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  padding: 11px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.15s ease;
}
.confirm-checkbox-row:hover {
  border-color: rgba(53, 201, 136, 0.45);
}
.confirm-checkbox-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}
.confirm-copy-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.confirm-copy-label {
  font-size: 13px;
  color: var(--muted);
}
.confirm-copy-label em {
  font-style: normal;
  opacity: 0.65;
}
.confirm-folder-checklist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 184px;
  overflow-y: auto;
  padding: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.confirm-folder-checklist:empty::after {
  content: "Eklenebilecek baska klasor yok";
  display: block;
  padding: 8px 4px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.confirm-folder-checklist label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  padding: 7px 8px;
  border-radius: 6px;
  text-align: left;
}
.confirm-folder-checklist label input[type="checkbox"] {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}
.confirm-folder-checklist label:hover {
  background: rgba(255, 255, 255, 0.06);
}
.confirm-modal-actions {
  gap: 8px;
}
.confirm-modal-actions .primary-button,
.confirm-modal-actions .ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.modal-close-x svg {
  display: block;
}

.toggle-field {
  min-width: 82px;
}

.toggle-control {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  cursor: pointer;
}

.toggle-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.toggle-control span {
  position: relative;
  width: 42px;
  height: 22px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.16s ease;
}

.toggle-control span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--muted);
  transition:
    transform 0.16s ease,
    background 0.16s ease;
}

.toggle-control input:checked + span {
  background: rgba(53, 201, 136, 0.25);
}

.toggle-control input:checked + span::after {
  transform: translateX(20px);
  background: var(--accent);
}

.folder-search-field {
  min-width: 0;
}

.folder-filter-clear {
  height: 34px;
  white-space: nowrap;
}

.folder-filter-apply {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.clear-icon-button svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.result-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  content-visibility: auto;
  contain-intrinsic-size: auto 420px;
}

.grouped-result-card {
  overflow: visible;
  min-width: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 420px;
}

.grouped-result-card::before,
.grouped-result-card::after {
  content: "";
  position: absolute;
  inset: 7px -5px -5px 7px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.grouped-result-card::after {
  inset: 13px -9px -9px 13px;
  opacity: 0.65;
}

.group-stack-count {
  position: absolute;
  z-index: 4;
  top: 8px;
  right: 8px;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(5, 10, 8, 0.78);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.variant-page-badge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  background: rgba(53, 201, 136, 0.92);
  color: #07130d;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 900;
  pointer-events: auto;
}

.variant-page-badge.pending {
  background: rgba(255, 196, 86, 0.94);
}

.variant-page-badge.candidate {
  background: rgba(240, 180, 41, 0.94);
  color: #07130d;
}

.variant-page-badge.approved {
  background: rgba(53, 201, 136, 0.92);
}

.variant-page-label {
  pointer-events: none;
  line-height: 1;
}

.variant-approve-btn {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(7, 19, 13, 0.28);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.88);
  color: #07130d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.variant-approve-btn:hover {
  background: #fff;
  border-color: rgba(7, 19, 13, 0.45);
}

.variant-reject-btn {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(7, 19, 13, 0.28);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.88);
  color: #c93535;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.variant-reject-btn:hover {
  background: #fff;
  border-color: rgba(7, 19, 13, 0.45);
  color: #e04444;
}

.card-select-control {
  position: absolute;
  z-index: 5;
  top: 8px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(5, 10, 8, 0.74);
  cursor: pointer;
}

.card-select-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.card-select-control span {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(237, 245, 239, 0.78);
  border-radius: 4px;
  background: transparent;
}

.card-select-control input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px rgba(5, 10, 8, 0.88);
}

.card-select-control input:indeterminate + span {
  border-color: var(--accent);
  background: linear-gradient(
    90deg,
    transparent 0 25%,
    var(--accent) 25% 75%,
    transparent 75% 100%
  );
}

.thumb-link {
  display: block;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 9;
  min-height: 120px;
  background: var(--panel-3);
  overflow: hidden;
  cursor: pointer;
}

.thumb-link img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  background: var(--panel-3);
}

.thumb-link img.thumb-loaded,
.thumb-link img[src]:not([src^="data:image/gif"]) {
  opacity: 1;
}

/* Eporner VR listing thumbs are 427x214 (2:1), not 16:9 — wrong ratio crops/shifts the frame. */
.thumb-link.ep-wide-thumb {
  aspect-ratio: 2 / 1;
  min-height: 120px;
}

.thumb-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  background: linear-gradient(
      135deg,
      rgba(78, 221, 167, 0.14),
      rgba(22, 30, 27, 0.92)
    ),
    var(--panel-3);
  color: var(--text-muted);
}

.thumb-placeholder span {
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(78, 221, 167, 0.35);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.thumb-placeholder strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}

.preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.preview-video.active {
  opacity: 1;
}

.result-badge-row {
  position: absolute;
  inset: auto 8px 8px 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  border-radius: 4px;
  background: rgba(5, 10, 8, 0.78);
  color: var(--text);
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 800;
}

.result-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
  min-height: 0;
}

/* Push action row to bottom so all cards in a row align */
.result-body .card-actions {
  margin-top: auto;
}

.variant-carousel {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: stretch;
}

.variant-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(126px, 150px);
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.variant-nav {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.variant-nav:hover {
  border-color: rgba(53, 201, 136, 0.35);
  color: var(--accent);
}

.variant-tile {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  scroll-snap-align: start;
}

.variant-tile.active {
  border-color: rgba(53, 201, 136, 0.45);
  background: rgba(53, 201, 136, 0.08);
  box-shadow: inset 0 0 0 1px rgba(53, 201, 136, 0.12);
}

.variant-tile a {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 8px 8px 8px 32px;
  color: var(--text);
  text-decoration: none;
}

.variant-tile strong,
.variant-tile span,
.variant-tile small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variant-tile strong {
  color: var(--accent);
  font-size: 12px;
}

.variant-tile span,
.variant-tile small {
  color: var(--muted);
  font-size: 11px;
}

.variant-select {
  position: absolute;
  z-index: 2;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.variant-select input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.variant-select span {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(237, 245, 239, 0.68);
  border-radius: 4px;
}

.variant-select input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px rgba(5, 10, 8, 0.88);
}

.result-title-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.result-title-row .result-title {
  flex: 1 1 auto;
  min-width: 0;
}

.result-title.is-locked {
  color: #d7e0dc;
}

.result-title--missing {
  appearance: none;
  border: 1px dashed rgba(255, 183, 77, 0.45);
  background: rgba(255, 183, 77, 0.08);
  color: #ffd59a;
  cursor: pointer;
  text-align: left;
  width: 100%;
  padding: 2px 6px;
  border-radius: 6px;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.result-title--missing:hover {
  border-color: rgba(255, 183, 77, 0.75);
  background: rgba(255, 183, 77, 0.14);
  color: #ffe8c2;
}

.title-lock-badge {
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1;
  opacity: 0.75;
}

.result-title {
  min-height: 44px;
  max-height: calc(1.25em * 3 + 2px);
  color: var(--text);
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.result-age {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.2px;
}
.result-age:empty {
  display: none;
}

.card-menu {
  position: relative;
  flex: 0 0 auto;
}

.card-menu-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--muted);
}

.card-menu-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.card-menu-pop {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  min-width: 156px;
  background: #111814;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-menu-pop[hidden] {
  display: none;
}

.card-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.card-menu-item svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex: 0 0 auto;
}

.card-menu-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.card-menu-item.active {
  color: #9cf2c6;
  background: rgba(53, 201, 136, 0.12);
}

.card-menu-item.danger {
  color: #ff6b6b;
}

.card-menu-item.danger:hover {
  background: rgba(255, 107, 107, 0.12);
}

.card-menu-better-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-menu-parent span {
  flex: 1 1 auto;
  text-align: left;
}

.card-menu-parent svg:last-child {
  width: 14px;
  height: 14px;
  opacity: 0.55;
  flex: 0 0 auto;
}

.card-menu-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 2px 10px;
  padding: 2px 0 2px 8px;
  border-left: 2px solid var(--line);
}

.card-menu-sub[hidden] {
  display: none;
}

.card-menu-sub-item {
  font-size: 12px;
  padding-left: 8px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.meta-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--panel-2);
  color: var(--muted);
}

.meta-pill-button,
.meta-pill-inner {
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  line-height: inherit;
}

.meta-pill-button:hover,
.meta-pill-inner:hover {
  color: #9fd4ff;
}

.folder-pill-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px 0 7px;
}

.folder-pill-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
  transition:
    color 0.15s,
    background 0.15s;
}

.folder-pill-remove:hover {
  color: #ff6b6b;
  background: rgba(255, 100, 100, 0.15);
}

.user-tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 26px;
}

.user-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  border: 1px solid rgba(53, 201, 136, 0.24);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(53, 201, 136, 0.08);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

/* Import'tan gelen site etiketleri: daha soluk, farkli ton */
.user-tag-pill.imported {
  border-color: rgba(140, 180, 255, 0.25);
  background: rgba(140, 180, 255, 0.07);
  color: var(--text-muted, #8fa3c8);
  font-weight: 600;
}

.pornstar-tags-wrap {
  margin-top: 6px;
}

.pornstar-tag-row {
  min-height: 24px;
}

.pornstar-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  border: 1px solid rgba(232, 121, 168, 0.35);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(232, 121, 168, 0.12);
  color: #f0a8c8;
  font-size: 11px;
  font-weight: 800;
}

.pornstar-tag-pill button {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  font-size: 11px;
}

.pornstar-tag-add {
  border-color: rgba(232, 121, 168, 0.35);
  color: #f0a8c8;
}

.pornstar-tag-add:hover {
  background: rgba(232, 121, 168, 0.16);
  border-color: rgba(232, 121, 168, 0.5);
}

.tag-overflow-btn {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(140, 180, 255, 0.2);
  background: transparent;
  color: rgba(140, 180, 255, 0.6);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.12s;
}

.tag-overflow-btn:hover {
  background: rgba(140, 180, 255, 0.12);
  color: rgba(140, 180, 255, 0.9);
}

.user-tag-pill button,
.user-tag-pill .tag-pill-remove {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
}

.user-tag-pill .tag-pill-remove {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  font-size: 14px;
  font-weight: 900;
}

.user-tag-pill .tag-pill-remove:hover {
  background: rgba(255, 100, 100, 0.22);
  border-color: rgba(255, 130, 130, 0.45);
  color: #ffd6d6;
}

.user-tag-pill.imported .tag-pill-remove {
  background: rgba(0, 0, 0, 0.18);
}

.tag-add-button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
}

.tag-add-button:hover {
  border-color: rgba(53, 201, 136, 0.42);
  color: var(--accent);
  background: rgba(53, 201, 136, 0.1);
}

.card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.card-save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  min-width: 0;
}

.card-icon-actions {
  display: flex;
  gap: 6px;
}

.card-icon-actions .icon-button,
.card-save-actions .icon-button {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.card-icon-actions svg,
.card-save-actions svg,
.folder-arrow svg,
.open-icon svg,
.danger-icon svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.open-icon {
  color: var(--accent);
}

.danger-icon {
  color: var(--muted);
}

.danger-icon:hover {
  color: var(--red);
  border-color: rgba(255, 107, 104, 0.42);
  background: rgba(255, 107, 104, 0.1);
}

.quick-folder-icon {
  color: var(--muted);
}

.quick-folder-icon:hover {
  border-color: rgba(53, 201, 136, 0.36);
  color: var(--accent);
  background: rgba(53, 201, 136, 0.1);
}

.quick-folder-icon.likey.active {
  border-color: rgba(255, 107, 104, 0.36);
  color: var(--red);
  background: rgba(255, 107, 104, 0.1);
}

.quick-folder-icon.watchlater.active {
  border-color: rgba(242, 191, 90, 0.38);
  color: var(--amber);
  background: rgba(242, 191, 90, 0.1);
}

.quick-folder-icon.watchlater.priority-active.active {
  border-color: rgba(53, 201, 136, 0.42);
  color: var(--accent);
  background: rgba(53, 201, 136, 0.13);
}

.star-row {
  display: flex;
  gap: 2px;
}

.star-button {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: #4f5b53;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  border-radius: 6px;
  transition:
    color 0.12s ease,
    transform 0.12s ease,
    background 0.12s ease;
}

.star-button svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
  transition: opacity 0.12s ease;
}

.star-row:hover .star-button:not(.active) {
  color: rgba(255, 255, 255, 0.28);
}

.star-row:has(.star-button:nth-child(1):hover) .star-button:nth-child(1),
.star-row:has(.star-button:nth-child(2):hover) .star-button:nth-child(-n + 2),
.star-row:has(.star-button:nth-child(3):hover) .star-button:nth-child(-n + 3),
.star-row:has(.star-button:nth-child(4):hover) .star-button:nth-child(-n + 4),
.star-row:has(.star-button:nth-child(5):hover) .star-button:nth-child(-n + 5) {
  color: var(--amber);
  transform: scale(1.08);
}

.star-row .star-button:hover {
  background: rgba(240, 180, 41, 0.1);
}

.star-row.can-clear:has(.star-button:nth-child(1):hover)
  .star-button:nth-child(1) {
  color: rgba(255, 255, 255, 0.35);
  transform: scale(0.92);
}

.star-row.can-clear:has(.star-button:nth-child(1):hover)
  .star-button:nth-child(1)
  svg {
  opacity: 0.45;
}

.star-row.can-clear .star-button.active:hover {
  color: rgba(255, 255, 255, 0.35);
  transform: scale(0.92);
}

.star-row.can-clear .star-button.active:hover svg {
  opacity: 0.45;
}

.star-button.active {
  color: var(--amber);
}

.url-star-row {
  min-height: 36px;
  align-items: center;
}

.url-star-row .star-button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.folder-select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px;
}

.vr-ribbon {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 44px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.relevance-ribbon {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  min-width: 34px;
  border-radius: 4px;
  background: rgba(32, 39, 43, 0.86);
  color: #fff;
  padding: 4px 7px;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.folder-picker {
  min-width: 0;
  position: relative;
}

.folder-picker-btn {
  /* inherits .icon-button styles */
}
.folder-picker-btn[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(53, 201, 136, 0.1);
}

.folder-picker-panel {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 300;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  min-width: 200px;
  padding: 8px;
}
.folder-picker-panel[hidden] {
  display: none;
}

.folder-check-list {
  display: grid;
  gap: 6px;
  min-width: 180px;
  max-height: 170px;
  overflow-y: auto;
  padding: 2px 0;
}

.folder-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
}

.folder-check span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-folder-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 6px;
  margin-top: 8px;
}

.inline-folder-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input);
  color: var(--text);
  padding: 8px;
}

.empty-mini {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-chip a {
  color: var(--blue);
  text-decoration: none;
}

.source-chip-error {
  border-color: rgba(255, 107, 104, 0.28);
  background: rgba(255, 107, 104, 0.08);
  color: var(--red);
  gap: 6px;
}

.source-chip-error a {
  color: var(--red);
  text-decoration: underline;
}

.history-list,
.folder-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.folder-list.is-collapsed > .folder-row-wrap:nth-child(n + 11),
.fav-stars-list.is-collapsed > .fav-star-row:nth-child(n + 11) {
  display: none;
}

.sidebar-section-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #aeb9bd;
  cursor: pointer;
}

.sidebar-section-toggle:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.sidebar-section-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.sidebar-section-toggle svg {
  transition: transform 0.15s ease;
}

.fav-pornstar-form {
  margin-top: 0;
}

.history-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 14px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.history-tabs button {
  border: 0;
  border-radius: 6px;
  min-height: 32px;
  background: transparent;
  color: #aeb9bd;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.history-tabs button.active {
  background: var(--accent);
  color: #06120d;
}

.history-clear-button {
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  border: 1px solid rgba(255, 107, 104, 0.24);
  border-radius: 6px;
  background: rgba(255, 107, 104, 0.08);
  color: #ffc2c0;
  cursor: pointer;
  font-weight: 800;
}

.history-clear-button:hover {
  background: rgba(255, 107, 104, 0.16);
}

.history-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.history-bulk-bar[hidden] {
  display: none;
}

.history-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #d7e0e3;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.history-select-all input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.history-delete-selected {
  flex-shrink: 0;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 107, 104, 0.28);
  border-radius: 6px;
  background: rgba(255, 107, 104, 0.1);
  color: #ffc2c0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.history-delete-selected:hover:not(:disabled) {
  background: rgba(255, 107, 104, 0.18);
}

.history-delete-selected:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.history-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.history-item.selected {
  border-color: rgba(53, 201, 136, 0.42);
  background: rgba(53, 201, 136, 0.08);
}

.history-select {
  display: grid;
  place-items: center;
  padding-top: 4px;
}

.history-select input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.history-item.favorite {
  border-color: rgba(183, 121, 31, 0.55);
  background: rgba(183, 121, 31, 0.14);
}

.history-item.favorite.selected {
  border-color: rgba(183, 121, 31, 0.72);
  background: rgba(183, 121, 31, 0.22);
}

.history-run {
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 2px;
  text-align: left;
}

.history-item:hover,
.history-run:focus-visible {
  background: rgba(255, 255, 255, 0.11);
  outline: none;
}

.history-run strong {
  display: block;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-run span {
  display: block;
  color: #aeb9bd;
  font-size: 12px;
}

.history-actions {
  display: grid;
  gap: 5px;
}

.history-star,
.history-delete {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #aeb9bd;
  cursor: pointer;
  font-weight: 900;
}

.history-star svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.history-star.active {
  color: #f1b54a;
  border-color: rgba(241, 181, 74, 0.35);
  background: rgba(241, 181, 74, 0.12);
}

.history-delete:hover {
  color: #fff;
  background: rgba(194, 65, 53, 0.56);
}

.folder-form {
  gap: 8px;
  margin-top: 12px;
}

.folder-form .clearable-field,
.folder-form-field {
  flex: 1 1 auto;
  min-width: 0;
}

.folder-search-clear svg {
  width: 14px;
  height: 14px;
}

.folder-row-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 7px;
  align-items: stretch;
  min-width: 0;
}

.folder-row-wrap.no-folder-delete,
.folder-row-wrap.search-results-row {
  grid-template-columns: 1fr;
}

.folder-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel-3);
  color: var(--text);
  font: inherit;
  text-align: left;
  appearance: none;
}

.folder-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: rgba(53, 201, 136, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}
.folder-mark svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.folder-mark.fav-stars-mark {
  background: rgba(232, 93, 138, 0.14);
  color: #e85d8a;
}
.folder-mark.recent-vr-mark {
  background: rgba(106, 168, 255, 0.14);
  color: #6aa8ff;
}
.folder-mark.recent-vr-mark svg {
  fill: #6aa8ff;
}

.folder-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.folder-copy strong,
.folder-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-copy small,
.folder-arrow {
  color: var(--muted);
}

.folder-link {
  cursor: pointer;
}

.folder-link:hover,
.folder-link.active {
  border-color: rgba(53, 201, 136, 0.42);
  background: rgba(53, 201, 136, 0.08);
}

.folder-delete-button {
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 100%;
  border: 1px solid rgba(255, 107, 104, 0.2);
  border-radius: 8px;
  background: rgba(255, 107, 104, 0.07);
  color: #ffaaa7;
  cursor: pointer;
}

.folder-delete-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.folder-delete-button:hover {
  border-color: rgba(255, 107, 104, 0.44);
  background: rgba(255, 107, 104, 0.16);
  color: #fff;
}

.select2ish {
  position: relative;
  width: 100%;
  min-width: 0;
}

.select2-control {
  position: relative;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 38px 6px 8px;
  background: var(--input);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.select2ish.open .select2-control,
.select2-control:focus {
  border-color: rgba(53, 201, 136, 0.72);
  box-shadow: 0 0 0 3px rgba(53, 201, 136, 0.14);
}

.select2-selection {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.select2-caret {
  position: absolute;
  right: 13px;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-60%) rotate(45deg);
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease;
}

.select2ish.open .select2-caret {
  transform: translateY(-35%) rotate(225deg);
  border-color: var(--accent);
}

.select2-tag,
.select2-more {
  flex: 0 1 auto;
  max-width: 142px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 999px;
  background: rgba(53, 201, 136, 0.14);
  color: #b9f4d8;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.select2-more {
  flex: 0 0 auto;
  background: rgba(122, 184, 255, 0.14);
  color: #c6defc;
}

.select2-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  width: min(520px, calc(100vw - 32px));
  max-height: min(420px, calc(100vh - 190px));
  display: none;
  overflow: auto;
  background: #121714;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.46);
  padding: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.select2ish.open .select2-menu {
  display: grid;
}

.select2ish-native.open .select2-menu {
  display: block;
}

.select2-search {
  width: 100%;
  margin-bottom: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.select2-search:focus {
  border-color: rgba(53, 201, 136, 0.72);
}

.select2ish-native .select2-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(320px, 42vh);
  overflow: auto;
}

.select2-native-source {
  display: none !important;
}

#bulkPersonSuggestions,
#bulkTagSuggestions {
  z-index: 420;
}

.folder-picker-search {
  width: 100%;
  margin-bottom: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  outline: none;
}

.folder-picker-search:focus {
  border-color: rgba(53, 201, 136, 0.72);
}

.folder-check[hidden] {
  display: none;
}

.select2-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 10px;
  cursor: pointer;
  color: var(--text);
  background: transparent;
}

.select2-option:hover {
  background: var(--panel-2);
}

.select2-option.selected {
  border-color: rgba(53, 201, 136, 0.36);
  background: rgba(53, 201, 136, 0.1);
}

.select2-option-all {
  grid-column: 1 / -1;
}

.select2-option input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.select2-option-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: 360px;
  border-radius: 8px;
  padding: 12px 14px;
  background: #0b0f0d;
  color: #fff;
  box-shadow: var(--shadow);
}

.global-loader {
  position: fixed;
  z-index: 60;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  min-width: min(440px, calc(100vw - 36px));
  padding: 18px 20px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(53, 201, 136, 0.34);
  border-radius: 8px;
  background: rgba(11, 15, 13, 0.97);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 15px;
  font-weight: 800;
}

.global-loader[hidden] {
  display: none;
}

.loader-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(53, 201, 136, 0.2);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: loader-spin 0.7s linear infinite;
}

.loader-cancel-button {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
}

.loader-cancel-button:hover {
  border-color: rgba(255, 107, 104, 0.5);
  color: var(--red);
}

.loader-cancel-button[hidden] {
  display: none;
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

.scroll-top-button {
  position: fixed;
  right: 18px;
  bottom: 74px;
  z-index: 45;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(53, 201, 136, 0.38);
  border-radius: 8px;
  background: rgba(53, 201, 136, 0.14);
  color: #9cf2c6;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.scroll-top-button:hover,
.history-rail-toggle:hover {
  border-color: rgba(53, 201, 136, 0.58);
  background: rgba(53, 201, 136, 0.22);
  color: #d0ffe6;
}

.scroll-top-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.history-toggle {
  display: none;
}

.history-toggle {
  display: inline-flex;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 5, 0.72);
  backdrop-filter: blur(6px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  display: grid;
  gap: 14px;
  width: min(620px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.tag-modal-panel {
  width: min(460px, calc(100vw - 36px));
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.modal-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.modal-head .icon-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
}

.modal-tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: var(--panel-2);
}

.modal-tabs button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.modal-tabs button:hover,
.modal-tabs button.active {
  background: rgba(53, 201, 136, 0.13);
  color: var(--accent);
}

.modal-tab-pane {
  display: none;
  gap: 12px;
}

.modal-tab-pane.active {
  display: grid;
}

.url-save-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 12px;
  align-items: end;
}

.url-save-preview {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 98px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-3);
}

.url-save-preview.empty-state {
  display: block;
  min-height: auto;
}

.url-save-preview img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
  background: var(--panel-2);
}

.url-preview-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.url-clipboard-prompt,
.url-clipboard-modal-title {
  margin: 0;
  color: var(--accent);
  font-weight: 800;
  line-height: 1.25;
}

.url-clipboard-modal-title {
  font-size: clamp(20px, 2.4vw, 24px);
  letter-spacing: -0.02em;
}

.url-clipboard-prompt {
  font-size: clamp(17px, 2vw, 20px);
  letter-spacing: -0.015em;
}

.url-save-preview.empty-state .url-clipboard-prompt {
  margin-bottom: 10px;
}

.url-preview-body strong {
  overflow-wrap: anywhere;
  color: var(--text);
}

.tag-field {
  position: relative;
}

.tag-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
}

.tag-entry-row input {
  width: 100%;
  min-width: 0;
}

.tag-entry-row .icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.tag-suggestions {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 46px;
  top: calc(100% - 2px);
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #0b0f0d;
  box-shadow: var(--shadow);
}

.tag-suggestions[hidden] {
  display: none;
}

.tag-suggestions.suggestions-floating,
.person-suggestions.suggestions-floating {
  right: auto;
  z-index: 5000;
  max-height: min(240px, 40vh);
  overflow: auto;
}

.tag-suggestions button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.tag-suggestions button:hover {
  background: rgba(53, 201, 136, 0.12);
  color: var(--accent);
}

.person-field {
  position: relative;
}

.person-suggestions {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 46px;
  top: calc(100% - 2px);
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #0b0f0d;
  box-shadow: var(--shadow);
}

.query-suggestions {
  right: 0;
}

.person-suggestions[hidden] {
  display: none;
}

.person-suggestions button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 5px 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.person-suggestions button:hover {
  background: rgba(53, 201, 136, 0.12);
}

.person-suggestions img,
.person-pill img,
.person-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  object-fit: cover;
  background: rgba(53, 201, 136, 0.16);
}

.person-avatar {
  display: inline-grid;
  place-items: center;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
}

.person-suggestions strong,
.person-suggestions small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-suggestions strong {
  font-size: 12px;
}

.person-suggestions small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.person-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 26px;
}

.person-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid rgba(122, 184, 255, 0.24);
  border-radius: 999px;
  padding: 2px 7px 2px 3px;
  background: rgba(122, 184, 255, 0.08);
  color: #bcd9ff;
  font-size: 11px;
  font-weight: 800;
}

button.person-pill {
  cursor: pointer;
  font: inherit;
}

button.person-pill:hover {
  border-color: rgba(53, 201, 136, 0.42);
  background: rgba(53, 201, 136, 0.1);
  color: var(--accent);
}

.person-pill-combo {
  padding-right: 3px;
}

.person-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.person-pill-link:hover {
  color: var(--accent);
}

.person-remove-button {
  margin-left: 1px;
}

/* Auto-matched pornstar: amber candidate styling */
.person-pill-auto,
.person-pill-candidate {
  border-color: rgba(240, 180, 41, 0.55);
  background: rgba(240, 180, 41, 0.16);
  color: #ffd98a;
}

.person-pill-auto .person-pill-link,
.person-pill-candidate .person-pill-link {
  color: inherit;
}

.person-pill-auto {
  box-shadow: inset 0 0 0 1px rgba(240, 180, 41, 0.35);
}

.person-confirm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 1px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: rgba(240, 180, 41, 0.16);
  color: #f0b429;
  flex-shrink: 0;
  cursor: pointer;
  transition:
    color 0.15s,
    background 0.15s;
}

.person-confirm-badge .pc-q {
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.person-confirm-badge .pc-check {
  display: none;
  width: 10px;
  height: 10px;
}

button.person-confirm-badge:hover {
  background: rgba(63, 185, 109, 0.2);
  color: #3fb96d;
}

button.person-confirm-badge:hover .pc-q {
  display: none;
}

button.person-confirm-badge:hover .pc-check {
  display: block;
}

.person-confirm-badge.static {
  cursor: default;
}

/* Fav button on pornstar pill */
.person-fav-button,
.person-kill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
  transition:
    color 0.15s,
    background 0.15s;
}

.person-fav-button svg,
.person-kill-button svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.person-fav-button:hover {
  color: #e85d8a;
  background: rgba(232, 93, 138, 0.14);
}

.person-fav-button.faved {
  color: #e85d8a;
}

.person-fav-button.faved svg {
  fill: #e85d8a;
}

.person-kill-button {
  color: rgba(255, 255, 255, 0.25);
}

.person-kill-button:hover {
  color: #e05c5c;
  background: rgba(224, 92, 92, 0.15);
}

/* Fav Stars sidebar section */
.fav-stars-title-btn {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-size: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-align: left;
}

.fav-stars-title-btn:hover {
  color: #e85d8a;
}

.recent-vr-panel .fav-stars-title-btn:hover {
  color: #6aa8ff;
}

.fav-stars-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 6px;
}

.fav-star-row {
  min-width: 0;
}

.fav-star-main {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(232, 93, 138, 0.04);
  overflow: hidden;
}

.fav-star-main .fav-star-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.fav-star-main .fav-star-link:hover {
  background: rgba(232, 93, 138, 0.06);
  color: #e85d8a;
}

.fav-star-avatar {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(232, 93, 138, 0.14);
  color: #e85d8a;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fav-star-initials {
  background: rgba(232, 93, 138, 0.14);
  color: #e85d8a;
}

.fav-star-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.fav-star-copy strong {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav-star-copy small {
  font-size: 10px;
  color: var(--muted);
}

.fav-star-actions {
  display: flex;
  align-items: center;
  border-left: 1px solid var(--line);
  flex-shrink: 0;
}

.fav-star-unfav,
.fav-star-kill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  color: #e85d8a;
  transition: background 0.15s;
}

.fav-star-unfav {
  color: #e85d8a;
}

.fav-star-kill {
  color: rgba(255, 255, 255, 0.35);
  border-left: 1px solid var(--line);
}

.fav-star-unfav:hover,
.fav-star-kill:hover {
  background: rgba(255, 255, 255, 0.06);
}

.person-pill.new {
  border-color: rgba(242, 191, 90, 0.34);
  background: rgba(242, 191, 90, 0.1);
  color: #f6cd78;
}

.person-pill small {
  color: inherit;
  opacity: 0.8;
}

.person-pill button {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  font-size: 11px;
}

.person-pill .person-pill-link {
  display: inline-flex;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  font-size: inherit;
}

.card-person-row {
  min-height: 24px;
}

.card-person-row .person-pill {
  min-height: 24px;
  padding: 1px 7px 1px 2px;
}

.card-person-row .person-pill img,
.card-person-row .person-avatar {
  width: 22px;
  height: 22px;
}

.person-add-button {
  color: #bcd9ff;
}

.tag-modal-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

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

.video-player-backdrop {
  z-index: 240;
}

.video-player-panel {
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.video-player-status {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.video-player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.video-player-element {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.video-player-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.video-quality-field {
  min-width: 140px;
  margin: 0;
}

.thumb-link {
  cursor: pointer;
}

.icon-button.play-icon svg {
  fill: currentColor;
}

@media (max-width: 1180px) {
  .result-card,
  .grouped-result-card {
    content-visibility: visible;
    contain-intrinsic-size: unset;
  }
}

@media (min-width: 700px) and (max-width: 1180px) {
  .main-shell {
    padding: 14px;
    gap: 12px;
  }

  .result-card,
  .grouped-result-card {
    content-visibility: visible;
    contain-intrinsic-size: unset;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 12px;
  }

  .results-panel,
  .folder-panel,
  .search-board {
    padding: 12px;
  }

  .source-row,
  .filter-grid,
  .details-grid {
    gap: 8px;
  }

  .bulk-toolbar-body {
    gap: 6px 10px;
  }

  .bulk-group--danger {
    margin-left: 0;
  }

  .source-row {
    grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr) 104px;
  }

  .url-save-open-button {
    width: 36px;
    height: 36px;
  }

  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
  }

  .panel-head h2,
  .section-head h2 {
    font-size: 16px;
  }

  .ghost-button,
  .primary-button,
  .field input,
  .field select,
  .field textarea {
    font-size: 12px;
  }

  .primary-button,
  .ghost-button {
    min-height: 36px;
    padding-left: 11px;
    padding-right: 11px;
  }

  .result-body {
    gap: 8px;
    padding: 9px;
  }

  .result-title {
    min-height: 38px;
    font-size: 13px;
  }

  .meta-row,
  .badge {
    font-size: 11px;
  }

  .variant-track {
    grid-auto-columns: minmax(112px, 132px);
  }
}

/* Tablet: topbar gets crowded — stack search bar on its own row, menu below */
@media (max-width: 1100px) {
  .topbar {
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
  }
  /* Search bar shares the row with the hamburger button */
  .global-search-bar {
    order: 1;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
  .menu-toggle {
    display: inline-flex;
    order: 2;
  }
  /* Menu becomes a right-aligned dropdown panel toggled by the hamburger */
  .top-actions {
    order: 3;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 70;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: min(280px, 86vw);
    max-width: none;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition:
      max-height 0.26s ease,
      opacity 0.2s ease,
      padding 0.26s ease;
  }
  body.menu-open .top-actions {
    max-height: 70vh;
    overflow: auto;
    padding: 10px;
    opacity: 1;
    pointer-events: auto;
  }
  /* Don't let the focus-collapse rule hide the dropdown on tablet */
  .topbar:has(.global-search-bar.focused) .top-actions {
    max-width: none;
    margin-left: 0;
  }
  .top-actions .ghost-button,
  .top-actions .url-save-open-button,
  .top-actions .language-select,
  .top-actions .user-chip-wrap {
    width: 100%;
  }
  .top-actions .ghost-button {
    text-align: left;
  }
  .top-actions .user-chip {
    width: 100%;
    justify-content: space-between;
  }
  .user-chip-menu {
    position: static;
    box-shadow: none;
    border: 0;
    padding-left: 8px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .history-panel {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    width: min(330px, 88vw);
    transform: translateX(-100%);
    transition: transform 0.18s ease;
  }

  body.history-open .history-panel {
    transform: translateX(0);
  }

  body.sidebar-collapsed .sidebar-panel {
    display: none;
  }

  body.sidebar-collapsed .sidebar-slot {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
  }

  body.sidebar-collapsed .sidebar-rail-toggle {
    display: grid;
  }

  .mobile-close,
  .history-toggle {
    display: inline-flex;
  }

  .workspace,
  .source-row,
  .similar-row,
  .url-save-row,
  .speed-form,
  .filter-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .bulk-toolbar-body {
    flex-direction: column;
    align-items: flex-start;
  }

  .bulk-floating-bar {
    width: 100%;
  }

  .bulk-group + .bulk-group {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 6px;
  }

  .source-row,
  .similar-row,
  .url-save-row {
    display: grid;
  }

  .field.wide {
    width: 100%;
  }

  .similar-button {
    width: 100%;
  }

  .url-folder-field,
  .url-save-button,
  .folder-filter-clear,
  .folder-filter-apply,
  .bulk-toolbar .ghost-button:not(.icon-only-button) {
    width: 100%;
  }

  .bulk-toolbar .icon-only-button {
    width: auto;
    min-width: 38px;
    flex: 0 0 auto;
  }

  .bulk-group {
    width: 100%;
    flex-wrap: wrap;
  }

  .probe-panel {
    grid-template-columns: 1fr;
  }

  .probe-thumb {
    width: 100%;
  }

  .topbar {
    align-items: flex-start;
  }

  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .card-icon-actions {
    justify-content: flex-end;
  }

  .card-actions .ghost-button {
    width: 100%;
  }

  .card-icon-actions .icon-button,
  .card-save-actions .icon-button {
    width: 36px;
  }

  .folder-picker summary {
    width: 36px;
    justify-content: center;
  }

  .folder-check-list {
    min-width: 0;
    width: 100%;
  }

  .select2-menu {
    width: 100%;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .main-shell {
    padding: 12px;
  }

  .result-card,
  .grouped-result-card {
    content-visibility: visible;
    contain-intrinsic-size: unset;
  }

  .thumb-link {
    min-height: 168px;
  }

  .thumb-link.ep-wide-thumb {
    min-height: 150px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .url-save-modal-grid,
  .url-save-preview {
    grid-template-columns: 1fr;
  }

  .url-save-preview img {
    max-width: 240px;
  }
}
