/* Tandem web app — design tokens mirror the native iOS/macOS UI:
   warm paper surface, ochre accent, serif headings, sans body. */

:root {
  --bg: #06070c;
  --paper: #f6f0e4;
  --paper-soft: #ede4d2;
  --paper-deep: #e6dcc6;
  --ink: #2a1f12;            /* primary text — 14:1 on --paper */
  --ink-soft: #4f4332;       /* secondary text — 7:1 on --paper (WCAG AAA) */
  --ink-fade: #6b5f4a;       /* tertiary / placeholders — 4.6:1 (WCAG AA) */
  --field-bg: rgba(42, 31, 18, 0.07);
  --cream: #f7f2ea;
  --dim: rgba(247, 242, 234, 0.55);
  --faint: rgba(247, 242, 234, 0.08);
  --accent: #7a4b1f;          /* warm ochre — 5.4:1 on white, 5.0:1 on --paper (WCAG AA) */
  --accent-hot: #e85d2b;      /* marketing hot accent */
  --danger: #b04a3a;
  --serif: 'Newsreader', 'Charter', Georgia, serif;
  --sans: 'DM Sans', -apple-system, sans-serif;
  --radius-card: 14px;
  --radius-button: 12px;
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.18);
  --shadow-deep: 0 30px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box; margin: 0; padding: 0;
  /* Kill the gray flash on tap that iOS Safari adds to every interactive
     element. We render our own :active / :focus styles below. */
  -webkit-tap-highlight-color: transparent;
}
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
  /* Stop the iOS rubber-band bounce on the app shell — feels native when
     scrolling stops where the content stops. Reader iframe keeps its own
     scroll behavior intact since this only applies to the outer body. */
  overscroll-behavior-y: none;
  /* iPhone with notch/Dynamic Island: keep content under the safe area. */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
/* Interactive elements: skip the 300ms double-tap-to-zoom delay, prevent
   accidental text selection on UI chrome (only book content stays
   selectable). */
button, .tab, .icon-btn, .book-tile, .club-row, .club-book-pick,
.club-invite-chip, .btn {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* --- Layout --- */
.app-shell {
  /* `dvh` reacts to mobile browser chrome showing/hiding; `lvh` stays at
     the large viewport. dvh keeps the footer visible without bouncing
     when the URL bar collapses. Fallback to lvh, then vh. */
  min-height: 100vh;
  min-height: 100lvh;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--paper);
}
.app-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px max(22px, env(safe-area-inset-right)) 14px max(22px, env(safe-area-inset-left));
  background: rgba(246, 240, 228, 0.85);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(42, 31, 18, 0.08);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
/* Transparent paper-toned logo blends with the cream surface — the
   square-bordered iOS-style app icon was too photographic for this
   conservative palette and read as a misaligned cutout. */
.brand img { width: 28px; height: 28px; }
.brand span { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); }
.tabs { display: flex; gap: 4px; }
.tab {
  appearance: none; background: transparent; border: 0; cursor: pointer;
  padding: 8px 14px; border-radius: 999px;
  font: inherit; color: var(--ink-soft); font-weight: 600; font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] {
  background: var(--ink); color: var(--paper);
}

main {
  flex: 1;
  padding: 36px max(22px, env(safe-area-inset-right)) 80px max(22px, env(safe-area-inset-left));
}
.container { max-width: 980px; margin: 0 auto; }

h1, h2, h3 { font-family: var(--serif); color: var(--ink); letter-spacing: -0.01em; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
.section-sub { color: var(--ink-soft); margin-top: 6px; }

/* --- Buttons & forms --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 18px; min-height: 46px;
  border-radius: var(--radius-button); border: 0; cursor: pointer;
  font: 600 15px var(--sans); text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--accent); color: white;
  box-shadow: 0 8px 24px rgba(140, 88, 40, 0.25);
}
.btn-primary:hover:not(:disabled) { background: #75481f; }
.btn-secondary {
  background: var(--field-bg); color: var(--ink);
}
.btn-secondary:hover:not(:disabled) { background: rgba(42, 31, 18, 0.12); }
.btn-ghost {
  background: transparent; color: var(--ink-soft);
}
.btn-danger { background: transparent; color: var(--danger); padding: 8px 12px; }
.btn-block { width: 100%; }

.input, .textarea {
  width: 100%;
  padding: 14px 16px;
  font: 16px var(--sans);
  background: var(--field-bg);
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  outline: none;
}
.input:focus, .textarea:focus { border-color: var(--accent); background: white; }
.textarea { resize: vertical; min-height: 110px; }
.field-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-soft); margin-bottom: 6px; }

.error-banner {
  background: rgba(176, 74, 58, 0.1);
  color: #8a3829; /* 6.5:1 on --paper — clearly distinct from body ink */
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  margin: 12px 0;
  border: 1px solid rgba(176, 74, 58, 0.25);
}
.note { color: var(--ink-soft); font-size: 13px; }

