/* ── SVG Icons ──────────────────────────────────────────────── */
.svg-icon {
  display: inline-block;
  vertical-align: -0.125em;
  flex-shrink: 0;
  color: currentColor;
}
.btn .svg-icon, .browse-tab .svg-icon, .genre-type-btn .svg-icon,
.dash-section-link .svg-icon, .at-header .svg-icon {
  margin-right: 4px;
}
.browse-header h2 .svg-icon, .queue-section-title .svg-icon,
.settings-card h3 .svg-icon, .profile-card h3 .svg-icon, .download-card h3 .svg-icon {
  vertical-align: -0.2em;
  margin-right: 4px;
}
.bottom-nav-item .svg-icon {
  display: block;
  margin: 0 auto;
  color: currentColor;
}

/* ── Login Section ─────────────────────────────────────────── */
.login-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  max-width: 480px; margin: 2rem auto;
  animation: fadeSlideUp 0.3s ease;
}
.login-section h2 { font-size: 16px; margin-bottom: 4px; color: var(--white); }
.login-section p { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.hint { font-size: 11px; color: var(--muted); margin-top: 8px; }
.hint a { color: var(--amber); text-decoration: none; }
.hint a:hover { text-decoration: underline; }

.btn-load {
  width: 100%; background: var(--amber); color: var(--bg); border: none;
  border-radius: var(--radius-sm); padding: 10px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all var(--transition); font-family: var(--font);
  margin-top: 8px;
}
.btn-load:hover { background: var(--amber-dim); }
.btn-load:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-load.loading { pointer-events: none; opacity: 0.7; }
.btn-load.loading::after { content: ' ...'; }

/* ── Dashboard ─────────────────────────────────────────────── */
#dashboard { padding: 1rem 0 1.5rem; animation: fadeIn 0.3s ease; }

.dash-welcome {
  margin-bottom: 1rem;
}
.dash-welcome h1 {
  font-size: 1.3rem; font-weight: 700; color: var(--white);
  margin-bottom: 2px;
}
.dash-welcome p { color: var(--muted); font-size: 12px; }
.dash-welcome .provider-badges {
  display: flex; gap: 6px; margin-top: 6px;
}
.dash-welcome .provider-badge {
  padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em;
  display: inline-flex; align-items: center; gap: 5px;
}
.dash-welcome .provider-badge .provider-logo {
  width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0;
}
.provider-badge.tb { background: rgba(88,166,255,0.12); color: var(--blue); }
.provider-badge.rd { background: rgba(248,81,73,0.12); color: var(--error); }
.provider-badge.ad { background: rgba(63,185,80,0.12); color: var(--success); }
.provider-badge.pm { background: rgba(168,85,247,0.14); color: #c084fc; }

/* Stats Grid */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-bottom: 1rem;
}
@media (min-width: 1000px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border2); }
.stat-card .stat-icon { font-size: 1rem; margin-bottom: 4px; }
.stat-card .stat-value {
  font-size: 1.1rem; font-weight: 700; color: var(--white);
  font-family: var(--mono);
}
.stat-card .stat-label { font-size: 10px; color: var(--muted); margin-top: 1px; }

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Quick Actions */
.quick-actions {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 1rem;
}
.action-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 8px;
  text-align: center; cursor: pointer;
  transition: all var(--transition);
  text-decoration: none; color: var(--text);
}
.action-card:hover {
  border-color: var(--amber); background: rgba(245,158,11,0.04);
  transform: translateY(-1px); text-decoration: none;
}
.action-card .action-icon { font-size: 1.4rem; margin-bottom: 4px; color: var(--amber); }
.action-card .action-label { font-size: 12px; font-weight: 600; }
.action-card .action-count {
  font-size: 10px; color: var(--muted); margin-top: 2px;
  font-family: var(--mono);
}

