:root {
  --fg: #1a1a1a;
  --bg: #fafaf7;
  --muted: #666;
  --accent: #8b1d1d;
  --accent-bg: #fff3f0;
  --border: #ddd;
  --table-stripe: #f3f1ec;
  --mark: #fff2a8;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--fg); }
.site-header nav { display: flex; gap: 1rem; }
.site-header nav a { color: var(--fg); font-size: 0.95rem; }
.search { margin-left: auto; display: flex; gap: 0.25rem; align-items: center; }
.search-field-select { font-size: 0.82rem; padding: 0.28rem 0.4rem; border: 1px solid rgba(255,255,255,0.35); border-radius: 3px; background: rgba(255,255,255,0.15); color: inherit; cursor: pointer; }
.search input[type=search] {
  padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 4px;
  min-width: 220px; font-size: 0.95rem; background: #fff;
}
.search button {
  padding: 0.4rem 0.9rem; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; border-radius: 4px; cursor: pointer; font-size: 0.95rem;
}
.search button:hover { filter: brightness(1.1); }
.search.big input[type=search] { min-width: 320px; padding: 0.6rem 0.8rem; font-size: 1.05rem; }
.search.big button { padding: 0.6rem 1.2rem; font-size: 1.05rem; }

/* hero */
.hero { padding: 2rem 0 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.hero h1 { margin: 0 0 0.4rem; font-size: 2rem; }
.lede { font-size: 1.1rem; color: var(--muted); margin: 0 0 1rem; }
.cta { margin-top: 0.75rem; }

/* lists */
.film-list { list-style: none; padding: 0; }
.film-list li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.film-list .meta { color: var(--muted); font-size: 0.9rem; margin-left: 0.5rem; }

/* database table */
.controls { margin: 1rem 0; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.controls label { font-size: 0.9rem; color: var(--muted); }
.controls select { padding: 0.3rem 0.5rem; border: 1px solid var(--border); border-radius: 4px; background: #fff; }

.film-table { width: 100%; border-collapse: collapse; margin: 1rem 0; background: #fff; font-size: 0.95rem; }
.film-table th, .film-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.film-table th { background: var(--table-stripe); font-weight: 600; }
.film-table tbody tr:nth-child(even) { background: var(--table-stripe); }
.film-table td:first-child { max-width: 480px; }
.film-table th.sortable { white-space: nowrap; }
.film-table th.sortable a { color: inherit; text-decoration: none; }
.film-table th.sortable a:hover { text-decoration: underline; }
.film-table th.sort-active a { color: var(--link); }

/* pager */
.pager { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin: 1.25rem 0; font-size: 0.95rem; }
.pager a, .pager .current {
  padding: 0.3rem 0.6rem; border: 1px solid var(--border); border-radius: 4px;
  background: #fff; color: var(--fg);
}
.pager a:hover { background: var(--accent-bg); border-color: var(--accent); text-decoration: none; }
.pager .current { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-info { margin-left: 0.5rem; color: var(--muted); }

/* film detail */
.film-detail h1 { margin: 1rem 0 0.75rem; }
.film-video {
  margin: 0 0 1.25rem;
}
.film-video iframe,
.film-video video {
  display: block;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 16 / 9;
  height: auto;
  background: #000;
}
.film-video--4x3 iframe {
  aspect-ratio: 4 / 3;
}
/* metadata block — plain lines, no box */
.film-meta {
  margin: 0 0 0;
  font-size: 1rem;
  line-height: 1.5;
}
.film-meta p {
  margin: 0;
  padding: 0;
}
/* slightly more breathing room before Description / Complete Record */
.film-meta p + p { margin-top: 0; }
.film-detail hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}
.empty {
  color: var(--muted);
  font-style: italic;
}
.tag-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag-list li a {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
}
.tag-list li a:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  text-decoration: none;
}
.permalink { color: var(--muted); margin-top: 2rem; }

/* search results */
.search-results { list-style: none; padding: 0; }
.search-results li { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.search-results .title { font-size: 1.05rem; font-weight: 600; }
.search-results .meta { color: var(--muted); font-size: 0.9rem; margin-left: 0.5rem; }
.search-results .snippet { margin: 0.35rem 0 0; color: #333; }
.search-results mark { background: var(--mark); padding: 0 2px; border-radius: 2px; }
.error { color: var(--accent); }

/* taxonomy index pages (series, collections) */
.taxonomy-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  column-width: 22rem;
  column-gap: 2rem;
}
.taxonomy-list li {
  break-inside: avoid;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.taxonomy-list .count {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.wantlist-badge {
  font-size: 0.75rem;
  color: var(--link);
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 0 0.35rem;
  white-space: nowrap;
  text-decoration: none;
  align-self: center;
}
.wantlist-badge:hover { background: var(--link); color: #fff; }

/* related films list on the film detail page */
.related-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}
.related-list li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}
.related-list li:last-child {
  border-bottom: none;
}
.related-list .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-left: 0.5rem;
}

/* user nav (top-right) */
.user-nav { display: flex; gap: 0.5rem; align-items: center; font-size: 0.9rem; }
.user-nav .who { color: var(--muted); }
.user-nav .linkish {
  border: 0; background: none; padding: 0; color: var(--accent);
  font: inherit; cursor: pointer;
}
.user-nav .linkish:hover { text-decoration: underline; }

/* auth cards (login, register) */
.auth-card {
  max-width: 420px;
  margin: 2rem auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem 1.75rem;
}
.auth-card h1 { margin-top: 0; }
.auth-card form { display: flex; flex-direction: column; gap: 0.85rem; }
.auth-card label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; color: var(--muted); }
.auth-card input {
  font-size: 1rem; padding: 0.5rem 0.6rem;
  border: 1px solid var(--border); border-radius: 4px; background: #fff;
}
.auth-card button[type="submit"] {
  padding: 0.55rem 1rem; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; border-radius: 4px;
  font-size: 1rem; cursor: pointer; margin-top: 0.25rem;
}
.auth-card button[type="submit"]:hover { filter: brightness(1.1); }
.auth-card p { margin: 0.75rem 0 0; font-size: 0.9rem; }

/* edit film form */
.edit-link { margin: 0.25rem 0 0.5rem; font-size: 0.9rem; }
.edit-link a {
  display: inline-block; padding: 0.25rem 0.6rem;
  border: 1px solid var(--border); border-radius: 4px;
  background: #fff; color: var(--fg); text-decoration: none;
}
.edit-link a:hover { border-color: var(--accent); color: var(--accent); }

.edit-form { display: flex; flex-direction: column; gap: 1rem; max-width: 800px; }
.edit-form label { display: flex; flex-direction: column; gap: 0.25rem; }
.edit-form label > span { font-size: 0.9rem; color: var(--muted); }
.edit-form input[type="text"],
.edit-form input[type="url"],
.edit-form textarea,
.edit-form select {
  font-size: 0.95rem; padding: 0.45rem 0.55rem;
  border: 1px solid var(--border); border-radius: 4px; background: #fff;
  font-family: inherit;
}
.edit-form textarea { resize: vertical; min-height: 4rem; line-height: 1.45; }
.edit-form select[multiple] { font-size: 0.9rem; }
.form-actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.5rem; }
.form-actions button.primary,
.delete-form button.primary {
  padding: 0.55rem 1.1rem; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; border-radius: 4px;
  font-size: 1rem; cursor: pointer;
}
.form-actions button.primary:hover { filter: brightness(1.1); }
.button-link {
  padding: 0.55rem 1rem; border: 1px solid var(--border);
  border-radius: 4px; background: #fff; color: var(--fg);
}
.button-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.delete-form { margin-top: 1.25rem; }
.delete-form button.danger {
  padding: 0.5rem 1rem; border: 1px solid #b30000;
  background: #b30000; color: #fff; border-radius: 4px;
  font-size: 0.95rem; cursor: pointer;
}
.delete-form button.danger:hover { background: #8c0000; }

.muted { color: var(--muted); }
code { background: #efece5; padding: 0 0.25rem; border-radius: 3px; font-size: 0.9em; }

/* within-collection / within-series search bar */
.within-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.within-search input[type="search"] {
  flex: 1 1 280px;
  min-width: 220px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  font-size: 0.95rem;
}
.within-search button {
  padding: 0.45rem 1rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
}
.within-search button:hover { filter: brightness(1.1); }
.within-search .clear-q {
  font-size: 0.85rem;
  color: var(--muted);
}

/* admin actions (Edit / Delete) on list rows + search results */
.admin-actions {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  white-space: nowrap;
}
.admin-actions-inline {
  margin-left: 0.6rem;
  vertical-align: middle;
  font-size: 0.85rem;
}
.admin-actions .action-form {
  display: inline;
  margin: 0;
  padding: 0;
}
.admin-actions .action {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1rem 0.45rem;
  background: #fff;
  color: var(--fg);
  font-size: 0.82rem;
  line-height: 1.3;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.admin-actions .action:hover {
  text-decoration: none;
}
.admin-actions .action.edit {
  color: var(--accent);
}
.admin-actions .action.edit:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
}
.admin-actions .action.delete {
  color: #8a1010;
}
.admin-actions .action.delete:hover {
  background: #fce6e6;
  border-color: #b30000;
}
.admin-actions .action.dupes { color: #005a8a; }
.admin-actions .action.dupes:hover { background: #e6f2fb; border-color: #005a8a; }
.col-actions {
  width: 1%;            /* shrink to fit, doesn't steal column space */
  white-space: nowrap;
}

/* batch select toolbar */
.batch-form { margin: 0; }
.batch-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.5rem 0 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
}
.batch-toolbar-bottom { margin: 0.75rem 0 0.5rem; }
.batch-toolbar .select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
}
.batch-toolbar .batch-count {
  color: var(--muted);
  margin-right: auto;        /* push the action buttons to the right */
}
.batch-toolbar .batch-btn {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--fg);
}
.batch-toolbar .batch-btn:hover { border-color: var(--accent); }
.batch-toolbar .batch-delete:hover { background: #fce6e6; border-color: #b30000; color: #8a1010; }
.batch-toolbar .batch-merge:hover { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.batch-toolbar .batch-holdings:hover { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

/* bulk holdings form */
.bulk-form { max-width: 1000px; margin-top: 1rem; }
.bulk-form .op-fieldset {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}
.bulk-form .op-fieldset legend {
  padding: 0 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.bulk-form .op-fieldset label {
  display: block;
  padding: 0.25rem 0;
  font-size: 0.92rem;
  line-height: 1.4;
}
.bulk-form .op-fieldset input[type="radio"] { margin-right: 0.5rem; }
.bulk-form .holdings-picker { display: flex; flex-direction: column; gap: 0.4rem; margin: 0 0 1rem; }
.bulk-form .holdings-picker > span { font-size: 0.9rem; color: var(--muted); }
.bulk-form .holdings-picker select {
  font-size: 0.95rem;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}
.bulk-films-table .col-select { width: 1%; text-align: center; }
.bulk-films-table tr.is-unchecked { opacity: 0.4; }

.bulk-form .new-term { display: flex; flex-direction: column; gap: 0.3rem; margin: 0 0 1rem; }
.bulk-form .new-term > span { font-size: 0.9rem; color: var(--muted); }
.bulk-form .new-term input[type="text"] {
  font-size: 0.95rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}
.bulk-form .new-term small { color: var(--muted); }

.row-select-label { display: inline-block; margin-right: 0.4rem; vertical-align: middle; }
.col-select { width: 1%; text-align: center; }
input.row-select { transform: scale(1.05); cursor: pointer; }

/* merge view */
.merge-form { margin-top: 1rem; }
.merge-scroll { overflow-x: auto; }
.merge-table {
  border-collapse: collapse;
  margin: 1rem 0;
  background: #fff;
  font-size: 0.9rem;
  min-width: 100%;
}
.merge-table th, .merge-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.6rem;
  vertical-align: top;
}
.merge-table thead th { background: var(--table-stripe); }
.merge-table .field-col {
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  background: var(--table-stripe);
  min-width: 9rem;
}
.merge-table .film-col {
  min-width: 16rem;
  max-width: 26rem;
}
.merge-table .film-col.is-empty { background: #fcfaf3; }
.merge-table .film-meta-line {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: normal;
  margin-top: 0.15rem;
}
.merge-table .primary-pick {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}
.merge-table .value-pick {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  cursor: pointer;
}
.merge-table .value-pick input { margin-top: 0.25rem; }
.merge-table .value-pick .value {
  word-break: break-word;
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.4;
}
.merge-table .empty { color: var(--muted); font-style: italic; }
.merge-table .custom-col {
  min-width: 14rem;
  max-width: 20rem;
  background: #fffef5;
}
.merge-table thead .custom-col {
  background: #fdf8d8;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.merge-custom-input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.3rem 0.45rem;
  font-size: 0.85rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
  resize: vertical;
  line-height: 1.4;
}
.merge-custom-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}

.union-list { margin: 0.75rem 0 1.5rem; }
.union-list dt { font-weight: 600; margin-top: 0.4rem; color: var(--muted); }
.union-list dd { margin: 0.2rem 0 0 0; }
.union-pill {
  display: inline-block;
  margin: 0.15rem 0.25rem 0.15rem 0;
  padding: 0.1rem 0.55rem;
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--accent);
}

/* import review queue */
.import-summary-table .num { text-align: right; }
.import-pending-count { font-weight: 700; color: var(--accent); }
.import-source-active { background: var(--accent-bg) !important; }
.import-filter-banner {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.75rem;
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 0.92rem;
}
.source-code { font-size: 0.85em; }
.review-link {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--fg);
  font-size: 0.87rem;
  white-space: nowrap;
}
.review-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* bucket badges */
.bucket-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.bucket-auto    { background: #d4edda; color: #155724; border: 1px solid #a8d5b5; }
.bucket-review  { background: #fff3cd; color: #856404; border: 1px solid #ffd97a; }
.bucket-low     { background: #e9ecef; color: #495057; border: 1px solid #ced4da; }

/* import review page */
.back-link { margin: 0.75rem 0 0.25rem; font-size: 0.9rem; }
.import-review-title { margin: 0.4rem 0 0.25rem; }
.import-review-meta { font-size: 0.9rem; margin-bottom: 1.25rem; }

.import-review-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 1.5rem;
  align-items: start;
  margin-top: 1rem;
}
@media (max-width: 860px) {
  .import-review-layout { grid-template-columns: 1fr; }
}

.import-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.4rem;
}
.import-panel h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* definition list used in both panels */
.import-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.3rem 0.75rem;
  font-size: 0.92rem;
}
.import-dl dt {
  color: var(--muted);
  font-weight: 500;
  padding-top: 0.05rem;
}
.import-dl dd {
  margin: 0;
  word-break: break-word;
}
.import-description {
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #444;
}

.transcription-block {
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
}
.transcription-block summary {
  cursor: pointer;
  user-select: none;
  padding: 0.2rem 0;
}
.transcription-text {
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0.5rem 0 0.25rem;
  color: #444;
}

.edit-field {
  width: 100%;
  box-sizing: border-box;
  font-size: 0.9rem;
  font-family: inherit;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text);
}
.edit-field:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
textarea.edit-field {
  resize: vertical;
  line-height: 1.4;
  white-space: pre-wrap;
}

/* decision radio group */
.import-decision-group {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #fafaf7;
}
.import-decision-group legend { display: none; }
.import-decision-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}
.import-decision-opt input[type=radio] {
  margin-top: 0.3rem;
  flex-shrink: 0;
}
.opt-text { display: flex; flex-direction: column; gap: 0.1rem; }
.opt-text strong { font-size: 0.95rem; }
.opt-text small { color: var(--muted); font-size: 0.83rem; }

/* candidate cards */
.import-candidates { display: flex; flex-direction: column; gap: 1rem; }
.import-candidate {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  background: #fff;
}
.cand-auto    { border-left: 4px solid #28a745; }
.cand-review  { border-left: 4px solid #ffc107; }
.cand-low     { border-left: 4px solid #ced4da; }

.cand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.cand-select-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.cand-pick-text { color: var(--accent); font-weight: 500; }
.cand-info { margin-bottom: 0.5rem; }
.cand-title { font-size: 1rem; font-weight: 600; }

.import-cand-dl { margin: 0.5rem 0; }
.import-cand-dl dt { color: var(--muted); }

/* match signal chips */
.import-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.6rem;
}
.signal-chip {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}
.sig-pos { background: #d4edda; color: #155724; border: 1px solid #a8d5b5; }
.sig-neg { background: #f8d7da; color: #721c24; border: 1px solid #f0a8af; }

/* nav badge */
.nav-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.05rem 0.4rem;
  vertical-align: middle;
  margin-left: 0.2rem;
  line-height: 1.4;
}

/* sr-only for accessibility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 1.5rem 0; color: var(--muted); font-size: 0.9rem; }

/* ── Duplicates page ──────────────────────────────────────────────── */
.dup-group { border: 1px solid var(--border); border-radius: 4px; margin-bottom: 1rem; overflow: hidden; }
.dup-exact { border-color: #e5a; }
.dup-fuzzy { border-color: var(--border); }
.dup-group-header { display: flex; align-items: center; gap: .8rem; padding: .45rem .7rem; background: #f8f8f5; border-bottom: 1px solid var(--border); }
.dup-key { flex: 1; font-size: .85rem; }
.dup-table { margin: 0; border: none; }
.dup-table td, .dup-table th { border-top: none; }
.dup-merge-link { white-space: nowrap; text-decoration: none; }

/* ── Import queue header + bulk toolbar ───────────────────────────── */
.import-queue-header { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.import-bulk-toolbar { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; background: #f4f4f0; border: 1px solid var(--border); border-radius: 4px; margin-bottom: .4rem; }
.import-bulk-count { font-size: .85rem; color: var(--muted); min-width: 6rem; }

/* ── YouTube admin page ───────────────────────────────────────────── */
.yt-table td, .yt-table th { vertical-align: middle; }
.btn-small { font-size: 0.82rem; padding: 0.2rem 0.6rem; border-radius: 3px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; }
.btn-small.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-small.danger  { background: #c0392b; color: #fff; border-color: #c0392b; }
.flash-ok  { background: #edfbee; border: 1px solid #6abf7b; padding: .5rem .8rem; border-radius: 4px; color: #1a6329; margin:.75rem 0; }
.flash-err { background: #fdecea; border: 1px solid #e57373; padding: .5rem .8rem; border-radius: 4px; color: #7f1d1d; margin:.75rem 0; }

/* Title search & replace panel */
.replace-panel { border: 1px solid var(--border); border-radius: 5px; padding: .5rem .75rem; margin: .75rem 0; background: var(--table-stripe); }
.replace-panel summary { cursor: pointer; font-weight: 600; user-select: none; }
.replace-form { margin-top: .6rem; }
.replace-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.replace-row label { display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; }
.replace-input { padding: .35rem .5rem; border: 1px solid var(--border); border-radius: 4px; font-size: .95rem; width: 16rem; }
.replace-scope-label select { padding: .35rem .5rem; border: 1px solid var(--border); border-radius: 4px; font-size: .95rem; }
.form-row-inline label { display: flex; align-items: center; gap: .4rem; font-weight: normal; }
.yt-add-form .form-row input[type=text] { max-width: 480px; }
.yt-lookback-select { font-size: 0.82rem; padding: 0.18rem 0.4rem; border: 1px solid var(--border); border-radius: 3px; background: var(--bg); }
.btn-deperiscopify { font-size: 0.78rem; padding: 0.15rem 0.5rem; border-radius: 3px; border: 1px solid var(--border); background: #fffbea; color: #7a5800; cursor: pointer; margin-left: .5rem; vertical-align: middle; }
.btn-deperiscopify:hover { background: #fff3c4; }

/* ── Collection info section ──────────────────────────────────────── */
.collection-info { margin-top: 2.5rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.collection-info h2 { font-size: 1.05rem; margin: 0 0 0.6rem; }
.collection-meta p { margin: 0; padding: 0; line-height: 1.7; }
.collection-info .edit-link { margin: 0 0 0.8rem; }

/* ── Film have / want user actions ───────────────────────────────── */
.film-user-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .75rem 0 1.25rem; }
.film-user-actions form { margin: 0; }
.btn-have, .btn-want {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .85rem; border-radius: 4px; border: 1px solid;
  font-size: .9rem; cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s;
}
.btn-have { background: var(--bg); border-color: #5a9e6f; color: #2d6a42; }
.btn-have:hover { background: #edfbee; }
.btn-have.active { background: #2d6a42; border-color: #2d6a42; color: #fff; }
.btn-have.active:hover { background: #245836; }
.btn-want { background: var(--bg); border-color: #b05a8a; color: #7a2f5f; }
.btn-want:hover { background: #fdedf6; }
.btn-want.active { background: #7a2f5f; border-color: #7a2f5f; color: #fff; }
.btn-want.active:hover { background: #641d4e; }
.film-actions-guest { margin: .75rem 0; color: var(--muted); }

/* ── My Films / Want List nav links ──────────────────────────────── */
.user-nav a { font-size: .88rem; }

@media (max-width: 720px) {
  .site-header .wrap { gap: 0.5rem; }
  .search { width: 100%; }
  .search input[type=search] { flex: 1; min-width: 0; }
  .film-table { font-size: 0.85rem; }
  .film-table th:nth-child(n+5), .film-table td:nth-child(n+5) { display: none; }
}
