/* ---- fonts: self-hosted variable woff2 (Google's own files, pinned).
   Third-party CSS + display=swap painted every page twice: system
   fallback first, webfont swapped in after two cross-origin hops. ---- */
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  /* optional = the font either makes first paint or waits for the NEXT
     navigation — the fallback→webfont double-render can never happen */
  font-display: optional;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  /* optional = the font either makes first paint or waits for the NEXT
     navigation — the fallback→webfont double-render can never happen */
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  /* optional = the font either makes first paint or waits for the NEXT
     navigation — the fallback→webfont double-render can never happen */
  font-display: optional;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  /* optional = the font either makes first paint or waits for the NEXT
     navigation — the fallback→webfont double-render can never happen */
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Billy app shell — warm California design system (matches css/style.css on the
   marketing site) with a living, time-of-day scene behind every screen.

   The page carries data-time="dawn|day|night" on <html> (set by js/app.js
   from the local clock). Each phase re-tokens the same components: the scene
   photo/starfield, the ground tint, ink, and glass surfaces all follow the sun.
   Class names are a contract — login.html and the backend-rendered magic-link
   pages (app/http/design.py) use them too — so this file restyles, never renames. */

:root {
  color-scheme: light;

  /* ground + ink — marketing tokens (css/style.css) */
  --ground: #eeebe6;
  --ink: #1a1f2b;
  --ink-soft: #565b66;
  --muted: #8a8f98;
  --line: rgba(26, 31, 43, 0.08);

  /* glass surfaces over the scene */
  --card: rgba(255, 255, 255, 0.66);
  --card-strong: rgba(255, 255, 255, 0.84);
  --glass-border: rgba(255, 255, 255, 0.55);
  --chip: rgba(26, 31, 43, 0.05);

  /* brand + status: iMessage blue is the app accent; billy green is the mark */
  --blue: #0a84ff;
  --green: #22c55e;
  --green-press: #1aa64b;
  --green-soft: rgba(34, 197, 94, 0.14);
  --dark: #2b2b28;
  --dark-hover: #1c1c1a;
  --btn-primary-ink: #ffffff;
  --danger: #c0392b;
  --grey-bubble: #e9e9eb;
  --bubble-ink: #1a1f2b;

  /* scene layer */
  --sky-img: url("/assets/hero-sky.jpg");
  --sky-pos: center 65%;
  --sky-opacity: 0.9;
  --wash-a: rgba(224, 242, 254, 0.32);   /* poke day-sky wash */
  --wash-b: rgba(238, 235, 230, 0);

  /* shape + type */
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(26, 31, 43, 0.06), 0 16px 40px -18px rgba(26, 31, 43, 0.22);
  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Nunito", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* the thread scrollbar (thin, edge-riding) — quiet on the light ground */
  --scrollbar: rgba(26, 31, 43, 0.28);
}

/* dawn — first light over the hills (hero-dawn.jpg, generated in-brand) */
:root[data-time="dawn"] {
  --ground: #f3e7de;
  --sky-img: url("/assets/hero-dawn.jpg");
  --sky-pos: center 70%;
  --wash-a: rgba(255, 236, 224, 0.25);
  --wash-b: rgba(255, 247, 237, 0);
  --sky-opacity: 0.95;
}

/* night — no photo in the brand set, so the sky is drawn: deep ink + stars.
   Ink flips light; glass goes dark; the primary button inverts to porcelain. */
