:root {
  color-scheme: light;
  --ink: #251733;
  --muted: #755f87;
  --line: #dfcdef;
  --panel: #fffaff;
  --page: #f3e8ff;
  --gold: #ffd236;
  --magenta: #d83a90;
  --accent: #9143aa;
  --shadow: 0 16px 40px rgba(37, 23, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
}

button,
input {
  font: inherit;
}

.name-dialog {
  width: min(calc(100% - 32px), 380px);
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.name-dialog::backdrop {
  background: rgba(37, 23, 51, 0.6);
  backdrop-filter: blur(3px);
}

.name-dialog__panel {
  display: grid;
  gap: 10px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid rgba(37, 23, 51, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.name-dialog h2 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.name-dialog__label {
  margin-top: 4px;
  color: #342044;
  font-size: 0.9rem;
  font-weight: 800;
}

.name-dialog input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
}

.name-dialog input:focus {
  border-color: rgba(216, 58, 144, 0.78);
  box-shadow: 0 0 0 4px rgba(216, 58, 144, 0.14);
}

.name-dialog__error {
  margin: 0;
  color: #b4233a;
  font-size: 0.86rem;
  font-weight: 800;
}

.name-dialog__submit {
  display: inline-grid;
  place-items: center;
  min-height: 48px;
  padding: 0 16px;
  color: #ffffff;
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 900;
  cursor: pointer;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.name-dialog__submit:focus-visible,
.name-dialog__submit:hover {
  background: var(--magenta);
  outline: 0;
}

.instagram-dialog {
  width: min(calc(100% - 28px), 520px);
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.instagram-dialog::backdrop {
  background: rgba(37, 23, 51, 0.72);
  backdrop-filter: blur(4px);
}

.instagram-dialog__panel {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 34px 24px 24px;
  overflow: hidden;
  text-align: center;
  background: #fffaff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 6px 7px 0 var(--ink), var(--shadow);
}

.instagram-dialog__panel::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--gold), var(--magenta), var(--accent));
  content: "";
}

.instagram-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ink);
  background: #ead9fb;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.instagram-dialog__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.instagram-dialog__close:hover {
  color: var(--ink);
  background: #dfcdef;
  outline: 0;
}

.instagram-dialog__close:focus-visible {
  color: var(--ink);
  background: #ead9fb;
  outline: 2px solid rgba(145, 67, 170, 0.42);
  outline-offset: 2px;
}

.instagram-dialog__eyebrow {
  margin: 8px 0 -8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.instagram-dialog h2 {
  margin: 0;
  padding: 0 36px;
  font-size: 1.85rem;
  line-height: 1.04;
  letter-spacing: 0;
}

.instagram-dialog__copy {
  max-width: 420px;
  margin: 0 auto;
  color: #342044;
  font-size: 1.04rem;
  font-weight: 700;
}

.instagram-dialog__follow {
  display: inline-grid;
  place-items: center;
  min-height: 58px;
  margin-top: 2px;
  padding: 0 22px;
  color: #ffffff;
  background: var(--ink);
  border-radius: 8px;
  font-size: 1.08rem;
  font-weight: 950;
  text-decoration: none;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.instagram-dialog__follow:focus-visible,
.instagram-dialog__follow:hover {
  background: var(--magenta);
  outline: 0;
}

.app-shell {
  width: min(100%, 840px);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}

.hero {
  display: grid;
  place-items: center;
  min-height: 214px;
  padding: 10px 0 2px;
  overflow: visible;
  text-align: center;
}

.hero__label {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1 {
  margin: 0;
}

.hero__logo {
  display: block;
  width: min(62vw, 226px);
  height: auto;
  margin: 0 auto;
}

.search-panel {
  position: sticky;
  top: 54px;
  z-index: 40;
  margin: 0 0 14px;
  padding: 8px 0;
  background: var(--page);
}

.search-box {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  min-height: 60px;
  padding: 0 10px 0 18px;
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 4px 5px 0 var(--ink), 0 14px 32px rgba(37, 23, 51, 0.14);
}

.search-box:focus-within {
  border-color: var(--magenta);
  box-shadow: 4px 5px 0 var(--magenta), 0 0 0 4px rgba(216, 58, 144, 0.22);
}

.search-box__icon {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
}

.search-box__icon::after {
  position: absolute;
  right: -6px;
  bottom: -5px;
  width: 9px;
  height: 2.5px;
  background: var(--ink);
  border-radius: 2px;
  content: "";
  transform: rotate(45deg);
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 56px;
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 1.02rem;
  font-weight: 600;
}

.search-box input::placeholder {
  color: #816c92;
  font-weight: 600;
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.clear-button {
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: #ead9fb;
  border: 0;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 800;
}

.guest-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--panel);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 4px 14px rgba(37, 23, 51, 0.14);
}

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

.guest-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 840px);
  min-height: 52px;
  margin: 0 auto;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
}

