:root {
  --ink: #1d1a3d;
  --paper: #f3f2f9;
  --card: #ffffff;
  --accent: #e0245e;
  --accent-dark: color-mix(in srgb, var(--accent) 82%, #000);
  --on-accent: #fff;
  /* muted text and lines follow the text and background colors, so custom themes stay readable */
  --muted: color-mix(in srgb, var(--ink) 72%, var(--paper));
  --line: color-mix(in srgb, var(--ink) 14%, var(--paper));
  --base-size: 100%;
  --must: #ffb627;
  --dont: #c81d3a;
  --ok: #14866a;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: var(--base-size); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--body);
}
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: 0 1.1rem; border-radius: 999px;
  border: 1.5px solid var(--ink); background: transparent; font-weight: 600;
}
.btn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.small { min-height: 36px; padding: 0 .85rem; font-size: .9rem; }
.btn.danger { border-color: var(--dont); color: var(--dont); }
.btn.danger:hover { background: rgba(200, 29, 58, .08); }
.btn[disabled] { opacity: .55; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }

.field { display: grid; gap: .3rem; }
.field > span { font-weight: 600; font-size: .92rem; }
input[type=text], input[type=date], input[type=time], input[type=password], textarea, select {
  width: 100%; min-height: 46px; padding: .6rem .8rem;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
}
input[type=url] { width: 100%; min-height: 46px; padding: .6rem .8rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
::placeholder { color: var(--muted); opacity: 1; }
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(29, 26, 61, .15); }

/* ---------- client page ---------- */
.client .wrap { max-width: 640px; margin: 0 auto; padding: 1.25rem 1rem 6rem; }
.loading, .empty-page { padding: 4rem 1rem; text-align: center; color: var(--muted); }

.topline { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.5rem; }
.topline a { color: var(--ink); font-family: var(--display); font-weight: 700; text-decoration: none; }
.topline span { font-size: .9rem; color: var(--muted); }

.hero h1 { font-size: clamp(2rem, 8.5vw, 3rem); line-height: 1.02; font-weight: 700; text-wrap: balance; }
.hero .meta { margin-top: .6rem; color: var(--muted); }
.hero .meta p + p { margin-top: .1rem; }
.hero .intro { margin-top: 1rem; max-width: 52ch; }

.notice { margin-top: 1.1rem; padding: .8rem 1rem; border-radius: 12px; background: var(--card); border: 1.5px solid var(--line); }
.notice.locked { border-color: var(--dont); }
.notice strong { font-weight: 600; }

.who { margin-top: 1.25rem; padding: 1rem; border-radius: 14px; background: var(--ink); color: var(--paper); display: grid; gap: .5rem; }
.who label span { font-weight: 600; }
/* the box is dark, but the name field is light: keep typed text dark so it shows */
.who input { border-color: transparent; background: var(--card); color: var(--ink); }
.who small { color: color-mix(in srgb, var(--paper) 80%, var(--ink)); }

.tl { margin: 2rem 0 0; padding: 0; list-style: none; }
.slot { display: grid; grid-template-columns: 4.3rem 1fr; gap: .75rem; position: relative; padding-bottom: 1rem; }
.slot::before { content: ""; position: absolute; left: calc(4.3rem + .375rem - 1px); top: 0; bottom: 0; width: 2px; background: var(--line); }
.slot:first-child::before { top: 1.45rem; }
.slot:last-child::before { bottom: auto; height: 1.45rem; }
.slot:first-child:last-child::before { display: none; }
.slot::after { content: ""; position: absolute; left: calc(4.3rem + .375rem - 6px); top: 1.2rem; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--paper); }
.slot.must::after { background: var(--must); }
.slot.dont::after { background: var(--dont); }

.when { padding-top: 1.05rem; text-align: right; font-family: var(--display); font-weight: 700; font-size: 1rem; line-height: 1.2; white-space: nowrap; }
.when small { display: block; font-family: var(--body); font-weight: 500; font-size: .8rem; color: var(--muted); }
.when.any { font-family: var(--body); font-weight: 500; font-size: .85rem; color: var(--muted); }