:root[data-time="night"] {
  color-scheme: dark;
  --ground: #0e1119;                       /* between poke night #111720 and iMessage-dark #09090b */
  --ink: #f2f4f8;
  --ink-soft: #b6bdc9;
  --muted: #7d8594;
  --line: rgba(255, 255, 255, 0.09);
  --card: rgba(30, 37, 52, 0.62);
  --card-strong: rgba(34, 42, 58, 0.85);
  --glass-border: rgba(255, 255, 255, 0.09);
  --chip: rgba(255, 255, 255, 0.07);
  --dark: #f2f4f8;
  --dark-hover: #ffffff;
  --btn-primary-ink: #10141d;
  --danger: #f87171;
  /* neutral graphite received-bubble, straight from the iMessage-dark
     reference (#202023) — not blue-tinted */
  --grey-bubble: #212124;
  --bubble-ink: #f2f4f8;
  --sky-img: url("/assets/hero-night.jpg");
  --sky-pos: center 70%;
  --sky-opacity: 1;
  --wash-a: rgba(16, 20, 29, 0);
  --wash-b: rgba(16, 20, 29, 0);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -18px rgba(0, 0, 0, 0.6);
  --scrollbar: rgba(255, 255, 255, 0.22);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { min-height: 100dvh; overscroll-behavior-y: none; }

a { color: var(--blue); text-decoration: none; }
input, select, button, textarea { font-family: inherit; }
::selection { background: rgba(10, 132, 255, 0.2); }

/* ---- the scene: a fixed sky behind everything, vignetted into the ground.
   Injected by billy.renderShell(); pages without it just show the ground. ---- */
.scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.scene-img {
  position: absolute; inset: 0;
  background-image: var(--sky-img);
  background-size: cover;
  background-position: var(--sky-pos);
  /* no load-time transition: the photo is HTTP-cached across pages, so a
     static opacity renders identical pixels instantly — the scene reads as
     continuous when navigating. (A fade here replayed on every page load.) */
  opacity: var(--sky-opacity);
}
/* the scene stays VISIBLE — only a light wash for text legibility up top and a
   short fade into the ground at the very bottom (the earlier full-height
   vignette was erasing the hills). */
.scene-fade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, var(--wash-a) 0%, var(--wash-b) 34%, rgba(0,0,0,0) 55%, var(--ground) 100%);
}
/* night: the photographed starfield carries the scene; a few drawn stars
   breathe on top so the sky feels alive */
.scene-stars { position: absolute; inset: 0; display: none; }
:root[data-time="night"] .scene-stars {
  display: block;
  background-image:
    radial-gradient(1.5px 1.5px at 18% 14%, rgba(255,255,255,.7), transparent 55%),
    radial-gradient(1.5px 1.5px at 46% 24%, rgba(255,255,255,.55), transparent 55%),
    radial-gradient(2px 2px at 68% 9%, rgba(255,255,255,.65), transparent 55%),
    radial-gradient(1.5px 1.5px at 85% 31%, rgba(255,255,255,.5), transparent 55%),
    radial-gradient(1.5px 1.5px at 31% 39%, rgba(255,255,255,.4), transparent 55%);
  animation: stars-breathe 6s ease-in-out infinite alternate;
}
:root[data-time="night"] .scene-fade {
  background:
    linear-gradient(180deg, rgba(16,20,29,0) 0%, rgba(16,20,29,0) 52%, var(--ground) 100%);
}
@keyframes stars-breathe { from { opacity: 0.35; } to { opacity: 0.9; } }

/* Cross-document view transitions: same-origin navigations crossfade, and
   the nav + scene — identical markup and geometry on every page — render as
   continuous shared elements instead of redrawing. Browsers without support
   ignore all three rules; the static shell above still prevents any pop-in. */
@view-transition { navigation: auto; }
.topnav { view-transition-name: topnav; }
.scene { view-transition-name: scene; }

/* content sits above the scene */
.screen {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 540px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 36px) clamp(18px, 5vw, 28px) 40px;
}
.screen-center { justify-content: center; }
/* /chat: the frame IS the viewport (the Tomo behavior). The page has nothing
   to scroll — the thread is the only scroller — so the composer sits in
   ordinary flow below it and cannot move under any scroll: rubber-band and
   momentum land inside the log, never on the frame. */
.screen-chat { height: 100dvh; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.spacer { flex: 1; }

/* ---- brand: the boomerang + serif wordmark, same as the marketing nav ---- */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; display: block; transition: transform .6s cubic-bezier(0.22, 1, 0.36, 1); }
.brand:hover .brand-logo { transform: rotate(-15deg); }
/* the doodle is pure black strokes — night turns the bare mark white */
:root[data-time="night"] .brand-logo { filter: invert(1); }
.brand-name {
  font-family: var(--font-display);
  font-size: 21px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink);
  /* optical alignment: "Billy" ends in a descender, so bbox-centering rides
     the visible word 2.76px high against the mark (measured via canvas
     TextMetrics: ink-band center minus cap-band center at 21px Newsreader).
     Nudge down so the CAP BAND centers on the logo and the y-tail hangs. */
  position: relative; top: 2.75px;
}
/* legacy green mark (login + magic-link pages still render it) */
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, var(--green), var(--green-press));
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

/* ---- type: serif display over Nunito body, like the marketing site ---- */
.title {
  font-family: var(--font-display);
  font-size: clamp(26px, 7vw, 32px); font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.1; margin: 0;
}
.title em { font-style: italic; font-weight: 500; }
.subtitle { color: var(--ink-soft); font-size: 14px; line-height: 1.55; margin: 0; }
.muted { color: var(--ink-soft); }
.faint { color: var(--muted); }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}

