* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root { --bg: #f3f4f7; --card: #fff; --line: #e2e5ec; --tx: #161b26; --mut: #6b7385; --acc: #2563eb; --live: #dc2626; --next: #d97706; --ok: #16a34a; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font-family: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif; font-size: 16px; }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--tx); border-radius: 10px; padding: 10px 14px; touch-action: manipulation; }
button:active { transform: scale(.97); }
button:disabled { opacity: .4; cursor: default; transform: none; }
input, select, textarea { font: inherit; color: var(--tx); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--acc); outline-offset: -1px; }
a { color: var(--acc); }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #eef1f6; color: #3b4456; white-space: nowrap; }
.badge.key { background: #dbe7ff; color: #1d4ed8; }
.badge.slow { background: #dcfce7; color: #166534; }
.badge.medium { background: #fef3c7; color: #92400e; }
.badge.fast { background: #fee2e2; color: #991b1b; }
.muted { color: var(--mut); }
mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
.seg-btns { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg-btns button { border: 0; border-radius: 0; border-right: 1px solid var(--line); padding: 9px 12px; }
.seg-btns button:last-child { border-right: 0; }
.seg-btns button.on { background: var(--tx); color: #fff; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 99; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.on { opacity: 1; }
.nav { display: flex; align-items: center; gap: 4px; padding: 8px 14px; background: #111827; color: #fff; flex-wrap: wrap; }
.nav .brand { font-weight: 800; margin-right: 12px; }
.nav a { color: #cbd5e1; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 15px; }
.nav a.on, .nav a:hover { background: #1f2937; color: #fff; }
.nav .grow { flex: 1; }
.nav .who { color: #9ca3af; font-size: 14px; margin-right: 6px; }
.nav button { background: #1f2533; color: #fff; border-color: #374151; padding: 7px 12px; font-size: 14px; }
.empty-hint { padding: 22px 16px; color: var(--mut); text-align: center; font-size: 15px; }
.primary { background: var(--acc); color: #fff; border-color: var(--acc); font-weight: 700; }
.danger { color: #b91c1c; }

.nav .brand { display: inline-flex; align-items: center; gap: 8px; }
.nav .brandlogo { width: 26px; height: 26px; border-radius: 6px; background: #fff; }
.legal { font-size: 13px; color: var(--mut); text-align: center; margin-top: 16px; }
.legal a { color: inherit; }

/* translations on the beamer and the monitor */
.ln.tr { font-size: .62em; font-weight: 400; color: #fff; opacity: .8; margin-bottom: .18em; }
.trgap { height: .7em; }

/* language chips in setlists */
.lchips { display: inline-flex; gap: 3px; margin: 0 4px; flex-shrink: 0; }
.lchip { font-size: 10.5px; font-weight: 800; padding: 2px 5px; min-width: 0; border-radius: 5px; border: 1px solid #cbd5e1; background: #fff; color: #64748b; line-height: 1.3; cursor: pointer; }
.lchip.on { background: #2563eb; border-color: #2563eb; color: #fff; }
.lchip.on.auto { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.lchip sup { font-size: 8px; margin-left: 1px; }
.main .lchips { margin: 3px 0 0; display: flex; }

/* ---------- theme picker */
.themewrap { position: relative; }
.nav .themebtn { padding: 7px 10px; font-size: 15px; }
.themepop { display: none; position: absolute; right: 0; top: 110%; z-index: 50; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px; gap: 4px; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.themewrap.open .themepop { display: flex; }
.themepick button, .nav .themepick button { background: var(--card); color: var(--tx); border: 1px solid var(--line); padding: 7px 12px; font-size: 14px; font-weight: 700; }
.themepick button.on, .nav .themepick button.on { background: var(--acc); border-color: var(--acc); color: #fff; }

/* ================= DARK: everything dark ================= */
html.t-dark { --bg: #0b0f17; --card: #151b26; --line: #2a3342; --tx: #e6eaf2; --mut: #93a0b4; color-scheme: dark; }
html.t-dark input, html.t-dark select, html.t-dark textarea { background: #0f141d; }
html.t-dark .badge { background: #232b39; color: #cbd5e1; }
html.t-dark .badge.key { background: #1e3a8a; color: #bfdbfe; }
html.t-dark .badge.slow { background: #14532d; color: #bbf7d0; }
html.t-dark .badge.medium { background: #713f12; color: #fde68a; }
html.t-dark .badge.fast { background: #7f1d1d; color: #fecaca; }
html.t-dark mark { background: #a16207; color: #fff; }
html.t-dark .seg-btns button.on, html.t-dark #tabs button.on { background: #e6eaf2; color: #0b0f17; }
html.t-dark #tabs button { background: #1f2733; }
html.t-dark .danger { color: #f87171; }
html.t-dark .lchip { background: #151b26; border-color: #2a3342; color: #93a0b4; }
html.t-dark .lchip.on.auto { background: #1e2a44; border-color: #1e3a8a; color: #bfdbfe; }
html.t-dark .lchip.on { background: #2563eb; border-color: #2563eb; color: #fff; }
/* pages */
html.t-dark #startSheet .box, html.t-dark #menu, html.t-dark .pan, html.t-dark header, html.t-dark #left, html.t-dark #importBox, html.t-dark .ibox,
html.t-dark .card, html.t-dark .svc, html.t-dark .logo { background: var(--card); color: var(--tx); }
html.t-dark #menu a:hover, html.t-dark #menu button:hover { background: #1f2733; }
html.t-dark #startList button.on, html.t-dark .row.isnext, html.t-dark .row:active, html.t-dark #pvBtns .next, html.t-dark .sl.pick, html.t-dark .setup, html.t-dark .inuse { background: #3a2a0a; color: #fde68a; }
html.t-dark .row:hover, html.t-dark .it:hover, html.t-dark .sl:hover { background: #1b2230; }
html.t-dark .row.sel, html.t-dark .it.on, html.t-dark .sl.on, html.t-dark .row.open, html.t-dark tr.cur td, html.t-dark .langbtn.on { background: #1e2a44; }
html.t-dark #pLive .sl.on, html.t-dark #pvSlides .sl.on, html.t-dark #liveSlides .sl.on { background: #3f1212; }
html.t-dark #nextBox { background: #231c0c; } html.t-dark #nextBox.empty { background: var(--card); }
html.t-dark .langbox, html.t-dark .trialnote, html.t-dark #trList .tr { background: #121a28; border-color: #1e3a8a; }
html.t-dark .bstat.ok, html.t-dark .tag, html.t-dark .pill { background: #14532d; color: #bbf7d0; }
html.t-dark .bstat.no, html.t-dark .pill.suspended { background: #7f1d1d; color: #fecaca; }
html.t-dark .pill.trial { background: #713f12; color: #fde68a; }
html.t-dark kbd, html.t-dark code, html.t-dark .meter { background: #232b39; color: #cbd5e1; }
html.t-dark #f input[readonly], html.t-dark #f textarea[readonly] { background: #0b0f17; }
html.t-dark #offline { background: #713f12; color: #fde68a; }
html.t-dark #pMenu { background: var(--card); color: var(--tx); } html.t-dark #pMenu > * { color: var(--tx); } html.t-dark #pMenu > button:hover, html.t-dark #pMenu > a:hover { background: #1f2733; }

/* ================= LIGHT: everything light (the beamer previews stay black) ================= */
html.t-light .nav { background: #fff; color: var(--tx); border-bottom: 1px solid var(--line); }
html.t-light .nav a { color: #475569; } html.t-light .nav a.on, html.t-light .nav a:hover { background: #eef1f6; color: #111827; }
html.t-light .nav .who { color: var(--mut); }
html.t-light .nav button { background: #fff; color: var(--tx); border-color: var(--line); }
/* songleader iPad */
html.t-light #bar { background: #fff; color: var(--tx); border-bottom: 1px solid var(--line); }
html.t-light #liveSlot { background: #fef2f2; } html.t-light #liveSlot .lbl { color: #b91c1c; }
html.t-light #nextSlot { background: #fff7e6; } html.t-light #nextSlot .lbl { color: #b45309; }
html.t-light #nextSlot.empty, html.t-light #liveSlot.empty { background: #f1f4f9; border-color: var(--line); }
html.t-light .side button, html.t-light #menuBtn { background: #f1f4f9; color: var(--tx); border-color: var(--line); }
html.t-light #blankBtn.on { background: #b91c1c; color: #fff; }
html.t-light #unq { color: #b45309; }
html.t-light #lyr { background: #fff; color: #111827; border: 1px solid var(--line); }
html.t-light #secLbl, html.t-light #lyr .ch, html.t-light #curLabel { color: #b45309; }
html.t-light #songLbl, html.t-light #txt.preview { color: var(--mut); }
html.t-light #prevTag { background: #fff7e6; color: #92400e; }
html.t-light #bottom { border-top-color: var(--line); }
html.t-light #chips button, html.t-light #slideNav button { background: #f1f4f9; color: #334155; }
html.t-light #chips button.on { background: #fbbf24; color: #111; }
html.t-light #slideNav #nextSl { background: #2563eb; color: #fff; }
/* musicians screen */
/* phone pages */
html.t-light .pv, html.t-light .lyr { background: #f8fafc; color: #111827; border: 1px solid var(--line); }
html.t-light .pv .acts .close { background: #eef1f6; color: #111827; }
html.t-light .top { background: #fff; color: #111827; border-bottom: 1px solid var(--line); }
html.t-light .top a, html.t-light .top button { background: #eef1f6; color: #111827; }

/* Settings button and tabs */
.nav a.gear { background: #1f2937; color: #fff; border: 1px solid #374151; margin-right: 6px; }
.nav a.gear.on, .nav a.gear:hover { background: #2563eb; border-color: #2563eb; }
html.t-light .nav a.gear { background: #eef1f6; color: #111827; border-color: var(--line); }
html.t-light .nav a.gear.on, html.t-light .nav a.gear:hover { background: #2563eb; color: #fff; }
.stabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.stabs b { margin-right: 8px; font-size: 18px; }
.stabs a { text-decoration: none; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--tx); font-weight: 700; font-size: 15px; }
.stabs a.on { background: var(--acc); border-color: var(--acc); color: #fff; }
