@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  --bg: #f4efe8;
  --bg-2: #f8f5f0;
  --ink: #1f1d1a;
  --muted: #5d5a55;
  --accent: #d97706;
  --accent-soft: #fcd34d;
  --surface: #ffffff;
  --surface-2: #fcfbf8;
  --border: #e1d7c7;
  --shadow: 0 18px 40px rgba(31, 29, 26, 0.12);
}

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

body {
  font-family: "Space Grotesk", "Avenir Next", "Helvetica Neue", sans-serif;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff7e6 0%, transparent 55%),
    radial-gradient(circle at 20% 40%, #fef3c7 0%, transparent 60%),
    linear-gradient(135deg, var(--bg), var(--bg-2));
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(244, 239, 232, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  font-family: "Fraunces", "Times New Roman", serif;
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 700;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.topbar-menu-toggle {
  display: none;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.topbar-menu-toggle:focus-visible {
  outline: 2px solid rgba(217, 119, 6, 0.45);
  outline-offset: 2px;
}

.topbar-user {
  color: var(--muted);
  font-size: 0.92rem;
}

h1,
h2,
h3 {
  font-family: "Fraunces", "Times New Roman", serif;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.page-hero,
.song-hero {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.page-hero h1,
.song-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2.3rem, 4vw, 3.4rem);
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.lede {
  margin: 0;
  color: var(--muted);
  max-width: 34rem;
  line-height: 1.6;
}

.hero-actions,
.song-hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-panel {
  margin: 2rem 0 1.5rem;
}

.search-form {
  display: flex;
  width: 100%;
}

.search-input-wrap {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 1rem;
  box-shadow: 0 12px 24px rgba(31, 29, 26, 0.08);
}

.search-input:focus {
  outline: 2px solid rgba(217, 119, 6, 0.35);
  border-color: var(--accent);
}

.search-meta {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.85rem;
}

.songs-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.song-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 12px 24px rgba(31, 29, 26, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.song-card-link {
  text-decoration: none;
  color: inherit;
}

.song-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(31, 29, 26, 0.14);
}

.song-card-link:focus-visible {
  outline: 2px solid rgba(217, 119, 6, 0.5);
  outline-offset: 2px;
}

.song-title {
  margin: 0;
  font-size: 1.2rem;
}

.song-meta {
  margin: 0.25rem 0 0;
  color: var(--muted);
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.song-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #fff7ed;
  color: #92400e;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-soft {
  background: #fef9c3;
  color: #854d0e;
}

.badge-accent {
  background: #ecfccb;
  color: #3f6212;
}

.song-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 12px 28px rgba(31, 29, 26, 0.1);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.panel-count {
  color: var(--muted);
  font-size: 0.9rem;
}

.form-hero {
  align-items: center;
}

.chip-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chip {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.9rem;
  font-weight: 600;
}

.chip-muted {
  background: #e2e8f0;
  color: #334155;
}

.hint {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.chords-block,
.chords-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

.chords-block {
  white-space: pre-wrap;
  background: #f8fafc;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.chords-input {
  width: 100%;
  min-height: 240px;
}

.chord-image-gallery {
  display: grid;
  gap: 1rem;
}

.chord-image img {
  max-height: 80vh;
  width: auto;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.attachment-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.attachment-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.attachment-card.is-removed {
  opacity: 0.55;
  transform: scale(0.98);
  box-shadow: none;
}

.attachment-card__thumb img {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

.attachment-card__icon {
  width: 86px;
  height: 86px;
  border-radius: 12px;
  background: #111827;
  color: #f8fafc;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.attachment-card__meta {
  min-width: 0;
}

.attachment-card__name {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
}

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

.attachment-card__remove {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: #1f2937;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.attachment-card__remove:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.attachment-remove-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.videos-section {
  margin-top: 2rem;
}

.video-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.video-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem;
}

.video-player {
  width: 100%;
  max-height: 320px;
  border-radius: 10px;
  background: #111827;
}

.video-meta {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  word-break: break-word;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.text-input,
.text-area {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  box-shadow: 0 8px 16px rgba(31, 29, 26, 0.05);
}

.text-input:focus,
.text-area:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

.text-area {
  min-height: 220px;
  resize: vertical;
}

.form-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.75rem;
  margin-top: 2rem;
  align-items: start;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  animation: lift-in 0.35s ease;
}

.form-aside {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.aside-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 12px 24px rgba(31, 29, 26, 0.08);
}

.aside-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.aside-text {
  margin: 0 0 0.75rem 0;
  color: var(--muted);
  line-height: 1.5;
}

.aside-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
}

.form-section {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px dashed var(--border);
}

.form-section:last-of-type {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

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

.section-head h2 {
  margin: 0 0 0.35rem 0;
  font-size: 1.5rem;
}

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

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

.form-actions {
  margin-top: 2rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.dropzone {
  position: relative;
  padding: 1.25rem;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, #fffaf0, #fff6e6);
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

.dropzone:focus-visible {
  outline: 3px solid rgba(217, 119, 6, 0.3);
  outline-offset: 2px;
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background: #fff1cc;
}

.dropzone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-prompt {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dropzone-title {
  font-weight: 600;
}

.dropzone-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

.dropzone-filename {
  color: var(--ink);
  font-size: 0.9rem;
}

.upload-progress {
  margin: 1rem 0 0;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: 0 10px 24px rgba(31, 29, 26, 0.08);
  animation: lift-in 160ms ease-out;
}

.upload-progress__bar {
  position: relative;
  height: 8px;
  background: #f4ede1;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.upload-progress__bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #fbbf24, #d97706);
  transition: width 0.35s ease;
}

.upload-progress--compact {
  padding: 0.85rem 1rem;
  margin: 0 0 0.75rem;
}

.upload-progress--compact .upload-progress__stages {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.45rem;
}

.upload-progress--compact .upload-progress__title {
  font-size: 0.94rem;
}

.upload-progress--compact .upload-progress__hint {
  font-size: 0.82rem;
}

.upload-progress__stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.upload-progress__stage {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.4rem;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.upload-progress__stage.is-active {
  background: #fff6e6;
  color: var(--ink);
}

.upload-progress__stage.is-complete {
  opacity: 0.85;
}

.upload-progress__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 0.15rem;
  background: #e2e8f0;
  flex-shrink: 0;
}

.upload-progress__stage.is-active .upload-progress__dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.2);
}

.upload-progress__stage.is-complete .upload-progress__dot {
  background: #22c55e;
  box-shadow: none;
}

.upload-progress__title {
  margin: 0;
  font-weight: 600;
  font-size: 0.98rem;
}

.upload-progress__hint {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.upload-progress__status {
  margin: 0.25rem 0 0;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}

.attachment-preview {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: #f7f4ef;
  border: 1px solid var(--border);
}

.attachment-preview img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.attachment-title {
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.attachment-list {
  margin: 0;
  padding-left: 1.1rem;
}

.actions {
  margin-top: 1rem;
}

@keyframes lift-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toolbar {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.button {
  text-decoration: none;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: #1f2933;
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.button-secondary {
  background: #475569;
}

.button-danger {
  background: #b91c1c;
}

.inline-form {
  display: inline;
  margin: 0;
}

.flash {
  padding: 0.6rem 0.8rem;
  margin: 1.5rem auto 0;
  border-radius: 12px;
  background: #ecfdf3;
  color: #065f46;
  max-width: 1100px;
  border: 1px solid #bbf7d0;
}

.flash.alert {
  background: #fff1f2;
  color: #9f1239;
  border-color: #fecdd3;
}

.error-summary {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  padding: 0.75rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.empty-panel {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 18px;
  padding: 2rem;
  text-align: center;
}

.empty-panel h2 {
  margin-top: 0;
}

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

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.auth-shell {
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
}

.auth-card {
  width: 100%;
}

.auth-form {
  max-width: 460px;
}

.admin-section {
  margin-top: 1.5rem;
}

.users-table-wrap {
  overflow-x: auto;
}

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

.users-table th,
.users-table td {
  border-top: 1px solid var(--border);
  padding: 0.8rem 0.4rem;
  text-align: left;
}

.users-table th:last-child,
.users-table td:last-child {
  text-align: right;
}

.bulk-panel {
  margin-top: 1.75rem;
}

.bulk-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.bulk-field-form {
  margin-top: 0.35rem;
}

.bulk-select {
  min-width: 240px;
}

.field-label {
  display: block;
  font-weight: 600;
}

.bulk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.bulk-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 12px 24px rgba(31, 29, 26, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bulk-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.bulk-title {
  margin: 0;
  font-size: 1.15rem;
}

.bulk-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.bulk-textarea {
  min-height: 180px;
}

.setlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.setlist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 12px 24px rgba(31, 29, 26, 0.08);
}

.setlist-card__header,
.setlist-item__title-row,
.performance-song__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.setlist-card__header h2,
.library-list__item h3,
.setlist-item__main h3,
.performance-song__header h2 {
  margin: 0;
}

.setlist-card__header p,
.setlist-card__notes,
.library-list__item p,
.setlist-item__main p,
.performance-song__header p,
.performance-header__meta {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.setlist-preview,
.setlist-items {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.setlist-preview li,
.library-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--border);
}

.setlist-preview li:first-child,
.library-list__item:first-child {
  border-top: 0;
  padding-top: 0;
}

.setlist-preview__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.setlist-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  gap: 1.5rem;
  margin-top: 2rem;
  align-items: start;
}

.setlist-items {
  display: grid;
  gap: 0.85rem;
}

.setlist-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.setlist-item__order {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 700;
  font-size: 1.05rem;
}

.setlist-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.library-list {
  margin-top: 1.25rem;
}

.performance-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
}

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

.performance-header__copy {
  min-width: 0;
}

.performance-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.performance-header__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.performance-setlist-toggle {
  display: none;
}

.performance-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 240px);
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.4rem 0 1rem;
  margin-bottom: 1rem;
}

.performance-strip.is-open {
  display: grid;
}

.performance-strip__item {
  display: grid;
  gap: 0.35rem;
  text-decoration: none;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(31, 29, 26, 0.08);
}

.performance-strip__item.is-active {
  border-color: var(--accent);
  background: #fff7ed;
}

.performance-strip__footer {
  display: none;
}

.performance-strip__count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.performance-strip__title {
  font-weight: 600;
}

.performance-song {
  position: relative;
  touch-action: pan-y;
}

.performance-mobile-summary,
.performance-mobile-nav {
  display: none;
}

.performance-nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.performance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.performance-panel {
  padding: 1rem;
}

.performance-chart-gallery .chord-image img {
  width: 100%;
  max-width: 100%;
  max-height: none;
  border-radius: 14px;
}

.performance-chords {
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  line-height: 1.8;
  min-height: 100%;
  padding: 1.25rem;
  overflow-x: auto;
}

.performance-panel .panel-header h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
}

.performance-chart-gallery {
  gap: 1.25rem;
}

.performance-chart-gallery__viewport {
  display: grid;
  gap: 1.25rem;
}

.performance-chart-gallery .chord-image {
  background: #fff;
  margin: 0;
}

.performance-chart-gallery .chord-image img {
  border-width: 0;
  box-shadow: 0 10px 28px rgba(31, 29, 26, 0.12);
}

.performance-chart-gallery__controls,
.performance-chart-gallery__dots {
  display: none;
}

.performance-chart-gallery__status {
  min-width: 4rem;
  text-align: center;
  font-weight: 700;
  color: var(--muted);
}

.performance-chart-gallery__dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  border: none;
  background: #cbd5e1;
  padding: 0;
}

.performance-chart-gallery__dot.is-active {
  background: var(--accent);
}

.button:disabled,
.button.is-disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 900px) {
  .setlist-layout,
  .performance-grid,
  .song-content,
  .form-shell {
    grid-template-columns: 1fr;
  }

  .performance-header,
  .page-hero,
  .song-hero,
  .performance-song__header {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 1.25rem 1rem 3rem;
  }

  .page-hero,
  .song-hero,
  .panel,
  .form-card {
    padding: 1.2rem;
    border-radius: 16px;
  }

  .topbar-inner {
    padding: 0.8rem 1rem;
    align-items: center;
    flex-wrap: wrap;
  }

  .topbar-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .topbar-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
  }

  .topbar-nav.is-open {
    display: flex;
  }

  .topbar-user {
    display: block;
    padding: 0.15rem 0;
  }

  .setlist-item {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 0.85rem;
  }

  .setlist-item__order {
    width: 44px;
    height: 44px;
  }

  .button {
    width: 100%;
  }

  .hero-actions,
  .song-hero-actions,
  .setlist-item__actions,
  .performance-nav,
  .topbar-nav {
    width: 100%;
  }

  .performance-strip {
    grid-auto-columns: minmax(150px, 76vw);
  }

  .performance-shell {
    padding: 0.9rem 0.75rem 6rem;
  }

  .performance-header {
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem 0 0.75rem;
    margin-bottom: 0.75rem;
    background: rgba(248, 250, 252, 0.96);
    backdrop-filter: blur(8px);
  }

  .performance-header h1 {
    font-size: 1.3rem;
    line-height: 1.2;
  }

  .performance-header__meta {
    font-size: 0.92rem;
  }

  .performance-header__actions {
    display: none;
  }

  .performance-setlist-toggle {
    display: inline-flex;
  }

  .performance-strip {
    display: none;
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 4.7rem;
    z-index: 30;
    max-height: min(60vh, 28rem);
    padding: 0.85rem;
    margin-bottom: 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    overflow-y: auto;
    overflow-x: hidden;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: 1fr;
  }

  .performance-strip__item {
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    box-shadow: none;
  }

  .performance-strip__footer {
    display: block;
    margin-top: 0.25rem;
  }

  .performance-mobile-summary {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.9rem;
  }

  .performance-mobile-summary__meta {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
  }

  .performance-mobile-summary h2 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.15;
  }

  .performance-mobile-summary p {
    margin: 0;
    color: var(--muted);
  }

  .performance-song__header {
    display: none;
  }

  .performance-panel {
    padding: 0.8rem 0.8rem 1rem;
  }

  .performance-chords {
    font-size: 1.3rem;
    line-height: 1.9;
    padding: 1rem 0.9rem;
  }

  .performance-chart-gallery {
    gap: 0.75rem;
  }

  .performance-chart-gallery__viewport {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pinch-zoom;
    scrollbar-width: none;
  }

  .performance-chart-gallery__viewport::-webkit-scrollbar {
    display: none;
  }

  .performance-chart-gallery__page {
    width: 100%;
    min-width: 100%;
    scroll-snap-align: start;
  }

  .performance-chart-gallery .chord-image img {
    width: 100%;
    max-width: 100%;
    max-height: none;
    border-radius: 12px;
    box-shadow: none;
  }

  .performance-chart-gallery__controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.75rem;
  }

  .performance-chart-gallery__nav {
    width: auto;
    min-width: 0;
  }

  .performance-chart-gallery__dots {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 0.7rem;
  }

  .performance-mobile-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 40;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(8px);
  }

  .performance-mobile-nav__button {
    width: 100%;
    min-width: 0;
  }
}

.bulk-attachments {
  display: grid;
  gap: 0.65rem;
}

.bulk-attachment-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.bulk-dropzone {
  padding: 1rem;
}

.bulk-dropzone .dropzone-title {
  font-size: 0.95rem;
}

.error-summary ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.admin-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .page-hero,
  .song-hero {
    flex-direction: column;
  }

  .search-meta {
    position: static;
    transform: none;
    display: block;
    margin-top: 0.5rem;
  }

  .form-shell {
    grid-template-columns: 1fr;
  }

  .form-aside {
    position: static;
  }

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

  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
