:root {
  --bg: #111114;
  --panel: #1a1a20;
  --ink: #f2f0ea;
  --muted: #9a9690;
  --border: #2c2c34;
  --accent: #c45c26;
  --accent-soft: rgba(196, 92, 38, 0.18);
  --tag: #25252e;
  --tag-primary: #c45c26;
  --highlight: #3d3420;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, #2a1a12 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #1a2030 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  line-height: 1.45;
  min-height: 100vh;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(17, 17, 20, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem 0.75rem;
}

.header-inner,
.toolbar-inner,
main,
footer,
.pagination {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  align-items: center;
  justify-content: space-between;
}

.header-sub {
  max-width: 760px;
  margin: 0.15rem auto 0;
}

h1 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 0 1 auto;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.brand-logo {
  display: block;
  height: 2.15rem;
  width: auto;
  max-width: min(240px, 58vw);
  object-fit: contain;
  object-position: left center;
  /* PNG has generous black padding — pull optical wordmark toward nav midline */
  margin-block: -0.45rem;
}

.meta-top {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0;
  line-height: 1.3;
}

.meta-top a { color: var(--accent); }

.app-nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.app-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
}

.app-nav a:hover { color: var(--ink); }

.app-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--accent-soft);
}

body.public-view #search {
  max-width: none;
}

#search {
  flex: 1 1 240px;
  max-width: 360px;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  border: 2px solid var(--accent);
  background: var(--panel);
  color: var(--ink);
  font-size: 0.95rem;
}

#search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.filters-wrap {
  width: calc(100% + 2.5rem);
  max-width: none;
  margin: 0.85rem -1.25rem 0;
  padding: 0 1.25rem;
}

.filters-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.chip-all-group {
  display: inline-flex;
  align-items: stretch;
  border: 1px dashed var(--border);
  border-radius: 999px;
  background: var(--panel);
  overflow: hidden;
}

.chip-all-group.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  border-style: solid;
}

.chip-all-main {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0.28rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
  line-height: 1.2;
}

.chip-all-group.is-active .chip-all-main {
  color: #ffd9c4;
}

.chip-all-collapse {
  appearance: none;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--muted);
  padding: 0 0.5rem;
  margin: 0;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
}

.chip-all-collapse:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.chip-reset-filters {
  appearance: none;
  border: 1px solid rgba(200, 70, 70, 0.55);
  border-radius: 999px;
  background: rgba(90, 24, 24, 0.55);
  color: #f0a8a8;
  padding: 0.28rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.2;
  cursor: pointer;
}

.chip-reset-filters:hover {
  color: #fff;
  border-color: #c84a4a;
  background: #a83333;
}

.chip-reset-filters.is-active {
  color: #fff;
  border-color: #d94a4a;
  border-style: solid;
  background: #b83737;
}

.active-filters-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  max-width: 760px;
  margin: 0.45rem auto 0;
  min-height: 0;
}

.active-filters-bar[hidden] {
  display: none;
}

.active-filters-pills {
  display: contents;
}

.active-filters-bar .chip-active-pill {
  appearance: none;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  padding: 0.22rem 0.6rem;
  font-size: 0.75rem;
  line-height: 1.2;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.active-filters-bar .chip-active-pill:hover {
  background: var(--accent);
  color: #fff;
}

.active-filters-bar .chip-active-pill .pill-x {
  font-size: 0.65rem;
  opacity: 0.7;
}

.active-filters-bar .chip-active-pill:hover .pill-x {
  opacity: 1;
}

.active-filters-bar .chip-active-pill--country {
  border-color: rgba(70, 130, 200, 0.75);
  background: rgba(24, 48, 80, 0.7);
  color: #9ec9f0;
}

.active-filters-bar .chip-active-pill--country:hover {
  background: #2b6cb0;
  border-color: #2b6cb0;
  color: #fff;
}

.chip.chip-country {
  background: #142436;
  border-color: rgba(70, 130, 200, 0.55);
  color: #9ec9f0;
}

.chip.chip-country em {
  color: #7eb6e8;
}

.chip.chip-country.active {
  background: #2b6cb0;
  border-color: #2b6cb0;
  color: #fff;
}

.chip.chip-country.active em {
  color: rgba(255, 255, 255, 0.85);
}

.empty-reset {
  display: inline-flex;
  margin-top: 0.75rem;
}

.filters-panel {
  display: none;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  max-height: min(42vh, 22rem);
  overflow: auto;
  overscroll-behavior: contain;
}

.filters-wrap.genres-expanded .filters-panel#filters-panel { display: block; }
.filters-wrap.countries-expanded .filters-panel#countries-panel { display: block; }

.filters-wrap.genres-expanded .chip-all-collapse#filters-toggle:not([hidden]),
.filters-wrap.countries-expanded .chip-all-collapse#countries-toggle:not([hidden]) {
  display: inline-flex;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
}

