:root {
  --bg: #0b1026;
  --bg-2: #141b3a;
  --panel: rgba(20, 27, 58, 0.85);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4efe6;
  --muted: #9aa0b8;
  --donut: #d7263d;
  --gold: #f2b134;
  --trey: #ff6b35;
  --mike: #3dd6a3;
  --page: #a66cff;
  --fish: #d7263d;
  --vox: #f2b134;
  --horns: #4cc9f0;
  --flute: #c3f06b;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: radial-gradient(1200px 600px at 50% -10%, var(--bg-2), var(--bg) 70%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  padding: 16px;
  overflow-x: hidden;
}

/* Backdrop: the Fishman-dress donut field, each ring in one of the five stem colors
   with a faint outer halo, at uniform strength. The tile holds one ring per color
   (320px = 5 x 64px). */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.07;
  background: url(bg-rings.svg) 0 0 / 320px 64px repeat;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.show { text-align: center; padding-top: 12px; }
.logo {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: -8px;
  color: var(--text);
  text-decoration: none;
}
.logo-mark { width: 44px; height: 28px; }
.logo-text {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
}
h1 {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 700;
  font-size: clamp(40px, 8vw, 76px);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 6px 0 8px;
  color: var(--text);
  text-shadow: 0 0 24px rgba(242, 177, 52, 0.25);
}
/* The title is the song picker; it turns gold under the pointer. */
.song-pick {
  display: inline-block;
  padding: 0 0.1em;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-shadow: inherit;
  cursor: pointer;
  border-radius: 12px;
  transition: color 0.15s;
}
.song-pick:hover { color: var(--gold); }
.song-pick:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.song-row:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* Under the venue: the next song, which one tap plays, and the full list.
   Both say there are more songs; the row is the way to them. */