details.sec { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; overflow: hidden; }
details.sec > summary { list-style: none; cursor: pointer; padding: 1rem 1rem .9rem; display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; align-items: center; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec h2 { font-size: 1.2rem; line-height: 1.15; font-weight: 700; }
.count { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.chev { grid-row: 1 / span 2; grid-column: 2; justify-self: end; width: 1.1rem; height: 1.1rem; transition: transform .15s; }
details[open] > summary .chev { transform: rotate(180deg); }
.sec .hint { grid-column: 1; font-size: .92rem; color: var(--muted); }
.sec-body { padding: 0 1rem 1rem; }
.sec.is-must { border-color: var(--must); }
.sec.is-dont { border-color: var(--dont); }

.songs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.song { display: grid; grid-template-columns: 3rem 1fr auto; gap: .75rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.art { width: 3rem; height: 3rem; border-radius: 6px; background: linear-gradient(135deg, #cfcbe8, #e9e7f5); object-fit: cover; display: block; }
.song .t { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.song .a { font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }
.song .by { font-size: .8rem; color: var(--muted); }
.tag { display: inline-block; margin-left: .35rem; padding: 0 .4rem; border-radius: 4px; background: var(--line); font-size: .72rem; font-weight: 600; vertical-align: middle; }
.empty-sec { padding: .9rem 0 .4rem; color: var(--muted); border-top: 1px solid var(--line); }

.sec-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; align-items: center; }
.note { margin-top: 1rem; display: grid; gap: .3rem; }
.note .status { font-size: .82rem; color: var(--ok); min-height: 1.1em; }
.note .link { justify-self: start; }

.footer { margin-top: 3rem; text-align: center; font-size: .85rem; color: var(--muted); }
.footer a { color: inherit; }

/* ---------- bottom sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(29, 26, 61, .55); z-index: 20; }
.sheet {
  position: fixed; z-index: 21; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(640px, 100%); max-height: 90vh; max-height: 90dvh; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--paper); border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 40px rgba(29, 26, 61, .35);
}
.sheet-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; padding: 1.1rem 1rem .6rem; }
.sheet-head h2 { font-size: 1.25rem; line-height: 1.15; }
.sheet-head p { font-size: .9rem; color: var(--muted); }
.x { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--ink) 8%, transparent); font-size: 1.4rem; line-height: 1; }
.search-row { display: flex; gap: .5rem; padding: 0 1rem .75rem; }
.search-row input { flex: 1; }
.results { overflow-y: auto; padding: 0 1rem 1rem; flex: 1; -webkit-overflow-scrolling: touch; }
.res { display: grid; grid-template-columns: 3rem 1fr auto; gap: .75rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.res .t { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.res .a { font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }
.msg { padding: 1rem 0; color: var(--muted); }
.msg.err { color: var(--dont); }
.manual { margin-top: 1rem; padding: 1rem; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); display: grid; gap: .75rem; }
.manual h3 { font-size: 1.05rem; }
.yt-found { display: grid; grid-template-columns: 7rem 1fr; gap: .75rem; align-items: start; }
.yt-thumb { width: 7rem; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--line); }
.yt-fields { display: grid; gap: .6rem; }
@media (max-width: 420px) { .yt-found { grid-template-columns: 1fr; } .yt-thumb { width: 100%; } }
a.tag.yt { background: #ff0033; color: #fff; text-decoration: none; }

#toasts { position: fixed; z-index: 40; left: 0; right: 0; top: 1rem; display: grid; justify-items: center; gap: .5rem; pointer-events: none; padding: 0 1rem; }
.toast { pointer-events: auto; background: var(--ink); color: var(--paper); padding: .7rem 1rem; border-radius: 12px; max-width: 28rem; box-shadow: 0 8px 24px rgba(29, 26, 61, .3); }
.toast.err { background: var(--dont); }

@media (min-width: 720px) {
  .client .wrap { padding-top: 2.5rem; }
  .sheet { bottom: 4vh; border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- song previews ---------- */
.preview-hint { font-size: .85rem; color: var(--muted); padding: .25rem 0 .4rem; }
.art-play { position: relative; padding: 0; border: 0; background: none; border-radius: 6px; width: 3rem; height: 3rem; display: block; }
.art-play .art { width: 100%; height: 100%; }
/* round play button over the cover; while playing it shows a stop square and a progress ring */
.art-play .pp {
  position: absolute; inset: 0; margin: auto; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p, 0) * 360deg), rgba(0, 0, 0, .55) 0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.art-play .pp::before {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: rgba(0, 0, 0, .6);
}
.art-play .pp::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%);
  border-style: solid; border-width: .38rem 0 .38rem .62rem; border-color: transparent transparent transparent #fff;
}
.art-play.playing .pp::after { transform: translate(-50%, -50%); width: .6rem; height: .6rem; border: 0; background: #fff; border-radius: 1px; }
.art-play.loading .pp::before { animation: pp-pulse 1s ease-in-out infinite; }
@keyframes pp-pulse { 50% { background: rgba(0, 0, 0, .3); } }
.art-play:hover .pp::before { background: rgba(0, 0, 0, .75); }
.res .store { display: inline-block; margin-top: .15rem; font-size: .78rem; font-weight: 600; color: var(--muted); text-underline-offset: 2px; }

/* ---------- announcements and details (MC plan) ---------- */
.plan-area { margin-top: 2.5rem; }
.area-h { font-size: 1.5rem; line-height: 1.1; margin-bottom: .35rem; }
.plan { display: grid; gap: .75rem; margin-top: 1rem; }
.plan-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.plan-item { display: grid; grid-template-columns: auto 1fr; gap: .4rem .75rem; align-items: start; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.plan-item:not(:has(.n)) { grid-template-columns: 1fr; }
.plan-item.editing { display: block; }
.plan-item .n { font-family: var(--display); font-weight: 700; color: var(--accent); min-width: 1.3rem; text-align: right; line-height: 1.4; }
.plan-text .t { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.plan-text .a { font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }
.plan-text .contact { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.plan-text .contact a { color: var(--ink); }
.plan-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; }
.plan-item:has(.n) .plan-actions { grid-column: 2; }
.btn.icon { width: 36px; padding: 0; font-size: 1rem; }
.plan-form { display: grid; gap: .7rem; grid-template-columns: 1fr; padding: .5rem 0 .25rem; }
.plan-form .field small { font-weight: 400; }
@media (min-width: 560px) { .plan-form { grid-template-columns: 1fr 1fr; } .plan-form .wide { grid-column: 1 / -1; } }
input[type=tel], input[type=email] { width: 100%; min-height: 46px; padding: .6rem .8rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }

.song-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.mv { display: inline-flex; gap: .25rem; }

/* ---------- playlist import ---------- */
.imp-paste summary { cursor: pointer; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; width: fit-content; }
.imp-head { margin-top: .5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; }
.imp-head span { font-weight: 600; }
.imp-list { list-style: none; margin: .5rem 0 .75rem; padding: 0; max-height: 18rem; overflow-y: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.imp-list label { display: grid; grid-template-columns: auto 2.25rem 1fr; gap: .6rem; align-items: center; padding: .4rem 0; cursor: pointer; }
.imp-list input { width: 20px; height: 20px; accent-color: var(--accent); }
.imp-list .art { width: 2.25rem; height: 2.25rem; }
.imp-list .t { display: block; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.imp-list .a { display: block; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- guest request page ---------- */
.guest .search-row.g-search { padding: 0; margin-top: 1.25rem; }
.guest .search-row input[type=search] { width: 100%; min-height: 46px; padding: .6rem .8rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.g-results { padding: 0; overflow: visible; }
.g-confirm { margin: .5rem 0 1rem; }
.g-picked { display: flex; gap: .75rem; align-items: center; }
.g-picked .t { font-weight: 600; }
.g-picked .a { font-size: .9rem; color: var(--muted); }
.g-mine { margin-top: 2rem; }
.g-mine h2 { font-size: 1.25rem; margin-bottom: .5rem; }
.g-status { font-size: .8rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: var(--line); white-space: nowrap; }
.g-status.is-played { background: #d5f1e8; color: #0b5c46; }

/* ---------- planning questions ---------- */
.q-cards { margin-top: .75rem; }
.q-foot { min-height: 1.2em; text-align: right; }
.q-status { font-size: .82rem; color: var(--ok); }
.q-grid { display: grid; gap: .8rem; padding-top: .25rem; }
@media (min-width: 560px) { .q-grid:not(.q-list) { grid-template-columns: 1fr 1fr; } .q-grid .wide, .q-grid .q-row.wide { grid-column: 1 / -1; } }
.q-list { gap: 0; border-top: 1px solid var(--line); }
.q-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .75rem; }
.q-list .q-row, .q-list .q-moment { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.q-label { font-weight: 600; font-size: .95rem; }
.q-grid:not(.q-list) .q-row { display: grid; justify-content: stretch; gap: .3rem; }
.q-grid:not(.q-list) .q-label { font-size: .92rem; }
.pills { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.pill { min-height: 36px; padding: 0 .8rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: .88rem; }
.pill.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pill[disabled] { opacity: .7; cursor: default; }
.q-check { display: flex; gap: .6rem; align-items: center; font-weight: 600; cursor: pointer; }
.q-check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.q-moment-extra { display: grid; gap: .4rem; margin: .5rem 0 .2rem 1.9rem; }
.q-moment-extra:empty { display: none; }
.q-moment-extra input { min-height: 40px; }
.q-ro { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.q-ro .a { color: var(--muted); font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; }

.time-edit { margin-top: .75rem; }
.time-form { display: grid; gap: .5rem; max-width: 18rem; }
