/* Mobile first: these rules are for a phone. The @media blocks at the
   bottom add changes for wider screens. Colors and fonts match the mockups. */

/* The "Sleeve" look (chosen 2026-11-04): warm paper and ink with an oxblood
   red, like a printed record sleeve. These are the light colors; the dark
   ones below replace them at night. Every color in this file comes from these
   names ("custom properties"), so switching theme only swaps this list. */
:root {
  --bg: #f4efe6;          /* paper */
  --surface: #e9e2d5;     /* a shade darker: fields, menus, tiles */
  --border: #d8cfbf;
  --text: #1d1b18;        /* ink */
  --muted: #6e665a;
  --accent: #8e2f22;      /* oxblood: buttons and links */
  --on-accent: #fbf7f1;   /* text on an oxblood button */
  --danger: #b42318;
  --danger-soft: #f6dcd6; /* behind error messages */
  --heading: "Fraunces", Georgia, serif;
  --body: "Source Sans 3", system-ui, sans-serif;
  --radius: 8px;
  color-scheme: light;
}

/* Dark: warm charcoal with a softer red. Used when the phone or computer is in
   dark mode (and the Settings page says Auto), or when Settings says Dark.
   :not([data-theme="light"]) lets "Light" in Settings win over a dark phone. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171412;
    --surface: #221e1a;
    --border: #3a332c;
    --text: #f1ebe2;
    --muted: #a59b8d;
    --accent: #e0705a;
    --on-accent: #1a0f0b;
    --danger: #f07a68;
    --danger-soft: #3a1d18;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #171412;
  --surface: #221e1a;
  --border: #3a332c;
  --text: #f1ebe2;
  --muted: #a59b8d;
  --accent: #e0705a;
  --on-accent: #1a0f0b;
  --danger: #f07a68;
  --danger-soft: #3a1d18;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.4;
}

a {
  color: var(--accent);
}

h1 {
  margin: 0;
  font-family: var(--heading);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------- Shared pieces ---------- */

/* Buttons look 36px tall, but ::after (an invisible layer 4px bigger above
   and below) keeps a 44px area to tap with a thumb. */
.button {
  position: relative;
  min-height: 36px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}

/* Secondary buttons (Cancel, Delete, Keep it): just an outline. */
.button-quiet {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

.button-danger {
  background: var(--danger);
  color: var(--on-accent);
}

.button:focus-visible,
.tabs a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

.actions .button {
  flex: 1;
}

/* Shown at the top of a page after add / save / delete. */
.flash {
  margin: 12px 20px 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--accent);
}

.error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--danger-soft);
  border: 1px solid var(--danger);
}

/* Hidden on screen but still read out by screen readers. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Collection page ---------- */

.page-header {
  padding: 24px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-header h1 {
  font-size: 34px;
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Section and format: two small groups of choices side by side. */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius);
  background: var(--surface);
}

.tabs a {
  min-height: 32px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
}

.tabs a[aria-current="page"] {
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--border);
}

.page-body {
  padding: 4px 20px 32px;
}

.header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.search {
  display: flex;
  gap: 8px;
}

input {
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

select {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

textarea {
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px or more stops iPhones from zooming in */
  line-height: 1.4;
  resize: vertical; /* drag the corner to make it taller, not wider */
}

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

.search input {
  flex: 1;
}

/* Order menu on the left, Grid / List icons on the right. */
.view-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.result-note {
  flex: 1 1 100%;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Format and Order: a <details> menu that drops down under its button. */
.menu {
  position: relative;
}

.menu summary {
  list-style: none;
  cursor: pointer;
}

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

.chip {
  min-height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--border);
  font-size: 15px;
}

.order {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  color: var(--muted);
}

.order em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}

.menu summary:focus-visible,
.view-icons a:focus-visible,
.menu-list a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.menu-list {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
}

/* The Format menu sits at the right edge, so it opens leftwards. */
.filter-row .menu-list {
  left: auto;
  right: 0;
}

.menu-list a {
  min-height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.menu-list a + a {
  border-top: 1px solid var(--border);
}

.menu-list a[aria-current="page"] {
  font-weight: 600;
  color: var(--accent);
}

/* Grid / List as two icons. */
.view-icons {
  display: flex;
  gap: 4px;
}

.view-icons a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--muted);
}