/* --- Cards --- */
.card {
  background: white;
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}
.card + .card { margin-top: 16px; }

/* --- Library grid --- */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 22px;
  margin-top: 24px;
}
.book-tile {
  display: flex; flex-direction: column; gap: 10px;
  text-align: left;
  background: transparent; border: 0; padding: 0;
  cursor: pointer; font: inherit; color: inherit;
  transition: transform 0.18s;
}
.book-tile:hover { transform: translateY(-3px); }
.book-cover {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--accent) 0%, #4a2e16 100%);
  color: var(--paper);
  display: flex; align-items: flex-end; padding: 14px;
  font-family: var(--serif); font-weight: 700;
  font-size: 17px; line-height: 1.2;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.book-cover img { transition: transform 0.4s; }
.book-tile:hover .book-cover img { transform: scale(1.04); }
.book-meta { display: flex; flex-direction: column; gap: 2px; }
.book-meta .title { font-weight: 600; font-size: 14.5px; }
.book-meta .author { color: var(--ink-soft); font-size: 12.5px; }
.progress-pill {
  margin-top: 4px; font-size: 11px; color: var(--accent); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* --- Auth view --- */
.auth-card {
  max-width: 420px; margin: 4rem auto;
  text-align: center;
}
.auth-card .app-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  /* Transparent SVG — no rounded-square frame here. The conservative
     warm-paper aesthetic was clashing with the vibrant iOS-style icon. */
}
.auth-card h1 { font-size: 24px; }
.auth-card p { color: var(--ink-soft); margin: 8px 0 24px; }
.auth-tabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 24px; }
.auth-tabs .tab[aria-current="page"] { background: var(--ink); color: var(--paper); }

.divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0;
  color: var(--ink-soft); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(42, 31, 18, 0.12);
}

/* --- Clubs --- */
.club-row {
  display: flex; align-items: center; gap: 16px;
  background: white; border-radius: var(--radius-card);
  padding: 16px 18px; cursor: pointer; transition: background 0.12s;
}
.club-row:hover { background: var(--paper-soft); }
.club-mark {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 50%;
  background: rgba(140, 88, 40, 0.12);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 18px;
}
.club-row .meta { flex: 1; }
.club-row .meta .title { font-weight: 600; }
.club-row .meta .sub { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

.invite-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font: 600 13px 'JetBrains Mono', 'SFMono-Regular', monospace;
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* === Club detail page === */
.club-detail {
  max-width: 760px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 18px;
}
.club-footer { display: flex; justify-content: center; padding: 12px 0 36px; }

/* Identity hero */
.club-hero {
  position: relative;
  padding: 28px 28px 24px;
  background: linear-gradient(180deg, #fffaf0 0%, #ffffff 100%);
  border: 1px solid rgba(42, 31, 18, 0.06);
}
.club-hero .club-back {
  position: absolute; top: 14px; left: 14px;
  padding: 6px 10px; font-size: 13px; min-height: 0;
}
.club-hero-mark {
  width: 64px; height: 64px; margin: 14px auto 14px;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--accent) 0%, #4a2e16 100%);
  color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font: 700 28px var(--serif);
  box-shadow: 0 14px 30px rgba(74, 46, 22, 0.32);
}
.club-hero-meta { text-align: center; }
.club-hero-meta h1 { font-size: 28px; }
.club-hero-meta p { margin: 6px auto 0; max-width: 540px; }
.club-invite-chip {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 18px;
  padding: 8px 14px;
  background: var(--field-bg);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s;
}
.club-invite-chip:hover { background: rgba(42, 31, 18, 0.12); }
.club-invite-chip-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-soft);
}
.club-invite-chip code {
  font-family: 'JetBrains Mono', 'SFMono-Regular', monospace;
  font-size: 13.5px; font-weight: 700; color: var(--accent);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.club-invite-chip-flash { font-size: 11px; }

/* Now reading */
.club-now-reading {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 22px;
  align-items: center;
  padding: 22px;
  background: linear-gradient(135deg, #fff7e8 0%, #ffffff 60%);
  border: 1px solid rgba(140, 88, 40, 0.12);
}
.club-now-reading-cover {
  width: 116px; aspect-ratio: 2/3;
  border-radius: 10px;
  background-color: rgba(42, 31, 18, 0.08);
  background-size: cover; background-position: center;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
  display: flex; align-items: flex-end; padding: 12px;
  color: var(--paper);
  font: 700 14px var(--serif);
  line-height: 1.2;
}
.club-now-reading-meta { min-width: 0; }
.club-now-reading-meta .eyebrow,
.club-now-reading-empty .eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent);
}
.club-now-reading-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;
}
.club-clear-book { padding: 8px 12px; min-height: 0; font-size: 13px; }
.club-now-reading-empty {
  grid-column: 1 / -1;
  padding: 6px 0;
}
.club-now-reading:has(.club-now-reading-empty) {
  grid-template-columns: 1fr;
  text-align: center;
}
.club-now-reading:has(.club-now-reading-empty) .club-now-reading-empty .btn {
  display: inline-flex;
}

