/* Рок н хор — стиль з прототипу: повітряно і тихо */
:root {
  --ink: #17201B;
  --muted: #6B726D;
  --muted-2: #5F6661;
  --green: #2E5D4B;
  --mint: #EEF2EC;
  --mint-2: #D9E0D6;
  --chip: #F2F4F0;
  --paper: #F7F8F5;
  --line: #E9ECE7;
  --brown: #7A4A21;
  --gold: #B07D12;
  --amber: #8A5A00;
  --bubble: #F4F1EC;
  --danger: #A4372B;
  --tab-h: 82px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-family: Onest, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #fff; }
body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.num { font-family: Geologica, sans-serif; letter-spacing: -0.03em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { max-width: 520px; margin: 0 auto; min-height: 100%; position: relative; }
.screen { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); }

/* ── шапка проєкту ── */
.hero { background: var(--mint); padding: calc(var(--safe-t) + 12px) 24px 56px; display: flex; flex-direction: column; gap: 6px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted-2); }
.countdown { display: flex; align-items: flex-end; gap: 14px; margin: 8px 0 18px; }
.countdown .big { font-family: Geologica, sans-serif; font-weight: 200; font-size: 120px; line-height: .82; letter-spacing: -0.06em; }
.countdown .lbl { font-size: 17px; line-height: 1.3; padding-bottom: 6px; }
.progress-row { display: flex; align-items: center; gap: 8px; }
.progress { flex: 1; height: 6px; border-radius: 999px; background: var(--mint-2); overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: var(--green); }
.sheet-body { background: #fff; margin-top: -32px; border-radius: 32px 32px 0 0; padding: 32px 24px 24px; display: flex; flex-direction: column; gap: 32px; position: relative; }

/* ── заголовки екранів ── */
.page-head { padding: calc(var(--safe-t) + 24px) 24px 0; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.page-title { font-family: Geologica, sans-serif; font-size: 34px; font-weight: 300; letter-spacing: -0.03em; line-height: 1; margin: 4px 0 0; }
.page { padding: 24px 24px 0; display: flex; flex-direction: column; gap: 24px; }

/* ── кнопки ── */
.btn { min-height: 52px; border-radius: 999px; border: 0; padding: 0 22px; font-size: 16px; font-weight: 500; background: var(--chip); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.pill { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--chip); font-size: 14px; font-weight: 500; text-decoration: none; }
.link { min-height: 44px; display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; font-size: 15px; font-weight: 500; color: var(--green); text-decoration: none; }
.link.muted { color: var(--muted); }
.icon-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--chip); display: flex; align-items: center; justify-content: center; }
.icon-btn.round48 { width: 48px; height: 48px; }
.icon-btn.white { background: #fff; }

/* ── найближча репетиція ── */
.next { display: flex; flex-direction: column; gap: 18px; }
.next-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.next-time { display: flex; align-items: baseline; gap: 10px; }
.next-time .big { font-family: Geologica, sans-serif; font-weight: 300; font-size: 44px; letter-spacing: -0.04em; line-height: 1; }
.addr { background: var(--paper); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.info { background: var(--mint); border-radius: 20px; padding: 14px 16px; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; color: #3E4642; }
.info svg { flex: none; margin-top: 1px; }
.warn { background: #FBF1E4; color: var(--amber); }
.cancel-tag { color: var(--danger); font-weight: 500; }

/* ── картка нот ── */
.score { background: var(--paper); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.score-top { display: flex; align-items: center; gap: 12px; }
.score-name { font-size: 15px; font-weight: 500; }
.score-sub { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.score-actions { display: flex; gap: 8px; }
.score-actions .btn { flex: 1; min-height: 44px; font-size: 15px; }

/* ── список розкладу ── */
.month { font-size: 13px; font-weight: 500; color: var(--muted); padding-bottom: 4px; }
.row { width: 100%; display: flex; align-items: center; gap: 16px; min-height: 72px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.row .date { width: 40px; flex: none; display: flex; flex-direction: column; align-items: center; }
.row .wd { font-size: 12px; color: var(--muted); }
.row .d { font-family: Geologica, sans-serif; font-size: 26px; font-weight: 300; letter-spacing: -0.03em; }
.row .main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row .t { font-size: 16px; }
.row .sub { font-size: 13px; color: var(--muted); }
.row .tag { font-size: 13px; font-weight: 500; }
.row.past { min-height: 52px; color: var(--muted); }
.row.cancelled .t { text-decoration: line-through; color: var(--muted); }
.expand { padding: 4px 0 16px 56px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }

/* ── список нот ── */
.song-row { display: flex; align-items: center; gap: 14px; min-height: 68px; border-bottom: 1px solid var(--line); }
.song-row .pos { width: 24px; flex: none; font-family: Geologica, sans-serif; font-weight: 300; font-size: 20px; color: var(--muted); text-align: center; }
.song-open { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; border: 0; background: transparent; text-align: left; padding: 12px 0; min-height: 68px; justify-content: center; }
.song-open:disabled { cursor: default; }
.song-title { font-size: 16px; font-weight: 500; }
.dot-ok { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }

/* ── нижня навігація ── */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + var(--safe-b)); background: #fff; border-top: 1px solid #EEF0EC; display: grid; padding: 6px 12px calc(22px + var(--safe-b)); z-index: 10; max-width: 520px; margin: 0 auto; }
.tabs button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 500; color: var(--muted); }
.tabs button[aria-current="page"] { color: var(--ink); }

/* ── нижні шторки і діалоги ── */
.overlay { position: fixed; inset: 0; background: rgba(23,32,27,.28); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.bsheet { width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 32px 32px 0 0; padding: 12px 24px calc(32px + var(--safe-b)); display: flex; flex-direction: column; gap: 20px; position: relative; }
.grab { align-self: center; width: 36px; height: 5px; border-radius: 3px; background: #E3E8E1; }
.bsheet .close { position: absolute; top: 16px; right: 16px; }
.bsheet h2 { font-family: Geologica, sans-serif; font-size: 28px; font-weight: 300; letter-spacing: -0.03em; line-height: 1.1; margin: 0; padding-right: 52px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--muted); }
.input { border: 0; border-radius: 18px; background: var(--chip); padding: 14px 16px; font-size: 16px; width: 100%; min-height: 52px; }
textarea.input { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--green); }
.err { color: var(--danger); font-size: 14px; }

/* ── перегляд нот ── */
.viewer { position: fixed; inset: 0; background: #fff; z-index: 40; display: flex; flex-direction: column; }
.viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(var(--safe-t) + 14px) 14px 10px; border-bottom: 1px solid #EEF0EC; }
.viewer-title { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; text-align: center; }
.viewer-title b { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
.viewer-pages { flex: 1; overflow: auto; background: var(--chip); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 16px; -webkit-overflow-scrolling: touch; }
.viewer-pages canvas { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(23,32,27,.08); max-width: none; }
.viewer-zoom { position: absolute; right: 16px; bottom: calc(16px + var(--safe-b)); display: flex; gap: 8px; }
.viewer-zoom .icon-btn { background: #fff; box-shadow: 0 4px 16px rgba(23,32,27,.14); }

/* ── тост ── */
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); max-width: 488px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: 20px; padding: 14px 18px; font-size: 14px; line-height: 1.35; z-index: 50; }

/* ── вхід ── */
.login { min-height: 100vh; display: flex; flex-direction: column; }
.login .hero { padding-bottom: 72px; }
.login form { display: flex; flex-direction: column; gap: 16px; }
.code-input { letter-spacing: .4em; font-family: Geologica, sans-serif; font-size: 28px; text-align: center; }

/* ── керування ── */
.mgmt-section { display: flex; flex-direction: column; gap: 4px; }
.mgmt-head { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.mgmt-head h3 { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.mrow { display: flex; align-items: center; gap: 12px; min-height: 60px; border-bottom: 1px solid var(--line); }
.mrow .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; border: 0; background: transparent; text-align: left; padding: 10px 0; }
.mrow .t { font-size: 15px; }
.mrow .sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-badge { font-size: 12px; font-weight: 500; color: var(--amber); background: #FBF1E4; border-radius: 999px; padding: 4px 10px; }
.empty { color: var(--muted); font-size: 15px; line-height: 1.45; padding: 8px 0; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--mint-2); border-top-color: var(--green); animation: spin .8s linear infinite; margin: 32px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: 0s !important; } }