.guest-summary__details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-width: 0;
  font-size: 0.94rem;
  font-weight: 900;
}

.guest-summary__name,
.guest-summary__table {
  min-width: 0;
  overflow-wrap: anywhere;
}

.guest-summary__table {
  color: var(--muted);
}

.guest-summary__edit {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ink);
  background: #ead9fb;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.guest-summary__edit svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.guest-summary__edit:focus-visible,
.guest-summary__edit:hover {
  color: #ffffff;
  background: var(--magenta);
  outline: 0;
}

.rules-section {
  margin: 14px 0 0;
  padding: 0;
  background: transparent;
}

.rules-section h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.rules-copy {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  color: #342044;
  font-size: 0.96rem;
}

.rules-copy p {
  margin: 0;
}

.rules-copy__instagram {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: var(--accent);
  font-weight: 900;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.rules-copy__instagram svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.rules-copy strong {
  color: var(--ink);
  font-size: 0.9rem;
  letter-spacing: 0;
}

.songs-section {
  margin-top: 18px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: 0;
}

#resultCount {
  flex: 0 0 auto;
  margin: 0 0 1px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}

.song-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.song-list:not(:empty) {
  min-height: 100vh;
  min-height: 100dvh;
}

.song-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 12px;
  background: rgba(255, 250, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(37, 23, 51, 0.08);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.song-card:hover {
  border-color: rgba(216, 58, 144, 0.5);
  box-shadow: 0 14px 34px rgba(37, 23, 51, 0.12);
}

.song-card__number {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--magenta));
  border: 1px solid rgba(37, 23, 51, 0.18);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

.song-card__body {
  min-width: 0;
}

.song-card h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.song-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.book-button {
  display: inline-grid;
  place-items: center;
  min-width: 72px;
  min-height: 46px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--ink);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.book-button:focus-visible {
  background: var(--magenta);
  outline: 0;
}

@media (hover: hover) and (pointer: fine) {
  .book-button:hover {
    background: var(--magenta);
  }
}

.book-button:active,
.clear-button:active,
.guest-summary__edit:active,
.instagram-dialog__close:active,
.instagram-dialog__follow:active,
.name-dialog__submit:active {
  transform: translateY(1px);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 55vh;
  margin: 32px 0;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.empty-state[hidden] {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .song-card:hover {
    transform: translateY(-1px);
  }
}

@media (max-width: 760px) {
  .hero__logo {
    width: min(66vw, 210px);
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .hero {
    min-height: 188px;
  }

  .hero__label {
    margin-bottom: 2px;
  }

  .hero__logo {
    width: min(68vw, 188px);
  }

  .search-panel {
    margin-bottom: 12px;
  }

  .rules-section {
    margin-right: 0;
    margin-left: 0;
  }

  .section-heading {
    align-items: start;
  }

  .song-card {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    min-height: 96px;
  }

  .song-card__number {
    width: 44px;
    height: 44px;
    font-size: 0.72rem;
  }

  .song-card h3 {
    font-size: 1rem;
  }

  .book-button {
    grid-column: 2;
    width: 100%;
    min-height: 42px;
  }

  .instagram-dialog__panel {
    gap: 14px;
    padding: 32px 18px 20px;
  }

  .instagram-dialog h2 {
    padding: 0 32px;
    font-size: 1.55rem;
  }

  .instagram-dialog__copy {
    font-size: 0.98rem;
  }
}

@media (max-width: 380px) {
  .search-box {
    grid-template-columns: 20px 1fr;
  }

  .clear-button {
    grid-column: 1 / -1;
    margin: 0 0 8px;
  }
}
