* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: #1c1c1e; color: #f2f2f7;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* ---------- elenco ---------- */
#screenLibrary { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
.libhead h1 { margin: 8px 0 2px; font-size: 34px; }
.libhead p { margin: 0 0 20px; color: #98989f; }
.partlist .part {
  background: #2c2c2e; border-radius: 14px; padding: 16px; margin-bottom: 12px;
}
.part .name { font-size: 20px; font-weight: 600; }
.part .meta { color: #98989f; margin: 4px 0 12px; font-size: 14px; }
.part .row { display: flex; gap: 10px; }

/* ---------- pulsanti ---------- */
.btn {
  -webkit-appearance: none; appearance: none;
  font: inherit; font-size: 16px; color: #f2f2f7;
  background: #3a3a3c; border: 0; border-radius: 10px;
  min-height: 44px; min-width: 44px; padding: 0 14px;
  cursor: pointer; touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
}
.btn:active { background: #505054; }
.btn.on { background: #0a84ff; color: #fff; }
.btn.accent { background: #ff9f0a; color: #1c1c1e; font-weight: 600; }
.btn.small { min-height: 38px; font-size: 14px; }

/* ---------- lettore ---------- */
#screenReader {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column;
}
#bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 8px 10px; background: #2c2c2e;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
}
.title { font-weight: 600; font-size: 16px; flex: 1 1 140px; min-width: 100px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group { display: flex; align-items: center; gap: 6px; }
.colors { display: inline-flex; gap: 6px; margin: 0 4px; }
.sw {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid #636366;
  padding: 0; cursor: pointer; touch-action: manipulation;
}
.sw.on { border-color: #fff; }
.pagelabel { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }

#banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; background: #5b4a00; color: #ffe9a3; font-size: 14px;
}

#stage {
  flex: 1 1 auto; min-height: 0; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: #48484a; overflow: hidden;
  touch-action: none;
}
#pageWrap { position: relative; background: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.5); }
#pageImg {
  display: block; width: 100%; height: 100%;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; pointer-events: none;
}
#ink {
  position: absolute; left: 0; top: 0;
  touch-action: none;
  mix-blend-mode: multiply;           /* l'evidenziatore non copre le note */
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}

#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: rgba(20,20,22,.94); color: #fff; padding: 12px 18px;
  border-radius: 12px; font-size: 15px; max-width: 90%; text-align: center;
  z-index: 10;
}

.sync { font-size: 13px; white-space: nowrap; }
.sync.ok { color: #6fdc8c; }
.sync.off { color: #98989f; }
.lnk { color: #0a84ff; font-size: 16px; }

.loginbox { max-width: 340px; margin: 22vh auto 0; padding: 0 16px; text-align: center; }
.loginbox h1 { font-size: 38px; margin: 0 0 4px; }
.loginbox p { color: #98989f; margin: 0 0 18px; }
.loginbox input { width: 100%; font: inherit; font-size: 22px; text-align: center; padding: 12px; margin-bottom: 12px;
  border-radius: 12px; border: 0; background: #2c2c2e; color: #f2f2f7; }
.loginbox .btn { width: 100%; }
.err { color: #ff6b6b; min-height: 24px; margin-top: 10px; }
.userline { display: flex; align-items: center; gap: 10px; margin: -8px 0 16px; color: #98989f; }

#bar #tools { order: 10; flex: 1 0 100%; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid #3a3a3c; }
.sz, .szb { }
.szb { width: 44px; height: 44px; border-radius: 10px; border: 0; background: #3a3a3c; display: inline-flex;
  align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.szb span { display: block; border-radius: 50%; background: #f2f2f7; }
.szb.on { background: #0a84ff; }
.sep { width: 1px; height: 28px; background: #636366; margin: 0 4px; display: inline-block; }
#screenSetlist { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
.sec { font-size: 15px; color: #98989f; text-transform: uppercase; letter-spacing: .04em; margin: 22px 0 10px; font-weight: 600; }
.slbody { display: flex; flex-direction: column; gap: 10px; }
.slitem { display: flex; align-items: center; gap: 10px; background: #2c2c2e; border-radius: 14px; padding: 10px 12px; }
.slitem.dim { opacity: .5; }
.slitem .num { width: 30px; text-align: center; font-size: 20px; color: #98989f; font-variant-numeric: tabular-nums; }
.slitem .mid { flex: 1 1 auto; min-width: 0; }
.slitem .name { font-size: 18px; font-weight: 600; }
.slitem .meta { color: #98989f; font-size: 13px; margin-top: 2px; }
.btn.big { min-height: 54px; font-size: 18px; width: 100%; }
.slname, .slsel { font: inherit; font-size: 18px; padding: 10px 12px; border-radius: 10px; border: 0;
  background: #2c2c2e; color: #f2f2f7; width: 100%; }
.slsel { flex: 1 1 auto; width: auto; }
.addrow { gap: 10px; }

.dlbtn { width: 100%; margin-bottom: 12px; }

#screenImport { max-width: 720px; margin: 0 auto; padding: 24px 16px 60px; }
#screenImport .libhead { display: block; }
.dropzone { display: block; border: 2px dashed #636366; border-radius: 16px; padding: 28px 16px; text-align: center; cursor: pointer; margin-bottom: 16px; }
.dropzone.over { border-color: #0a84ff; background: #1f2a3a; }
.dropzone .big { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.impcard { background: #2c2c2e; border-radius: 14px; padding: 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.imptop { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.imptop .name { font-weight: 600; word-break: break-word; }
.impfield { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #98989f; }
.impsel, .impin { font: inherit; font-size: 17px; padding: 10px 12px; border-radius: 10px; border: 0; background: #3a3a3c; color: #f2f2f7; width: 100%; }
.warn { color: #ffd60a; font-size: 14px; }
.ok { color: #6fdc8c; font-weight: 600; }
#btnImport { margin-bottom: 8px; }
.meta { color: #98989f; font-size: 14px; }

.btn.danger{color:#ff8a80;border-color:#7a2d2d}
.mvsel{max-width:9em}

/* strumenti sopra la pagina: compaiono con un tocco al centro, poi spariscono */
#chrome { position: absolute; top: 0; left: 0; right: 0; z-index: 5; box-shadow: 0 6px 20px rgba(0,0,0,.55); }
#chrome[hidden] { display: none; }
#mask { position: absolute; left: 0; top: 0; pointer-events: none; }
.jobbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; color: #98989f; }
.jobbar select { max-width: 260px; }
.songhead { font-size: 17px; margin: 18px 2px 6px; color: #f2f2f7; border-bottom: 1px solid #3a3a3c; padding-bottom: 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.delall { margin: 0 0 10px; }
.searchbox { width: 100%; font: inherit; font-size: 18px; padding: 12px 14px; margin: 0 0 6px; border: 0; border-radius: 12px; background: #2c2c2e; color: #f2f2f7; box-sizing: border-box; }
.versel{width:auto;min-height:44px;max-width:9em;font-weight:600}