@media (max-width: 540px) {
  .club-now-reading {
    grid-template-columns: 88px 1fr;
    gap: 16px;
  }
  .club-now-reading-cover { width: 88px; padding: 10px; font-size: 13px; }
  .club-now-reading-meta h2 { font-size: 19px; }
}

/* Book picker modal grid */
.club-book-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.club-book-pick {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px;
  background: transparent; border: 1.5px solid transparent;
  border-radius: 14px;
  cursor: pointer; font: inherit; color: inherit;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
  text-align: left;
}
.club-book-pick:hover { transform: translateY(-2px); background: rgba(42,31,18,0.04); }
.club-book-pick[aria-current="true"] {
  border-color: var(--accent);
  background: rgba(140, 88, 40, 0.08);
}
.club-book-pick.is-busy { opacity: 0.5; pointer-events: none; }
.club-book-pick-cover {
  width: 100%; aspect-ratio: 2/3;
  border-radius: 8px;
  background-color: rgba(42, 31, 18, 0.08);
  background-size: cover; background-position: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
  display: flex; align-items: flex-end; padding: 10px;
  color: var(--paper);
  font: 700 12px var(--serif);
  line-height: 1.15;
}
.club-book-pick-title { font-size: 13.5px; font-weight: 600; }
.club-book-pick-author { font-size: 12px; }

/* Member roster */
.club-roster-card { padding: 22px; }
.club-roster-header { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.club-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.club-roster-tile {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--field-bg);
  border-radius: 12px;
}
.club-roster-avatar {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 50%;
  background: rgba(140, 88, 40, 0.12);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font: 700 15px var(--serif);
}
.club-roster-avatar.is-owner {
  background: var(--accent); color: var(--paper);
}
.club-roster-meta { min-width: 0; flex: 1; }
.club-roster-name {
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.role-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px; border-radius: 999px;
  background: rgba(140, 88, 40, 0.12); color: var(--accent);
}
.chapter-pill {
  display: inline-flex; align-items: baseline; gap: 0;
  margin-top: 4px;
  font-size: 12px; color: var(--accent); font-weight: 600;
}
.chapter-pill-when { color: var(--ink-soft); font-weight: 500; }
.chapter-pill-pending {
  color: var(--ink-fade); font-weight: 500; font-style: italic;
}

/* Activity card */
.club-activity-card { padding: 22px; }

/* --- Modals --- */
.scrim {
  position: fixed; inset: 0; background: rgba(6, 7, 12, 0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  z-index: 100;
}
.modal {
  background: var(--paper); border-radius: 18px;
  padding: 28px; max-width: 460px; width: 100%;
  box-shadow: var(--shadow-deep);
}
.modal h2 { margin-bottom: 6px; }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; }

/* --- Popover (kebab menu on activity rows) --- */
.popover-item:hover { background: var(--field-bg); }
.popover-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.reason-row:hover { filter: brightness(0.97); }

