/* Present's look: warm, flat earth tones, Inter throughout, one clay accent. */
@font-face { font-family: Inter; src: url(/fonts/Inter.ttf) format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Lexend; src: url(/fonts/Lexend.ttf) format('truetype'); font-weight: 100 900; font-display: swap; }

:root {
  --rail: #171513; --window: #1c1a17; --panel: #23211e; --raised: #2d2a26; --hover: #282522;
  --border: rgba(232, 220, 200, 0.08);
  --text: #e2dacb; --text2: #a69d8f; --text3: #857c70;
  --accent: #c0795b; --accent-text: #1e1612; --accent-dim: #5c3b2d; --link: #d6a488;
  --good: #9cae88; --warn: #c9a263; --bad: #bc6f5e;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--window); color: var(--text); font: 14px/1.45 Inter, system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); }
h1, h2, h3 { margin: 0; font-weight: 600; }
.spacer { flex: 1; }

button {
  background: var(--raised); border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 12px; cursor: pointer; white-space: nowrap;
}
button:hover:not(:disabled) { background: var(--hover); border-color: rgba(232, 220, 200, 0.16); }
button:disabled { opacity: 0.5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button.primary, a.button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.primary:hover:not(:disabled) { background: #cc8667; }
button.danger { color: var(--bad); }
button.ghost { background: none; border-color: transparent; color: var(--text2); }
button.wide { width: 100%; display: flex; gap: 8px; align-items: center; justify-content: center; }
button.icon {
  background: none; border: none; padding: 5px; border-radius: 6px; color: var(--text2);
  display: inline-flex; align-items: center; justify-content: center;
}
button.icon:hover:not(:disabled) { background: var(--raised); color: var(--text); }
button.icon.danger:hover { color: var(--bad); }
input, select, textarea {
  background: var(--rail); border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; width: 100%;
}
label { font-size: 12px; color: var(--text2); }

.splash, .empty { color: var(--text3); padding: 40px; text-align: center; }
.empty.small { padding: 8px 0; text-align: left; }
.small { font-size: 12.5px; color: var(--text2); margin: 0; }
.warn { color: var(--warn); font-size: 12.5px; margin: 0; }
.err { color: var(--bad); margin: 0; }

/* sign-in */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login form { width: min(360px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.login h1 { font-size: 22px; }
.login p { margin: 0 0 8px; color: var(--text2); }
.login input { font-size: 17px; letter-spacing: 0.08em; text-transform: uppercase; }
.login button { margin-top: 8px; padding: 9px; }

/* layout */
.shell { display: grid; grid-template-columns: 250px 1fr; grid-template-rows: auto 1fr; height: 100vh; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--rail); border-bottom: 1px solid var(--border); min-width: 0; }
.brand { font-weight: 700; letter-spacing: 0.02em; }
.save { font-size: 12px; color: var(--text3); }
.save.bad { color: var(--bad); }
.who { font-size: 12.5px; color: var(--text2); }
.menu { display: none; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--raised); color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.pill.on::before, .pill.live::before, .pill.off::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.pill.on::before { background: var(--good); }
.pill.live { color: var(--text); }
.pill.live::before { background: var(--bad); }
.pill.off::before { background: var(--text3); }

.rail { background: var(--rail); border-right: 1px solid var(--border); overflow-y: auto; padding: 14px 10px 30px; }
.rail h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text3); margin: 18px 8px 6px; display: flex; align-items: center; justify-content: space-between; }
.rail-actions { padding: 0 4px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { position: relative; border-radius: 7px; }
.list li.on { background: var(--raised); }
.list li:hover:not(.on) { background: var(--hover); }
.row { width: 100%; background: none; border: none; text-align: left; display: flex; gap: 8px; padding: 7px 8px; border-radius: 7px; }
.row:hover:not(:disabled) { background: none; border: none; }
.row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { font-size: 11.5px; color: var(--text3); font-variant-numeric: tabular-nums; }
.count.accent { color: var(--accent); font-weight: 600; }
.row-tools { position: absolute; right: 4px; top: 3px; display: none; background: inherit; }
.list li:hover .row-tools, .list li:focus-within .row-tools { display: flex; }
.row-tools button.icon { padding: 3px; }

.main { overflow-y: auto; padding: 22px 26px 60px; min-width: 0; }
.progress { position: sticky; top: 0; z-index: 5; background: var(--accent-dim); color: var(--text); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }

/* playlist */
.pl-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.pl-head h1 { font-size: 21px; }
.sub { margin: 4px 0 0; color: var(--text3); font-size: 12.5px; }
.live-note { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: rgba(188, 111, 94, 0.14); color: var(--text); font-size: 13px; max-width: 640px; }
.pl-tools { display: flex; gap: 8px; flex-wrap: wrap; }

.group { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.group-head { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.group-head h3 { font-size: 14px; }
.kind { color: var(--text3); display: inline-flex; }
.kind.song { color: var(--accent); }
.working { font-size: 12px; color: var(--accent); }
.svc-header { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text3); margin: 20px 4px 8px; }
.note { margin: 4px 0 8px; color: var(--text3); font-size: 12.5px; }
.problem { margin: 4px 0 8px; color: var(--warn); font-size: 12.5px; }
.spelling { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 10px; font-size: 12.5px; color: var(--text2); }
.word { background: var(--raised); border-radius: 6px; padding: 2px 4px 2px 8px; display: inline-flex; gap: 6px; align-items: center; color: var(--warn); }
.word button { padding: 1px 7px; font-size: 11.5px; color: var(--text2); }
.dropzone { width: 100%; margin-top: 8px; padding: 18px; border: 1.2px dashed rgba(232, 220, 200, 0.25); background: none; color: var(--text3); border-radius: 9px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin-top: 10px; }
.card { border-radius: 9px; transition: opacity 0.15s; }
.card.dragging { opacity: 0.35; }
.card.over { box-shadow: -4px 0 0 var(--accent); }
.card-btn { width: 100%; padding: 0; background: none; border: none; text-align: left; border-radius: 9px; }
.card-btn:hover:not(:disabled) { background: none; border: none; }
.card-btn:hover .thumb { outline: 2px solid rgba(232, 220, 200, 0.25); }
.thumb { aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; position: relative; display: grid; place-items: center; outline: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb.web { background: var(--raised); color: var(--text2); gap: 4px; font-size: 12px; place-content: center; justify-items: center; padding: 8px; text-align: center; word-break: break-all; }
.thumb.blank { font-family: Lexend, Inter, sans-serif; color: #fff; font-size: 11px; padding: 10px; text-align: left; }
.badge { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.card-name { display: flex; gap: 6px; align-items: baseline; font-size: 12.5px; padding: 6px 2px 0; color: var(--text2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-name .n { color: var(--text3); font-variant-numeric: tabular-nums; font-size: 11px; }
.edited { font-size: 10.5px; color: var(--accent); margin-left: auto; }

/* modals */
.scrim { position: fixed; inset: 0; background: rgba(10, 9, 8, 0.6); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px 20px; }
.modal.wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.modal-head h2 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.inline { display: flex; gap: 8px; }
.buttons { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.buttons.wrap { flex-wrap: wrap; }
.slide-menu { display: flex; flex-direction: column; gap: 14px; }
.slide-menu .preview .thumb { max-width: 100%; }
.lyrics { font-family: Lexend, Inter, sans-serif; background: #000; color: #fff; border-radius: 8px; padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.lyric-input { font-family: Lexend, Inter, sans-serif; font-size: 15px; line-height: 1.5; }
.passcode { font-size: 26px; font-weight: 700; letter-spacing: 0.12em; text-align: center; background: var(--rail); border-radius: 10px; padding: 16px; margin: 0; font-variant-numeric: tabular-nums; }

/* lists */
.tracks, .people, .jobs { list-style: none; margin: 8px 0 0; padding: 0; }
.tracks li, .people li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-top: 1px solid var(--border); }
.tracks .name { flex: 1; }
.people li { padding: 10px 4px; flex-wrap: wrap; }
.people li.disabled .name { color: var(--text3); text-decoration: line-through; }
.add-person { display: flex; gap: 8px; margin-bottom: 8px; max-width: 640px; flex-wrap: wrap; }
.add-person input { flex: 2; min-width: 160px; }
.add-person select { flex: 1; min-width: 160px; width: auto; }
.jobs li { display: grid; grid-template-columns: 76px 1fr auto; gap: 4px 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.jobs .state { font-size: 12px; font-weight: 600; }
.jobs .queued .state { color: var(--text2); }
.jobs .running .state { color: var(--accent); }
.jobs .done .state { color: var(--good); }
.jobs .failed .state { color: var(--bad); }
.jobs .by { font-size: 12px; color: var(--text3); }
.jobs .msg { grid-column: 2 / -1; font-size: 12.5px; color: var(--text2); }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--raised); border: 1px solid var(--border); padding: 10px 16px; border-radius: 10px; z-index: 30; max-width: min(560px, calc(100vw - 32px)); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); }
.toast.bad { border-color: var(--bad); }

/* phones and narrow windows */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .menu { display: inline-flex; }
  .rail { position: fixed; top: 49px; bottom: 0; left: 0; width: min(290px, 85vw); z-index: 10; transform: translateX(-100%); transition: transform 0.2s; }
  .rail.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); }
  .row-tools { display: flex; position: static; }
  .list li { display: flex; align-items: center; }
  .main { padding: 16px 16px 60px; }
  .who, .save { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

a.button { display: inline-block; padding: 6px 12px; border-radius: 7px; text-decoration: none; border: 1px solid var(--accent); }
.drive { max-width: 720px; }

/* lyric slides take their section's color, as in Present */
.card.part { background: color-mix(in srgb, var(--part) 28%, var(--panel)); padding: 4px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--part) 55%, transparent); }
.card.part .card-name { color: var(--text); font-weight: 500; }
.card.part .card-name .n { color: var(--part); font-weight: 600; }
.card.part.over { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--part) 55%, transparent), -4px 0 0 var(--accent); }

/* who else is here */
.here { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text2); }
.avatar { border-radius: 50%; object-fit: cover; background: #000; border: 2px solid var(--rail); flex: none; }
.here .avatar { margin-left: -6px; }
.here .avatar:first-child { margin-left: 0; }
.who { display: inline-flex; align-items: center; gap: 6px; }
.people .avatar { border-color: var(--panel); }
.here-label { margin-left: 4px; }
.also { margin: 8px 0 0; font-size: 12.5px; color: var(--link); }
button.link { background: none; border: none; padding: 0; color: var(--link); text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }
button.link:hover:not(:disabled) { background: none; border: none; color: var(--text); }

/* history */
.history { list-style: none; margin: 0 0 8px; padding: 0; }
.history li { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; align-items: center; padding: 9px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; }
.history .when { font-size: 12px; color: var(--text3); font-variant-numeric: tabular-nums; }
.history .what { font-size: 13px; }
.history .where { color: var(--text3); }
.history li.restored { border-color: var(--accent-dim); }
@media (max-width: 820px) { .here-label { display: none; } .history li { grid-template-columns: 1fr auto; } .history .when { grid-column: 1 / -1; } }