@media (max-width: 600px) {
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

/* Dashboard Sections */
.dash-section { margin-bottom: 0.6rem; }
.dash-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.dash-section-title {
  font-size: 11px; font-weight: 700; color: var(--white);
  display: flex; align-items: center; gap: 4px;
}
.dash-section-link {
  font-size: 10px; color: var(--amber); font-weight: 500;
  cursor: pointer; background: none; border: none;
  font-family: var(--font);
}
.dash-section-link:hover { text-decoration: underline; }

/* Horizontal scroll row */
.scroll-row {
  display: flex; gap: 6px; overflow-x: auto;
  scroll-behavior: smooth; padding-bottom: 2px;
  scrollbar-width: none;
}
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row .card { flex: 0 0 100px; }
@media (min-width: 600px) { .scroll-row .card { flex: 0 0 110px; } }
.scroll-row .card .card-info { padding: 5px; }
.scroll-row .card .card-title { font-size: 10px; line-height: 1.2; }
.scroll-row .card .card-year { font-size: 9px; }

/* Activity list */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon { font-size: 0.85rem; width: 18px; text-align: center; flex-shrink: 0; color: var(--muted); }
.activity-info { flex: 1; min-width: 0; }
.activity-title {
  font-size: 11px; font-weight: 500; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.activity-meta { font-size: 9px; color: var(--muted); margin-top: 1px; }
.activity-time { font-size: 9px; color: var(--muted); flex-shrink: 0; }

/* ── Search Bar ─────────────────────────────────────────────── */
.search-bar { padding: 10px 0; position: relative; }
.search-bar input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px 10px 36px;
  color: var(--text); font-size: 13px; outline: none;
  font-family: var(--font); transition: border-color var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center; background-size: 14px;
}
.search-bar input:focus { border-color: var(--amber); }
.search-bar input::placeholder { color: var(--border2); }

/* ── Autocomplete ───────────────────────────────────────────── */
.ac-dropdown {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); max-height: 360px;
  overflow-y: auto; z-index: 50; margin-top: 4px;
  box-shadow: var(--shadow-lg);
  scrollbar-width: thin; scrollbar-color: var(--border2) transparent;
}
.ac-dropdown.open { display: block; animation: fadeSlideDown 0.15s ease; }
.ac-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.1s;
}
.ac-item:hover, .ac-item.active { background: rgba(245,158,11,0.08); }
.ac-item:last-child { border-bottom: none; }
.ac-item img { width: 36px; height: 54px; border-radius: 4px; object-fit: cover; flex-shrink: 0; background: var(--surface2); }
.ac-item-info { flex: 1; min-width: 0; }
.ac-item-title { font-size: 13px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.ac-item-type {
  font-size: 9px; font-weight: 700; padding: 2px 5px;
  border-radius: 3px; background: var(--amber-glow); color: var(--amber);
  text-transform: uppercase; flex-shrink: 0; font-family: var(--mono);
}
.ac-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.ac-loading { padding: 14px; text-align: center; color: var(--muted); font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* ── Browse Grid ────────────────────────────────────────────── */
.browse-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-top: 12px;
}
.browse-grid .empty { grid-column: 1 / -1; justify-self: center; }
@media (min-width: 500px) { .browse-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 700px) { .browse-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1000px) { .browse-grid { grid-template-columns: repeat(6, 1fr); } }

/* Browse Tabs */
.browse-tabs {
  display: flex; gap: 4px; padding: 8px 0;
  overflow-x: auto; flex-wrap: nowrap;
  scrollbar-width: none;
}
.browse-tabs::-webkit-scrollbar { display: none; }
.browse-tab {
  padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--muted); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all var(--transition); font-family: var(--font);
  white-space: nowrap; flex-shrink: 0;
}
.browse-tab:hover { color: var(--text); background: var(--surface); }
.browse-tab.active { background: var(--amber); color: var(--bg); font-weight: 700; border-color: var(--amber); }

/* Browse Header */
.browse-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; flex-wrap: wrap; gap: 8px;
}
.browse-header h2 { font-size: 16px; font-weight: 700; color: var(--white); }
.browse-header .count { font-size: 12px; color: var(--muted); }

/* View toggle */
.view-toggle {
  display: inline-flex; gap: 0; border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.view-toggle button {
  padding: 5px 10px; background: transparent; border: none;
  color: var(--muted); font-size: 12px; cursor: pointer;
  font-family: var(--font); transition: all var(--transition);
}
.view-toggle button.active { background: var(--amber); color: var(--bg); }
.view-toggle button:hover:not(.active) { background: var(--surface); color: var(--text); }

/* ── Library List ───────────────────────────────────────────── */
.list { padding: 0; }
#libraryView, #browseView, #genreView, #recentView, #profileView, #watchlistView, #queueView, #downloadView, #settingsView {
  padding-bottom: 3rem;
}
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-bottom: 1px solid var(--border);
  transition: background 0.1s; position: relative;
}
.list-item:hover { background: var(--surface); }
.list-item:last-child { border-bottom: none; }
.list-item.selected { background: rgba(245, 158, 11, 0.06); }
#libraryContent .card.selected { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
#libraryContent .card.watched { opacity: 0.72; }
#libraryContent .card.watched .card-title { text-decoration: line-through; }
.lib-card-cb { position: absolute; top: 8px; left: 8px; z-index: 2; }
.lib-card-cb input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--amber); cursor: pointer; }

.list-item .cb { flex-shrink: 0; }
.list-item .cb input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--amber); cursor: pointer; }

