/* SERVICE LOG — phone app only. Uses the app's own colours (Index.html :root). */

/* ---------- connect this device ---------- */
body.sl-connecting > *:not(#slConnect):not(script):not(style) { display: none !important; }
#slConnect { position: fixed; inset: 0; z-index: 90; background: var(--paper); overflow: auto;
  padding: calc(24px + env(safe-area-inset-top)) 16px 24px; }
#slConnect .slc-card { max-width: 480px; margin: 0 auto; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; }
#slConnect .slc-brand { font-family: var(--serif); font-size: 24px; color: var(--ink); margin-bottom: 14px; }
#slConnect h2 { font-family: var(--serif); font-size: 19px; margin: 0 0 6px; }
#slConnect p { font-size: 14px; color: var(--muted); line-height: 1.45; margin: 0 0 12px; }
#slConnect p.slc-small { font-size: 12.5px; margin: 12px 0 0; }
#slConnect input { margin: 4px 0 10px; }
#slConnect .slc-err { font-size: 13px; color: var(--red); background: var(--red-bg); border-radius: 10px;
  padding: 10px 12px; margin-top: 10px; line-height: 1.4; }
#slConnect [hidden] { display: none; }

/* ---------- a job showing the copy saved on the phone: read, don't change ---------- */
/* Controls that change something can't be touched. Boxes of text stay readable —
   select and copy work — and are made read-only by phone.js. The map's own
   buttons only show things, so they work too. */
body.sl-stale #app .body button,
body.sl-stale #app .body select,
body.sl-stale #app .body label,
body.sl-stale #app .body input[type=checkbox],
body.sl-stale #app .body input[type=radio],
body.sl-stale #app .body input[type=file] { pointer-events: none; }
body.sl-stale #app .body label input:not([type=checkbox]):not([type=radio]):not([type=file]),
body.sl-stale #app .body label textarea,
body.sl-stale #app .body a,
body.sl-stale #app .body summary,
body.sl-stale #app .body button[onclick^="mapToggle("],
body.sl-stale #app .body button[onclick^="mapLocateMe("],
body.sl-stale #app .body button[onclick^="mapGoToPin("] { pointer-events: auto; }
body.sl-stale #app .body select,
body.sl-stale #app .body input[type=checkbox],
body.sl-stale #app .body input[type=radio] { opacity: .7; }
body.sl-stale #app .body button { opacity: .45; }
body.sl-stale #app .body button[onclick^="mapToggle("],
body.sl-stale #app .body button[onclick^="mapLocateMe("],
body.sl-stale #app .body button[onclick^="mapGoToPin("] { opacity: 1; }
body.sl-stale #app .body input[data-sl-ro],
body.sl-stale #app .body textarea[data-sl-ro] { background: #f7f5ef; }
body.sl-stale #app::after { content: ''; display: block; height: 96px; }   /* room to scroll the last lines out from under the note */
.sl-stale-note { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(40px + env(safe-area-inset-bottom));
  z-index: 50; max-width: min(92%, 440px); background: var(--ink); color: #fff; border-radius: 12px;
  padding: 9px 14px; font-size: 13px; line-height: 1.35; box-shadow: 0 6px 18px rgba(0,0,0,.25);
  display: flex; align-items: center; gap: 9px; pointer-events: none; }
.sl-stale-note.off { background: #4a463f; }
.sl-stale-note i { flex: none; width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; animation: slspin .8s linear infinite; }
@keyframes slspin { to { transform: rotate(360deg); } }

/* ---------- This phone ---------- */
.sl-panel { max-height: 88vh; overflow: auto; }
.sl-facts { margin: 12px 0 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; }
.sl-facts div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 13px;
  border-top: 1px solid var(--line); }
.sl-facts div:first-child { border-top: none; }
.sl-facts span { color: var(--muted); }
.sl-facts b { font-weight: 600; text-align: right; }
.sl-sub { font-family: var(--serif); font-size: 16px; margin-top: 16px; }
.sl-lead { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 4px 0 6px; }
.sl-qr { display: flex; justify-content: center; margin: 6px 0; min-height: 40px; }
.sl-qr svg { width: 190px; height: 190px; }
.sl-row { display: flex; gap: 8px; margin: 6px 0 4px; }
.sl-row .btn-outline { flex: 1; font-size: 13px; }
.sl-danger { color: var(--red) !important; }
.sl-foot { text-align: center; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 12px; }

/* ---------- the Api file in Apps Script is older than this app ---------- */
.sl-olddoor { margin: calc(8px + env(safe-area-inset-top)) auto 8px; width: calc(100% - 16px); max-width: 464px;
  box-sizing: border-box; background: var(--red); color: #fff; border-radius: 12px; padding: 11px 14px;
  font-size: 13px; line-height: 1.4; }
.sl-olddoor b { display: block; font-size: 14px; margin-bottom: 2px; }

/* ---------- a new version is ready ---------- */
.sl-updatebar { position: fixed; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top));
  z-index: 95; background: var(--brass); color: #fff; border-radius: 12px; padding: 11px 16px; font-size: 14px;
  font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.28); max-width: 92%; }
