*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@font-face {
  font-family: 'Univers Next Pro';
  src: url('/fonts/UniversNextProRegular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Univers Next Pro';
  src: url('/fonts/UniversNextProBold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Univers Next Pro';
  src: url('/fonts/Univers Next Pro Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Univers Next Pro';
  src: url('/fonts/Univers Next Pro Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

:root {
  --bg-primary: #111113;
  --bg-surface: #1a1a1e;
  --bg-elevated: #222226;
  --bg-hover: #2a2a30;
  --border: #333338;
  --text-primary: #f0f0f2;
  --text-secondary: #8e8e93;
  --text-tertiary: #636366;
  --accent: #f5c644;
  --accent-hover: #f7d06a;
  --red: #ff453a;
  --green: #30d158;
  --radius: 10px;
  --radius-lg: 14px;
  --transition: 0.2s ease;
}

html,
body {
  font-family: 'Univers Next Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Login Screen ─── */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(245, 198, 68, 0.06) 0%, transparent 60%),
    var(--bg-primary);
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-card h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.login-card .subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}

.login-card .error {
  background: rgba(255, 69, 58, 0.12);
  color: var(--red);
  border: 1px solid rgba(255, 69, 58, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* ─── Form Elements ─── */

.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group input[type="file"] {
  padding: 10px;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #111;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-danger {
  background: rgba(255, 69, 58, 0.12);
  color: var(--red);
  border: 1px solid rgba(255, 69, 58, 0.2);
}

.btn-danger:hover {
  background: rgba(255, 69, 58, 0.2);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

/* ─── Dashboard Layout ─── */

.dashboard {
  display: none;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-left h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 3px;
}

.nav-tab {
  padding: 7px 16px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.nav-tab.active {
  background: var(--accent);
  color: #111;
}

.nav-tab:hover:not(.active) {
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-right .user {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ─── Tab Content ─── */

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.count-badge {
  color: var(--text-tertiary);
  font-weight: 400;
  font-size: 16px;
}

/* ─── Content Area ─── */

.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.content-header h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

/* ─── Search Bar ─── */

.search-bar {
  margin-bottom: 16px;
}

.search-bar input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.search-bar input:focus {
  border-color: var(--accent);
}

.search-bar input::placeholder {
  color: var(--text-tertiary);
}

/* ─── Table ─── */

.table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 14px 16px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--bg-hover);
}

tbody td {
  padding: 14px 16px;
  font-size: 14px;
  vertical-align: middle;
}

.td-image {
  width: 60px;
}

.td-image img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-elevated);
}

.td-image .no-image {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 18px;
}

.td-name {
  font-weight: 500;
}

.td-secondary {
  color: var(--text-secondary);
}

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

/* ─── Modal ─── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.image-preview {
  margin-top: 8px;
}

.image-preview img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 8px;
  object-fit: cover;
}

.modal-wide {
  max-width: 640px;
}

/* ─── Image credit (library card form) ─── */

.credit-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 0;
  margin-bottom: 16px;
}

.credit-group legend {
  padding: 0 6px;
  margin-left: -6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.form-hint,
.form-note {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}

.form-note {
  color: var(--accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.credit-preview,
.td-credit {
  font-size: 12px;
  color: var(--text-secondary);
}

.credit-preview {
  margin-top: 6px;
}

.credit-preview a,
.td-credit a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--text-tertiary);
}

.td-credit {
  font-weight: 400;
  margin-top: 2px;
}

/* ─── Content Block Editor ─── */

.content-block {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.content-block .block-type {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  padding: 8px 0;
  min-width: 70px;
  flex-shrink: 0;
}

.content-block input,
.content-block textarea {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.content-block input:focus,
.content-block textarea:focus {
  border-color: var(--accent);
}

.content-block textarea {
  resize: vertical;
  min-height: 60px;
}

.content-block .remove-block {
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  border-radius: 4px;
  transition: color var(--transition);
}

.content-block .remove-block:hover {
  color: var(--red);
}

/* ─── Empty State ─── */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state .icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 14px;
}

/* ─── Toast ─── */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.toast.success {
  border-color: rgba(48, 209, 88, 0.3);
}

.toast.error {
  border-color: rgba(255, 69, 58, 0.3);
}

@keyframes slideIn {
  from {
    transform: translateX(30px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ─── Category Pills ─── */

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  transition: all var(--transition);
  user-select: none;
}

.cat-pill input[type="checkbox"] {
  display: none;
}

.cat-pill:has(input:checked) {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
  font-weight: 500;
}

.cat-pill:hover {
  border-color: var(--text-tertiary);
}

.td-categories {
  max-width: 180px;
}

.cat-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  margin: 1px 2px;
}

/* ─── Responsive ─── */

@media (max-width: 768px) {
  .content {
    padding: 16px;
  }

  .topbar {
    padding: 12px 16px;
  }

  .modal {
    margin: 16px;
    max-width: calc(100% - 32px);
  }
}
/* ─── Suggestions: the review queue (042) ─── */

.nav-count {
  margin-left: 6px;
  background: var(--accent);
  color: #111;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
}

.seg {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.seg-btn {
  background: none;
  border: 0;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.review-intro {
  color: var(--text-secondary);
  font-size: 13px;
  max-width: 760px;
  margin: -12px 0 20px;
}

.review {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.review-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}

.review-item:hover {
  background: var(--bg-hover);
}

.review-item.active {
  background: var(--bg-elevated);
  border-color: var(--border);
}

.review-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.review-item-sub {
  color: var(--text-secondary);
  font-size: 12.5px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.tag {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 7px;
  border-radius: 6px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.tag-listing  { color: var(--text-primary); }
.tag-new      { color: var(--accent); border-color: rgba(245, 198, 68, 0.4); background: rgba(245, 198, 68, 0.08); }
.tag-dup      { color: #7fb2ff; border-color: rgba(127, 178, 255, 0.35); background: rgba(127, 178, 255, 0.08); }
.tag-reply,
.tag-approved { color: var(--green); border-color: rgba(48, 209, 88, 0.35); background: rgba(48, 209, 88, 0.08); }
.tag-declined { color: var(--red); border-color: rgba(255, 69, 58, 0.35); background: rgba(255, 69, 58, 0.08); }

.age {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.age.due  { color: var(--accent); }
.age.late { color: var(--red); }

.review-detail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: 22px 24px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.review-detail .empty-state {
  padding: 48px 16px;
}

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

.review-head h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.review-head p,
.muted {
  color: var(--text-secondary);
  font-size: 13px;
}

.muted {
  display: block;
  margin-top: 4px;
}

.review-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.review-photos a {
  position: relative;
  display: block;
}

.review-photos img {
  display: block;
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.cover-mark {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 5px;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
}

.photo-missing {
  display: grid;
  place-items: center;
  width: 110px;
  height: 110px;
  font-size: 12px;
  color: var(--text-tertiary);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.compare th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 0 12px 8px 0;
}

.compare td {
  vertical-align: top;
  padding: 10px 12px 10px 0;
  border-top: 1px solid var(--border);
}

.compare td:first-child {
  width: 90px;
  color: var(--text-secondary);
}

.compare td:nth-child(2) {
  width: 34%;
  font-weight: 500;
}

.compare tr.pair-new td {
  background: rgba(245, 198, 68, 0.05);
}

.known  { color: var(--green); font-weight: 600; }
.newish { color: var(--accent); font-weight: 700; }

.review-boxes {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 14px;
}

.review-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  font-size: 13px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.review-box h4,
.review-section h4 {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.review-box q {
  font-style: italic;
}

.review-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.dup-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.dup-row span {
  color: var(--text-secondary);
}

.dup-row em,
.match-row em {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  color: #7fb2ff;
}

.thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble {
  align-self: flex-start;
  max-width: 75%;
  padding: 10px 13px;
  font-size: 13px;
  background: var(--bg-elevated);
  border-radius: 14px;
}

.bubble.editors {
  align-self: flex-end;
  background: rgba(245, 198, 68, 0.12);
}

.bubble img {
  display: block;
  max-width: 180px;
  border-radius: 10px;
  margin-top: 4px;
}

.bubble time {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-fit {
  width: auto;
}

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

.action-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 16px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

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

.panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.outcome {
  font-size: 13px;
  color: var(--green);
}

.outcome.declined {
  color: var(--red);
}

.review-empty {
  padding: 12px 4px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.match-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 50vh;
  overflow-y: auto;
  margin-top: 8px;
}

.match-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.match-row span {
  display: block;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.match-label {
  margin: 8px 0 2px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

@media (max-width: 900px) {
  .review { grid-template-columns: minmax(0, 1fr); }
  .review-list { position: static; max-height: none; }
  .review-boxes { grid-template-columns: minmax(0, 1fr); }
}

/* Live queue (049): something arrived for the open suggestion while the
   editor was writing in it. */
.live-note {
  display: block;
  width: 100%;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid rgba(245, 198, 68, 0.4);
  border-radius: var(--radius-lg);
  background: rgba(245, 198, 68, 0.08);
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

/* Search (053): the feed the editors compose. */
#searchTabs {
  margin-bottom: 20px;
}

.search-tab-row,
.search-tab-tools,
.search-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.search-tab-tools {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.search-tab {
  font: inherit;
  font-size: 14px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
}

.search-tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.search-inline input,
.search-inline select,
.search-add-section input,
.search-add-section select {
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
}

.search-lookup input {
  flex: 1;
  min-width: 220px;
}

.search-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.search-order {
  display: inline-flex;
  gap: 4px;
}

.search-order .btn-sm {
  padding: 2px 8px;
}

.search-add-section {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.search-add-section input,
.search-add-section select {
  flex: 1;
  min-width: 0;
}

.search-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.search-entries {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.search-entry-hidden {
  opacity: 0.6;
}

.search-entry-text {
  flex: 1;
  min-width: 0;
}

.search-entry-text span,
.search-candidate span {
  display: block;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.search-entry-text em,
.search-candidate em {
  display: block;
  font-size: 12px;
  font-style: normal;
  color: var(--red);
}

.search-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.search-candidate {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.search-entry .td-image,
.search-candidate .td-image {
  flex: none;
}

.search-entry-text .tag {
  display: inline-block;
  vertical-align: 1px;
  margin-left: 4px;
}

/* ─── A style's options (036, 058) ─── */

.modal-options {
  max-width: 780px;
}

#optionsEditor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.option-group-name,
.option-name {
  flex: 1;
  min-width: 180px;
}

.option-group-name {
  font-weight: 600;
}

.option-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

/* The dot the listing form shows beside the option; a colour picker under it. */
.option-swatch {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--swatch, #fff);
  border: 1px solid var(--text-tertiary);
  cursor: pointer;
}

.option-swatch-none {
  background: transparent;
  border-style: dashed;
}

.option-swatch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

/* Linked profiles (059): how the editors checked, kept as written. */
.link-note {
  white-space: pre-wrap;
}

/* Signing in with an emailed code (074) */
.login-hint { font-size: 13px; color: #6b7280; margin: 0 0 12px; line-height: 1.5; }
.btn-link { background: none; border: none; color: #6b7280; text-decoration: underline; cursor: pointer; padding: 8px 0; margin-top: 4px; font-size: 13px; }
.shared-login { margin-top: 20px; font-size: 13px; color: #6b7280; }
.shared-login summary { cursor: pointer; }
.shared-login form { margin-top: 12px; }

/* ─── Reports (076) ─── */
.refused-box { margin-top: 24px; }
.refused-box .panel-actions { display: flex; justify-content: flex-start; align-items: center; gap: 8px; margin-top: 12px; margin-bottom: 0; }
.refused-box input { max-width: 220px; }
.tag-x { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 0 0 4px; font-size: 13px; }
.report-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.section-label { margin: 18px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-weight: normal; }

/* ─── Editorial stories (087) ─── */

.tab-hint {
  margin: -8px 0 16px;
}

.td-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.story-photo {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex: 1;
}

.story-photo-preview {
  width: 72px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.story-photo-preview img,
.story-photo-preview .no-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-photo-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.story-photo-fields .btn-fit {
  align-self: flex-start;
}

.story-photo-fields input {
  width: 100%;
}

.story-block-tools {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.story-add-row {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.form-warn {
  color: var(--red);
  margin-bottom: 0;
}