.list-info { flex: 1; min-width: 0; }
.list-title {
  font-size: 13px; font-weight: 600; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
.list-title .year { color: var(--muted); font-weight: 400; margin-left: 4px; }
.list-filename {
  font-size: 11px; color: var(--muted); font-family: var(--mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px; line-height: 1.3;
}
.list-meta {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px; font-size: 10px; color: var(--muted); flex-wrap: wrap;
}
.list-meta .sep { color: var(--border2); }

.btn-delete {
  flex-shrink: 0; background: none; border: 1px solid transparent;
  color: var(--muted); cursor: pointer; font-size: 13px;
  padding: 4px 6px; border-radius: 4px; transition: all var(--transition);
  opacity: 0; line-height: 1;
}
.list-item:hover .btn-delete { opacity: 1; }
.btn-delete:hover { color: var(--error); border-color: rgba(248,81,73,0.3); background: rgba(248,81,73,0.08); }

/* Batch bar */
.batch-bar {
  display: none; align-items: center; gap: 12px;
  padding: 8px 12px; margin: 8px 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--muted);
}
.batch-bar.show { display: flex; }
.batch-bar .count { color: var(--amber); font-weight: 600; }

/* Duplicate panel */
.dupe-panel {
  margin: 8px 0; border-radius: var(--radius-md);
  background: rgba(210,153,34,0.06); border: 1px solid rgba(210,153,34,0.25);
  overflow: hidden;
}
.dupe-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; gap: 12px; flex-wrap: wrap;
}
.dupe-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.dupe-stat {
  display: flex; align-items: baseline; gap: 6px;
}
.dupe-stat-num {
  font-size: 18px; font-weight: 700; color: var(--amber);
  font-family: var(--mono); line-height: 1;
}
.dupe-stat-warn .dupe-stat-num { color: var(--error); }
.dupe-stat-label {
  font-size: 12px; color: var(--muted); font-weight: 500;
}
.dupe-panel-actions {
  display: flex; gap: 8px; flex-shrink: 0;
}
.dupe-group-list {
  display: flex; flex-direction: column; gap: 1px;
  max-height: 180px; overflow-y: auto;
  background: rgba(0,0,0,0.15);
  border-top: 1px solid rgba(210,153,34,0.15);
}
.dupe-group {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; gap: 12px;
  background: rgba(210,153,34,0.04);
  transition: background var(--transition);
}
.dupe-group:hover { background: rgba(210,153,34,0.1); }
.dupe-group-info {
  display: flex; align-items: center; gap: 8px;
  min-width: 0; flex: 1;
}
.dupe-group-title {
  color: var(--text); font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dupe-group-year { color: var(--muted); font-weight: 400; }
.dupe-group-meta {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.dupe-group-copies {
  font-size: 12px; color: var(--muted);
  font-family: var(--mono);
}
.dupe-group-keep {
  font-size: 11px; color: var(--amber);
  font-family: var(--mono); font-weight: 500;
  background: rgba(245,158,11,0.1); padding: 2px 6px;
  border-radius: 3px;
}

/* Duplicate item highlighting */
.list-item.dupe-extra {
  background: rgba(248,81,73,0.06);
  border-left: 3px solid var(--error);
}
.list-item.dupe-extra:hover {
  background: rgba(248,81,73,0.1);
}
.badge-duplicate {
  background: rgba(248,81,73,0.15); color: var(--error);
  font-size: 9px; padding: 1px 5px; border-radius: 3px;
  font-weight: 700; text-transform: uppercase;
}
.active-dupe {
  background: var(--error) !important; color: var(--bg) !important;
  border-color: var(--error) !important;
}
.badge-series { background: rgba(88,166,255,0.12); color: var(--blue); font-size: 9px; padding: 1px 5px; border-radius: 3px; }

/* Content header */
.content-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0 8px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 8px;
}
.content-header .meta { font-size: 13px; color: var(--muted); }
.content-header .meta strong { color: var(--text); font-weight: 600; }
.header-actions { display: flex; gap: 8px; align-items: center; }

/* ── Library toolbar (sort / filters) ──────────────────────── */
.lib-toolbar {
  display: flex; gap: 6px; padding: 8px 0; flex-wrap: wrap;
  align-items: center;
}
.lib-toolbar select, .lib-toolbar input {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 8px;
  color: var(--text); font-size: 12px; outline: none;
  font-family: var(--font); cursor: pointer;
}
.lib-toolbar select:focus, .lib-toolbar input:focus { border-color: var(--amber); }
.lib-toolbar input { width: 70px; }

/* Watched */
.badge-watched {
  background: rgba(63,185,80,0.15); color: var(--success);
  font-size: 9px; padding: 1px 5px; border-radius: 3px;
}
.list-item.watched { opacity: 0.72; }
.list-item.watched .list-title { text-decoration: line-through; }
.btn-watch {
  flex-shrink: 0; background: none; border: 1px solid transparent;
  color: var(--muted); cursor: pointer; font-size: 12px;
  padding: 4px 6px; border-radius: 4px; transition: all var(--transition);
  opacity: 0; line-height: 1;
}
.list-item:hover .btn-watch { opacity: 1; }
.btn-watch:hover { color: var(--success); border-color: rgba(63,185,80,0.3); background: rgba(63,185,80,0.08); }

/* ── Download Manager ──────────────────────────────────────── */
.download-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; max-width: 640px;
  animation: fadeSlideUp 0.3s ease;
}
.download-desc { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 16px; }
.download-desc code {
  font-family: var(--mono); background: var(--surface2);
  padding: 1px 5px; border-radius: 3px; font-size: 11px;
}
.download-desc em { color: var(--amber); font-style: normal; }
#dlInput {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text);
  font-size: 12px; font-family: var(--mono); outline: none; resize: vertical;
  line-height: 1.6;
}
#dlInput:focus { border-color: var(--amber); }
#dlInput::placeholder { color: var(--border2); }
#atLink {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text);
  font-size: 12px; font-family: var(--mono); outline: none; resize: vertical;
  line-height: 1.6;
}
#atLink:focus { border-color: var(--amber); }
#atLink::placeholder { color: var(--border2); }
.dl-providers { display: flex; gap: 14px; flex-wrap: wrap; }
.dl-provider {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text); cursor: pointer;
}
.dl-provider input { accent-color: var(--amber); width: 15px; height: 15px; cursor: pointer; }
.dl-result {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 12px; margin-bottom: 6px; border: 1px solid;
}
.dl-result.ok { background: rgba(63,185,80,0.08); border-color: rgba(63,185,80,0.25); color: var(--success); }
.dl-result.err { background: rgba(248,81,73,0.08); border-color: rgba(248,81,73,0.25); color: var(--error); }
.dl-result-icon { flex-shrink: 0; }
.dl-result-line {
  font-family: var(--mono); font-size: 11px; word-break: break-all;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%;
}
.dl-result-msg { margin-left: auto; flex-shrink: 0; font-size: 11px; }