.chip {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.chip em {
  font-style: normal;
  color: var(--muted);
  margin-left: 0.2rem;
}

.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #ffd9c4;
}

.chip.clear { border-style: dashed; }

/* Staff debug filters — always first in the chip row */
.chip.chip-debug {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.chip.chip-debug-doubt {
  background: #3a1210;
  border-color: rgba(180, 35, 24, 0.65);
  color: #ffb4a8;
}

.chip.chip-debug-doubt em {
  color: #ff8a7a;
}

.chip.chip-debug-doubt.active {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}

.chip.chip-debug-doubt.active em {
  color: rgba(255, 255, 255, 0.85);
}

.chip.chip-debug-temp {
  background: #1a2a3a;
  border-color: rgba(56, 132, 200, 0.65);
  color: #9ec9f0;
}

.chip.chip-debug-temp em {
  color: #7eb6e8;
}

.chip.chip-debug-temp.active {
  background: #2b6cb0;
  border-color: #2b6cb0;
  color: #fff;
}

.chip.chip-debug-temp.active em {
  color: rgba(255, 255, 255, 0.85);
}

/* Wikipedia-list Primary tags — after debug chips, before enrich genres */
.chip.chip-primary {
  background: #102418;
  border-color: rgba(61, 140, 90, 0.7);
  color: #9fd9b0;
  font-weight: 600;
}

.chip.chip-primary em {
  color: #7fc894;
}

.chip.chip-primary.active {
  background: #2f7a4a;
  border-color: #2f7a4a;
  color: #fff;
}

.chip.chip-primary.active em {
  color: rgba(255, 255, 255, 0.85);
}

.toolbar {
  padding: 0.75rem 1.25rem 0;
}

.toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.status {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.page-size-label {
  color: var(--muted);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.page-size-label select {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.45rem;
}

main {
  padding: 0.75rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.artist {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem 0;
  display: flex;
  flex-direction: column;
}

.artist.is-discog-open {
  padding-bottom: 0;
}

.artist-refresh {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.artist-actions {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.artist-actions .artist-refresh,
.artist-actions .artist-match,
.artist-actions .artist-edit {
  position: static;
  opacity: 0.35;
}

.artist-match,
.artist-edit {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.artist:hover .artist-actions .artist-refresh,
.artist:hover .artist-actions .artist-match,
.artist:hover .artist-actions .artist-edit,
.artist-actions .artist-refresh:focus-visible,
.artist-actions .artist-match:focus-visible,
.artist-actions .artist-edit:focus-visible {
  opacity: 0.85;
}

.artist:hover .artist-refresh,
.artist-refresh:focus-visible {
  opacity: 0.85;
}

.artist-refresh:hover,
.artist-match:hover,
.artist-edit:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  opacity: 1;
}

.artist-match:hover,
.artist-edit:hover {
  color: var(--accent);
}

.artist-refresh svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}

.artist-refresh.is-refreshing {
  opacity: 1;
  color: var(--accent);
  pointer-events: none;
}

.artist-refresh.is-refreshing svg {
  animation: artist-refresh-spin 0.85s linear infinite;
}

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

.match-dialog {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  padding: 0;
  max-width: min(520px, calc(100vw - 2rem));
  width: 100%;
}

.match-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.match-dialog form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.15rem 1.25rem 1.25rem;
}

.match-dialog h2 {
  margin: 0;
  font-size: 1.05rem;
}

.match-dialog .match-sub {
  margin: -0.25rem 0 0.15rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.match-dialog label {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.match-dialog input[type="url"],
.match-dialog input[type="text"] {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

.match-dialog input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.match-dialog .match-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.match-dialog .dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.35rem;
}

.match-dialog .dialog-actions .spacer { flex: 1; }

.match-dialog .btn {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.match-dialog .btn:hover {
  border-color: #3f3f4a;
}

.match-dialog .btn-primary {
  background: var(--accent-soft);
  border-color: rgba(196, 92, 38, 0.45);
  color: var(--ink);
}

.match-dialog .btn-primary:hover {
  border-color: var(--accent);
}

.match-dialog .btn-danger {
  background: #3a1210;
  border-color: rgba(180, 35, 24, 0.55);
  color: #ffb4a8;
}

.match-dialog .btn-danger:hover {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}

.match-dialog .match-error {
  margin: 0;
  color: #e07070;
  font-size: 0.82rem;
}

.match-dialog .optional {
  color: var(--muted);
  font-weight: 400;
}

.match-dialog .check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.35rem 0 0.15rem;
  font-size: 0.82rem;
  color: var(--ink);
  cursor: pointer;
}

.match-dialog .check-row input[type="checkbox"] {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.match-dialog .check-row span {
  line-height: 1.35;
}

.edit-dialog {
  max-width: min(560px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: hidden;
}

.edit-dialog .edit-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.15rem 0.2rem;
}

.edit-dialog .edit-title-prefix {
  color: var(--muted);
  font-weight: 600;
}

.edit-dialog .edit-name-display {
  appearance: none;
  margin: 0;
  padding: 0.05rem 0.2rem;
  border: 1px dashed transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: text;
}

.edit-dialog .edit-name-display:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.edit-dialog .edit-name-input {
  flex: 1 1 12rem;
  min-width: 8rem;
  margin: 0;
  padding: 0.15rem 0.4rem;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
}

.edit-dialog form {
  max-height: calc(100vh - 2rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.edit-dialog .edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.edit-dialog .edit-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
}

.edit-dialog .edit-grid .edit-field {
  margin: 0;
}

.edit-dialog .edit-field-main {
  min-width: 0;
}

.edit-dialog .edit-field-main > label {
  margin: 0;
}

.edit-dialog .edit-field-control {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
}

.edit-dialog .edit-field-icon {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 40px;
  border-radius: 50%;
}

.edit-dialog .edit-field-control > input,
.edit-dialog .edit-field-control > select,
.edit-dialog .edit-field-control > textarea {
  flex: 1 1 auto;
  min-width: 0;
}

.edit-dialog .edit-field-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.edit-dialog .edit-disable-row,
.edit-dialog .edit-share-row,
.edit-dialog .edit-verify-row {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.edit-dialog .edit-disable-row input[type="checkbox"],
.edit-dialog .edit-share-row input[type="checkbox"],
.edit-dialog .edit-verify-row input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.edit-dialog .edit-disable-row input[type="checkbox"] {
  accent-color: #b45353;
}

.edit-dialog .edit-share-row input[type="checkbox"] {
  accent-color: #3d7a5a;
}

.edit-dialog .edit-verify-row input[type="checkbox"] {
  accent-color: #3b6ea5;
}

.edit-dialog .edit-field.is-disabled .edit-field-main input,
.edit-dialog .edit-field.is-disabled .edit-field-main select,
.edit-dialog .edit-field.is-disabled .edit-field-main textarea {
  opacity: 0.55;
  cursor: not-allowed;
  background: color-mix(in srgb, var(--panel) 80%, #888 20%);
}

.edit-dialog .edit-field.is-disabled .edit-disable-row {
  color: #b45353;
}

.edit-dialog .edit-share-row:has(input:checked) {
  color: #3d7a5a;
}

.edit-dialog .edit-verify-row:has(input:checked) {
  color: #3b6ea5;
}

.edit-dialog .edit-section {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.edit-dialog .edit-field.edit-field-enrich {
  padding: 0.65rem 0.75rem;
  margin: 0.2rem 0 0.9rem;
  border-radius: 10px;
}

.edit-dialog .edit-field.edit-field-enrich .edit-field-main > label {
  font-weight: 600;
}

.edit-dialog .edit-field.edit-field-enrich input[type="text"] {
  background: rgba(18, 22, 30, 0.9);
}

/* Wikipedia — blue */
.edit-dialog .edit-field.edit-field-wikipedia {
  border: 1px solid rgba(96, 150, 210, 0.48);
  background: linear-gradient(135deg, rgba(55, 95, 150, 0.22), rgba(30, 45, 70, 0.35));
}

.edit-dialog .edit-field.edit-field-wikipedia .edit-field-main > label {
  color: #a8c8ec;
}

.edit-dialog .edit-field.edit-field-wikipedia input[type="text"] {
  border-color: rgba(96, 150, 210, 0.55);
}

.edit-dialog .edit-field.edit-field-wikipedia input[type="text"]:focus {
  outline-color: #6a9fd4;
}

/* Spotify — green */
.edit-dialog .edit-field.edit-field-spotify {
  border: 1px solid rgba(46, 180, 100, 0.5);
  background: linear-gradient(135deg, rgba(30, 120, 70, 0.28), rgba(20, 50, 35, 0.4));
}

.edit-dialog .edit-field.edit-field-spotify .edit-field-main > label {
  color: #8fd9a8;
}

.edit-dialog .edit-field.edit-field-spotify input[type="text"] {
  border-color: rgba(46, 180, 100, 0.55);
}

.edit-dialog .edit-field.edit-field-spotify input[type="text"]:focus {
  outline-color: #3ecf7a;
}

/* Wikidata — teal */
.edit-dialog .edit-field.edit-field-wikidata {
  border: 1px solid rgba(50, 180, 175, 0.48);
  background: linear-gradient(135deg, rgba(25, 110, 105, 0.28), rgba(20, 45, 50, 0.4));
}

.edit-dialog .edit-field.edit-field-wikidata .edit-field-main > label {
  color: #7fd4cf;
}

.edit-dialog .edit-field.edit-field-wikidata input[type="text"] {
  border-color: rgba(50, 180, 175, 0.55);
}

.edit-dialog .edit-field.edit-field-wikidata input[type="text"]:focus {
  outline-color: #3ecfc8;
}

/* MusicBrainz — orange */
.edit-dialog .edit-field.edit-field-musicbrainz {
  border: 1px solid rgba(220, 140, 55, 0.5);
  background: linear-gradient(135deg, rgba(140, 80, 25, 0.28), rgba(55, 35, 18, 0.4));
}

.edit-dialog .edit-field.edit-field-musicbrainz .edit-field-main > label {
  color: #e8b878;
}

.edit-dialog .edit-field.edit-field-musicbrainz input[type="text"] {
  border-color: rgba(220, 140, 55, 0.55);
}

.edit-dialog .edit-field.edit-field-musicbrainz input[type="text"]:focus {
  outline-color: #e89a45;
}

/* Discogs — warm amber / brown */
.edit-dialog .edit-field.edit-field-discogs {
  border: 1px solid rgba(200, 160, 90, 0.48);
  background: linear-gradient(135deg, rgba(110, 85, 40, 0.28), rgba(45, 35, 20, 0.4));
}

.edit-dialog .edit-field.edit-field-discogs .edit-field-main > label {
  color: #dcc48a;
}

.edit-dialog .edit-field.edit-field-discogs input[type="text"] {
  border-color: rgba(200, 160, 90, 0.55);
}

.edit-dialog .edit-field.edit-field-discogs input[type="text"]:focus {
  outline-color: #d4b060;
}

/* Soundcharts — violet */
.edit-dialog .edit-field.edit-field-soundcharts {
  border: 1px solid rgba(150, 110, 210, 0.48);
  background: linear-gradient(135deg, rgba(90, 55, 140, 0.28), rgba(40, 28, 60, 0.4));
}

.edit-dialog .edit-field.edit-field-soundcharts .edit-field-main > label {
  color: #c4a8e8;
}

.edit-dialog .edit-field.edit-field-soundcharts input[type="text"] {
  border-color: rgba(150, 110, 210, 0.55);
}

.edit-dialog .edit-field.edit-field-soundcharts input[type="text"]:focus {
  outline-color: #a87de0;
}

.edit-dialog textarea,
.edit-dialog select {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.edit-dialog select:focus,
.edit-dialog textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

@media (max-width: 520px) {
  .edit-dialog .edit-grid {
    grid-template-columns: 1fr;
  }
}

.artist-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  position: relative;
  padding-bottom: 0.85rem;
}

.artist-photo-col {
  flex: 0 0 64px;
  width: 64px;
  min-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.artist-photo {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 64px;
  background: #0f0f13;
  border: 1px solid var(--border);
}

.artist-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.artist-body {
  min-width: 0;
  flex: 1;
  padding-right: 1.6rem;
}

.artist h2 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.artist-name-link {
  color: inherit;
  text-decoration: none;
  border-radius: 3px;
  transition: color 0.15s ease;
}

.artist-name-link:hover {
  color: #b8e0c4;
  text-decoration: none;
}

.artist-name-link:focus-visible {
  outline: 2px solid rgba(29, 185, 84, 0.55);
  outline-offset: 2px;
}

.doubt-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #b42318;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  cursor: help;
}

.doubt-source {
  margin: 0.65rem 0 0;
  padding: 0.45rem 0 0;
  border-top: 1px solid rgba(180, 35, 24, 0.22);
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
}

.doubt-source-label {
  color: #c45c4e;
  font-weight: 600;
}

.artist.has-doubt {
  border-color: rgba(180, 35, 24, 0.45);
}

.tag.tag-doubt {
  background: #3a1210;
  color: #ffb4a8;
  border: 1px solid rgba(180, 35, 24, 0.55);
}

.tag.tag-doubt.active {
  background: #b42318;
  color: #fff;
}

.tag.tag-temp {
  background: #1a2a3a;
  color: #9ec9f0;
  border: 1px solid rgba(56, 132, 200, 0.55);
}

.tag.tag-temp.active {
  background: #2b6cb0;
  color: #fff;
}

.tag.tag-primary {
  background: #102418;
  color: #9fd9b0;
  border: 1px solid rgba(61, 140, 90, 0.55);
}

.tag.tag-primary.active {
  background: #2f7a4a;
  color: #fff;
}

.artist .meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.55rem;
}

.ext-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.ext-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  text-decoration: none;
  opacity: 0.92;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.ext-link:hover,
.ext-link:focus-visible {
  opacity: 1;
  transform: scale(1.08);
  outline: none;
}

.ext-link-icon {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  appearance: none;
  display: inline-block;
  background: var(--tag);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.18rem 0.5rem;
  font: inherit;
  font-size: 0.75rem;
  color: #ddd9d1;
  cursor: pointer;
}

.tag:hover {
  border-color: #4a4a56;
  color: var(--ink);
}

.tag.active {
  background: var(--tag-primary);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.tag.hit {
  outline: 2px solid #e6c35c;
  background: var(--highlight);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 1rem 1.25rem 0;
}

.empty-msg {
  display: block;
}

.empty-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.85rem;
  padding-bottom: 0.25rem;
}

.empty-filter {
  /* reuse .chip.active; slightly larger hit target under empty state */
  padding: 0.35rem 0.85rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  padding: 0.5rem 1.25rem 1.5rem;
}

.page-btn {
  min-width: 2.1rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.85rem;
}

.page-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #ffd9c4;
}

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

.page-ellipsis {
  color: var(--muted);
  padding: 0.35rem 0.2rem;
}

footer {
  padding: 0 1.25rem 2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

footer code {
  color: #ddd9d1;
}

/* Discography tab — flush with card bottom, 64px left column */
.discog-toggle {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 64px;
  margin: 0;
  padding: 0.16rem 0.12rem 1px;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.46rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.12;
  text-align: center;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.artist:hover .discog-toggle,
.discog-toggle:focus-visible,
.discog-toggle.is-open {
  opacity: 1;
}

.discog-toggle:hover,
.discog-toggle.is-open {
  color: #1db954;
  background: rgba(29, 185, 84, 0.1);
  border-color: rgba(29, 185, 84, 0.35);
}

.discog-toggle.is-open {
  background: rgba(29, 185, 84, 0.14);
}

.discog-toggle.is-disabled,
.discog-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.28;
  color: var(--muted);
  background: var(--panel);
  border-color: var(--border);
  border-bottom: 0;
}

.discog-toggle-label {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  hyphens: auto;
  line-height: 1;
}

.discog-toggle-chevron {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid currentColor;
}

.discog-toggle.is-open .discog-toggle-chevron {
  border-top: 0;
  border-bottom: 4px solid currentColor;
}

.discog-panel {
  width: 100%;
  min-width: 0;
  margin-top: 0;
  padding: 0.7rem 0 0.55rem;
  border-top: 1px solid var(--border);
}

.artist-albums-slot {
  width: 100%;
  min-width: 0;
  container-type: inline-size;
  container-name: artist-albums;
  --album-slots: 10;
  --album-gap: 8px;
  --single-gap: 6px;
  --album-size: calc((100cqw - (var(--album-slots) - 1) * var(--album-gap) - 1px) / var(--album-slots));
  --single-size: calc(var(--album-size) / 2);
}

.artist-releases {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.artist-releases.loading,
.artist-releases.empty {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-height: 48px;
  justify-content: flex-start;
}

.item-sub {
  color: var(--muted);
  font-size: 0.82rem;
}

.discog-loading .item-sub {
  color: #1db954;
}

.discog-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, #1db954 0 70%, transparent 70% 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: discog-spin 0.85s linear infinite;
  flex: 0 0 22px;
}

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

.release-scroll {
  position: relative;
  display: block;
  width: 100%;
}

.release-scroll-viewport {
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 4px 0 6px;
}

.release-scroll.is-scrollable .release-scroll-viewport {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(29, 185, 84, 0.45) transparent;
}

.release-scroll.is-scrollable .release-scroll-viewport::-webkit-scrollbar {
  height: 5px;
}

.release-scroll.is-scrollable .release-scroll-viewport::-webkit-scrollbar-thumb {
  background: rgba(29, 185, 84, 0.4);
  border-radius: 999px;
}

.release-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-55%);
  z-index: 4;
  width: 30px;
  height: 54px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(18, 18, 18, 0.88);
  color: var(--ink);
  cursor: pointer;
}

.release-scroll.is-scrollable .release-scroll-btn:not([hidden]) {
  display: inline-flex;
}

.release-scroll-btn.is-prev { left: 0; }
.release-scroll-btn.is-next { right: 0; }

.release-scroll-btn:hover:not(:disabled) {
  color: #1db954;
  border-color: rgba(29, 185, 84, 0.45);
}

.release-scroll-btn:disabled {
  opacity: 0.28;
  cursor: default;
}

.release-scroll-btn[hidden] {
  display: none !important;
}

.release-row {
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  max-width: none;
  align-items: flex-start;
}

.release-row-albums { gap: var(--album-gap); }
.release-row-singles { gap: var(--single-gap); }

.release-row-albums .album-thumb {
  flex: 0 0 var(--album-size);
  width: var(--album-size);
  min-width: var(--album-size);
  max-width: var(--album-size);
  height: var(--album-size);
}

.release-row-singles .album-thumb {
  flex: 0 0 var(--single-size);
  width: var(--single-size);
  min-width: var(--single-size);
  max-width: var(--single-size);
  height: var(--single-size);
}

.album-thumb {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f0f13;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

a.album-thumb:hover {
  transform: translateY(-3px) scale(1.04);
  border-color: rgba(29, 185, 84, 0.55);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.album-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.album-year {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 0.52rem;
  font-weight: 700;
  text-align: center;
  padding: 1px 0;
  line-height: 1.05;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  letter-spacing: 0.01em;
}

.release-row-singles .album-year {
  font-size: 0.42rem;
  padding: 1px 0;
  line-height: 1;
}

.album-type-chip {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 0.44rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 1px 2px;
  border-radius: 2px;
  background: rgba(29, 185, 84, 0.9);
  color: #000;
  line-height: 1;
}

.release-row-singles .album-type-chip {
  top: 1px;
  left: 1px;
  font-size: 0.36rem;
  padding: 1px 2px;
  letter-spacing: 0.02em;
  border-radius: 2px;
}