/* the poke-style day strip: greeting in serif + the date, set by js/app.js */
/* the greeting bows out the moment the thread exists (chat.html adds
   .daystrip-gone on the first bubble): opacity fades while the 1fr→0fr grid
   row collapses the height. Bubbles are bottom-anchored, so the freed space
   opens at the TOP of the log and nothing on screen shifts. The inner wrapper
   is what 0fr squeezes (overflow: hidden); visibility flips after the
   transition so the collapsed greeting also leaves the a11y tree. */
.daystrip {
  margin: 2px 0 18px;
  display: grid; grid-template-rows: 1fr;
  transition: grid-template-rows 0.3s ease, opacity 0.25s ease, margin 0.3s ease, visibility 0s 0.3s;
}
.daystrip-inner { min-height: 0; overflow: hidden; }
.daystrip-gone { grid-template-rows: 0fr; opacity: 0; margin: 0; visibility: hidden; }
.daystrip-date { font-size: 13.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.daystrip .title { margin-top: 2px; }

/* ---- buttons: charcoal pill primary (btn-dark on the marketing site),
   glass secondary. At night the primary inverts to porcelain. ---- */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border: 1px solid var(--glass-border);
  background: var(--card); color: var(--ink);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-size: 14.5px; font-weight: 700;
  padding: 11px 18px; border-radius: var(--radius-pill);
  cursor: pointer; width: 100%; white-space: nowrap;
  box-shadow: 0 2px 10px -4px rgba(26, 31, 43, 0.18);
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
/* A disabled PRIMARY stays opaque — the solid pill at 55% opacity let the
   scene photo bleed through and read as mud, not as "waiting for input". */
.btn-primary:disabled { opacity: 1; background: var(--card-strong); color: var(--muted); box-shadow: none; }
/* the marketing "Get Started" pill (css/style.css .btn-dark), token-adapted so
   night inverts it to porcelain: same type, padding, lift, and layered shadows */
.btn-primary {
  background: var(--dark); border-color: transparent; color: var(--btn-primary-ink);
  font-size: 14.5px; font-weight: 600; padding: 11px 22px; gap: 8px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 24px -10px rgba(26, 31, 43, 0.5);
}
.btn-primary:hover {
  background: var(--dark-hover); transform: translateY(-2px) scale(1.02);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 16px 32px -12px rgba(26, 31, 43, 0.55);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-plus { font-size: 15px; font-weight: 400; line-height: 1; }
.btn-ghost {
  background: transparent; border-color: transparent; color: var(--ink-soft);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: none; font-weight: 600;
}
.btn-ghost:hover { color: var(--ink); transform: none; }

/* ---- form fields ---- */
.field { display: flex; flex-direction: column; gap: 8px; }
.label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.input, .select {
  width: 100%; background: var(--card-strong); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; font-size: 15px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder { color: var(--muted); }
.input:focus, .select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.18); }

.phone-row { display: flex; gap: 10px; align-items: stretch; }
.phone-row .input { flex: 1; min-width: 0; }
.dial-code {
  flex: 0 0 auto; display: inline-flex; align-items: center;
  padding: 0 14px; font-size: 15px; font-weight: 700; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.code-input { text-align: center; letter-spacing: 0.5em; font-size: 21px; font-weight: 600; padding-left: 0.5em; }

/* ---- profile rows: an icon in the input's left gutter (settings) ----
   Works on real inputs, read-only divs, and link-action anchors alike, so a
   linked identity and its missing-state action share one silhouette. */
.iconfield { position: relative; }
.iconfield > .input { padding-left: 40px; display: block; }
.iconfield-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--ink-soft); pointer-events: none;
  /* Above the input: its backdrop-filter forms a stacking context that would
     otherwise paint the glass over the icon and dim it to a ghost. */
  z-index: 1;
}
.input:disabled { color: var(--muted); -webkit-text-fill-color: var(--muted); opacity: 1; cursor: not-allowed; }
.input.rowlink {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  color: var(--ink); text-decoration: none; font-weight: 600; cursor: pointer;
}
.rowlink:hover { border-color: var(--blue); }
.rowlink > span { color: var(--ink-soft); }

/* ---- timezone combobox (js/tzselect.js, data from js/timezones.js) ----
   A search field that behaves like a select: the trigger is the input, and the
   popup is a listbox of ~316 zones. Tokens only, so it re-themes with the sun
   like every other surface. */
.tzselect { position: relative; }
/* Every card is its own stacking context (backdrop-filter), so a later sibling
   card would paint over this card's open dropdown no matter the popup's
   z-index. Raise the host card while a picker is open — same idiom as
   .connector:has(.acct-menu) below. */