/* ── Add Torrent Modal ──────────────────────────────────────── */
.at-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.75); display: flex;
  align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn 0.15s ease;
}
.at-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: scaleIn 0.15s ease;
}
.at-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.at-header h3 { font-size: 15px; font-weight: 700; color: var(--white); margin: 0; }
.at-close {
  background: none; border: none; color: var(--muted); font-size: 1.4rem;
  cursor: pointer; line-height: 1; padding: 0 4px;
}
.at-close:hover { color: var(--white); }
.at-body { padding: 18px; }

/* Dropzone */
.at-dropzone {
  border: 2px dashed var(--border2); border-radius: var(--radius-md);
  padding: 28px 16px; text-align: center; cursor: pointer;
  transition: all var(--transition); color: var(--muted);
}
.at-dropzone:hover, .at-dropzone.drag { border-color: var(--amber); background: rgba(245,158,11,0.06); color: var(--white); }
.at-dropzone.has-file { border-color: var(--success); background: rgba(63,185,80,0.06); }
.at-drop-icon { font-size: 1.6rem; margin-bottom: 6px; }
.at-drop-text { font-size: 13px; line-height: 1.5; }
.at-drop-text strong { color: var(--white); font-weight: 600; }
.at-drop-name {
  margin-top: 8px; font-family: var(--mono); font-size: 11px;
  color: var(--success); word-break: break-all;
}

/* Divider */
.at-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.at-divider::before, .at-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.at-providers { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0; }

/* Loader (progress bar, not spinner) */
.at-loader {
  margin-top: 16px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px;
}
.at-loader-bar {
  height: 6px; background: var(--border); border-radius: 3px;
  overflow: hidden; margin-bottom: 8px;
}
.at-loader-fill {
  height: 100%; background: linear-gradient(90deg, var(--amber), #fbbf24);
  border-radius: 3px; width: 0%; transition: width 0.25s ease;
}
.at-loader-status { font-size: 12px; color: var(--muted); font-family: var(--mono); }

.at-results {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 12px; border: 1px solid;
}
.at-results.ok { background: rgba(63,185,80,0.08); border-color: rgba(63,185,80,0.25); color: var(--success); }
.at-results.err { background: rgba(248,81,73,0.08); border-color: rgba(248,81,73,0.25); color: var(--error); }

/* ── Genres ─────────────────────────────────────────────────── */
.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.genre-chip {
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); font-size: 13px; font-weight: 600;
  color: var(--text); cursor: pointer; transition: all var(--transition); text-align: center;
}
.genre-chip:hover { border-color: var(--amber); color: var(--white); background: rgba(245,158,11,0.08); }
.genre-chip.active { border-color: var(--amber); color: var(--amber); background: rgba(245,158,11,0.12); }

