/* Live feed page (/conditionone/feed, restored Nov 3, owner): the app gets a full screen under the Code Annex
   bars and lays itself out for the window: the phone layout on a phone, a sidebar and columns on a computer.
   The first screenful is its own block (.app-screen, exactly one viewport tall): the skinny beta strip, the
   site bars, then the app filling whatever is left, its own tab bar at the bottom of the screen. The site
   footer is NOT in that block — it sits under it in the normal page flow, so it only shows when the page is
   scrolled to the very bottom (owner, Nov 11, 2026: locked into the screen, the bars and footer squeezed
   the app into a sliver). On a phone the site bars also collapse away while the reader scrolls the feed
   (feed.js watches the frame's own scrolling and sets .bars-collapsed), giving the app the whole screen
   under the strip; scrolling back up brings them back. */
/* Inside the frame the app reads every safe-area inset as 0, so this page keeps the app clear of the iPhone home
   bar and, in landscape, the notch. */
.app-page body {
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.app-screen { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
/* The screen block is 100dvh tall, but iPhone Safari paints a taller area than the layout viewport while
   its toolbar floats (the zone under the toolbar pill): the top of the footer used to show in that
   leftover strip, behind the pill, where no tap can reach it (owner, Nov 11, 2026: "I can't do anything
   with the strip at the bottom"). Push the footer down by exactly the large-viewport difference, so none
   of it paints on the first screen; it only appears at the very bottom of the page, after a scroll.
   Measured live on the iPhone (874pt screen, Safari toolbar floating): the 100dvh block ends ~98pt
   above the screen's bottom edge, but 100lvh - 100dvh covers only ~40 of those points and the
   safe-area insets read 0 in this mode — the rest is the status-bar zone the viewport units never
   count, so phones add a flat 60px on top (see the media rule). Overshoot is harmless here — worst
   case a little blank space above the footer — while undershoot is the bug.
   Where the two units agree (desktop, most browsers) the difference is 0 and nothing changes. Browsers
   without lvh drop the rule and keep the old layout. */
.app-page .site-footer { margin-top: calc(100lvh - 100dvh); }
/* The beta strip is the one bar that never leaves: it also sticks to the top for the short page scroll
   down to the footer. */
.app-page .beta-strip { position: sticky; top: 0; z-index: 3; }
.app-page .site-header .wrap { max-width: none; }
.app-bar {
  flex: none; margin: 0; padding: 9px var(--gutter); text-align: center;
  background: var(--surface); border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 14px; line-height: 1.35; text-wrap: balance;
}
.app-bar a { font-weight: 700; text-decoration: none; white-space: nowrap; }
.app-bar a:hover { text-decoration: underline; }
.app-frame { flex: 1 1 auto; display: block; width: 100%; min-height: 0; border: 0; background: #060b11; }
.app-shell { position: relative; flex: 1 1 auto; display: flex; min-height: 0; }
.app-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #060b11; color: #9fb4c4; font-size: 15px; transition: opacity 0.35s ease; z-index: 2; }
.app-loading.done { opacity: 0; pointer-events: none; }
.app-spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #22384c; border-top-color: #f2a900; animation: app-spin 0.9s linear infinite; }
@keyframes app-spin { to { transform: rotate(360deg); } }
.app-page noscript p { padding: 24px var(--gutter); color: var(--muted); }

/* The slim waitlist bar under the app bar (Nov 8, owner): the same signup as /conditionone/waitlist — same
   fields, same /api/waitlist, same .signup styles from styles.css — compressed into a bar so people who land
   on the feed (most of them from X) can join without leaving the page. */
.signup-bar {
  flex: none; margin: 0; padding: 10px var(--gutter) 12px;
  border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
}
.signup-bar h2 { font-size: 14px; margin-bottom: 8px; }
.signup-bar .field-row input { min-height: 44px; font-size: 16px; }
.signup-bar .consent { margin-top: 10px; font-size: 13px; line-height: 1.45; }
.signup-bar .consent input { width: 20px; height: 20px; }
.signup-bar .form-status { margin-top: 8px; font-size: 13px; }
.signup-bar .signup-done .check { width: 32px; height: 32px; font-size: 16px; margin-bottom: 8px; }
.signup-bar .signup-done p { font-size: 15px; }
.signup-bar .signup-done p + p { font-size: 13px; }

/* Compact bar (Nov 8, owner): on phones the stacked field + full-width button made the bar block most of
   the screen, so the field and Join sit side by side at every width, the bar can be closed (feed.js keeps
   it closed on that device), and the joined state shrinks to one line. */
.signup-bar-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.signup-close {
  /* The padding (cancelled out by the negative margins, so the × itself does not move) gives the × a
     phone-sized tap target; as a bare glyph it was about 20px and easy to miss (owner, Nov 8). */
  flex: none; background: none; border: 0; padding: 10px 12px; margin: -10px -12px -10px 0; cursor: pointer;
  color: var(--muted); font-size: 20px; line-height: 1.1; font-family: inherit;
}
.signup-close:hover { color: var(--text); }
.signup-bar .field-row { flex-direction: row; }
.signup-bar .field-row input { flex: 1; min-width: 0; }
.signup-bar .field-row .button { flex: none; min-height: 44px; padding: 0 18px; }
.signup-bar.is-done .signup-done { display: flex; align-items: center; gap: 10px; }
.signup-bar .signup-done .check { width: 26px; height: 26px; font-size: 14px; margin-bottom: 0; flex: none; }
.signup-bar .signup-done p + p { display: none; }

/* F9: while the bar is closed, one small link brings it back — closing used to be forever
   on that device, with no way to change your mind. */
.signup-reopen { flex: none; margin: 0; padding: 6px var(--gutter); text-align: right; background: var(--surface); border-bottom: 1px solid var(--border); }
.signup-reopen button { background: none; border: 0; padding: 6px 4px; cursor: pointer; color: var(--accent, #f2a900); font: inherit; font-size: 14px; font-weight: 700; }
.signup-reopen button:hover { text-decoration: underline; }

/* Phone only (owner, Nov 11, 2026): while the reader scrolls the feed down, the site bars above the app
   fold away (feed.js sets .bars-collapsed on <html> from the frame's scrolling) and the app takes the
   screen; scrolling up unfolds them again. The beta strip is not in this list — it stays. The max-height
   values are a little above each bar's real height so nothing is ever clipped when the bars are open. */
@media (max-width: 767px) {
  .app-screen .site-header, .app-screen .app-bar, .app-screen .signup-bar, .app-screen .signup-reopen {
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding-top 0.25s ease, padding-bottom 0.25s ease;
  }
  .app-screen .site-header { max-height: 120px; }
  .app-screen .app-bar { max-height: 220px; }
  .app-screen .signup-bar { max-height: 420px; }
  .app-screen .signup-reopen { max-height: 80px; }
  html.bars-collapsed .app-screen .site-header,
  html.bars-collapsed .app-screen .app-bar,
  html.bars-collapsed .app-screen .signup-bar,
  html.bars-collapsed .app-screen .signup-reopen {
    max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; border-bottom-width: 0;
  }
}
@media (max-width: 767px) {
  /* Phones: plus a flat 60px — the status-bar zone the viewport units never count (measured above);
     overshoot is harmless, undershoot is the bug. */
  .app-page .site-footer { margin-top: calc(100lvh - 100dvh + 60px); }
}
