html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: #000; }
body { font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
.hidden { display: none !important; }
button, select, [role="button"] { cursor: pointer; }

/* ---------- Slideshow ---------- */
#frame { position: fixed; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; background: #000; }
.slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; overflow: hidden;
  -webkit-transition: opacity 1.5s; transition: opacity 1.5s; }
.slide.show { opacity: 1; }
.fg, .bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: center center no-repeat; }
.fg { -webkit-background-size: contain; background-size: contain; }
/* Blurred, enlarged copy fills the gaps around a photo that doesn't match the screen shape.
   Scaled up a little so the soft blurred edges are cropped off. Hidden where blur is unsupported. */
.bg { display: none; -webkit-background-size: cover; background-size: cover;
  -webkit-filter: blur(25px); filter: blur(25px);
  -webkit-transform: scale(1.15); transform: scale(1.15); opacity: 0.8; }
.blur .bg { display: block; }

#info { position: absolute; top: 40px; top: calc(constant(safe-area-inset-top) + 14px); top: calc(env(safe-area-inset-top) + 14px);
  right: 16px; z-index: 5; text-align: right; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  background: rgba(0,0,0,0.35); padding: 6px 12px; border-radius: 10px; }
#clock { font-size: 40px; font-weight: 300; line-height: 1.1; }
#sub { font-size: 16px; }
/* The photo's comment and the photo-update messages share one style: 27pt, white with a black border
   (shadows in all directions, which works on old Safari where text-stroke thins the letters). */
#caption, #msg { color: #fff; font-size: 27pt; line-height: 1.25; font-weight: 600;
  text-shadow: -2px -2px 0 #000, 0 -2px 0 #000, 2px -2px 0 #000, -2px 0 0 #000, 2px 0 0 #000, -2px 2px 0 #000, 0 2px 0 #000, 2px 2px 0 #000; }
#caption { position: absolute; left: 5%; width: 90%; text-align: center; bottom: 18px; bottom: calc(env(safe-area-inset-bottom) + 18px); z-index: 5; }
#msg { position: absolute; top: 40%; left: 8%; width: 84%; z-index: 6; text-align: center; }

.arrow { position: absolute; top: 50%; margin-top: -50px; z-index: 9; width: 64px; height: 100px; line-height: 90px; text-align: center; font-family: Arial, Helvetica, sans-serif;
  font-size: 90px; color: #fff; text-shadow: 0 0 6px #000, 0 2px 8px #000, 0 0 14px #000; pointer-events: none; }
#arrow-l { left: 12px; }
#arrow-r { right: 12px; }
#menu { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; text-align: center;
  padding: 18px 12px; padding-bottom: calc(env(safe-area-inset-bottom) + 18px); background: rgba(0,0,0,0.75); }
#menu button { font-size: 18px; margin: 6px; padding: 12px 22px; border-radius: 12px; border: 0;
  background: rgba(255,255,255,0.18); color: #fff; }

/* Sleep hours: a plain black cover. The screen light stays on, a web page can't switch it off. */
#sleep { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 30; background: #000; }
#share { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 20; background: rgba(0,0,0,0.6);
  overflow-y: auto; -webkit-overflow-scrolling: touch; }
.share-card { max-width: 520px; margin: 40px auto; margin-top: calc(env(safe-area-inset-top) + 40px); background: #fff; color: #1c1c1e;
  border-radius: 18px; padding: 8px 22px 22px; font-size: 16px; line-height: 1.5; }