.genre-type-toggle {
  display: inline-flex; gap: 0; border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 16px;
}
.genre-type-btn {
  padding: 6px 12px; background: transparent; border: none; color: var(--muted);
  font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--font);
  transition: all var(--transition);
}
.genre-type-btn.active { background: var(--amber); color: var(--bg); }
.genre-type-btn:hover:not(.active) { background: var(--surface); color: var(--text); }

/* ── Detail Page ────────────────────────────────────────────── */
#detailPage {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg); overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: fadeIn 0.2s ease;
}
.detail-hero {
  position: relative; width: 100%; height: 350px; overflow: hidden; z-index: 0;
}
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 0%, transparent 30%, var(--bg) 75%);
}
.detail-hero-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 20px 24px; display: flex; align-items: center; justify-content: space-between;
  z-index: 2;
}
@media (max-width: 768px) { .detail-hero-content { padding: 12px 16px; } }

/* Two-panel layout (desktop: poster left, torrents right) */
.detail-layout {
  position: relative; z-index: 1;
  display: flex; gap: 0; padding: 12px 0 0;
}
.detail-left {
  flex: 0 0 260px; padding: 0 16px 16px; position: relative;
}
.detail-sticky {
  position: sticky; top: 0; padding-top: 4px;
}
.detail-right {
  flex: 1; min-width: 0; border-left: 1px solid var(--border);
  padding: 0 16px 16px;
}

/* Back + action row (over backdrop) */
.detail-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(22,27,34,0.8); backdrop-filter: blur(8px);
  border: 1px solid var(--border); color: var(--text);
  padding: 6px 14px; border-radius: 6px;
  font-size: 13px; cursor: pointer; font-family: var(--font);
}
.detail-back-btn:hover { border-color: var(--border2); background: rgba(22,27,34,0.95); }
.detail-actions-row { display: flex; gap: 6px; }
.detail-action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(22,27,34,0.8); backdrop-filter: blur(8px);
  border: 1px solid var(--border); color: var(--text);
  padding: 6px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font); transition: all var(--transition);
}
.detail-action-btn:hover { border-color: var(--border2); background: rgba(22,27,34,0.95); }
.detail-action-btn#btnTrailer { border: none; background: rgba(22,27,34,0.8); }

/* Detail info */
.detail-info {
  display: flex; gap: 10px; margin-bottom: 6px;
}
.detail-poster { width: 90px; flex-shrink: 0; }
.detail-poster img { width: 100%; border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,0.5); }
.detail-text { flex: 1; min-width: 0; padding-top: 0; }
.detail-title { font-size: 1.1rem; font-weight: 700; color: var(--white); margin-bottom: 2px; }
.detail-meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.detail-meta .imdb-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3);
  padding: 2px 6px; border-radius: 3px; font-size: 11px; font-weight: 700;
}
.detail-meta .imdb-badge img { height: 14px; }
.detail-meta .tmdb-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(59,130,246,0.15); color: var(--blue);
  padding: 2px 6px; border-radius: 3px; font-size: 11px; font-weight: 700;
}
.detail-overview {
  font-size: 12px; color: var(--text); line-height: 1.5;
  margin-bottom: 8px;
}

/* Genre badges */
.detail-genre-bar {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px;
}
.genre-badge {
  padding: 1px 6px; background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2);
  border-radius: 3px; font-size: 9px; font-weight: 600; color: var(--amber);
  font-family: var(--font);
}

/* Season bar */
.detail-season-bar {
  display: flex; gap: 3px; flex-wrap: wrap; padding: 4px 0;
  border-top: 1px solid var(--border); margin-top: 4px;
}
.season-btn {
  padding: 3px 8px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 3px; font-size: 10px; font-weight: 600; color: var(--muted);
  cursor: pointer; font-family: var(--font); transition: all var(--transition);
}
.season-btn:hover { color: var(--text); border-color: var(--border2); }
.season-btn.active { background: var(--amber); color: var(--bg); border-color: var(--amber); }

