/* Shell styles. The widget brings its own CSS; these only cover the splash,
   offline screen and install affordances that sit around it. */

:root {
  --shell-ink: #141b2d;
  --shell-muted: #566077;
  --shell-ground: #ffffff;
  --shell-rule: #d9dfe8;
  /* Everything below must sit above the widget, which uses a very high z-index. */
  --shell-z: 2147483647;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--shell-ground);
  color: var(--shell-ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none; /* no rubber-band bounce behind the fixed chat window */
}

[hidden] { display: none !important; }

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 20px;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn:focus-visible { outline: 2px solid var(--shell-ink); outline-offset: 2px; }
.btn--primary { background: var(--shell-ink); color: #fff; }
.btn--ghost { background: transparent; color: var(--shell-ink); border-color: var(--shell-rule); }

/* Splash: visible until widget.js has loaded */
.splash {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}
.splash__name { margin: 0; font-weight: 700; font-size: 18px; }
.splash__hint { margin: 0; color: var(--shell-muted); font-size: 14px; }

/* Offline screen */
.offline {
  position: fixed;
  inset: 0;
  z-index: var(--shell-z);
  display: grid;
  place-items: center;
  background: var(--shell-ground);
  padding: calc(24px + var(--safe-top)) calc(24px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(24px + var(--safe-left));
}
.offline__card { max-width: 380px; text-align: center; }
.offline__title { margin: 0 0 10px; font-size: 24px; line-height: 1.2; }
.offline__text { margin: 0 0 22px; color: var(--shell-muted); }

/* Install pill (POC placement: floats above the widget's input area).
   The long-term home for this is a header icon inside the widget. */
.install {
  position: fixed;
  right: calc(16px + var(--safe-right));
  bottom: calc(88px + var(--safe-bottom));
  z-index: var(--shell-z);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--shell-ink);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}
.install:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* iOS "Add to Home Screen" sheet */
.ios-hint {
  position: fixed;
  left: calc(12px + var(--safe-left));
  right: calc(12px + var(--safe-right));
  bottom: calc(12px + var(--safe-bottom));
  z-index: var(--shell-z);
  background: var(--shell-ground);
  border: 1px solid var(--shell-rule);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 8px;
  justify-items: start;
}
.ios-hint__title { margin: 0; font-weight: 700; }
.ios-hint__text { margin: 0; color: var(--shell-muted); font-size: 15px; }
