:root {
  color-scheme: light;
  --paper: #F7F5F2;
  --cream: #fffdf8;
  --ink: #4f4841;
  --muted: #7a7067;
  --line: rgba(77, 52, 33, 0.26);
  --line-strong: rgba(77, 52, 33, 0.48);
  --panel: rgba(255, 253, 248, 0.94);
  --accent: #4D3421;
  --accent-strong: #372516;
  --sand-soft: #f4eee6;
  --rose: #c7aaa0;
  --gold: #c49a62;
  --shadow: 0 18px 42px rgba(111, 88, 66, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(120deg, rgba(77, 52, 33, 0.08), transparent 32rem),
    linear-gradient(180deg, #fffaf1 0%, var(--paper) 100%);
  color: var(--ink);
  font-family: "Futura Light", "Futura PT", Futura, Avenir, "Century Gothic", ui-sans-serif, system-ui, sans-serif;
  font-weight: 300;
}

body[data-embed="true"] {
  background: transparent;
}

button,
input,
select {
  font: inherit;
}

button,
.secondary-button,
.file-button {
  min-height: 2.75rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fffdf7;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 1rem;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0;
}

button:hover,
.secondary-button:hover,
.file-button:hover {
  background: var(--accent-strong);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 3vw, 2.5rem);
  background: rgba(255, 253, 248, 0.9);
  border-bottom: 1px solid rgba(77, 52, 33, 0.12);
  backdrop-filter: blur(18px);
}

.brand {
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--cream);
  display: grid;
  place-items: center;
  font-family: "Futura Light", "Futura PT", Futura, Avenir, sans-serif;
  font-size: 1.25rem;
}

.brand small {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
}

.brand strong {
  font-weight: 400;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.top-actions a,
.ghost-button,
.text-button {
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
  min-height: 2.35rem;
  padding: 0 0.75rem;
  text-decoration: none;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  font-weight: 400;
}

.top-actions a:hover,
.ghost-button:hover,
.text-button:hover {
  background: rgba(23, 21, 19, 0.06);
  color: var(--ink);
}

.workspace {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem);
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr) minmax(260px, 340px);
  gap: 1rem;
  align-items: start;
}

.intro-panel {
  grid-column: 1 / -1;
  min-height: 14rem;
  border-radius: 8px;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  color: #fffdf7;
  background:
    linear-gradient(90deg, rgba(111, 88, 66, 0.56), rgba(177, 145, 112, 0.24)),
    url("assets/baggrund-repertoire.webp");
  background-size: cover;
  background-position: center 42%;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem;
  box-shadow: var(--shadow);
}

.admin-intro {
  background:
    linear-gradient(90deg, rgba(111, 88, 66, 0.7), rgba(177, 145, 112, 0.34)),
    url("assets/baggrund-repertoire.webp");
  background-size: cover;
  background-position: center;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: currentColor;
  opacity: 0.78;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.75rem;
  font-weight: 500;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 0.85rem;
  font-family: "Futura Light", "Futura PT", Futura, Avenir, sans-serif;
  font-size: clamp(2.5rem, 6vw, 5.9rem);
  line-height: 1;
  font-weight: 300;
}

.hero-copy {
  max-width: 650px;
  margin-bottom: 0;
  color: rgba(255, 253, 247, 0.9);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

h2 {
  margin-bottom: 0.25rem;
  font-size: 1.35rem;
  font-weight: 300;
}

h3 {
  font-size: 1rem;
  font-weight: 400;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(6.5rem, 1fr));
  gap: 0.7rem;
}

.quick-stats span {
  border: 1px solid rgba(255, 250, 240, 0.28);
  border-radius: 8px;
  padding: 0.8rem;
  background: rgba(255, 250, 240, 0.11);
}

.quick-stats strong {
  display: block;
  font-size: 1.6rem;
}

.filter-panel,
.selection-panel,
.catalog-shell {
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.filter-panel {
  border-top-color: rgba(77, 52, 33, 0.18);
  border-bottom-color: rgba(77, 52, 33, 0.14);
  background:
    linear-gradient(
      180deg,
      rgba(247, 245, 242, 0) 0%,
      rgba(205, 190, 174, 0.34) 16%,
      rgba(190, 171, 151, 0.42) 50%,
      rgba(205, 190, 174, 0.26) 84%,
      rgba(247, 245, 242, 0) 100%
    );
}

.catalog-shell {
  background: transparent;
}

.selection-panel {
  background: transparent;
}

.filter-panel,
.selection-panel {
  position: sticky;
  top: 5rem;
  padding: 1rem 0;
}

.catalog-shell {
  padding: 1rem 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 0.8rem;
}

.section-head p,
.tool-copy {
  color: var(--muted);
  margin-bottom: 0;
}

label span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.filter-choice {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.filter-choice > span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

input,
select {
  width: 100%;
  min-height: 2.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  padding: 0 0.75rem;
}

select {
  cursor: pointer;
}

input:focus,
select:focus {
  outline: 3px solid rgba(77, 52, 33, 0.08);
  border-color: var(--line-strong);
}

.field-grid,
.form-grid {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.75rem;
}

.check-row {
  min-height: 2.65rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  align-items: end;
}

.check-row-two {
  grid-template-columns: repeat(2, minmax(0, 4.5rem));
  justify-content: start;
}

.check-row label {
  min-height: 2.65rem;
  display: grid;
  place-items: center;
  gap: 0.28rem;
  cursor: pointer;
}

.check-row span {
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1;
  text-align: center;
  font-weight: 400;
}

.check-row input {
  appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--cream);
  cursor: pointer;
}

.check-row input:checked {
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--cream);
}

