/*
 * livekaraoke layout, skinned with the 2222 theme pack (/theme/theme.css, copied from
 * apps/2222/app/static/theme). Component names follow groupchat and 2222 (.card rows with
 * when/where/what, .list-label, .actionbar with one accent button, grain <dialog> sheets,
 * italic status words) so the tools read as siblings.
 */

* { box-sizing: border-box; }
body {
  margin: 0;
  font-size: 16px;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
html { touch-action: manipulation; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

header, main, footer { width: min(560px, calc(100% - 32px)); margin: 0 auto; }
header { height: 60px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--veil-2); }
.wordmark { color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 600; letter-spacing: -.3px; font-style: italic; }
header .quiet { padding: 7px 14px; font-size: 15px; border-radius: var(--r-pill); }
main { min-height: 60vh; padding-top: 24px; }
footer { padding: 32px 0 24px; }
footer p { margin: 0; font-size: 13px; color: var(--ink-4); font-style: italic; }
footer a { color: var(--ink-3); }

h1 { font-size: 30px; line-height: 1.15; font-weight: 400; letter-spacing: -.5px; margin: 0 0 14px; font-style: italic; overflow-wrap: anywhere; }
h2 { font-size: 22px; line-height: 1.3; font-weight: 500; letter-spacing: -.3px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.lede { color: var(--ink-2); font-size: 18px; }
.lede a { color: inherit; }
.muted { color: var(--muted); font-size: 15px; }
.fine { color: var(--ink-3); font-size: 13px; font-style: italic; }
.fine a { color: var(--ink-2); }
.empty { padding: 18px 2px; color: var(--muted); font-style: italic; font-size: 16px; }
.back { margin-top: 28px; font-size: 15px; }
.back a { color: var(--ink-2); }
.more { text-align: center; margin: 18px 0 0; }
.error { color: var(--danger); font-size: 14px; white-space: pre-line; margin: 10px 0 0; }
.error:empty { display: none; }

/* ---------- buttons (2222: cream primary, quiet outline, accent for the one big action) ---------- */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--r-sm); background: var(--cream); color: var(--ground-1);
  padding: 11px 16px; font-weight: 500; cursor: pointer; text-decoration: none; line-height: 1.2;
}
button:hover, .button:hover { background: var(--cream-bright); }
button:disabled { opacity: .45; cursor: default; }
.quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--veil-3); font-weight: 400; }
.quiet:hover { background: var(--veil-2); }
.linkbtn { background: transparent; box-shadow: none; color: var(--muted); font-size: 15px; font-weight: 300; padding: 6px 2px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--veil-3); }
.linkbtn:hover { background: transparent; color: var(--ink); }
.close { background: transparent !important; box-shadow: none !important; color: var(--muted); font-size: 28px; line-height: 1; padding: 0 4px; font-weight: 300; }
.block { width: 100%; min-height: 56px; font-size: 19px; border-radius: var(--r-pill); }

/* ---------- find a song ---------- */
.find { margin: 0 0 6px; }
.find input, .filter {
  width: 100%; padding: 15px 18px; font-size: 20px; border-radius: var(--r-pill);
  background: var(--veil-2); border: 1px solid var(--veil-3); color: var(--ink); -webkit-appearance: none; appearance: none;
}
.find input::placeholder, .filter::placeholder { color: var(--ink-3); font-style: italic; }
.find input:focus, .filter:focus { outline: none; border-color: var(--veil-4); background: var(--veil-1); }
.find-note { margin: 8px 4px 0; }
.filter { font-size: 18px; padding: 12px 16px; margin: 4px 0 6px; }
body.searching #nights { display: none; }