.card:has(.tzselect[data-open="true"]) { position: relative; z-index: 60; }
.tzselect-control { position: relative; display: flex; align-items: center; }
.tzselect-input {
  width: 100%; background: var(--card-strong); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 38px 12px 40px; font-size: 15px; outline: none;
  text-overflow: ellipsis;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tzselect-input::placeholder { color: var(--muted); }
.tzselect-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.18); }
/* Pristine = showing the chosen label, not a query. No caret, no selectable
   text look — the field reads as a closed select until you actually type. */
.tzselect.is-pristine .tzselect-input { caret-color: transparent; }
/* Icons sit over the input's padding gutters and must never eat the click.
   z-index keeps them above the input's backdrop-filter stacking context. */
.tzselect-icon, .tzselect-chevron { position: absolute; color: var(--ink-soft); pointer-events: none; z-index: 1; }
.tzselect-icon { left: 13px; }
.tzselect-chevron { right: 12px; transition: transform 0.15s ease; }
.tzselect[data-open="true"] .tzselect-chevron { transform: rotate(180deg); }

.tzselect-pop {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 8px);
  max-height: 288px; overflow-y: auto; overscroll-behavior: contain;
  padding: 6px;
  /* Opaque, but still themed: the glass tint composited over the solid ground.
     A translucent popup let the card's own labels ghost through the rows. */
  background-color: var(--ground);
  background-image: linear-gradient(var(--card-strong), var(--card-strong));
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow), 0 24px 56px -16px rgba(16, 20, 29, 0.35);
  animation: tzselect-in 0.16s cubic-bezier(0.2, 0.9, 0.3, 1);
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.tzselect-pop::-webkit-scrollbar { width: 8px; }
.tzselect-pop::-webkit-scrollbar-thumb { background: var(--line); border-radius: var(--radius-pill); }
.tzselect-pop::-webkit-scrollbar-track { background: transparent; }
@keyframes tzselect-in {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
/* Flipped by tzselect.js when the field sits too near the viewport bottom. */
.tzselect.is-up .tzselect-pop { top: auto; bottom: calc(100% + 8px); animation-name: tzselect-in-up; }
@keyframes tzselect-in-up {
  from { opacity: 0; transform: translateY(-6px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .tzselect-pop { animation: none; } }
/* Row radius = popup radius minus its padding, so the bands sit concentric. */
.tzselect-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
  font-size: 14px; line-height: 1.3; color: var(--ink);
}
.tzselect-opt-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* One quiet chip for hover, keyboard cursor, and the chosen row alike — the
   check is what says "selected", so the popup never shows competing accents. */
.tzselect-opt:hover, .tzselect-opt.is-active, .tzselect-opt[aria-selected="true"] { background: var(--chip); }
.tzselect-opt[aria-selected="true"] { font-weight: 600; }
.tzselect-check { flex: 0 0 auto; color: var(--blue); }
.tzselect-empty { padding: 12px; font-size: 13.5px; color: var(--muted); }

/* ---- billing plans (settings) ---- */
.planhint { text-align: center; font-size: 13px; color: var(--ink-soft); margin: 0 0 2px; }
.planrow {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 13px; padding: 15px 14px; cursor: pointer;
  background: var(--card-strong); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.planrow:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.18); }
.planrow-active { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.planname { font-size: 14px; color: var(--ink); }
.planname b { font-size: 15px; }
.planprice { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.planbadge {
  position: absolute; top: -10px; left: 13px; padding: 2px 9px; z-index: 1;
  background: var(--green); color: #fff; font-size: 11px; font-weight: 800;
  letter-spacing: 0.03em; border-radius: var(--radius-pill);
}
.plancheck {
  width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  visibility: hidden; flex: 0 0 auto;
}
.planrow-active .plancheck { visibility: visible; }
.planterms { text-align: center; font-size: 12.5px; color: var(--muted); margin: 11px 0 0; }
.planterms a { color: inherit; }

/* ---- cards: glass over the scene ---- */
.card {
  background: var(--card); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg); padding: 18px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.notice { color: var(--danger); font-size: 14px; margin: 0; }
.callout {
  background: var(--card); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}

/* ---- apps grid ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 380px) { .grid { grid-template-columns: 1fr; } }
.tile {
  position: relative; display: block; overflow: hidden;
  background: var(--card); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg); color: var(--ink);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 2px 12px -6px rgba(26, 31, 43, 0.16);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile:active { transform: scale(0.98); }
.tile-body { padding: 12px 14px 14px; }
.tile-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }

/* per-app cover (kept for /a/<id> and future tiles) */
.cover { position: relative; overflow: hidden; }
.cover-tile { height: 104px; }
/* The cover palette — THEME-NATIVE (the v1 lesson: inline hex gradients
   bypassed the time-of-day system entirely, so covers clashed with every
   scene). The HUE pair is the app's identity and never changes; saturation
   and lightness are THEME knobs re-tokened by data-time like every other
   surface — sun-lit by day, hazier at dawn, ink-deep at night. apps.html
   picks .cover-p<n> by id hash (a minted theme-color snaps to the nearest
   hue); app/og.py renders the night form of the same entry — a PNG can't
   follow the viewer's theme, but the ENTRY is pinned identical by test. */
:root { --cover-s1: 46%; --cover-s2: 40%; --cover-l1: 45%; --cover-l2: 32%; }
:root[data-time="dawn"] { --cover-s1: 40%; --cover-s2: 36%; --cover-l1: 50%; --cover-l2: 37%; }
:root[data-time="night"] { --cover-s1: 40%; --cover-s2: 36%; --cover-l1: 30%; --cover-l2: 19%; }
.cover-p0, .cover-p1, .cover-p2, .cover-p3, .cover-p4, .cover-p5, .cover-p6, .cover-p7 {
  background: linear-gradient(
    140deg,
    hsl(var(--ch1) var(--cover-s1) var(--cover-l1)),
    hsl(var(--ch2) var(--cover-s2) var(--cover-l2))
  );
}
.cover-p0 { --ch1: 210; --ch2: 230; } /* ocean */
.cover-p1 { --ch1: 142; --ch2: 162; } /* sage — the brand's calm cousin */
.cover-p2 { --ch1: 36;  --ch2: 20;  } /* dusk gold */
.cover-p3 { --ch1: 16;  --ch2: 356; } /* terracotta */
.cover-p4 { --ch1: 300; --ch2: 320; } /* plum */
.cover-p5 { --ch1: 183; --ch2: 203; } /* deep teal */
.cover-p6 { --ch1: 255; --ch2: 275; } /* indigo */
.cover-p7 { --ch1: 215; --ch2: 235; --cover-s1: 22%; --cover-s2: 20%; } /* slate ink */
.cover-glow {
  position: absolute; inset: 0;
  background: radial-gradient(130% 100% at 18% -10%, rgba(255, 255, 255, 0.35), transparent 55%);
}
.cover-deboss {
  position: absolute; right: -12px; bottom: -20px; font-size: 108px; line-height: 1;
  filter: grayscale(1); mix-blend-mode: overlay; opacity: 0.62;
  transform: rotate(-7deg); pointer-events: none; user-select: none;
}
.app-banner {
  position: relative; border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  overflow: hidden; margin-bottom: 16px;
}
.cover-banner { height: 150px; }
.cover-banner .cover-deboss { right: 14px; bottom: -46px; font-size: 210px; }
.app-banner-name {
  position: absolute; left: 24px; bottom: 20px; margin: 0;
  font-family: var(--font-display);
  font-size: 24px; font-weight: 600; letter-spacing: -0.01em; color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}
.app-banner-actions { position: absolute; top: 14px; right: 14px; z-index: 2; }

.empty {
  text-align: center; padding: 40px 24px; display: flex; flex-direction: column;
  align-items: center; gap: 14px;
}
.empty-emoji { font-size: 40px; }

/* ---- generic renderer ---- */
.app-header { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.app-header .tile-emoji { width: 42px; height: 42px; font-size: 22px; }
.app-title { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.summary-pill {
  display: inline-block; margin: 2px 0 18px; padding: 6px 12px;
  background: var(--chip); border: 1px solid var(--line);
  border-radius: var(--radius-pill); font-size: 13px; color: var(--ink-soft);
}
.entry-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.entry-form .field { flex: 1 1 130px; min-width: 0; }
.entry-form .btn { width: auto; flex: 0 0 auto; padding: 13px 22px; }
.entry-form .checkbox-field { flex-direction: row; align-items: center; gap: 8px; }
.reaction {
  flex-basis: 100%; margin-top: 4px; padding: 12px 14px;
  background: var(--green-soft); border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius); font-size: 14px; color: var(--ink);
}
.table-wrap {
  margin-top: 22px; border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--card);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
table.entries { border-collapse: collapse; width: 100%; min-width: max-content; font-size: 14px; }
table.entries th {
  text-align: left; padding: 12px 14px; background: var(--chip);
  color: var(--ink-soft); font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--line);
}
table.entries td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
table.entries tr:last-child td { border-bottom: none; }
table.entries .empty-row { color: var(--muted); }

.row-actions { white-space: nowrap; text-align: right; width: 1%; }
.row-action {
  appearance: none; background: none; border: none; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--ink-soft); padding: 4px 8px; border-radius: 8px;
}
.row-action:hover { color: var(--ink); background: var(--chip); }
.row-action.danger:hover { color: var(--danger); }
.row-action:disabled { opacity: 0.5; cursor: default; }

.backlink { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-soft); margin-bottom: 18px; }
.backlink:hover { color: var(--ink); }

/* ---- top nav: brand · glass pill of links · logout ---- */
.topnav {
  /* brand · links · logout. The middle track is minmax(0,1fr) so the pill can
     actually SHRINK and scroll internally — an auto track never shrinks below
     its content and overflowed the brand at phone widths. Sticky: the shell
     stays put while the thread scrolls under it, like an app header. */
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 10px; min-height: 44px; margin-bottom: 24px;
  position: sticky; top: max(8px, env(safe-area-inset-top, 0px)); z-index: 10;
}
.topnav-brand { display: inline-flex; justify-self: start; }
.topnav-links {
  display: flex; align-items: center; gap: 2px; min-width: 0; justify-self: center; max-width: 100%;
  padding: 4px; border-radius: var(--radius-pill);
  background: var(--card); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px -4px rgba(26, 31, 43, 0.14);
}
.topnav > :last-child { justify-self: end; }
.navlink {
  display: inline-flex; align-items: center; min-height: 36px; padding: 7px 13px;
  font-size: 14.5px; font-weight: 700; color: var(--ink-soft); white-space: nowrap;
  border-radius: var(--radius-pill);
  transition: color 0.15s ease, background 0.15s ease;
}
.navlink:hover { color: var(--ink); background: var(--chip); }
.navlink-active { color: var(--ink); background: var(--card-strong); box-shadow: 0 1px 6px -2px rgba(26, 31, 43, 0.25); }
.topnav .btn-ghost { min-height: 40px; }

/* The screen column is capped at 540px at EVERY window size, so the nav is
   sized for that container unconditionally — never by viewport media queries
   (that was the desktop collision). Logout is always an icon; the pill
   scrolls internally as the last resort. */
.topnav { gap: 8px; }
.logout-label { display: none; }
.logout-icon { display: block; }
/* the icon lives in a rounded glass chip, matching the links pill */
#logout {
  flex: 0 0 auto; width: 40px; height: 40px; min-height: 40px; padding: 0;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--card); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px -4px rgba(26, 31, 43, 0.14);
}
#logout:hover { color: var(--ink); background: var(--card-strong); }

