/* Installed-app chrome. Self-contained: no styles.css tokens, so a visual
   restore can replace the page styles without restyling this file.
   Colors are the 18 Nov 2026 dark mockup: shell #141414, card #1c1c1c,
   mark teal #00c0e8. Labels use Geist Mono. */

html {
  height: 100dvh;
  /* Apply device insets outside the scaled body so a 47px cutout gets 47px. */
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  overscroll-behavior: none;
}

html.is-preparing-shell .app-frame { visibility: hidden; }

.shell-boot-error[hidden] { display: none; }

.shell-boot-error:not([hidden]) {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 16px;
  padding: 32px;
  color: #eee;
  background: #141414;
  font: 14px/1.5 "Geist", Arial, sans-serif;
  text-align: center;
}

.shell-boot-error p { max-width: 420px; margin: 0; }

.shell-boot-error button {
  justify-self: center;
  padding: 8px 12px;
  border: 1px solid #3a3a3a;
  border-radius: 5px;
  color: #eee;
  background: #1c1c1c;
  font: inherit;
}

body {
  width: 100%;
  height: 100%;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

.app-shell,
.app-frame,
.sidebar,
.note-list,
.editor-scroll,
.settings-window {
  overscroll-behavior: none;
}

/* Fixed notices use the viewport, but their offsets scale with the .75 body zoom. */
.toast {
  right: max(25px, calc(env(safe-area-inset-right, 0px) / .75));
  bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) / .75));
}

.pwa-notice {
  position: fixed;
  z-index: 35;
  left: max(16px, calc(env(safe-area-inset-left, 0px) / .75));
  right: max(16px, calc(env(safe-area-inset-right, 0px) / .75));
  bottom: max(72px, calc(56px + env(safe-area-inset-bottom, 0px) / .75));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 13px;
  border: 1px solid #2a2a2a;
  border-radius: 5px;
  color: #eee;
  background: #1c1c1c;
  box-shadow: 0 8px 30px #0008;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.pwa-notice p { margin: 0; flex: 1 1 220px; }

.pwa-notice button {
  flex: 0 0 auto;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  color: #00c0e8;
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pwa-notice button.pwa-text-button {
  color: #8b8b8c;
  font-weight: 600;
}

.pwa-notice button:disabled {
  opacity: .55;
  cursor: wait;
}

.pwa-update {
  top: max(16px, calc(env(safe-area-inset-top, 0px) / .75));
  bottom: auto;
}

#pwa-settings-install {
  margin-top: 10px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #2a2a2a;
  border-radius: 5px;
  color: #eee;
  background: #1c1c1c;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
