/* Shared by the listening page and the editor: colours, buttons, the player bar, countdown, toast, sign-in. */
:root {
  --del: #ffc9c9;
  --bg: #ffffff; --fg: #333333; --panel: #f2f2f2; --line: #dddddd; --accent: #007bff; --accent-fg: #ffffff;
  --warn: #b00020; --ok: #1b7f3b; --hl: #fff3b0; --input-bg: #ffffff; --input-line: #cccccc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --del: #7a2230;
    --bg: #121212; --fg: #e0e0e0; --panel: #2a2a2a; --line: #444444; --accent: #3d8bfd; --accent-fg: #ffffff;
    --warn: #ff6b81; --ok: #5bd17f; --hl: #4a4310; --input-bg: #1e1e1e; --input-line: #555555;
  }
}
:root { --staff: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%27240%27%20height=%27150%27%20viewBox=%270%200%20240%20150%27%3E%3Cg%20stroke=%27rgb(128,128,128)%27%20stroke-opacity=%27.16%27%20stroke-width=%271%27%20fill=%27none%27%3E%3Cpath%20d=%27M0%2040h240M0%2049h240M0%2058h240M0%2067h240M0%2076h240%27/%3E%3C/g%3E%3Cg%20fill=%27rgb(128,128,128)%27%20fill-opacity=%27.2%27%3E%3Cellipse%20cx=%2750%27%20cy=%2767%27%20rx=%275.5%27%20ry=%274%27%20transform=%27rotate(-20%2050%2067)%27/%3E%3Cellipse%20cx=%27110%27%20cy=%2753%27%20rx=%275.5%27%20ry=%274%27%20transform=%27rotate(-20%20110%2053)%27/%3E%3Cellipse%20cx=%27170%27%20cy=%2745%27%20rx=%275.5%27%20ry=%274%27%20transform=%27rotate(-20%20170%2045)%27/%3E%3C/g%3E%3Cg%20stroke=%27rgb(128,128,128)%27%20stroke-opacity=%27.2%27%20stroke-width=%271.2%27%3E%3Cpath%20d=%27M55%2066V36M115%2052V22M175%2044V14%27/%3E%3C/g%3E%3C/svg%3E"); --staff-soft: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%27240%27%20height=%27150%27%20viewBox=%270%200%20240%20150%27%3E%3Cg%20stroke=%27rgb(128,128,128)%27%20stroke-opacity=%27.09%27%20stroke-width=%271%27%20fill=%27none%27%3E%3Cpath%20d=%27M0%2040h240M0%2049h240M0%2058h240M0%2067h240M0%2076h240%27/%3E%3C/g%3E%3Cg%20fill=%27rgb(128,128,128)%27%20fill-opacity=%27.12%27%3E%3Cellipse%20cx=%2750%27%20cy=%2767%27%20rx=%275.5%27%20ry=%274%27%20transform=%27rotate(-20%2050%2067)%27/%3E%3Cellipse%20cx=%27110%27%20cy=%2753%27%20rx=%275.5%27%20ry=%274%27%20transform=%27rotate(-20%20110%2053)%27/%3E%3Cellipse%20cx=%27170%27%20cy=%2745%27%20rx=%275.5%27%20ry=%274%27%20transform=%27rotate(-20%20170%2045)%27/%3E%3C/g%3E%3Cg%20stroke=%27rgb(128,128,128)%27%20stroke-opacity=%27.12%27%20stroke-width=%271.2%27%3E%3Cpath%20d=%27M55%2066V36M115%2052V22M175%2044V14%27/%3E%3C/g%3E%3C/svg%3E"); }
html, body, :fullscreen { background: var(--bg); color: var(--fg); }
body { font-family: Lato, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; margin: 0; padding: 0;
  background-image: var(--staff-soft); background-size: 240px 150px; }
.hidden { display: none !important; }
button, input, select, .box { font: inherit; color: var(--fg); }
button {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px;
  min-height: 36px; cursor: pointer; touch-action: manipulation;
}
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
button.link { background: none; border: 0; min-height: 0; padding: 2px 4px; color: var(--accent); text-decoration: underline; }
/* a long press on a button must never start a text selection or open the callout menu */
button, #player-bar { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, .box:focus { outline: 3px solid #A9A9A9; outline-offset: -2px; }
input, select, .box {
  background: var(--input-bg); border: 1px solid var(--input-line); border-radius: 4px; padding: 5px 6px;
  box-sizing: border-box; min-width: 0;
}
select { padding: 8px 6px; }

/* ---- player bar ---- */
#player-bar {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 9999; background: var(--bg);
  box-shadow: 0 2px 5px rgba(0,0,0,.15); border-bottom: 1px solid var(--line);
}
/* narrow screens: one info line, then all buttons in one row (they share the width), then the seek bar */
#bar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 4px 8px 4px; }
.ctl { display: flex; align-items: stretch; gap: 6px; flex: 1 1 0; min-width: 0; }
#bar-row button { flex: 1 1 0; min-width: 0; min-height: 50px; padding: 4px 2px; font-size: 1.2em; }
#b-play { font-size: 1.35em; }
#b-play, #b-prev, #b-next { touch-action: none; }
#bar-row #b-prev, #bar-row #b-next { font-size: 1.7em; line-height: 1; }
.ico { width: 1em; height: 1em; display: block; margin: 0 auto; }   /* previous / next symbols: drawn, so the bar is as tall as the triangles */
kbd .ico { display: inline-block; vertical-align: -.15em; margin: 0; }
#nowfile {
  order: -1; flex: 0 0 100%; min-width: 0; margin: 0; font-size: .9em; line-height: 1.3; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#now-event, #now-song { display: inline; }