/* ---- mobile nav: on phones the pill of links collapses into one dropdown
   (current page + chevron) inside the same glass pill. Desktop keeps the row.
   Viewport query is correct here — this is a phone-vs-desktop interaction
   swap, not container sizing (see the 540px column note above). ---- */
.nav-mobile { display: none; position: relative; }
.nav-menu {
  appearance: none; border: 0; background: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 6px 10px 6px 14px; border-radius: var(--radius-pill);
  font: inherit; font-size: 14px; font-weight: 700; color: var(--ink);
}
.nav-chevron { color: var(--muted); transition: transform 0.15s ease; }
.nav-menu[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }
.nav-pop {
  position: absolute; z-index: 45; top: calc(100% + 10px); left: 50%; translate: -50% 0;
  min-width: 200px; padding: 6px;
  /* opaque like the picker popup: translucency over cards read as ghosting */
  background-color: var(--ground);
  background-image: linear-gradient(var(--card-strong), var(--card-strong));
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: var(--shadow), 0 24px 56px -16px rgba(16, 20, 29, 0.35);
  animation: tzselect-in 0.16s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.nav-pop a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none;
}
.nav-pop a:hover { background: var(--chip); }
.nav-pop a[aria-current="page"] { font-weight: 700; }
.nav-check { color: var(--blue); flex: 0 0 auto; }
@media (max-width: 540px) {
  .topnav-links > .navlink { display: none; }
  .nav-mobile { display: block; }
  /* the pill's internal scroll (last-resort for the link row) would CLIP the
     absolutely-positioned dropdown; with only the menu button inside there is
     nothing left to scroll. Extra specificity: the scroll rule sits later in
     the file and would win a plain .topnav-links at equal weight. */
  .topnav .topnav-links { overflow: visible; }
}
.topnav-links { max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 3px; }
.topnav-links::-webkit-scrollbar { display: none; }
.navlink { padding: 7px 10px; font-size: 14px; }
.topnav-brand { min-width: 0; }
.topnav-brand .brand-name { white-space: nowrap; }

