/* Ping 8 · what p8.css (the prototype's own stylesheet) does not contain.
   Same visual language: canvas #FAF7F0, paper #F1EBDD, sand #EDE3D1, sage #DDE3D4, brand/night #233D3A, brand-deep #2E5E4E,
   amber #E8A83B, ink #1F2A2E, ink-soft #3A464A, ink-mute #5F6B6E, ink-faint #7E8786. "white/x" in p8.css is ink at that opacity. */

/* ---------------------------------------------------------------- the frame: full screen on a phone, a 430px column on wider screens */

html, body { height: 100%; }
body { overflow: hidden; background: #FAF7F0; overscroll-behavior: none; }

.p8-stage { position: relative; display: flex; height: 100vh; height: 100dvh; width: 100%; align-items: center; justify-content: center; background: #FAF7F0; }
.p8-glow { display: none; }
.p8-phone { position: relative; z-index: 1; height: 100%; width: 100%; }
.p8-screen { isolation: isolate; }
.p8-safe-top { padding-top: env(safe-area-inset-top, 0px); }

@media (min-width: 640px) {
  body { background: #0B100F; }
  .p8-stage { background: #0B100F; padding: 24px; }
  .p8-glow { display: block; position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
  .p8-glow::before { content: ""; position: absolute; left: 50%; top: 50%; height: 72vh; width: 72vh; transform: translate(-50%, -50%); border-radius: 9999px; background: rgba(46, 94, 78, 0.25); filter: blur(130px); }
  .p8-glow::after { content: ""; position: absolute; left: 50%; top: 86%; height: 30vh; width: 60vh; transform: translateX(-50%); border-radius: 9999px; background: rgba(232, 168, 59, 0.1); filter: blur(100px); }
  .p8-phone { width: 430px; height: min(932px, calc(100dvh - 48px)); overflow: hidden; border-radius: 2.4rem; background: #FAF7F0;
              box-shadow: 0 60px 120px -30px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.12); }
}

.p8-boot { flex: 1; }

/* ---------------------------------------------------------------- sheets, toasts, the floating mark bar */

@keyframes p8-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.p8-sheet { animation: p8-sheet-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; outline: none; }
.p8-fade { animation: p8-fade 0.25s both; }

.p8-toasts { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 64px); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 16px; pointer-events: none; }
.p8-toast { max-width: 100%; text-align: center; line-height: 1.4; border-radius: 22px; }

.p8-selbar { max-width: calc(100vw - 16px); }

/* ---------------------------------------------------------------- small things in the prototype's manner */

.p8-break { overflow-wrap: anywhere; }

/* a piece the server only suggested: dashed outline in the type's colour, waiting for a yes or no */
.p8-dashed { border: 1px dashed currentColor; background: transparent; }

/* the pill switch (settings, "They said this") */
.p8-switch { position: relative; flex: none; height: 24px; width: 42px; border-radius: 9999px; background: rgba(31, 42, 46, 0.15); transition: background-color 0.18s; }
.p8-switch > span { position: absolute; left: 3px; top: 3px; height: 18px; width: 18px; border-radius: 9999px; background: #FAF7F0; box-shadow: 0 1px 3px rgba(31, 42, 46, 0.3); transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1); }
.p8-switch.on { background: #233D3A; }
.p8-switch.on > span { transform: translateX(18px); }
.p8-switch:focus-visible { outline: 2px solid #E8A83B; outline-offset: 2px; }

.p8-search::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

.p8-graph { display: block; height: 380px; width: 100%; touch-action: none; cursor: grab; outline: none; }
.p8-graph:focus-visible { box-shadow: inset 0 0 0 2px rgba(232, 168, 59, 0.7); }
.p8-frame { height: 440px; }

.p8-details > summary { list-style: none; }
.p8-details > summary::-webkit-details-marker { display: none; }
.p8-details[open] > summary .p8-chevron { transform: rotate(180deg); }

input[type="date"], input[type="time"] { min-height: 2.6rem; color-scheme: light; }
textarea { font-family: inherit; }
[hidden] { display: none !important; }

/* everything that can be pressed shows where the keyboard is */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible, summary:focus-visible { outline: 2px solid #E8A83B; outline-offset: 2px; border-radius: 12px; }
main:focus { outline: none; }

/* utilities the prototype's build did not happen to contain (same names and values as Tailwind would give them) */
.grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.pb-0 { padding-bottom: 0; }
.pb-14 { padding-bottom: 3.5rem; }
.pt-10 { padding-top: 2.5rem; }
.pl-1\.5 { padding-left: 0.375rem; }
.pr-0\.5 { padding-right: 0.125rem; }
.pr-1\.5 { padding-right: 0.375rem; }
.max-h-\[70\%\] { max-height: 70%; }
.pb-\[calc\(0\.75rem\+env\(safe-area-inset-bottom\)\)\] { padding-bottom: calc(0.75rem + env(safe-area-inset-bottom)); }
.-mr-1 { margin-right: -0.25rem; }
.gap-y-1 { row-gap: 0.25rem; }
.max-w-full { max-width: 100%; }
.min-h-full { min-height: 100%; }
.max-h-56 { max-height: 14rem; }
.rounded-\[1px\] { border-radius: 1px; }
.rounded-\[8px\] { border-radius: 8px; }
.normal-case { text-transform: none; }
.tracking-normal { letter-spacing: 0; }
.select-all { user-select: all; -webkit-user-select: all; }
.p8-own { min-width: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------------- simple mode: larger type and buttons */

html[data-mode="simple"] #main > * { zoom: 1.16; }
html[data-mode="simple"] nav a span:last-child { font-size: 12.5px; }
html[data-mode="simple"] nav a { min-height: 62px; }

/* ---------------------------------------------------------------- printing the book */

@media print {
  html, body { height: auto; overflow: visible; background: #fff; }
  .p8-stage { display: block; height: auto; padding: 0; background: #fff; }
  .p8-glow, .p8-toasts, #overlays, .no-print { display: none !important; }
  .p8-phone { width: auto; height: auto; overflow: visible; border-radius: 0; box-shadow: none; background: #fff; }
  .p8-screen, #app, #main { display: block !important; height: auto !important; overflow: visible !important; background: #fff !important; }
  #main > * { zoom: 1 !important; animation: none !important; }
  .p8-book { max-width: 640px; margin: 0 auto; padding: 0 !important; }
  .p8-keep { break-inside: avoid; background: #fff !important; }
  .p8-keep-next { break-after: avoid; }
  @page { margin: 18mm 16mm; }
}

/* ---------------------------------------------------------------- the voice guide: a ring around one thing, and its card */

.p8-guide { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
/* the dim is the ring's own shadow, so every click still reaches the app underneath */
.p8-guide-spot { position: absolute; pointer-events: none; outline: 2px solid #E8A83B; box-shadow: 0 0 0 200vmax rgba(31, 42, 46, 0.3); animation: p8-fade 0.35s both; }
.p8-guide-card { position: absolute; left: 8px; right: 8px; bottom: 8px; pointer-events: auto; animation: p8-rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.p8-guide-bubble { max-height: min(60vh, 440px); }

/* how many stored nodes are drawn */
.p8-range { height: 24px; accent-color: #233D3A; }