.view-icons a[aria-current="page"] {
  background: var(--surface);
  color: var(--text);
}




/* "Popular" and "Classical" headings when both sections show. */
.section-heading {
  margin: 8px 0 14px;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 22px;
}

.section-heading span {
  margin-left: 6px;
  font-size: 14px;
  color: var(--muted);
}

.grid + .section-heading,
.list + .section-heading {
  margin-top: 32px;
}

/* The list view: a plain table that fits a phone. */
.list {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.list th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.list th,
.list td {
  padding: 12px 8px 12px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

/* Tick boxes: hidden until Actions puts the class "show-ticks" on the form. */
.list .pick,
.ticks-on {
  display: none;
}

.show-ticks .list .pick {
  display: table-cell;
}

.show-ticks .ticks-on {
  display: inline-flex;
}

.show-ticks .ticks-off {
  display: none;
}

.show-ticks .action-hint {
  display: inline;
}

/* The tick boxes in the list, and the Actions bar under it. */
.list .pick {
  width: 24px;
  padding-right: 4px;
}

/* 16px box, nudged down 3px so it lines up with the 21px-high line of text.
   min-height and padding undo the rules for text boxes (input, above),
   which made the tick box 44px tall and pushed it down. */
.list .pick input {
  display: block;
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.action-bar {
  position: sticky;
  bottom: 0;
  margin: 16px -20px 0;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.action-hint {
  margin-right: auto;
  font-size: 14px;
  color: var(--muted);
}

.actions-menu {
  position: relative;
}

/* Hide the little triangle browsers put before a <summary>. */
.actions-menu summary {
  list-style: none;
}

.actions-menu summary::-webkit-details-marker {
  display: none;
}

/* The menu opens upwards, above the button. */
.actions-list {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  min-width: 200px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
}

.actions-list button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.actions-list button + button {
  border-top: 1px solid var(--border);
}

.actions-list button.danger {
  color: var(--danger);
}

/* Column names are links that sort; they look like the plain headings. */
.list th a.column-sort {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  min-height: 24px;
}

.list th[aria-sort="ascending"],
.list th[aria-sort="descending"] {
  color: var(--text);
}

.list td a {
  color: var(--text);
  font-weight: 600;
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text);
  text-decoration: none;
}

/* Covers stay nearly square-cornered, like a real sleeve. */
.cover {
  aspect-ratio: 1;
  margin-bottom: 6px;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 18%);
  display: flex;
  align-items: flex-end;
  padding: 12px;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 28px;
  color: rgb(255 255 255 / 85%);
}

.tile-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-meta {
  font-size: 13px;
  color: var(--muted);
}

.empty {
  color: var(--muted);
}

.empty h1 {
  color: var(--text);
  margin: 28px 0 8px;
}

/* ---------- Item page ---------- */

.hero {
  color: #fbf7f1;
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: rgb(0 0 0 / 30%);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-main {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

.cover-large {
  width: 128px;
  flex: none;
  margin: 0;
  background: rgb(0 0 0 / 25%);
  box-shadow: 0 10px 30px rgb(0 0 0 / 40%);
}

.hero h1 {
  font-size: 26px;
  line-height: 1.1;
}

.hero-artist {
  margin: 4px 0 0;
}

/* Genres under the artist: small outlined labels in the hero's own text colour. */
.hero-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.hero-genres li {
  padding: 2px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.8rem;
  opacity: 0.85;
}

.facts {
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* The facts are a quiet two-column list, not a wall of boxes. */
.facts div {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.facts dt {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.facts dd {
  margin: 4px 0 0;
  font-weight: 600;
}

.notes p {
  margin: 4px 0 0;
  white-space: pre-line; /* keep the line breaks you typed */
  overflow-wrap: anywhere;
}

/* A real cover picture fills its square; object-fit crops it instead of stretching. */
img.cover {
  width: 100%;
  padding: 0;
  object-fit: cover;
  background: var(--surface);
}

/* A cover picture covers the whole colored square it sits in. */
.cover {
  position: relative;
  overflow: hidden;
}

.cover-picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The track list on the item page. */
.tracks h2,
.notes h2 {
  margin: 28px 0 8px;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 22px;
}

.tracks h3 {
  margin: 16px 0 4px;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.track-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.track-list li {
  padding: 10px 0;
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.track-number {
  min-width: 2.2em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.track-title {
  flex: 1;
}

.track-artist {
  color: var(--muted);
}

/* Classical: the work's name above its movements, and each track's own people. */
.track-list .work-heading {
  display: block;
  padding: 14px 0 6px;
  font-weight: 600;
}

.track-people {
  display: block;
  font-size: 14px;
  color: var(--muted);
}

/* Songs found by a search, above the albums. */
.song-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.song-list li {
  padding: 10px 0;
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.song-list a {
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.song-title {
  display: block;
  font-weight: 600;
}

.song-on {
  display: block;
  font-size: 14px;
  color: var(--muted);
}

.track-length {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Barcode lookup ---------- */

/* Camera scanning: the camera picture appears under the button. */
.scan {
  display: grid;
  gap: 8px;
  justify-items: start;
  margin-top: 12px;
}

.scan .hint:empty {
  display: none;
}

.scanner-view {
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
}

.scanner-view video {
  display: block;
  width: 100% !important;
}

.page-body .lookup-hint {
  margin: 8px 0 16px;
}

.releases {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.release {
  padding: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.release > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.release-cover {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
}

.type-it-in,
.lookup-offer {
  margin: 20px 0;
  color: var(--muted);
}

.lookup-offer {
  margin-top: 0;
}

/* On the add form: "Filled in from MusicBrainz", with the cover. */
.found {
  margin-bottom: 20px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-radius: var(--radius);
  background: var(--surface);
}

.found p {
  margin: 0;
  font-size: 14px;
}

img.found-cover {
  width: 72px;
  flex: none;
  margin: 0;
}

/* ---------- Find on MusicBrainz, edit tracks ---------- */

/* "Find on MusicBrainz" and "Edit tracks" under the track list. */
.item-links {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.item-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.match-search {
  margin-bottom: 20px;
  display: grid;
  gap: 10px;
}

.match-search label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.compare {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare .checkbox {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface);
}

.compare-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.compare-values {
  overflow-wrap: anywhere;
}

.compare-empty {
  color: var(--muted);
  font-style: italic;
}

.compare-yours {
  color: var(--muted);
  text-decoration: line-through;
}

/* The track editor: one row of small inputs per track. */
.track-editor {
  width: 100%;
  border-collapse: collapse;
}

.track-editor th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.track-editor td {
  padding: 4px 6px 4px 0;
  vertical-align: top;
}

.track-editor input {
  width: 100%;
  padding: 0 8px;
  font-size: 16px;
}

/* Disc and side are one or two characters; the title gets the room. */
.track-editor td:first-child,
.track-editor th:first-child {
  width: 3.4em;
}

.track-editor td:last-child,
.track-editor th:last-child {
  width: 5.2em;
}

/* Title and artist sit one above the other, so the phone keeps room for both. */
.track-editor .title-cell input + input {
  margin-top: 4px;
}

.track-editor .narrow {
  width: 2.8em;
}

/* The folded "Classical" fields under a track's title. */
.classical-fields {
  margin-top: 4px;
}

.classical-fields summary {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.classical-fields label {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.classical-fields input {
  margin-top: 2px;
}

.classical-fields .movement {
  display: flex;
  gap: 4px;
}

.classical-fields .movement label:first-child {
  width: 3.4em;
  flex: none;
}

.classical-fields .movement label:last-child {
  flex: 1;
}

/* ---------- CSV import ---------- */

.page-body .import-hint {
  margin: 8px 0 16px;
}

.import-column {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
}

.import-column .hint {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.import-column-name {
  color: var(--text);
  font-weight: 600;
}

.import-problems {
  margin: 0;
  padding-left: 18px;
  overflow-wrap: anywhere;
}

.import-problems li {
  margin-bottom: 8px;
}

.actions + .section-heading,
.import-confirm + .section-heading,
.import-problems + .section-heading {
  margin-top: 28px;
}

.import-confirm {
  margin-top: 20px;
}

.import-confirm .actions {
  margin-top: 4px;
}

.cancel-import {
  margin-top: 16px;
}

.button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ---------- Add / edit form ---------- */

.item-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.item-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.item-form input {
  font-size: 16px; /* 16px or more stops iPhones from zooming in on the field */
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--muted);
}

/* Radio buttons drawn as one bar of choices, like the format tabs. */
.segmented {
  display: flex;
  padding: 3px;
  border-radius: var(--radius);
  background: var(--surface);
}

.segmented label {
  flex: 1;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--muted);
  font-size: 16px;
}

.segmented input:checked + span {
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--border);
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--accent);
}

.two-up {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hint {
  margin: -8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.confirm h1 {
  margin: 28px 0 8px;
}

/* ---------- Accounts ---------- */

/* The thin bar at the top: who is signed in, and Sign out. */
.account-bar {
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}

.account-bar strong {
  color: var(--text);
  font-weight: 600;
}

.account-bar form {
  margin: 0;
}

.account-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-links a {
  font-weight: 600;
  text-decoration: none;
}

/* A button that looks like a link (forms need a real button to send them). */
.link-button {
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Sign in and sign up: one column, centered on the screen, like the mockup. */
.auth {
  min-height: 100vh;
  min-height: 100dvh; /* dvh: the screen height without the phone's address bar */
  padding: 0 24px;
  display: flex;
  flex-direction: column;
}

.auth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}

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

.auth-intro-center {
  align-items: center;
  text-align: center;
}

.auth-intro h1 {
  font-size: 30px;
}

.auth-intro p {
  margin: 0;
  color: var(--muted);
}

/* The round amber "record" above Welcome back. */
.logo {
  width: 72px;
  height: 72px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
}

.auth .error {
  margin: 0;
}

.button-big {
  min-height: 44px;
  margin-top: 6px;
}

/* Settings and other one-column pages. */
.narrow-page h1 {
  margin: 8px 0 20px;
  font-size: 32px;
}

.back-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  font-weight: 600;
  text-decoration: none;
}

.field-hint {
  font-size: 13px;
  color: var(--muted);
}

.item-form .checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 15px;
  color: var(--text);
}

.checkbox input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--accent);
}

.forgot-link {
  align-self: flex-end;
  margin-top: -6px;
  padding: 8px 0;
  font-size: 14px;
}

.auth-switch {
  margin: 0 0 32px;
  text-align: center;
  color: var(--muted);
}

.auth-switch a {
  font-weight: 600;
}

/* ---------- Wider screens ---------- */

/* Tablets: more covers per row. */
@media (min-width: 600px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Computers: even more covers, and keep the page from getting too wide. */
@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .page-header,
  .page-body,
  .hero {
    max-width: 1100px;
    margin-inline: auto;
  }

  /* Forms are easier to fill in when they are not too wide. */
  .item-form,
  .confirm,
  .narrow-page {
    max-width: 560px;
  }

  .auth {
    max-width: 420px;
    margin-inline: auto;
  }

  .auth .item-form {
    max-width: none;
  }

  .account-bar {
    padding-inline: max(20px, calc((100% - 1060px) / 2));
  }

  .actions .button {
    flex: none;
  }

  .flash {
    max-width: 1060px;
    margin: 12px auto 0;
  }

  .hero {
    border-radius: 0 0 16px 16px;
  }
}

/* ---------- "You already have this" (lookup and add form) ---------- */

.owned {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border-left: 4px solid var(--accent);
}

.owned-title {
  margin: 0 0 6px;
  font-weight: 600;
}

.owned ul {
  margin: 0 0 4px;
  padding-left: 18px;
}

.owned li {
  margin: 4px 0;
}

.owned-same {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--on-accent);
  background: var(--accent);
  white-space: nowrap;
}

.owned .button {
  margin-top: 8px;
}

/* ---------- Genres ---------- */

/* The Genre menu is the first one in the row, so it opens to the right. */
.filter-row .menu:first-child .menu-list {
  left: 0;
  right: auto;
}

.genre-menu {
  min-width: 220px;
  max-height: 70vh;
  overflow-y: auto;
  padding-bottom: 10px;
}

.genre-menu label {
  min-height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}

.genre-menu input[type="checkbox"],
.genre-ticks input[type="checkbox"],
.switch input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.genre-menu .button {
  margin: 10px 14px 0;
}

.button-small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 15px;
}

/* A square button holding one symbol, like the ↑ ↓ ✕ next to each genre. */
.button-icon {
  width: 36px;
  padding: 0;
}

.button-icon:disabled {
  opacity: 0.35;
  cursor: default;
}

/* The tick boxes on the add / edit form. */
.genre-ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.item-form .genre-ticks .tick {
  flex-direction: row;
  font-size: 16px;
  color: var(--text);
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

/* The list view's Actions menu: pick a genre, then Add or Remove it. */
.actions-list .genre-pick {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--muted);
}

.actions-list .genre-pick select {
  flex: 1;
  min-height: 36px;
}

.actions-list .genre-pick + button {
  border-top: 1px solid var(--border);
}

/* Settings: the "Get genres from MusicBrainz" switch and the genre list. */
.switch,
.item-form label.switch {
  margin-top: 20px;
  flex-direction: row;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.switch + .field-hint {
  margin-top: 6px;
}

.genre-settings {
  margin-top: 36px;
}

.genre-settings h2 {
  margin: 0 0 4px;
  font-family: var(--heading);
  font-size: 22px;
}

.genre-rows {
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.genre-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
}

.genre-rows li + li .genre-row {
  border-top: 1px solid var(--border);
}

.genre-row input[name="name"] {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

.genre-count {
  min-width: 2em;
  text-align: right;
  font-size: 14px;
  color: var(--muted);
}

/* The add / edit form's Genres menu: one line until you open it. */
.genre-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 14px;
  color: var(--muted);
}

.genre-picker summary {
  min-height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  list-style: none;
  cursor: pointer;
}

.genre-picker summary::-webkit-details-marker {
  display: none;
}

.genre-summary {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.genre-panel {
  margin-top: 6px;
  padding: 4px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.genre-panel .tick {
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: var(--text);
  cursor: pointer;
}

.genre-panel .tick + .tick {
  border-top: 1px solid var(--border);
}

.genre-panel .tick.suggest {
  color: var(--accent);
  font-weight: 600;
}

.genre-panel .hint {
  margin: 8px 12px 4px;
}

.genre-panel input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

/* Settings: MusicBrainz genre names suggested under the "New genre" box. */
.genre-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
}

.genre-suggestions .chip {
  border: 0;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

/* ---------- Fill in from MusicBrainz ---------- */

.fill-status {
  margin: 16px 0;
}

.fill-state {
  font-weight: 600;
  margin: 0 0 8px;
}

/* The progress bar: a track with a red part as wide as the share done. */
.progress {
  height: 8px;
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.fill-status .actions form {
  flex: 1;
  display: flex;
}

.fill-counts {
  color: var(--muted);
}

.fill-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.fill-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.fill-list .field-hint {
  display: block;
  margin: 2px 0 0;
}

/* "(guessed)" after the edition's year: picked by the fill job, not by you. */
.guessed {
  color: var(--muted);
  font-size: 0.85em;
}

/* A "Not sure" row: its tick box, then the album and why. */
.fill-pick {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.fill-pick input {
  margin-top: 4px;
}

/* The fill page's folded Hidden list: tap the heading to open it. */
.fill-hidden {
  margin-top: 32px;
}
.fill-hidden[open] summary {
  margin-bottom: 8px;
}
.fill-hidden summary {
  cursor: pointer;
  list-style: none;
}
.fill-hidden summary::-webkit-details-marker {
  display: none;
}
.fill-hidden summary h2 {
  display: inline;
}
.fill-hidden summary h2::after {
  content: " ▾";
  color: var(--muted);
  font-size: 0.8em;
}
.fill-hidden[open] summary h2::after {
  content: " ▴";
}
.fill-hidden summary .field-hint {
  font-family: inherit;
  font-weight: normal;
}