/* ---------- list label + rows (2222's night card: WHEN / WHERE / WHAT) ---------- */
.list-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 24px 0 8px; margin: 0; font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; line-height: 1.3; }
.list-label b { font-weight: 500; color: var(--ink-2); font-style: italic; font-size: 17px; }
.list { border-top: 1px solid var(--veil-2); }
.card {
  display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 14px; row-gap: 2px;
  padding: 15px 2px; border-bottom: 1px solid var(--veil-2); color: inherit; text-decoration: none;
}
.card.tap { cursor: pointer; }
.card.tap:hover { background: var(--veil-1); }
.card.tap:active { background: var(--veil-2); }
.card > .when, .card > .where, .card > .what { grid-column: 1; min-width: 0; }
.card > .chev { grid-column: 2; grid-row: 1 / 4; align-self: center; color: var(--ink-4); font-size: 24px; line-height: 1; }
.card.tap:hover > .chev { color: var(--accent); }
.when { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 15px; color: var(--muted); }
.when-date { color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.when-window { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.when-dot { color: var(--ink-4); }
.chip { margin-left: auto; font-size: 14px; font-style: italic; color: var(--ink-3); white-space: nowrap; border: 0; background: transparent; padding: 0; border-radius: 0; }
.chip.warn { color: var(--accent); }
.where { display: block; font-weight: 500; font-size: 21px; line-height: 1.25; letter-spacing: -.2px; margin: 0; color: var(--ink); overflow-wrap: anywhere; text-decoration: none; }
.what { display: block; font-size: 16px; line-height: 1.4; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.card.off .where, .card.off .when-window { text-decoration: line-through; text-decoration-color: var(--ink-4); color: var(--ink-3); }

/* ---------- song search results ---------- */
.hit { padding: 14px 2px 12px; border-bottom: 1px solid var(--veil-2); }
.hit .where { font-size: 20px; }
.who { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.who li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 16px; }
.who .band { color: var(--ink); font-weight: 500; text-decoration: none; }
.who .band::after { content: ' ›'; color: var(--ink-4); }
.who .next { color: var(--accent); text-decoration: none; font-style: italic; }
.who .next:hover { text-decoration: underline; }
.who .none { color: var(--ink-4); }

/* ---------- a band's songs ---------- */
.songs-label { margin-top: 8px; }
.songs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--veil-2); }
.songs li { padding: 10px 2px; border-bottom: 1px solid var(--veil-2); font-size: 18px; line-height: 1.35; }
.songs .t { color: var(--ink); }
.songs .a { color: var(--muted); font-size: 15px; }
.songs .a::before { content: '· '; color: var(--ink-4); }
.songs .new { font-size: 13px; font-style: italic; color: var(--accent); }

/* ---------- one night (page and sheet) ---------- */
.night .eyebrow { font-size: 15px; font-style: italic; color: var(--ink-2); margin: 0 0 4px; }
.night-title { font-size: 30px; font-weight: 500; line-height: 1.15; margin: 0 0 4px; }
.night-where { color: var(--muted); font-size: 17px; margin: 0 0 14px; }
.night-time { font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; margin: 0 0 6px; }
.night-time.off { text-decoration: line-through; color: var(--ink-3); }
.night-status { font-style: italic; color: var(--ink-2); font-size: 17px; }
.night-status.warn { color: var(--accent); }
.night-note { color: var(--ink-2); font-size: 17px; }
.band-link { margin: 16px 0 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.actions .button, .actions button { border-radius: var(--r-pill); padding: 11px 18px; font-size: 16px; }
.listed { margin-top: 14px; }

/* ---------- calendar ---------- */
.subscribe { display: grid; gap: 10px; margin: 22px 0 14px; }
.primary-soft { background: var(--accent); color: var(--ground-0); }
.primary-soft:hover { background: var(--accent); filter: brightness(1.07); }
.seg { display: inline-flex; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--veil-3); padding: 3px; margin: 6px 0 0; }
.seg a { padding: 8px 16px; border-radius: var(--r-pill); color: var(--ink-2); text-decoration: none; font-size: 15px; }
.seg a.on { background: var(--veil-2); color: var(--ink); }
.copied { box-shadow: inset 0 0 0 1px var(--accent) !important; color: var(--accent) !important; }

/* ---------- sources ---------- */
.card.source { grid-template-columns: 1fr; }
.card.source .where { font-size: 18px; }
.card.source .what.fine { font-size: 13px; }
.source-actions { display: flex; gap: 16px; margin-top: 6px; }
.source-actions .linkbtn { font-size: 14px; padding: 4px 0; }

/* ---------- forms (import) ---------- */
.login { max-width: 420px; margin: 8px 0 32px; }
.login.wide { max-width: none; display: grid; gap: 4px; }
label { display: block; font-size: 15px; margin: 16px 0 7px; color: var(--ink-2); }
label.check { display: flex; gap: 10px; align-items: center; margin: 10px 0 0; }
label.check input { width: auto; }
.login input, .login textarea, .login select {
  width: 100%; padding: 13px 15px; font-size: 18px;
  background: var(--veil-2); border: 1px solid var(--veil-3); border-radius: var(--r-sm); color: var(--ink);
}
.login input[type=file] { padding: 10px; font-size: 15px; }
.login textarea { resize: vertical; min-height: 96px; line-height: 1.4; }
.login button[type=submit] { margin-top: 18px; }
#newBand { margin-top: 8px; }
.preview-list { list-style: none; margin: 8px 0 14px; padding: 0; border-top: 1px solid var(--veil-2); max-height: 50vh; overflow: auto; }
.preview-list li { padding: 8px 2px; border-bottom: 1px solid var(--veil-2); font-size: 16px; }
.preview-list .a { color: var(--muted); }

/* ---------- privacy ---------- */
.policy h2 { margin-top: 28px; }
.policy p { font-size: 17px; color: var(--ink-2); }

/* ---------- pinned action bar ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--grain), linear-gradient(180deg, var(--ground-2), var(--ground-1));
  border-top: 1px solid var(--veil-3); box-shadow: 0 -10px 30px #0006;
}
.bar-inner { width: min(560px, 100%); margin: 0 auto; display: flex; gap: 8px; }
.actionbar .primary { flex: 1; background: var(--accent); color: var(--ground-0); border-radius: var(--r-pill); font-size: 19px; min-height: 56px; padding: 14px 16px; }
.actionbar .primary:hover { background: var(--accent); filter: brightness(1.07); }
body.with-bar footer { padding-bottom: 120px; }
body.searching .actionbar { display: none; }

/* ---------- sheets (raised grain dialogs) ---------- */
dialog {
  color: var(--ink); width: min(480px, calc(100% - 24px)); max-height: 90dvh; overflow: auto; padding: 18px 22px 24px;
  background: var(--ground-2); background-image: var(--grain), linear-gradient(180deg, var(--ground-3), var(--ground-2));
  border: 1px solid var(--veil-3); border-radius: var(--r-lg); box-shadow: 0 24px 80px #0007;
}
dialog::backdrop { background: #000a; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: -6px; }
dialog .night-title { font-size: 26px; }

@media (max-width: 400px) {
  h1 { font-size: 27px; }
  .where { font-size: 19px; }
}

/* ---------- pictures (scripts/heroes.mjs) ---------- */
.card.pics { grid-template-columns: auto 1fr auto; }
.card.pics > .thumb { grid-column: 1; grid-row: 1 / 4; align-self: center; }
.card.pics > .when, .card.pics > .where, .card.pics > .what { grid-column: 2; }
.card.pics > .chev { grid-column: 3; }
.thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; display: block; background: var(--ground-4); box-shadow: inset 0 0 0 .8px var(--veil-3); }
.thumb.none { display: grid; place-items: center; color: var(--ink-3); font-style: italic; font-size: 17px; font-weight: 500; letter-spacing: .02em; }
.banner { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-md); margin: 0 0 18px; box-shadow: 0 2px 12px #0006; background: var(--ground-3); }
.banner.top { object-position: top; }
dialog .banner { margin-top: 10px; }

/* ---------- good to know ---------- */
.know { list-style: none; margin: 10px 0 4px; padding: 0; display: grid; gap: 6px; }
.know li { position: relative; padding-left: 18px; font-size: 17px; line-height: 1.4; color: var(--ink-2); }
.know li::before { content: '·'; position: absolute; left: 4px; color: var(--accent); font-weight: 700; }

/* ---------- calling the venue, and where they post ---------- */
.night-check { font-size: 17px; color: var(--ink-2); margin: 12px 0 4px; }
.night-check a { color: var(--ink); white-space: nowrap; }
.social { font-size: 15px; color: var(--muted); margin: 6px 0 0; }
.social a { color: var(--ink-2); }