/* ---- integrations: connector card — row + account list underneath ---- */
/* overflow must stay VISIBLE: the ••• menu drops below the card edge, and an
   overflow:hidden here silently clipped it (the "dots do nothing" bug). The
   rounded corners are done per-child instead. */
.connector {
  position: relative;
  background: var(--card); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 2px 12px -6px rgba(26, 31, 43, 0.14);
}
/* each card's backdrop-filter makes a stacking context, so a LATER sibling
   card paints over the previous card's open menu — lift the card that owns
   the open menu above its siblings */
.connector:has(.acct-menu:not([hidden])) { z-index: 30; }
.connector-row { display: flex; align-items: center; gap: 13px; padding: 13px 14px; }
.connector-icon {
  width: 42px; height: 42px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 20px; background: var(--chip);
}
.connector-info { flex: 1; min-width: 0; }
.connector-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.connector-status { color: var(--ink-soft); font-size: 12.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.connector-row .btn-primary { width: auto; flex: 0 0 auto; padding: 7px 14px; font-size: 13px; }
.account-row {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 9px 14px; border-top: 1px solid var(--line); background: var(--chip);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.account-email { font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
.btn-more {
  /* real dots (svg circles), not bullet glyphs — text "•••" rendered huge */
  appearance: none; background: none; border: none; cursor: pointer; flex: 0 0 auto;
  width: 28px; height: 28px; display: grid; place-items: center;
  color: var(--muted); border-radius: 8px;
}
.btn-more:hover { color: var(--ink); background: var(--chip); }
.acct-menu {
  position: absolute; right: 12px; top: calc(100% - 8px); z-index: 20;
  background: var(--card-strong); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 5px; min-width: 150px;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.acct-menu button {
  appearance: none; background: none; border: none; cursor: pointer; width: 100%;
  text-align: left; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--danger); padding: 8px 11px; border-radius: 8px;
}
.acct-menu button:hover { background: var(--chip); }

/* legacy row (kept: class contract) */
.conn-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg); padding: 13px 16px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 2px 12px -6px rgba(26, 31, 43, 0.14);
}
.conn-app { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.conn-emoji {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 19px; background: var(--chip);
}
.conn-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.pill-connected {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  padding: 9px 15px; border-radius: var(--radius-pill);
  background: var(--green-soft); border: 1px solid rgba(34, 197, 94, 0.32);
  color: #15803d; font-size: 14px; font-weight: 700;
}
:root[data-time="night"] .pill-connected { color: #4ade80; }
.callout-ok { background: var(--green-soft); border-color: rgba(34, 197, 94, 0.32); color: var(--ink); }

/* ---- chat: iMessage semantics — the brand IS texting. The log grows from the
   bottom like a real thread; the composer never floats mid-screen. ---- */
.chat { display: flex; flex-direction: column; gap: 0; margin-top: 10px; flex: 1; min-height: 0; position: relative; }
/* The scroller is FULL-BLEED (the Tomo comparison): the margin breakout spans
   the viewport, so the scrollbar rides the far right edge of the window —
   never the middle of the page next to the bubbles. The thread column
   (.chat-log) re-centers itself INSIDE the scroller; the composer stays
   outside it entirely, which is what keeps it pinned. */
.chat-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  overflow-anchor: none;
  margin-inline: calc(50% - 50vw);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}
.chat-log {
  display: flex; flex-direction: column; gap: 14px; min-height: 100%;
  max-width: 540px; margin-inline: auto;
  padding: 0 clamp(18px, 5vw, 28px) 12px; /* the .screen gutters, restated */
}
/* bottom-anchor a short thread WITHOUT justify-content: flex-end — inside a
   scroller, flex-end makes rows that overflow past the top unreachable; the
   auto margin collapses to zero the moment the log fills. */
.chat-log > :first-child { margin-top: auto; }

/* iMessage thread mechanics (the Tomo pattern): no avatars, consecutive
   same-sender bubbles group tight (.row-follow), centered time separators. */
.row { display: flex; align-items: flex-start; margin-top: 18px; }
.row-user { justify-content: flex-end; }
.row-billy { justify-content: flex-start; }
.row-follow { margin-top: 4px; }
.chat-sep {
  text-align: center; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 22px 0 6px; text-shadow: 0 1px 6px var(--ground);
}
/* delivery receipt under the LAST sent bubble only — the Tomo/iMessage pattern:
   tiny, right-aligned, muted; red when the send actually failed */
.receipt {
  text-align: right; font-size: 11px; font-weight: 600; color: var(--muted);
  margin: 5px 8px 0 0;
}
.receipt-failed { color: var(--danger); }

.bubble {
  max-width: 75%; padding: 10px 16px; border-radius: 18px; font-size: 15px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere; letter-spacing: -0.004em;
  animation: bubble-in 0.18s ease-out;
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.bubble-user {
  background: var(--blue); color: #fff; font-weight: 500;
  border-bottom-right-radius: 6px;
}
.row-follow .bubble-user { border-top-right-radius: 6px; }
.bubble-billy {
  background: var(--grey-bubble); color: var(--bubble-ink);
  border-bottom-left-radius: 6px;
}
.row-follow .bubble-billy { border-top-left-radius: 6px; }
.bubble-tools {
  display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace;
}

.bubble-typing { display: inline-flex; gap: 4px; padding: 15px 17px; }
.bubble-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-soft); animation: chat-dot 1.2s infinite ease-in-out; }
.bubble-typing span:nth-child(2) { animation-delay: 0.18s; }
.bubble-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes chat-dot { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* composer: glass pill, blue circular send; respects the iPhone home bar.
   The thread fades under it optically — a blur ramp on a pseudo-element —
   instead of a painted strip: a flat --ground gradient read as a hard
   rectangle against the scene photo. Sticky forms a stacking context, so the
   z:-1 backdrop stays inside the composer, behind the pill. */
.chat-composer {
  position: sticky; bottom: 0; padding: 12px 0 calc(16px + env(safe-area-inset-bottom, 0px));
}
.chat-composer::before {
  content: ""; position: absolute; inset: -10px 0 0 0; z-index: -1;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 45%);
  mask-image: linear-gradient(180deg, transparent, #000 45%);
}
.chat-input {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px;
  background: var(--card-strong); border: 1px solid var(--glass-border); border-radius: var(--radius-pill);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 8px 28px -10px rgba(26, 31, 43, 0.3);
}
.chat-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.16); }
.chat-field { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--ink); font-size: 15px; padding: 9px 0; }
.chat-field::placeholder { color: var(--muted); }
.chat-send {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--blue); color: #fff; font-size: 17px; display: grid; place-items: center;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.chat-send:hover:not(:disabled) { transform: scale(1.05); }
.chat-send:disabled { opacity: 0.4; cursor: default; }