/* Season batch add */
.detail-batch-bar {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.detail-batch-bar .batch-title {
  font-size: 11px; font-weight: 700; color: var(--muted);
  display: flex; align-items: center; gap: 5px;
}
.batch-providers {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.batch-provider {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text); cursor: pointer;
}
.batch-provider input { accent-color: var(--amber); cursor: pointer; }
.batch-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.batch-status { font-size: 10px; color: var(--muted); min-height: 12px; }

/* Recommendations */
.detail-rec { margin-top: 8px; }
.detail-rec-title {
  font-size: 11px; font-weight: 700; color: var(--muted);
  display: flex; align-items: center; gap: 5px; margin-bottom: 6px;
}
.detail-rec-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.detail-rec-grid .card {
  flex: none; cursor: pointer;
}
.detail-rec-grid .card img {
  width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px;
}
.detail-rec-grid .card .card-info { padding: 3px; }
.detail-rec-grid .card .card-title { font-size: 9px; line-height: 1.2; }
.detail-rec-grid .card .card-year { font-size: 8px; }

/* Torrent panel header */
.detail-torrent-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  margin-bottom: 8px; position: sticky; top: 0;
  background: var(--bg); z-index: 5;
}
.detail-torrent-title {
  font-size: 13px; font-weight: 700; color: var(--white);
  display: flex; align-items: center; gap: 6px;
}
.detail-filter-row input {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 10px;
  color: var(--text); font-size: 12px; outline: none;
  font-family: var(--font); width: 140px;
}
.detail-filter-row input:focus { border-color: var(--amber); }
.detail-filter-row input::placeholder { color: var(--border2); }

/* Manual search row */
.detail-search-row {
  display: flex; gap: 6px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.detail-search-row input {
  flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 10px;
  color: var(--text); font-size: 12px; outline: none; font-family: var(--font);
}
.detail-search-row input:focus { border-color: var(--amber); }
.detail-search-row input::placeholder { color: var(--border2); }
#btnCachedFirst.active { background: var(--amber); color: var(--bg); }

/* Language chips */
.detail-lang-bar {
  display: flex; gap: 6px; padding: 8px 0; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.lang-chip {
  padding: 3px 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; font-size: 10px; font-weight: 600; color: var(--muted);
  cursor: pointer; font-family: var(--font); transition: all var(--transition);
}
.lang-chip:hover { color: var(--text); border-color: var(--border2); }
.lang-chip.active { background: var(--amber); color: var(--bg); border-color: var(--amber); }

/* Loading */
.detail-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 2rem; gap: 8px;
}
.detail-loading p { color: var(--muted); font-size: 13px; margin: 0; }
.detail-loading .spinner {
  margin: 0 auto;
}

/* Auto-search hint */
.detail-auto-hint {
  display: none; text-align: center; padding: 1rem;
  color: var(--muted); font-size: 13px;
}

/* Empty state */
.detail-empty {
  text-align: center; padding: 2rem; color: var(--muted); font-size: 13px;
}

/* Torrent grid */
.torrent-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
@media (max-width: 600px) { .torrent-grid { grid-template-columns: 1fr; } }

.torrent-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px;
  transition: border-color var(--transition);
}
.torrent-card:hover { border-color: var(--border2); }
.torrent-card-title {
  font-size: 12px; font-weight: 600; color: var(--white);
  margin-bottom: 6px; word-break: break-word; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.torrent-card-meta {
  font-size: 10px; color: var(--muted); display: flex;
  gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px;
}
.torrent-card-badge { padding: 2px 6px; border-radius: 3px; font-size: 9px; font-weight: 700; }
.badge-single { background: rgba(59,130,246,0.15); color: #3b82f6; }
.badge-extras { background: rgba(168,85,247,0.15); color: #a855f7; }
.badge-full { background: rgba(63,185,80,0.15); color: var(--success); }
.badge-partial { background: rgba(245,158,11,0.15); color: var(--amber); }
.torrent-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-action {
  padding: 5px 10px; border-radius: 5px; font-size: 10px;
  font-weight: 700; border: none; cursor: pointer;
  font-family: var(--font); display: inline-flex;
  align-items: center; gap: 4px; transition: all var(--transition);
}
.btn-instant { background: var(--success); color: var(--bg); }
.btn-instant:hover { opacity: 0.85; }
.btn-download { background: var(--blue); color: var(--bg); }
.btn-download:hover { opacity: 0.85; }
.btn-copy { background: var(--border); color: var(--text); }
.btn-copy:hover { background: var(--border2); }
.btn-report { background: transparent; border: 1px solid var(--error); color: var(--error); }
.btn-report:hover { background: rgba(248,81,73,0.1); }

/* Trailer modal */
.trailer-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.85); display: flex;
  align-items: center; justify-content: center;
  padding: 24px; animation: fadeIn 0.2s ease;
}
.trailer-box {
  width: 100%; max-width: 900px; position: relative;
  border-radius: 12px; overflow: hidden; background: #000;
  box-shadow: 0 16px 64px rgba(0,0,0,0.7);
  animation: scaleIn 0.2s ease;
}
.trailer-box iframe { width: 100%; aspect-ratio: 16/9; border: none; display: block; }
.trailer-close {
  position: absolute; top: -40px; right: 0;
  background: none; border: none; color: var(--text);
  font-size: 1.5rem; cursor: pointer; padding: 4px 8px; line-height: 1;
}
.trailer-close:hover { color: var(--white); }

/* ── Mobile detail overrides ──────────────────────────────── */
@media (max-width: 768px) {
  .detail-hero { height: 250px; }
  .detail-hero-content { padding: 12px 16px; }
  .detail-layout { flex-direction: column; padding-top: 16px; }
  .detail-left { flex: none; padding: 0 12px; }
  .detail-right { border-left: none; border-top: 1px solid var(--border); padding: 0 12px 12px; }
  .detail-poster { width: 80px; }
  .detail-title { font-size: 1rem; }
  .detail-season-bar { padding: 4px 0; }
  .detail-torrent-header { flex-direction: column; gap: 6px; align-items: flex-start; }
  .detail-filter-row input { width: 100%; }
  .detail-search-row { flex-wrap: wrap; }
  .detail-search-row input { flex: 1 1 100%; }
}
/* Small desktop / tablet: stack vertically */
@media (min-width: 769px) and (max-width: 1024px) {
  .detail-hero { height: 280px; }
  .detail-layout { flex-direction: column; padding-top: 12px; }
  .detail-left { flex: none; padding: 0 16px; }
  .detail-right { border-left: none; border-top: 1px solid var(--border); padding: 0 16px 16px; }
  .detail-poster { width: 90px; }
  .detail-torrent-header { flex-direction: row; }
  .detail-search-row { flex-wrap: nowrap; }
  .detail-rec-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Back to top button ───────────────────────────────────── */
.back-to-top {
  position: fixed; bottom: 80px; right: 20px; z-index: 50;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--amber); color: var(--bg); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: all 0.2s ease;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-2px); }
