@font-face { font-family: 'Montserrat'; font-weight: 400; font-display: swap; src: url('fonts/montserrat-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url('fonts/montserrat-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url('fonts/montserrat-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 800; font-display: swap; src: url('fonts/montserrat-latin-800-normal.woff2') format('woff2'); }

:root {
  --purple: #621a96;
  --lilac: #ab9cdc;
  --lilac-bg: #f3effb;
  --ink: #241b2f;
  --muted: #5d5468;
  --line: #e4ddef;
  --live: #fff6d6;
  --live-edge: #e2a700;
  --ok: #1f8a4c;
  --warn: #b35c00;
  --bad: #b3261e;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 20px;
  line-height: 1.45;
  color: var(--ink);
  background: #fff;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; }
button { cursor: pointer; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.small { font-size: 0.8em; color: var(--muted); }

/* header */
.top { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 2px solid var(--line); padding: 10px 16px 0; }
.brandrow { display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--purple); font-size: 1.1em; flex: 1; }
.brand.big { font-size: 1.5em; justify-content: center; flex: none; }
.mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--purple); color: #fff; font-weight: 800; }
.status { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 0.75em; color: var(--muted); min-height: 44px; }
.status .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); }
.status.off .dot { background: var(--muted); }
.status.warn .dot { background: var(--warn); }
.status.busy .dot { background: var(--lilac); animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .3; } to { opacity: 1; } }
.iconbtn { width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-size: 1.3em; color: var(--purple); }

.rooms { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.chip { flex: 1 0 auto; min-height: 56px; padding: 0 18px; border-radius: 14px; border: 2px solid var(--lilac); background: #fff; color: var(--purple); font-weight: 700; }
.chip.on { background: var(--purple); border-color: var(--purple); color: #fff; }

.daterow { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.nav { width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-size: 1.6em; color: var(--purple); }
.datepick { flex: 1; position: relative; min-height: 56px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 14px; font-weight: 700; }
.datepick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }
.today { min-height: 56px; padding: 0 18px; border-radius: 14px; border: 2px solid var(--purple); background: var(--lilac-bg); color: var(--purple); font-weight: 700; }

.tabs { display: flex; gap: 4px; margin-top: 10px; overflow-x: auto; }
.tab { flex: 1 0 auto; min-height: 56px; padding: 0 16px; border: none; background: none; border-bottom: 4px solid transparent; color: var(--muted); font-weight: 700; }
.tab.on { color: var(--purple); border-bottom-color: var(--purple); }
.banner { margin: 8px 0; padding: 10px 14px; background: var(--live); border-radius: 12px; }
.link { border: none; background: none; color: var(--purple); font-weight: 700; text-decoration: underline; }

/* main */
main { padding: 16px; max-width: 1400px; margin: 0 auto; }
.sec { color: var(--purple); font-size: 1.15em; margin: 8px 0 12px; }
.clock { color: var(--muted); font-weight: 600; margin-left: 8px; }
h3 { color: var(--purple); margin: 18px 0 8px; font-size: 1em; }
.notice { background: var(--lilac-bg); border-radius: var(--radius); padding: 16px 18px; margin: 8px 0 16px; }
.nowgrid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .nowgrid { grid-template-columns: 1fr; } body { font-size: 18px; } }

.block { border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px; background: #fff; }
.block.routine { background: #faf9fc; border-style: dashed; }
.block.big { border-color: var(--purple); box-shadow: 0 4px 16px rgba(98, 26, 150, .12); }
.block.big .btitle { font-size: 1.45em; }
.block.live { background: var(--live); border-color: var(--live-edge); }
.block.compact { padding: 10px 14px; }
.bhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.btime { font-weight: 700; color: var(--purple); }
.btitle { font-weight: 800; font-size: 1.1em; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 0.7em; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--lilac-bg); color: var(--purple); }
.badge.alt { background: #e8f1ff; color: #1d4f91; }
.badge.live { background: var(--live-edge); color: #fff; }
.badge.soft { background: #eef6ee; color: #2c6b3c; }
.steps { margin: 10px 0; padding-left: 1.4em; }
.steps li { margin: 6px 0; }
.block.big .steps li { font-size: 1.05em; }
.pill { display: inline-block; margin: 4px 6px 4px 0; padding: 4px 12px; border-radius: 999px; background: #f1eff4; font-size: 0.85em; }
.pill.book { background: #fff3e6; }
.pill em { color: var(--muted); font-style: normal; font-weight: 600; }
.grab, .books, .backup, .stretch, .milestone { margin-top: 8px; }
.backup { background: #eef3fb; padding: 8px 12px; border-radius: 10px; }
.milestone { font-size: 0.75em; color: var(--muted); }
.photo { margin: 10px 0; padding: 12px 14px; border-radius: 12px; background: #e9f7ef; border: 2px solid #8fd1a8; }
.song, .video { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 8px 12px; background: var(--lilac-bg); border-radius: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 18px; border-radius: 14px; border: 2px solid var(--purple); background: #fff; color: var(--purple); font-weight: 700; text-decoration: none; margin-top: 6px; }
.btn.music { background: var(--purple); color: #fff; }
.btn.bw { background: #1f8a4c; border-color: #1f8a4c; color: #fff; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.primary { min-height: 60px; padding: 0 28px; border: none; border-radius: 14px; background: var(--purple); color: #fff; font-weight: 800; font-size: 1.05em; }

.grablist { list-style: none; padding: 0; margin: 0; }
.grablist li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts { margin-bottom: 8px; }
.notes li { margin: 6px 0; }
.words { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.word { border: 2px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.w1 { font-weight: 800; font-size: 1.2em; color: var(--purple); }
.w2 { font-weight: 600; }
.w3 { font-size: 0.85em; color: var(--muted); margin-top: 4px; }
.songrow { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lyrics { font-size: 0.85em; color: var(--muted); }

.pdfbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
#pdfhost { width: 100%; }
.pdfpage { display: block; margin: 0 auto 14px; border: 1px solid var(--line); border-radius: 6px; max-width: 100%; }

/* setup and rooms */
.setup { min-height: 100vh; display: grid; place-items: center; background: var(--lilac-bg); padding: 20px; }
.setupcard { width: min(520px, 100%); background: #fff; border-radius: 24px; padding: 32px; box-shadow: 0 10px 30px rgba(98, 26, 150, .15); text-align: center; }
.lead { color: var(--muted); }
.field { display: block; text-align: left; font-weight: 700; margin: 16px 0; }
.field input { display: block; width: 100%; margin-top: 6px; min-height: 60px; padding: 0 16px; border: 2px solid var(--lilac); border-radius: 14px; font-size: 1.2em; }
.err { color: var(--bad); min-height: 1.4em; }
.roompick { text-align: center; }
.roomgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 20px; }
.roombig { min-height: 140px; border-radius: 24px; border: 3px solid var(--lilac); background: var(--lilac-bg); color: var(--purple); font-size: 1.4em; font-weight: 800; }

.overlay { position: fixed; inset: 0; background: rgba(36, 27, 47, .45); display: grid; place-items: center; z-index: 20; padding: 20px; }
.panel { width: min(560px, 100%); background: #fff; border-radius: 24px; padding: 24px 28px; }
.panel h2 { color: var(--purple); margin-top: 0; }
.check { display: flex; gap: 10px; align-items: center; margin: 12px 0; }
.check input { width: 28px; height: 28px; }
.row { display: flex; gap: 12px; margin-top: 12px; }
hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