/* --- Reader --- */
.reader {
  position: fixed; inset: 0;
  display: grid; grid-template-rows: auto 1fr auto;
  background: var(--paper);
  color: var(--ink);
  z-index: 70;
}
.reader[data-theme="night"] { background: #1a160e; color: #e8dec5; }
.reader-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 18px;
  background: rgba(246, 240, 228, 0.94);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid rgba(42, 31, 18, 0.08);
}
.reader[data-theme="night"] .reader-bar {
  background: rgba(26, 22, 14, 0.9); border-color: rgba(255,255,255,0.06);
}
.reader-bar .title-line {
  font-family: var(--serif); font-weight: 600; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0; color: inherit;
}
.reader-bar .chapter { color: var(--ink-soft); font-size: 13px; }
.reader[data-theme="night"] .reader-bar .chapter { color: rgba(232, 222, 197, 0.6); }
.reader-bar-actions { display: flex; gap: 4px; }
.icon-btn {
  appearance: none; border: 0; background: transparent;
  width: 38px; height: 38px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: inherit; font-size: 16px;
  transition: background 0.12s;
}
.icon-btn:hover { background: rgba(42, 31, 18, 0.08); }
.reader[data-theme="night"] .icon-btn:hover { background: rgba(255, 255, 255, 0.08); }
.icon-btn[aria-pressed="true"] { background: rgba(140, 88, 40, 0.15); color: var(--accent); }
.reader-canvas {
  position: relative;
  height: 100%;
  overflow: hidden;
}
.reader-frame {
  height: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 max(2vw, 24px);
}
.reader-bar.bottom {
  border-top: 1px solid rgba(42, 31, 18, 0.08);
  border-bottom: 0;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--ink-soft);
}
.reader[data-theme="night"] .reader-bar.bottom {
  border-color: rgba(255,255,255,0.06);
  color: rgba(232, 222, 197, 0.6);
}
.reader-progress {
  flex: 1; height: 4px; border-radius: 999px;
  background: rgba(42, 31, 18, 0.1); overflow: hidden;
  margin: 0 14px;
}
.reader[data-theme="night"] .reader-progress { background: rgba(255,255,255,0.1); }
.reader-progress-fill { height: 100%; background: var(--accent); transition: width 0.25s; }
.reader-nav-btn {
  position: absolute; top: 0; bottom: 0;
  width: 14vw; max-width: 100px; min-width: 56px;
  background: transparent; border: 0; cursor: pointer;
  font-size: 28px; color: rgba(42, 31, 18, 0.4);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
  z-index: 5;
}
.reader-nav-btn:hover { color: var(--accent); background: rgba(140, 88, 40, 0.06); }
.reader[data-theme="night"] .reader-nav-btn { color: rgba(232, 222, 197, 0.4); }
.reader[data-theme="night"] .reader-nav-btn:hover { background: rgba(216, 161, 102, 0.08); }
.reader-nav-btn.prev { left: 0; }
.reader-nav-btn.next { right: 0; }
.reader-nav-btn:disabled { opacity: 0.25; cursor: default; }

.reader-toc {
  position: fixed; top: 0; bottom: 0; left: 0;
  width: min(360px, 88vw);
  background: var(--paper); color: var(--ink);
  padding: 22px 22px 60px;
  overflow-y: auto;
  box-shadow: 8px 0 30px rgba(0,0,0,0.18);
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  z-index: 80;
}
.reader[data-theme="night"] .reader-toc { background: #1a160e; color: #e8dec5; }
.reader-toc[aria-hidden="false"] { transform: none; }
.reader-toc h3 { margin-bottom: 14px; }
.reader-toc ul { list-style: none; padding: 0; }
.reader-toc li { margin: 0; }
.reader-toc a {
  display: block; padding: 10px 12px; border-radius: 8px;
  color: inherit; text-decoration: none;
  font-family: var(--serif); font-size: 14.5px;
  transition: background 0.12s;
}
.reader-toc a:hover { background: rgba(42, 31, 18, 0.06); }
.reader[data-theme="night"] .reader-toc a:hover { background: rgba(255,255,255,0.06); }
.reader-toc a.is-current { background: rgba(140, 88, 40, 0.15); color: var(--accent); }
.reader-toc ul ul a { padding-left: 26px; font-size: 13.5px; color: var(--ink-soft); }

.reader-toc-scrim {
  position: fixed; inset: 0;
  background: rgba(6, 7, 12, 0.45);
  z-index: 75;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s;
}
.reader-toc-scrim[aria-hidden="false"] { opacity: 1; pointer-events: auto; }

@media (max-width: 600px) {
  .reader-bar .title-line { font-size: 14px; }
  .reader-bar-actions .icon-btn { width: 36px; height: 36px; }
}

/* --- Loading skeleton --- */
.skeleton {
  background: linear-gradient(90deg, rgba(42,31,18,0.06), rgba(42,31,18,0.12), rgba(42,31,18,0.06));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 10px;
  height: 18px; margin: 8px 0;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Light/paper aesthetic is the default for the app shell; the in-book
   reader has its own paper / night toggle controlled per-session. We
   intentionally don't follow `prefers-color-scheme: dark` here — Tandem's
   identity is the warm paper look, the same way Stripe and Linear keep
   one canonical product surface regardless of OS theme. */

/* --- Install pill (Android PWA prompt) ---
   Fixed bottom-center, paper-and-ink palette so it reads as part of the app
   chrome instead of a browser overlay. Hidden until the page captures
   `beforeinstallprompt` AND the user is mid-session (see index.html). */
.install-pill {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100vw - 32px);
}
.install-pill[hidden] { display: none; }
.install-pill--in {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.install-pill__label {
  white-space: nowrap;
}
.install-pill__btn {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: var(--paper);
  font: inherit;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
}
.install-pill__btn:hover { filter: brightness(1.08); }
.install-pill__dismiss {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.7;
}
.install-pill__dismiss:hover { opacity: 1; }