.back-to-top .svg-icon { transform: rotate(90deg); }

/* ── Watchlist disclaimer ─────────────────────────────────── */
.watchlist-disclaimer {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; margin-bottom: 12px;
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--muted);
  line-height: 1.4;
}
.watchlist-disclaimer .svg-icon { flex-shrink: 0; color: var(--amber); }

/* ── Profile ────────────────────────────────────────────────── */
#content { padding-bottom: 80px; }
.profile-section { max-width: 600px; }
.profile-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px;
}
.profile-card h3 {
  font-size: 14px; font-weight: 700; color: var(--white);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.profile-row {
  display: flex; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.profile-row:last-child { border-bottom: none; }
.profile-label { color: var(--muted); }
.profile-value { color: var(--text); font-weight: 500; }
.profile-badge { font-size: 10px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.badge-valid { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-expired { background: rgba(239,68,68,0.15); color: var(--error); }
.badge-premium { background: rgba(245,158,11,0.15); color: var(--amber); }
.profile-note {
  font-size: 11px; color: var(--muted); margin-top: 16px;
  padding: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); line-height: 1.5;
}

/* ── Watchlist ──────────────────────────────────────────────── */
.watchlist-empty {
  text-align: center; padding: 3rem 1rem; color: var(--muted);
}
.watchlist-empty .icon { font-size: 2rem; margin-bottom: 8px; }
.watchlist-empty h3 { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.watchlist-empty p { font-size: 13px; }

/* ── Queue ──────────────────────────────────────────────────── */
.queue-section { margin-bottom: 16px; }
.queue-section-title {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.queue-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.queue-item-info { flex: 1; min-width: 0; }
.queue-item-title {
  font-size: 12px; font-weight: 500; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.queue-item-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.progress-bar {
  width: 100%; height: 4px; background: var(--border);
  border-radius: 2px; margin-top: 6px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: var(--amber); border-radius: 2px;
  transition: width 0.3s ease;
}

/* ── Settings ───────────────────────────────────────────────── */
.settings-section { max-width: 600px; }
.settings-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px;
}
.settings-card h3 {
  font-size: 14px; font-weight: 700; color: var(--white);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 13px; color: var(--text); }
.settings-row-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Toggle switch */
.toggle-switch {
  position: relative; width: 40px; height: 22px;
  background: var(--border); border-radius: 11px;
  cursor: pointer; transition: background var(--transition);
}
.toggle-switch.active { background: var(--amber); }
.toggle-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; background: var(--white);
  border-radius: 50%; transition: transform var(--transition);
}
.toggle-switch.active::after { transform: translateX(18px); }

/* Color picker */
.color-options { display: flex; gap: 8px; }
.color-option {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  transition: all var(--transition);
}
.color-option:hover { transform: scale(1.1); }
.color-option.active { border-color: var(--white); box-shadow: 0 0 0 2px var(--bg); }

/* Provider status (Settings) */
.status-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.status-item:last-child { border-bottom: none; }
.status-item img { width: 22px; height: 22px; border-radius: 5px; flex-shrink: 0; background: var(--surface2); }
.status-item-info { flex: 1; min-width: 0; }
.status-item-name { font-size: 13px; color: var(--text); font-weight: 600; }
.status-item-detail { font-size: 11px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-item-state {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap; flex-shrink: 0;
}
.status-item-state:hover { text-decoration: underline; }
.status-item-state.state-operational { color: #3fb950; }
.status-item-state.state-degraded { color: var(--amber); }
.status-item-state.state-down { color: var(--error); }
.status-item-state.state-unknown { color: var(--muted); }

/* ── Keyboard shortcuts modal ───────────────────────────────── */
.shortcuts-overlay {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(0,0,0,0.7); display: flex;
  align-items: center; justify-content: center;
  padding: 24px; animation: fadeIn 0.15s ease;
}
.shortcuts-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  max-width: 420px; width: 100%;
  animation: scaleIn 0.15s ease;
}
.shortcuts-box h3 {
  font-size: 16px; font-weight: 700; color: var(--white);
  margin-bottom: 16px;
}
.shortcut-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.shortcut-row:last-child { border-bottom: none; }
.shortcut-label { font-size: 13px; color: var(--text); }
.shortcut-keys { display: flex; gap: 4px; }
.kbd {
  padding: 2px 8px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; font-size: 11px; font-family: var(--mono);
  color: var(--muted); font-weight: 500;
}

/* ── Library item: preview / view-files buttons ──────────────── */
.btn-view {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; width: 30px; height: 30px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0;
}
.btn-view:hover { color: var(--amber); border-color: var(--amber); }

/* ── Item preview bar (bottom) ───────────────────────────────── */
.item-preview-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: none; align-items: center; gap: 12px;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 10px 16px; box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
}
.item-preview-bar.show { display: flex; }
.item-preview-bar .provider-logo { width: 26px; height: 26px; border-radius: 5px; flex-shrink: 0; }
.item-preview-info { flex: 1; min-width: 0; }
.item-preview-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-preview-meta { font-size: 11px; color: var(--muted); }
@media (max-width: 768px) {
  .item-preview-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
}

/* ── Item modal ──────────────────────────────────────────────── */
.item-modal { max-width: 620px; overflow: hidden; }
.item-modal-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px 0; font-size: 12px; color: var(--muted);
}
.airlock-chip {
  padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700;
  background: rgba(168,85,247,0.12); color: #c084fc;
}
.item-modal-actions {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.item-modal-files, .item-modal-edit { padding: 12px 16px; }
.item-modal-files {
  overflow-y: auto; min-height: 0; max-height: 40vh;
}
.item-modal-section-title {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px;
}
.item-file-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.item-file-row:last-child { border-bottom: none; }
.item-file-name {
  flex: 1; min-width: 0; font-size: 12.5px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-file-size { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.item-edit-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
  font-size: 12.5px;
}
.item-edit-row label { flex: 0 0 90px; color: var(--muted); font-size: 12px; }
.item-edit-row input[type="text"] {
  flex: 1; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 7px 10px; color: var(--text); font-size: 12.5px;
  font-family: var(--font);
}
.item-hashes {
  flex: 1; font-family: var(--mono); font-size: 11px; color: var(--muted);
  background: var(--surface2); padding: 6px 10px; border-radius: 6px;
  overflow-wrap: anywhere;
}

/* ── Duplicate panel responsive ─────────────────────────────── */
@media (max-width: 600px) {
  .dupe-panel-header {
    flex-direction: column; align-items: flex-start; gap: 10px;
  }
  .dupe-panel-actions { width: 100%; }
  .dupe-panel-actions .btn { flex: 1; }
  .dupe-stats { gap: 12px; }
  .dupe-group { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 14px; }
  .dupe-group-meta { gap: 8px; }
}

/* ── Item modal responsive ───────────────────────────────────── */
@media (max-width: 600px) {
  .item-modal { max-width: 100%; border-radius: var(--radius-md); }
  .item-modal-files { max-height: 50vh; }
  .item-modal-actions { gap: 6px; }
  .item-modal-actions .btn { flex: 1 1 auto; }
  .item-file-row { flex-wrap: wrap; gap: 4px 8px; }
  .item-file-name { flex-basis: 100%; }
}
