/* RTS admin: dark studio palette from the design canvas (brick + gold). */
:root {
  --ground: #15110E; --panel: #1F1915; --panel2: #2A221D; --line: #3B312A;
  --text: #F2EADC; --muted: #B9AC9B; --gold: #D9A74A; --brick: #A33A32;
  --warn: #F2A27A;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--text);
       font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif; }
a { color: var(--gold); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
       padding: 14px 24px; background: #100D0B; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: .04em; color: var(--gold); flex: 1 1 auto; }
.env { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
       padding: 4px 10px; border-radius: 999px; background: var(--panel2); color: var(--muted); }
.env-live { background: #5A1F19; color: #FFD9CF; }
.env-staging { background: #1A2624; color: #8FC7BC; }
.who { color: var(--muted); }

main { padding: 40px 24px 64px; margin: 0 auto; }
main.narrow { max-width: 460px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 20px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
        padding: 20px; display: flex; flex-direction: column; gap: 16px; margin: 0 0 16px; }
.card p { margin: 0; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
input { height: 44px; padding: 0 12px; font-size: 16px; color: var(--text);
        background: var(--ground); border: 1px solid #4A3D33; border-radius: 8px; }
input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

button, .button { font: inherit; cursor: pointer; }
.primary { min-height: 44px; padding: 0 20px; border: 0; border-radius: 8px;
           background: var(--gold); color: #1A120C; font-weight: 700;
           display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.link { background: none; border: 0; padding: 8px 0; color: var(--gold); text-decoration: underline; }
form.inline { display: inline; margin: 0; }

.alert { padding: 12px 14px; border-radius: 8px; border: 1px solid #E0743C;
         background: #2E1A12; color: var(--warn); }
.hint { color: var(--muted); font-size: 14px; }
.warn { color: var(--warn); }

.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.qr { margin: 12px 0; padding: 12px; background: #fff; border-radius: 8px; width: max-content; }
.qr img { display: block; }
.key code { font-size: 15px; letter-spacing: .05em; word-break: break-all; }
.codes { list-style: none; padding: 16px; margin: 0 0 20px; display: grid;
         grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px;
         background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.codes code { font-size: 17px; letter-spacing: .06em; }

/* ---- menu, tables, users page ---- */
.menu { display: flex; gap: 4px; flex: 1 1 auto; }
.menu a { padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.menu a:hover { background: var(--panel2); }
main.wide { max-width: 1040px; }
h2 { font-size: 18px; margin: 28px 0 12px; }
.card h2 { margin: 0; }
.notice { padding: 12px 14px; border-radius: 8px; border: 1px solid #3E5650; background: #14231F; color: #A6DCD2; }
.tablebox { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap;
     background: var(--panel2); padding: 10px 14px; }
td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
tr.dim td { color: var(--muted); }
td.actions { text-align: right; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.btns form { margin: 0; }
.small { min-height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid #4A3D33;
         background: transparent; color: var(--text); font-size: 14px; }
.small:hover { border-color: var(--gold); }
.small.danger { border-color: #5A2A22; color: var(--warn); }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--muted); }
.tag.warn { color: var(--warn); }
.card.row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.card.row label { flex: 1 1 220px; }
.linkbox { border-color: var(--gold); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.staging-banner { background: repeating-linear-gradient(135deg, #1A2624 0 14px, #22322F 14px 28px); color: #8FC7BC; border-bottom: 2px solid #8FC7BC; padding: 8px 20px; font-weight: 600; letter-spacing: .04em; text-align: center; }

/* ---- studio screens ---- */
.subnav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 20px; border-bottom: 1px solid var(--line); }
.subnav a { padding: 10px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--text); }
.subnav a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }
h2 .tag { vertical-align: middle; margin-left: 6px; }
td .dim, .dim { color: var(--muted); }
td.small-text { font-size: 14px; color: var(--muted); }
.chainlist { margin: 0; padding: 16px 16px 16px 40px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.chainlist li { padding: 4px 0; }

/* Default settings (#29) */
a.small.button { display: inline-flex; align-items: center; text-decoration: none; color: var(--text); }
.tag.ok { color: #A6DCD2; }
table.defaults td { padding: 8px 10px; vertical-align: top; }
table.defaults input, table.defaults select { height: 36px; font-size: 15px; width: 100%; min-width: 70px; box-sizing: border-box; }
table.defaults select { padding: 0 8px; color: var(--text); background: var(--ground); border: 1px solid #4A3D33; border-radius: 8px; }
table.defaults td:last-child { min-width: 180px; }
tr.bad td { background: #2A1714; }
h2.place { font-size: 22px; }

/* Bands and songs (#30, #31) */
.titlerow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 20px; }
.titlerow h1 { margin: 0; }
a.primary.button { display: inline-flex; align-items: center; text-decoration: none; color: #1A1410; }
.crumbs { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
textarea { padding: 10px 12px; font: inherit; font-size: 16px; color: var(--text); background: var(--ground); border: 1px solid #4A3D33; border-radius: 8px; resize: vertical; }
textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.pre { white-space: pre-wrap; }
ul.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.row2 input { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }
label.check { flex-direction: row; align-items: center; gap: 10px; }
label.check input { height: auto; width: 18px; height: 18px; }
form.addrow { margin-top: 12px; }
form.addrow p.warn { flex-basis: 100%; margin: 0; }
.card.details p { margin: 0; }

/* Song setups (#31) */
.track { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 12px; overflow: hidden; }
.trackhead { padding: 10px 14px; background: var(--panel); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
table.slots td { padding: 8px 14px; }
table.slots td.unit { width: 34%; }

/* Streaming settings (0011) */
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.packs select, .card.section textarea { width: 100%; box-sizing: border-box; }
.packs select { height: 40px; padding: 0 8px; color: var(--text); background: var(--ground); border: 1px solid #4A3D33; border-radius: 8px; }
.card.section p { margin: 0; }
ul.files { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
ul.files img { display: block; max-width: 320px; max-height: 200px; border-radius: 8px; margin: 0 0 4px; }
form.upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
form.upload input[type=file] { height: auto; padding: 8px; }
label.desk { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; }
label.desk input { height: 32px; width: 3.2em; padding: 0 6px; font-size: 15px; }
/* Song credits, lyrics, sheet music, licenses (#95) */
table.credits td { padding: 6px 8px; vertical-align: top; }
table.credits input { height: 36px; font-size: 15px; width: 100%; min-width: 70px; box-sizing: border-box; }
table.credits td.name { min-width: 170px; }
table.credits td.share input { min-width: 60px; width: 5em; }
table.credits .roles { display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 200px; }
table.credits label.check { font-size: 13px; gap: 6px; }
table.credits label.check input { min-width: 0; width: 16px; height: 16px; }
.card h3 { margin: 0; font-size: 17px; }
.card.license details summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.card.license details[open] { display: flex; flex-direction: column; gap: 12px; }
form.licenseform { display: flex; flex-direction: column; gap: 12px; }
form.licenseform select { height: 44px; padding: 0 10px; font-size: 16px; color: var(--text); background: var(--ground); border: 1px solid #4A3D33; border-radius: 8px; }
/* Users page: role and band pickers (#105) */
form.stack, .card.stack { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.card.stack .row { display: flex; gap: 12px; flex-wrap: wrap; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; margin: 0; }
legend { font-weight: 600; padding: 0 4px; }
td details summary { cursor: pointer; color: var(--muted); }
/* Field help (help.go): "?" with a hover bubble and a click popover. No JavaScript. */
.help { display: inline-block; position: relative; vertical-align: middle; margin: 0 4px; line-height: 1; }
.help-btn { width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 1px solid var(--muted); background: transparent;
  color: var(--muted); font: 600 12px/16px -apple-system, system-ui, sans-serif; cursor: help; text-transform: none; letter-spacing: 0; }
.help-btn:hover, .help-btn:focus-visible { border-color: var(--gold); color: var(--gold); }
@media (hover: hover) {
  /* fixed with no top/left: starts where the ? is, but no box's overflow clips it */
  .help-btn:hover::after { content: attr(data-tip); position: fixed; transform: translate(-14px, 22px);
    width: max-content; max-width: 300px; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line);
    background: var(--panel2); color: var(--text); font: 400 13px/1.45 -apple-system, system-ui, sans-serif;
    text-align: left; white-space: normal; z-index: 30; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
}
@media (hover: hover) {
  /* last column: open to the left so it stays on screen */
  :is(th, td):last-child .help-btn:hover::after { transform: translate(calc(-100% + 4px), 22px); }
}
.help:has(.help-pop:popover-open) .help-btn::after { display: none; }
.checkrow { display: flex; align-items: center; gap: 2px; }
/* In stacked labels the ? sits beside the label text and the field takes the next line. */
label:has(> .help):not(.check):not(.desk) { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 0; }
label:has(> .help):not(.check):not(.desk) > :is(input, select, textarea, .warn) { flex-basis: 100%; }
.help-pop { max-width: min(30rem, 90vw); margin: auto; padding: 18px 44px 18px 20px; border: 1px solid var(--gold); border-radius: 10px;
  background: var(--panel); color: var(--text); font: 400 15px/1.55 -apple-system, system-ui, sans-serif; text-align: left;
  text-transform: none; letter-spacing: 0; white-space: normal; box-shadow: 0 12px 40px rgba(0,0,0,.6); }
.help-pop::backdrop { background: rgba(0,0,0,.35); }
.help-close { position: absolute; top: 8px; right: 10px; padding: 2px 8px; border: 0; background: transparent; color: var(--muted);
  font-size: 20px; line-height: 1; cursor: pointer; }
.help-close:hover { color: var(--gold); }
/* Notes from bands (#77) */
.note { margin: 12px 0; }
.note.done { opacity: .7; }
.notehead { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 6px; }
.reply { margin: 10px 0 0 18px; padding-left: 12px; border-left: 2px solid var(--line); }
.noteactions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 10px; }
.noteactions details { flex: 1 1 100%; }
.noteactions summary, details.section > summary { cursor: pointer; color: var(--gold); }
.notecell { max-width: 420px; }
/* M32 channel vs wiring (#112) */
.notice.warnbox { border-color: var(--warn); }
.notice.warnbox form.inline { display: inline; margin-left: 8px; }