.check-row input:focus-visible {
  outline: 3px solid rgba(77, 52, 33, 0.1);
  outline-offset: 2px;
}

.sort-control {
  width: min(10.5rem, 100%);
}

.sort-control select {
  min-height: 2.35rem;
}

.chip-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0 0.5rem;
}

.chip {
  min-height: 2.05rem;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  padding: 0 0.65rem;
  font-size: 0.86rem;
}

.chip.is-active {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--cream);
}

.song-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.song-card {
  min-height: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0.75rem 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
}

.song-card:last-child {
  border-bottom: 1px solid var(--line);
}

.song-card header {
  min-width: 0;
}

.song-card h3 {
  margin: 0 0 0.25rem;
  line-height: 1.2;
  font-weight: 400;
  font-size: 1rem;
}

.song-card p {
  color: var(--muted);
  margin-bottom: 0;
  font-size: 0.9rem;
  line-height: 1.25;
}

.song-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
}

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

.tag {
  border-radius: 999px;
  background: var(--sand-soft);
  color: #6d5f52;
  padding: 0.25rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 500;
}

.source-pill {
  flex: 0 0 auto;
  align-self: center;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  background: rgba(187, 169, 161, 0.2);
  color: #80685d;
  font-size: 0.74rem;
  font-weight: 500;
}

.source-pill.original {
  background: rgba(199, 165, 106, 0.18);
  color: #7b6338;
}

.mini-actions {
  display: flex;
  gap: 0.45rem;
  white-space: nowrap;
}

.mini-actions a,
.mini-actions button {
  min-height: 2.25rem;
  border-radius: 8px;
  padding: 0 0.7rem;
  font-size: 0.86rem;
  text-decoration: none;
}

.mini-actions a {
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  font-weight: 500;
}

.load-more {
  width: 100%;
  margin-top: 1rem;
}

.selection-list {
  display: grid;
  gap: 0.55rem;
  min-height: 6rem;
}

.selection-item {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 0.7rem 0;
  background: transparent;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: center;
}

.selection-item strong,
.selection-item small {
  display: block;
}

.selection-item small {
  color: var(--muted);
}

.selection-actions,
.stacked-actions {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.danger-button {
  background: #9b6a62;
}

.danger-button:hover {
  background: #7d5049;
}

.icon-button {
  width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  border-radius: 50%;
  background: rgba(23, 21, 19, 0.08);
  color: var(--ink);
  font-size: 1.4rem;
}

dialog {
  width: min(920px, calc(100% - 2rem));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(23, 21, 19, 0.5);
  backdrop-filter: blur(4px);
}

.tools-modal {
  padding: 1.25rem;
  background: var(--panel);
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.8fr);
  gap: 1rem;
}

.tools-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: white;
}

.embed-workspace {
  padding: 0;
}

.embed-intro {
  min-height: 11rem;
}

body[data-embed="true"] .filter-panel,
body[data-embed="true"] .selection-panel {
  position: static;
}

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

.wide {
  grid-column: 1 / -1;
}

.file-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.empty-state {
  border: 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  border-radius: 0;
  padding: 1rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  }

  .filter-panel {
    grid-column: 1 / -1;
    position: static;
  }

  .field-grid {
    grid-template-columns: repeat(5, minmax(140px, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    align-items: start;
  }

  .top-actions {
    overflow-x: auto;
    justify-content: end;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 0.85rem;
  }

  .intro-panel {
    min-height: 18rem;
    align-items: start;
    flex-direction: column;
  }

  .quick-stats {
    width: 100%;
  }

  .field-grid,
  .tools-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .selection-panel {
    position: static;
  }
}

@media (max-width: 520px) {
  .top-actions a {
    display: none;
  }

  h1 {
    font-size: 2.55rem;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .song-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .song-card footer {
    justify-content: flex-start;
  }

  .source-pill {
    width: fit-content;
  }

  .mini-actions {
    white-space: normal;
  }
}