.share-opt { display: block; width: 100%; text-align: left; margin: 12px 0 0; padding: 14px 16px; border-radius: 12px; border: 0;
  background: #f2f2f7; color: #1c1c1e; font-family: inherit; font-size: 17px; line-height: 1.4; }
.share-opt span { display: block; font-size: 14px; color: #6c6c70; margin-top: 3px; }
.share-qr { text-align: center; margin: 14px 0 6px; }
.share-qr img { width: 240px; height: 240px; max-width: 100%; background: #fff; padding: 10px; border-radius: 12px;
  image-rendering: pixelated; -webkit-box-sizing: border-box; box-sizing: border-box; border: 1px solid #e5e5ea; }
.share-addr { text-align: center; font-weight: 600; word-break: break-all; }
.warn { color: #b3261e; }

/* ---------- Setup ---------- */
#setup { min-height: 100%; background: #f2f2f7; color: #1c1c1e; padding: 24px 16px; padding-top: calc(env(safe-area-inset-top) + 24px);
  -webkit-box-sizing: border-box; box-sizing: border-box; }
.card { max-width: 560px; margin: 0 auto; background: #fff; border-radius: 18px; padding: 28px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.logo { width: 64px; height: 64px; border-radius: 14px; display: block; }
h1 { font-size: 30px; margin: 14px 0 6px; }
h2 { font-size: 20px; margin: 22px 0 8px; }
.lead { font-size: 17px; color: #48484a; margin: 0 0 18px; line-height: 1.45; }
.howto { padding-left: 22px; margin: 0 0 20px; font-size: 16px; line-height: 1.5; color: #3a3a3c; }
.howto li { margin-bottom: 4px; }
label { display: block; font-weight: 600; font-size: 15px; margin: 16px 0 6px; }
.opt { font-weight: 400; color: #8e8e93; }
textarea, input, select { width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; font-size: 17px; padding: 12px;
  border: 1px solid #c7c7cc; border-radius: 10px; background: #fff; color: #1c1c1e; font-family: inherit; -webkit-appearance: none; }
textarea { resize: vertical; word-break: break-all; }
button.primary, button.secondary, a.primary, a.secondary { display: block; width: 100%; margin-top: 20px; font-size: 18px; font-weight: 600; padding: 14px;
  border-radius: 12px; border: 0; font-family: inherit; text-align: center; text-decoration: none;
  -webkit-box-sizing: border-box; box-sizing: border-box; }
button.primary, a.primary { background: #0a84ff; color: #fff; }
button.primary[disabled] { opacity: 0.55; }
button.secondary, a.secondary { background: #e5e5ea; color: #0a84ff; }
.share-card a.primary, .share-card a.secondary { margin-top: 12px; }
.error { color: #c62828; font-size: 16px; line-height: 1.45; margin: 14px 0 0; }
.small { font-size: 14px; color: #6c6c70; }
#found { margin-top: 22px; border-top: 1px solid #e5e5ea; padding-top: 18px; font-size: 16px; line-height: 1.5; }
.found-row { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; -webkit-align-items: center; align-items: center; }
#found-thumb { width: 72px; height: 72px; border-radius: 10px; background: #e5e5ea center center no-repeat;
  -webkit-background-size: cover; background-size: cover; margin-right: 14px; -webkit-flex-shrink: 0; flex-shrink: 0; }
#found-text { margin: 0; font-size: 17px; }
#change-box { background: #f2f2f7; border-radius: 12px; padding: 4px 16px 12px; margin: 0 0 8px; font-size: 16px; line-height: 1.45; }
#change-box .howto { margin-bottom: 8px; }
.footer { margin: 26px 0 0; text-align: center; }
.footer a { color: #0a84ff; text-decoration: none; }
#app-address { color: #0a84ff; font-weight: 600; -webkit-user-select: text; user-select: text; word-break: break-all; font-size: 16px; }
#journey { background: #f2f2f7; border-radius: 12px; padding: 4px 16px 10px; margin: 0 0 14px; }
#journey h2 { margin-top: 14px; }
#journey .howto { margin-bottom: 8px; font-size: 15px; }
.device { margin: 14px 0 6px; }
.dev-tag { display: inline-block; background: #0a84ff; color: #fff; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
#use-here { margin-top: 26px; border-top: 1px solid #e5e5ea; padding-top: 4px; }
#qr-box { margin-top: 26px; border-top: 1px solid #e5e5ea; padding-top: 4px; }
#qr-img { text-align: center; margin: 18px 0 8px; }
#qr-img img { width: 260px; height: 260px; max-width: 100%; background: #fff; padding: 10px; border-radius: 12px;
  image-rendering: pixelated; -webkit-box-sizing: border-box; box-sizing: border-box; }
.share-icon { width: 22px; height: 22px; vertical-align: -5px; color: #0a84ff; }

@media (prefers-color-scheme: dark) {
  #setup { background: #000; color: #f2f2f7; }
  .card { background: #1c1c1e; box-shadow: none; }
  .lead, .howto { color: #c7c7cc; }
  textarea, input, select { background: #2c2c2e; border-color: #3a3a3c; color: #f2f2f7; }
  button.secondary, a.secondary { background: #2c2c2e; }
  #found, #qr-box, #use-here { border-top-color: #3a3a3c; }
  #journey { background: #2c2c2e; }
  #change-box { background: #2c2c2e; }
  .share-card { background: #1c1c1e; color: #f2f2f7; }
  .share-opt { background: #2c2c2e; color: #f2f2f7; }
  .share-opt span { color: #98989d; }
  .warn { color: #ff6b6b; }
  #found-thumb { background-color: #2c2c2e; }
  .small { color: #98989d; }
  .error { color: #ff6b6b; }
}