.upnext[hidden] { display: none; }
.upnext {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.upnext-song, .upnext-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font: 600 14px Inter, sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.upnext-song:hover, .upnext-all:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }
.upnext-song:focus-visible, .upnext-all:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.upnext-kicker { font-size: 11px; font-weight: 600; color: var(--gold); text-transform: uppercase; letter-spacing: 0.12em; margin-right: 2px; }
.upnext-band { color: var(--muted); font-weight: 400; }
.upnext-band::before { content: "·"; margin-right: 6px; }
.upnext .chevron { width: 16px; height: 16px; }
.upnext-all { border-color: var(--gold); color: var(--gold); background: rgba(242, 177, 52, 0.12); }
.upnext-all:hover { background: var(--gold); color: #1a1200; border-color: var(--gold); }
.venue { color: var(--muted); font-size: 14px; }
.venue .source { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.venue .source:hover { color: var(--gold); }

.song {
  font: 600 13px Inter, sans-serif;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
}
.song:hover { background: rgba(255,255,255,0.12); }
.song.on { background: var(--gold); border-color: var(--gold); color: #1a1200; }
.song small { opacity: 0.7; font-weight: 400; margin-left: 6px; }

/* Guides for this song: a labeled row of chips in the song-list style. */
.guides {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.guides:empty { display: none; }
.guides-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-right: 4px;
}

.loading { text-align: center; color: var(--muted); font-size: 14px; }
.loading-bar {
  margin: 10px auto 0;
  max-width: 420px;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.loading-fill { height: 100%; width: 0%; background: var(--gold); transition: width 0.15s; }

/* Mixer */
.mixer[hidden] { display: none; }
.mixer {
  display: grid;
  grid-template-columns: repeat(var(--stems, 5), minmax(0, 1fr)); /* --stems set per song */
  gap: 12px;
}
/* Seven strips (a band with horns and flute) share the same width, so each
   is about 138px; the names stay on one line by wrapping as needed. */
.strip .who { text-align: center; }

.strip {
  --c: var(--gold);
  container-type: inline-size;
  background: var(--panel);
  border: 2px solid var(--c);
  border-radius: 12px;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: opacity 0.15s;
}
.strip.inactive { opacity: 0.45; }

.strip .who {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 700;
  font-size: 23px;
  letter-spacing: -0.02em;
  color: var(--c);
  line-height: 1;
}
.strip .inst {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.meter-fader {
  display: flex;
  gap: 10px;
  align-items: stretch;
  height: 180px;
}
.meter {
  width: 10px;
  background: rgba(0,0,0,0.4);
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.meter-fill {
  width: 100%;
  height: var(--lvl, 0%);
  background: linear-gradient(to top, var(--c), var(--gold) 80%, var(--donut));
  transition: height 0.05s linear, width 0.05s linear;
}

/* Vertical fader: rotate a horizontal range */
.fader-wrap { width: 32px; position: relative; }
.fader {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180px;
  height: 32px;
  margin: 0;
  transform: translate(-50%, -50%) rotate(-90deg);
  background: transparent;
  cursor: pointer;
}
.fader::-webkit-slider-runnable-track {
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}
.fader::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 28px;
  margin-top: -11px;
  border-radius: 4px;
  background: var(--c);
  border: 2px solid var(--bg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.fader::-moz-range-track { height: 6px; background: rgba(255,255,255,0.15); border-radius: 3px; }
.fader::-moz-range-thumb {
  width: 18px; height: 28px; border-radius: 4px;
  background: var(--c); border: 2px solid var(--bg);
}

.buttons { display: flex; gap: 8px; }
.btn {
  font: 700 13px Inter, sans-serif;
  letter-spacing: 0.05em;
  min-width: 44px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
}
.btn:hover { background: rgba(255,255,255,0.12); }
.btn.mute.on { background: var(--donut); border-color: var(--donut); color: #fff; }
.btn.solo.on { background: var(--gold); border-color: var(--gold); color: #1a1200; }
/* M / S become Mute / Solo once the strip is wide enough to hold the words.
   The two labeled buttons plus their gap come to about 126px; the query is
   against the strip's content box, which is 170px at the full 1040px app
   width and shrinks with the window. */
.btn .long { display: none; }
@container (min-width: 130px) {
  .btn .short { display: none; }
  .btn .long { display: inline; }
}

/* Small viewports: everything is squeezed so the mixer and Play fit above
   the fold without scrolling. Each stem is one compact row (name, instrument,
   M / S) with the meter as a thin bar along the strip's bottom edge; faders
   are dropped. The transport is fixed to the bottom of the screen, and the
   app is padded so the footer can still scroll out from under it. */
@media (max-width: 720px) {
  .app { gap: 12px; padding-bottom: 92px; }
  .help > span { display: none; } /* keyboard shortcuts mean nothing on a touch screen */
  /* Everything else in the header is centered, and the phone gap is tight,
     so the logo joins the centered column and keeps clear of the title. */
  .logo { align-self: center; margin-bottom: 0; }
  .show { padding-top: 0; }
  h1 { margin: 0 0 4px; }
  .mixer { grid-template-columns: 1fr; gap: 6px; }
  .strip {
    position: relative;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 7px 10px 10px 12px;
  }
  .strip .who { font-size: 20px; }
  .strip .inst { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fader-wrap { display: none; }
  .meter-fader {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 3px;
    height: 3px;
  }
  .meter {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    border-radius: 2px;
  }
  .meter-fill {
    height: 100%;
    width: var(--lvl, 0%);
    background: linear-gradient(to right, var(--c), var(--gold) 80%, var(--donut));
  }
}

/* Guide panel: the current note up top, the list of tips beneath. */
.guide[hidden] { display: none; }
.guide {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.guide-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.guide-kicker {
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.guide-title {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 18px;
  flex: 1 0 auto; /* never squeezed; on a phone the controls wrap below */
}
.guide-by { color: inherit; }
a.guide-by { text-decoration: underline; text-underline-offset: 3px; }
a.guide-by:hover { color: var(--gold); }
/* Edit and Contribute keep the spot beside the close button, which takes it when both are hidden. */
.btn.guide-edit { margin-left: auto; }
.btn.guide-edit[hidden] + .btn.guide-offer { margin-left: auto; }
.btn.guide-edit[hidden] + .btn.guide-offer[hidden] + .btn.guide-close { margin-left: auto; }
.btn.guide-offer { border-color: var(--gold); color: var(--gold); }
.btn.guide-offer:hover { background: var(--gold); color: #1a1200; }
.btn.guide-close {
  min-width: 34px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
}
.guide-status { margin: 0; color: var(--muted); font-size: 14px; }
.guide-status.error { color: var(--donut); }
.guide-status .inline-icon { width: 15px; height: 15px; vertical-align: -3px; }
.guide-status[hidden] { display: none; }
.guide-head .btn[hidden] { display: none; }

/* Writing a guide. The tip list is one compact line per tip: handle, mix,
   start (and a quiet optional end), then edit / play / delete, with the
   first line of the note beneath. */
.edit-row input[type="text"], .times input, .edit-note {
  min-width: 0;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font: 16px Inter, sans-serif; /* 16px: below that, iOS Safari zooms the page when the field is focused */
}
.times input:focus, .edit-note:focus { outline: 1px solid var(--gold); }
.guide.editing .guide-tips { max-height: 60vh; }
.icon {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.icon svg { width: 16px; height: 16px; }
.icon:hover { background: rgba(255,255,255,0.12); }
li.looping .icon.loop { background: var(--gold); border-color: var(--gold); color: #1a1200; }
.mini {
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font: 600 12px Inter, sans-serif;
  cursor: pointer;
}
.mini:hover { background: rgba(255,255,255,0.12); }
.edit-note { width: 100%; resize: vertical; line-height: 1.4; }
.song.chip.new { background: none; border-style: dashed; color: var(--muted); }
.song.chip.new:hover { color: var(--text); }
.handle {
  cursor: grab;
  color: var(--muted);
  font-size: 16px;
  letter-spacing: -4px;
  padding: 0 4px 0 0;
  user-select: none;
  touch-action: none;
}
.guide-tips li.dragging { opacity: 0.6; background: rgba(242, 177, 52, 0.12); }
.guide-tips li.dragging .handle { cursor: grabbing; }

/* Editing one tip: the list and mixer step aside for its times and note. */
.guide.tip-editing .guide-tips { max-height: none; overflow: visible; }
.guide-tips li.tip-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0;
  color: var(--text);
}
/* Start and End sit in one grid so their values and Set buttons line up. */
.tip-editor .times {
  display: grid;
  grid-template-columns: max-content max-content max-content max-content;
  justify-content: start;
  align-items: center;
  gap: 8px 10px;
  font-size: 14px;
}
.tip-editor .time-row { display: contents; }
.tip-editor .time-row .time-label { grid-column: 1; } /* each row starts at the label */
.tip-editor .scrub-hint { grid-column: 1 / -1; }
.tip-editor .time-row.opt .time-label { color: var(--muted); }
.tip-editor .time-value { font-variant-numeric: tabular-nums; min-width: 3.5em; font-size: 16px; }
.tip-editor .time-value.unset { color: var(--muted); }
.tip-editor .clear-to:disabled { opacity: 0.35; cursor: default; }
.tip-editor .mini.quiet { color: var(--muted); }
.tip-editor .scrub-hint { font-size: 12px; color: var(--muted); }
.marks i.editing { opacity: 1; background: var(--gold); box-shadow: 0 0 6px rgba(242, 177, 52, 0.7); }
.tip-editor .actions { display: flex; gap: 8px; align-items: center; }
.tip-editor .btn.save { background: var(--gold); border-color: var(--gold); color: #1a1200; }
.tip-editor .btn.loop { display: inline-flex; align-items: center; gap: 6px; }
.tip-editor .btn.loop svg { width: 14px; height: 14px; fill: currentColor; }
.tip-editor.looping .btn.loop { background: var(--gold); border-color: var(--gold); color: #1a1200; }
.tip-editor .btn.discard { color: var(--muted); margin-left: auto; }
.tip-editor .mix-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  margin: -6px -10px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.tip-editor .mix-btn:hover { background: rgba(255,255,255,0.06); }
.tip-editor .mix-hint { font-size: 12px; color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }

/* Sheets: modals that drop in on desktop and rise from the bottom on
   phones. The mix sheet has one row per player; the song sheet lists the
   songs by band with a search box. */
.sheet {
  width: min(440px, calc(100vw - 32px));
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
  color: var(--text);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}
.sheet::backdrop { background: rgba(5, 8, 24, 0.7); }
.sheet:focus { outline: none; } /* the sheet takes focus on phones; no ring for that */
.song-sheet { width: min(520px, calc(100vw - 32px)); max-height: min(80vh, 720px); display: none; flex-direction: column; }
.song-sheet[open] { display: flex; }
.sheet-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 10px; }
.sheet-head .sheet-title { margin: 0; }
.sheet-search {
  flex: 1;
  min-width: 160px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font: 16px Inter, sans-serif; /* 16px: below that, iOS Safari zooms the page when the field is focused */
}
.sheet-search:focus { outline: 1px solid var(--gold); }
.song-list { overflow-y: auto; min-height: 0; margin: 0 -6px; padding: 0 6px; }
.song-band {
  margin: 12px 6px 4px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.song-band:first-child { margin-top: 2px; }
.song-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.song-row:hover { background: rgba(255,255,255,0.06); }
.song-row.on { background: rgba(242, 177, 52, 0.14); }
.song-row.on .song-title { color: var(--gold); }
.song-title { font: 600 15px Inter, sans-serif; }
.song-where { font-size: 12px; color: var(--muted); }
.song-none { margin: 16px 6px; color: var(--muted); font-size: 14px; }
.sheet-title {
  margin: 0 0 12px;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 18px;
}
.sheet-rows { display: flex; flex-direction: column; gap: 6px; }
.sheet-row {
  --c: var(--gold);
  cursor: pointer;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 2px solid var(--c);
  border-radius: 10px;
  background: var(--panel);
  transition: opacity 0.15s;
}
.sheet-row.inactive { opacity: 0.45; }
.sheet-row .btn[hidden] { display: none; }
.sheet-row .who { font-family: "Space Grotesk", Inter, sans-serif; font-size: 18px; color: var(--c); line-height: 1; }
.sheet-row .inst { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.sheet-actions .spacer { flex: 1; }
.sheet-actions .btn.use { background: var(--gold); border-color: var(--gold); color: #1a1200; }
/* Contributing a guide: the headers writing left out, a preview of the
   text, and the way to the library's inbox. */
.offer-sheet { width: min(520px, calc(100vw - 32px)); max-height: min(90vh, 760px); overflow-y: auto; }
.offer-intro { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.offer-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.offer-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.offer-opt { text-transform: none; letter-spacing: 0; color: var(--muted); opacity: 0.8; }
.offer-row { display: flex; gap: 12px; }
.offer-row .offer-field { flex: 1; }
.offer-row .offer-lang { flex: 0 0 96px; }
.offer-field input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font: 16px Inter, sans-serif; /* 16px: below that, iOS Safari zooms the page when the field is focused */
}
.offer-field input:focus { outline: 1px solid var(--gold); }
/* The link field: https:// as plain text to the left of the box. */
.offer-url { display: flex; align-items: center; gap: 6px; }
.offer-prefix { color: var(--muted); font: 16px Inter, sans-serif; user-select: none; }
.offer-url input { flex: 1; }
.offer-preview { margin: 2px 0 10px; font-size: 14px; }
.offer-preview summary { cursor: pointer; color: var(--muted); }
.offer-preview summary:hover { color: var(--text); }
.offer-preview pre {
  margin: 8px 0 0;
  max-height: 180px;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0,0,0,0.3);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.offer-status { margin: 0; font-size: 14px; color: var(--muted); }
.offer-status.error { color: var(--donut); }
.offer-status a { color: var(--gold); }
.offer-status[hidden] { display: none; }

@media (max-width: 720px) {
  .sheet {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 16px 16px 0 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .song-sheet { max-height: 85vh; }
}

/* The tip editor's head: the mix label as a button. */
.card-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.card-head .mix .who { font-family: "Space Grotesk", Inter, sans-serif; font-size: 16px; }
.mini {
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font: 600 12px Inter, sans-serif;
  cursor: pointer;
}
.mini:hover { background: rgba(255,255,255,0.12); }
.edit-note { width: 100%; resize: vertical; line-height: 1.4; }
.song.chip.new { background: none; border-style: dashed; color: var(--muted); }
.song.chip.new:hover { color: var(--text); }

/* Long notes are clamped to a few lines, with a "more" link that shows the
   rest; the link only appears when there is more. */
.note.clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--lines, 2);
  line-clamp: var(--lines, 2);
  overflow: hidden;
}
.more {
  border: none;
  background: none;
  padding: 0;
  color: var(--gold);
  font: 600 13px Inter, sans-serif;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.more[hidden] { display: none; }

.btn.continue {
  align-self: flex-start;
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1200;
}
.guide-tips {
  position: relative; /* so each tip's offsetTop is measured from the list */
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}
/* Tip rows, read or written alike: mix and times on the first line, the
   note beneath clamped behind "more". Writing adds a handle on the left
   and edit / play / delete on the right. */
.guide-tips li.tip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "jump" "note" "more";
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  padding: 7px 6px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}
.guide-tips li.tip-row.edit {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "handle jump actions" "handle note note" "handle more more";
}
.guide-tips li.tip-row.on { background: rgba(255,255,255,0.05); color: var(--text); }
.guide-tips li.tip-row .handle { grid-area: handle; }
.guide-tips li.tip-row .jump {
  grid-area: jump;
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.guide-tips li.tip-row .mix { color: var(--text); min-width: 0; }
.guide-tips li.tip-row .mix .who { font-family: "Space Grotesk", Inter, sans-serif; font-size: 15px; }
.guide-tips li.tip-row .when { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); }
.guide-tips li.tip-row .when .to { color: var(--muted); }
.guide-tips li.tip-row.on .when .at { color: var(--gold); }
.guide-tips li.tip-row .actions { grid-area: actions; display: inline-flex; gap: 4px; }
.guide-tips li.tip-row .note { grid-area: note; }
.guide-tips li.tip-row .note[hidden] { display: none; }
.guide-tips li.tip-row .more { grid-area: more; justify-self: start; }

/* Transport */
.transport {
  position: sticky;
  bottom: 12px;
  z-index: 2;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
}
.play {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--gold);
  color: #1a1200;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.play svg { width: 24px; height: 24px; fill: currentColor; }
.play .icon-pause { display: none; }
.play.playing .icon-play { display: none; }
.play.playing .icon-pause { display: block; }
/* Play is on but the next segment has not arrived yet */
.play.buffering { animation: buffering 1s ease-in-out infinite; }
@keyframes buffering { 50% { opacity: 0.4; } }

.time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; min-width: 44px; text-align: center; }
.seek-wrap { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; }
.seek { flex: 1; min-width: 0; accent-color: var(--gold); cursor: pointer; }
/* Guide tips are marked over the seek bar: a span for the passage (a tick
   when it runs to the next tip). The marks are decoration only; every
   pointer goes to the seek bar beneath, so it can be dragged anywhere. The
   row is inset by half the thumb so the marks line up with the thumb. */
.marks {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 12px;
  transform: translateY(-50%);
  pointer-events: none;
}
.marks i {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  margin-left: -1px;
  background: var(--gold);
  opacity: 0.6;
  border-radius: 1px;
}
.marks i.on { opacity: 1; }
/* Share icon, in the style of GitHub's small clipboard buttons. Where there
   is no share sheet the link is copied instead, and the glyph gives way to a
   check for a moment, or turns red if the copy failed. */
.btn.share {
  width: 32px;
  height: 32px;
  padding: 0;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.btn.share:hover { color: var(--text); }
.btn.share svg { width: 18px; height: 18px; }
.btn.share .icon-check { display: none; width: 16px; height: 16px; fill: currentColor; }
.btn.share.copied { color: var(--gold); }
.btn.share.copied .icon-share { display: none; }
.btn.share.copied .icon-check { display: block; }
.btn.share.failed { color: var(--donut); }
@media (max-width: 720px) {
  .transport {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 12px;
    gap: 10px 12px;
    padding: 12px;
  }
}

/* Tips: one line under the transport, each fading in on its own cue (see
   the tips section of app.js). Keeps its height while empty so nothing
   below it jumps when a tip arrives. */
.tip {
  min-height: 42px;
  display: flex;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.tip.on { opacity: 1; }
.tip-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px 9px 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 8%, var(--panel));
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  font-size: 15px;
  color: var(--text);
}
.tip-icon { width: 20px; height: 20px; flex: none; color: var(--gold); }
.tip em { font-style: normal; font-weight: 600; color: var(--gold); }
.tip-link {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.tip-link:hover { color: var(--text); }
.tip-link .tip-glyph {
  width: 14px;
  height: 14px;
  margin-left: 5px;
  vertical-align: -2px;
}
/* On phones the transport is fixed to the bottom, so the tip floats just
   above it instead of sitting in the flow underneath. */
@media (max-width: 720px) {
  .tip {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 102px; /* the transport is 78px tall, 12px up from the bottom */
    z-index: 2;
    pointer-events: none; /* taps fall through to the page, except on a showing tip */
  }
  .tip.on .tip-card { pointer-events: auto; }
  .tip-card { font-size: 14px; }
}

.help {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
  padding-bottom: 16px;
}
.colophon {
  flex-basis: 100%;
  margin: 6px 0 0;
  text-align: center;
  font-style: italic;
  opacity: 0.8;
}
.colophon a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.colophon a:hover {
  color: var(--text);
}
/* Touch-only devices have no keyboard, so the shortcut legend is noise there. */
@media (hover: none) and (pointer: coarse) {
  .help > span { display: none; }
  .colophon { margin-top: 0; }
}
kbd {
  font-family: inherit;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
}

/* First-run hints: a soft pulse on Play while paused, and on one S button
   while playing (until the listener has used solo or mute). */
.play.hint {
  animation: play-pulse 2.2s ease-out infinite;
}
@keyframes play-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(242, 177, 52, 0.55); }
  70%  { box-shadow: 0 0 0 14px rgba(242, 177, 52, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 177, 52, 0); }
}

.btn.solo.hint {
  animation: solo-glow 2.4s ease-in-out infinite;
}

@keyframes solo-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); border-color: var(--line); }
  50%      { box-shadow: 0 0 8px color-mix(in srgb, var(--c) 45%, transparent); border-color: color-mix(in srgb, var(--c) 60%, var(--line)); }
}

@media (prefers-reduced-motion: reduce) {
  .play.hint { animation: none; box-shadow: 0 0 0 4px rgba(242, 177, 52, 0.35); }
  .btn.solo.hint { animation: none; box-shadow: 0 0 8px color-mix(in srgb, var(--c) 45%, transparent); }
}