.chat-new-indicator {
  position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--blue); color: #fff; border: 0; border-radius: var(--radius-pill);
  padding: 6px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 14px -4px rgba(10, 132, 255, 0.4);
  animation: bubble-in 0.18s ease-out; z-index: 10;
}
.chat-new-indicator:hover { filter: brightness(1.1); }

/* click the bird: the brand cycles the time-of-day scene (app.js cyclePhase) */
.topnav-brand { cursor: pointer; border-radius: var(--radius-pill); }
.topnav-brand:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.18); }
.topnav-brand .brand-logo { transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.topnav-brand:active .brand-logo { transform: rotate(-12deg) scale(0.9); }

/* ---- mobile polish ---- */
@media (max-width: 420px) {
  .topnav .brand-name { display: none; }
  .navlink { padding: 7px 11px; font-size: 14px; }
  .topnav-links { gap: 1px; }
}
@media (max-width: 540px) {
  table.entries th, table.entries td { padding: 11px 12px; }
  .row-action { padding: 9px 11px; font-size: 14px; }
  .entry-form .btn { width: 100%; }
  .card { padding: 16px; }
  .connector-row { padding: 12px; gap: 11px; }
  .planrow { padding: 13px 12px; gap: 8px; }
  .planname { font-size: 13.5px; white-space: nowrap; }
  .planname b { font-size: 14.5px; }
  .planprice { font-size: 13px; gap: 8px; white-space: nowrap; }
}

/* ---- legal pages ---- */
.legal { line-height: 1.65; }
.legal h1 { font-family: var(--font-display); font-size: 1.9rem; letter-spacing: -0.02em; margin-bottom: .25rem; }
.legal h2 { font-family: var(--font-display); font-size: 1.2rem; margin-top: 1.9rem; color: var(--ink); }
.legal h3 { font-size: .98rem; margin-top: 1.2rem; }
.legal p, .legal li { color: var(--ink-soft); }
.legal .legal-date { color: var(--muted); font-size: .85rem; }
.legal code { background: var(--chip); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
/* the footer rides the bottom of the screen, where the scene has already
   faded to the ground color — never floating mid-photo */
#pagefoot { margin-top: auto; }
.pagefoot { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
  .scene-stars, .bubble, .bubble-typing span { animation: none !important; }
  .btn, .tile, .chat-send { transition: none; }
}

/* the hidden attribute must win over .stack{display:flex} etc. */
[hidden] { display: none !important; }