#now-event { font-weight: bold; opacity: .85; }
#now-event:not(:empty) + #now-song:not(:empty)::before { content: ' \2013  '; }
#seekrow { padding: 0 10px 3px; }
#seek { width: 100%; margin: 0; display: block; height: 16px; padding: 0; border: 0; border-radius: 0; background: transparent; -webkit-appearance: none; appearance: none; touch-action: none; }
#seek::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line); }
#seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--accent); border: 0; }
#seek::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
#seek::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
#seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 0; }
#seek:disabled { opacity: .35; }
/* the playing time on the right: small note above the centred symbol (listening page) */
#bar-row #b-fs { position: relative; display: flex; align-items: center; justify-content: center; line-height: 1; }
#fs-icon { font-size: 1.7em; }
#fs-time { position: absolute; top: 3px; left: 0; right: 0; text-align: center; font-size: .55em; opacity: .7; font-variant-numeric: tabular-nums; }
#clock { font-variant-numeric: tabular-nums; }

/* wide screens: previous, -5, play | info | symbol/time, +5, next. There is no video, so the info text uses the space;
   the buttons are as tall as a video would be */
@media (min-width: 640px) {
  #bar-row { flex-wrap: nowrap; justify-content: flex-start; gap: 10px; padding: 4px 8px 2px; }
  .ctl { flex: none; align-self: stretch; }
  #bar-row button { flex: none; min-width: clamp(48px, 8vw, 80px); min-height: 0; padding: 4px 10px; font-size: 1.4em; }
  #b-play { font-size: 1.6em; }
  #nowfile {
    order: 0; display: flex; flex-direction: column; justify-content: center; flex: 1; min-width: 0; height: 90px; margin: 0; overflow: hidden;
    overflow-wrap: anywhere; white-space: normal; text-overflow: clip; line-height: 1.25; font-size: 1em;
  }
  #now-event, #now-song { display: block; }
  #now-event { font-size: .9em; }
  #now-event:not(:empty) + #now-song:not(:empty)::before { content: none; }
}
@media (min-width: 640px) and (max-height: 500px) { #nowfile { height: 72px; } }

/* picture box (wide screens only, where the buttons are beside the text): the video that is playing, or the cover art.
   It is as tall as the buttons. On narrow screens it is hidden; a hidden video still plays its sound. */
#art { display: none; }
#art img { display: none; }
@media (min-width: 640px) {
  #art.on { display: flex; flex: none; align-items: center; height: 90px; }
  #art img, #art video { height: 90px; border-radius: 6px; }
  #art.cover img { display: block; width: 90px; object-fit: cover; }
  #art video { width: auto; max-width: 35vw; background: #000; cursor: pointer; }
  #art:not(.video) video { display: none; }
}
@media (min-width: 640px) and (max-height: 500px) { #art.on, #art img, #art video { height: 72px; } #art.cover img { width: 72px; } }

/* countdown shown while a pair of buttons or keys is held: 3 - 2 - 1, then a check mark */
#countdown {
  position: fixed; top: 6px; left: 50%; transform: translateX(-50%); z-index: 10001; display: none; pointer-events: none;
  min-width: 2.2em; height: 2.2em; padding: 0 .3em; box-sizing: border-box; border-radius: 1.1em;
  background: rgba(0, 0, 0, .78); color: #fff; font: bold 2em/2.2em sans-serif; text-align: center;
}
#countdown.on { display: block; }

#toast {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); max-width: 92vw; z-index: 10000;
  background: #222; color: #fff; padding: 8px 14px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
#toast.err { background: var(--warn); }

#login { box-sizing: border-box; min-height: 100vh; min-height: 100dvh; padding: 18vh 16px 2rem; text-align: center;
  background-image: radial-gradient(ellipse 60% 45% at 50% 38%, var(--bg) 0%, var(--bg) 35%, transparent 100%), var(--staff);
  background-size: auto, 240px 150px; }
#login a.btn { display: inline-block; padding: 12px 20px; border-radius: 6px; background: var(--accent); color: var(--accent-fg); text-decoration: none; }
.muted { opacity: .7; }

/* the name of the choir when there is only one (instead of a list to choose from) */
.choir-name { font-weight: 600; align-self: center; min-width: 0; overflow-wrap: anywhere; }
/* sign out */
#btn-logout { background: var(--accent); color: var(--accent-fg); border: 1px solid var(--accent); border-radius: 16px;
  min-height: 32px; padding: 0 14px; text-decoration: none; font-weight: 600; }
#btn-logout:active { opacity: .8; }
/* tables and the text areas stay plain, so that the pattern never runs under what is being read */
#result table, #filters, .tablewrap, .tablewrap table { background: var(--bg); }
