:root {
  --page: #FAF7F2;
  --ink: #2D1E2F;
  --muted: #6B5A6D;
  --button: #2D1E2F;
  --button-ink: #FAF7F2;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #141216;
    --ink: #F1EBF5;
    --muted: #B9ADBD;
    --button: #E9DFF0;
    --button-ink: #2D1E2F;
  }
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  /* Compose draws everything; the page itself never scrolls, zooms on double tap or highlights taps */
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* The ribbon on ivory while the app loads (and the place for a clear message if it can't) */
#veya-loading {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
  box-sizing: border-box;
  background: var(--page);
  text-align: center;
  transition: opacity 320ms cubic-bezier(0.2, 0, 0, 1);
}
#veya-loading.done { opacity: 0; pointer-events: none; }
#veya-loading .mark { width: 72px; height: 72px; animation: breathe 2.4s ease-in-out infinite; }
#veya-loading .mark.dark { display: none; }
@media (prefers-color-scheme: dark) {
  #veya-loading .mark.light { display: none; }
  #veya-loading .mark.dark { display: block; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.92; }
  50% { transform: scale(1.06); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #veya-loading .mark { animation: none; }
}
#veya-loading.failed .mark { animation: none; }

#veya-message { max-width: 420px; }
#veya-message h1 { font-size: 22px; line-height: 1.3; font-weight: 600; margin: 0 0 8px; }
#veya-message p { font-size: 16px; line-height: 1.5; margin: 0; color: var(--muted); }
#veya-reload {
  margin-top: 20px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 24px;
  background: var(--button);
  color: var(--button-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.noscript { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; justify-content: center; align-items: center; background: var(--page); padding: 24px; }
.noscript p { margin: 4px 0; font-size: 15px; }

/* the Compose canvas fills the window */
canvas { display: block; outline: none; }

/* Compose hosts its canvas in the body (a shadow root); keyboard focus is drawn by the app itself */
body:focus, body:focus-visible { outline: none; }
