/* RiffList app styles. Single stylesheet, single network request (see
   architecture/clean-architecture.md — splitting into @imports adds
   sequential request latency, so it is deferred). Organized into the
   commented sections below; rules are NOT reordered, so the cascade is
   unchanged. Roughly: tokens → shell → components → views. */

/* ==========================================================================
   DESIGN TOKENS & RESET
   ========================================================================== */

:root {
  color-scheme: light;
  --visual-bottom-inset: 0px;
  --sticky-top-space: 72px;
  --sticky-bottom-space: 190px;
  --ink: #1a1a1a;
  --muted: #767676;
  --line: #e6e6e6;
  --soft: #f6f6f6;
  --paper: #fff;
  --danger: #d9480f;
  --focus: #1f6feb;
  /* Sync/recovery surfaces are NEUTRAL — calm, never alarmist. --danger (red) is
     reserved for genuine failures + destructive actions only. */
  --sync-fg: #5f5f5f;
  --sync-bg: #f6f6f6;
  --sync-border: #e6e6e6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overscroll-behavior-y: none;
  scroll-padding-top: calc(var(--sticky-top-space) + env(safe-area-inset-top));
  scroll-padding-bottom: calc(var(--sticky-bottom-space) + env(safe-area-inset-bottom) + var(--visual-bottom-inset));
}

body {
  margin: 0;
  min-height: 100%;
  overscroll-behavior-y: none;
  background: var(--paper);
}

body.has-modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

/* ==========================================================================
   APP SHELL & SCREENS
   ========================================================================== */

.app-shell {
  min-height: 100vh;
  max-width: 720px;
  margin: 0 auto;
  background: var(--paper);
}

.screen {
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
}

.loading-screen {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-content: center;
  padding: 24px;
  text-align: center;
}

.loading-screen h1 {
  margin: 0 0 8px;
  font-size: 42px;
  line-height: 1;
}

.loading-screen p {
  margin: 0;
  color: var(--muted);
}

.auth-screen {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  justify-content: center;
  gap: 36px;
}

/* ==========================================================================
   PULL-TO-REFRESH GESTURE
   ========================================================================== */

.pull-refresh {
  --pull-offset: 0px;
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  left: 50%;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 8px 24px rgb(0 0 0 / 14%);
  color: var(--ink);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-52px + var(--pull-offset)));
  transition: opacity 140ms ease, transform 140ms ease;
}

.pull-refresh.is-visible {
  opacity: 1;
}

.pull-refresh-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid #d6d6d6;
  border-top-color: var(--ink);
  border-radius: 50%;
}

.pull-refresh.is-refreshing .pull-refresh-spinner {
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   CONNECTION & OFFLINE BANNERS
   ========================================================================== */

.connection-banner {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--sync-border);
  background: var(--sync-bg);
  color: var(--sync-fg);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
}

.connection-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid var(--line);
  border-top-color: var(--sync-fg);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.composer-offline-hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--sync-fg);
}

/* ==========================================================================
   BRAND, NOTICES & BETA TOOLS
   ========================================================================== */

.brand h1 {
  margin: 0 0 8px;
  font-size: 48px;
  line-height: 0.95;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.invite-note,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px 16px;
  color: #444;
  line-height: 1.35;
}

.auth-trust-copy {
  display: grid;
  gap: 6px;
}

.auth-trust-copy p {
  margin: 0;
}

.notice {
  display: grid;
  gap: 10px;
}

.notice-action {
  width: fit-content;
  min-height: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
}

.beta-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.beta-tools button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 700;
}

/* ==========================================================================
   AD SLOTS
   ========================================================================== */

.ad-slot {
  display: grid;
  min-height: 82px;
  align-content: center;
  gap: 4px;
  margin: 14px 0;
  border: 1px dashed #d7d7d7;
  border-radius: 8px;
  background: #fafafa;
  padding: 14px 16px;
  color: #555;
  text-align: center;
}

.ad-slot-inline {
  position: relative;
}

.topic-list .ad-slot {
  min-height: 76px;
  margin: 0;
  border-width: 0 0 1px;
  border-radius: 0;
}

/* Browser scroll anchoring must not re-anchor feed rows beneath the sticky
   composer while the mobile keyboard is open. */
.feed {
  overflow-anchor: none;
}

.feed .ad-slot {
  margin: 0;
  border-width: 0 0 1px;
  border-radius: 0;
}

.ad-slot span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ad-slot strong {
  color: var(--ink);
  font-size: 15px;
}

/* ==========================================================================
   BANNERS, CALLOUTS & LEGAL LINKS
   ========================================================================== */

.button-stack {
  display: grid;
  gap: 12px;
}

.compact-button {
  min-height: 40px;
  padding: 0 12px;
  font-size: 14px;
}

.feature-banner {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfbfb;
  padding: 14px;
}

.feature-banner strong,
.feature-banner p {
  display: block;
  margin: 0;
}

.feature-banner strong {
  font-size: 17px;
}

.feature-banner p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.feature-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attention-banner {
  border-color: #d9e7ff;
  background: #f8fbff;
}

.legal-links a,
.legal-links button {
  color: var(--ink);
  font-weight: 800;
}

.legal-links button {
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-links {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.legal-links span {
  margin: 0 7px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.primary-button,
.secondary-button,
.icon-button,
.option-button,
.danger-button {
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 16px;
  font-weight: 700;
}

.primary-button {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.secondary-button,
.option-button {
  background: #fff;
  color: var(--ink);
}

.primary-button:disabled,
.secondary-button:disabled,
.option-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-with-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgb(255 255 255 / 45%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.danger-button {
  border-color: #f1c8bd;
  background: #fff7f4;
  color: #9a3412;
}

/* ==========================================================================
   TOPBAR, ACCOUNT & LIST / FEED HEADERS
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin: -20px -20px 18px;
  padding: calc(16px + env(safe-area-inset-top)) 20px 14px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(12px);
}

.topbar h1,
.topic-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
}

.topbar p,
.subtle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.app-title {
  min-width: 0;
}

.profile-button {
  display: grid;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.profile-button h1,
.profile-button p {
  pointer-events: none;
}

.profile-button p {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.account-button {
  position: relative;
  display: inline-grid;
  width: 48px;
  height: 48px;
  min-width: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  padding: 0;
  font-weight: 900;
}

.account-button span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  line-height: 1;
}

.account-button b {
  position: absolute;
  top: -3px;
  right: -3px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #d9480f;
  color: #fff;
  padding: 0 5px;
  font-size: 11px;
  line-height: 1;
}

.account-button.has-attention {
  border-color: #d0d0d0;
}

.topic-meta {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.text-button {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: #555;
  padding: 0;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.support-inline {
  color: var(--muted);
  font-size: 14px;
}

.list-header {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.list-header-main {
  min-width: 0;
}

.list-header-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.riff-order-choice {
  width: 100%;
  text-align: center;
}

.topic-meta-button {
  position: relative;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.topic-meta-button.has-pending-requests {
  padding-right: 11px;
}

.meta-attention-dot {
  position: absolute;
  top: 5px;
  right: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--danger);
}

.list-more-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
}

.feed-header {
  position: sticky;
  top: calc(var(--sticky-top-space) + env(safe-area-inset-top));
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -20px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(12px);
  padding: 8px 20px;
  box-shadow: 0 1px 0 rgb(0 0 0 / 3%);
}

.feed-game-state {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-sort-button {
  flex: 0 0 auto;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

.feed-sort-button span {
  color: var(--muted);
  font-size: 12px;
  transform: translateY(1px);
}

.people-actions {
  margin-top: 12px;
}

@media (max-width: 380px) {
  .topic-meta {
    gap: 5px;
    font-size: 13px;
  }

  .topic-meta-button {
    font-weight: 750;
  }

  .list-header-meta-row {
    gap: 8px;
  }

  .feed-game-state {
    font-size: 13px;
  }
}

/* ==========================================================================
   FEATURE CALLOUT & NAV
   ========================================================================== */

.feature-callout {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 12px;
  border: 1px solid #d9e7ff;
  border-radius: 10px;
  background: #f8fbff;
  padding: 12px;
}

.feature-callout strong,
.feature-callout span {
  display: block;
}

.feature-callout strong {
  font-size: 15px;
}

.feature-callout span {
  margin-top: 2px;
  color: #5f6f85;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.feature-callout-close {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 50%;
  font-size: 24px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.nav-button {
  justify-self: start;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-weight: 800;
}

.icon-button {
  min-width: 44px;
  padding: 0 12px;
  background: var(--soft);
  color: var(--ink);
}

/* ==========================================================================
   HOME — TOPIC LIST, ENDED SECTION & FAB
   ========================================================================== */

.topic-list {
  display: grid;
  gap: 0;
  margin: 0 -20px;
}

.topic-row {
  min-height: 72px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 13px 20px;
  text-align: left;
}

.topic-row-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.topic-row-title strong {
  min-width: 0;
  font-size: 22px;
  line-height: 1.12;
}

.topic-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
}

.turn-pill {
  display: inline-block;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 800;
}

.ended-section {
  margin-top: 12px;
}

.ended-section-toggle {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 8px 20px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  text-align: left;
}

.ended-section-toggle span {
  font-size: 12px;
  transform: translateY(1px);
}

.ended-topic-row .topic-row-title strong {
  color: var(--muted);
}

.hidden-ended-row {
  opacity: 0.75;
}

.ended-section-toggle.hidden-ended-toggle {
  min-height: 40px;
  font-size: 13px;
  font-weight: 700;
}

.feed-game-state.list-ended-note {
  color: var(--muted);
  font-weight: 600;
}

.empty-state {
  padding: 48px 8px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

.fab {
  position: fixed;
  right: max(20px, calc((100vw - 720px) / 2 + 20px));
  bottom: calc(20px + env(safe-area-inset-bottom) + var(--visual-bottom-inset));
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 44px;
  line-height: 1;
  box-shadow: 0 10px 30px rgb(0 0 0 / 20%);
}

/* ==========================================================================
   PANELS & FORMS
   ========================================================================== */

.panel {
  border-top: 1px solid var(--line);
  margin: 0 -20px;
  padding: 20px;
}

.form {
  display: grid;
  gap: 16px;
}

.label {
  display: grid;
  gap: 8px;
  color: #555;
  font-size: 14px;
  font-weight: 700;
}

.form-note {
  margin: -6px 0 2px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.35;
}

.choice-group {
  display: grid;
  gap: 10px;
  margin: 0;
  border: 0;
  padding: 0;
}

.choice-group legend {
  margin: 0 0 2px;
  color: #555;
  font-size: 14px;
  font-weight: 700;
}

.choice-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.choice-row input {
  margin-top: 3px;
}

.choice-row span,
.choice-row strong,
.choice-row small {
  display: block;
}

.choice-row strong {
  color: var(--ink);
}

.choice-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

/* ==========================================================================
   PROFILE & ACCOUNT MODAL
   ========================================================================== */

.profile-summary {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.profile-summary strong {
  font-size: 22px;
}

.profile-summary span {
  color: var(--muted);
  font-size: 15px;
}

.profile-summary .profile-email-label {
  color: #555;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-summary p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.account-section {
  margin: 0 0 18px;
}

.account-section h3 {
  margin: 0 0 8px;
  color: #666;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.account-section .profile-stats {
  margin-bottom: 10px;
}

.account-section .settings-list,
.account-section .attention-list {
  margin-bottom: 0;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0 0 16px;
}

.account-modal .modal-header {
  margin-bottom: 14px;
}

.attention-list {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

.attention-row {
  display: grid;
  border: 1px solid #d9e7ff;
  border-radius: 10px;
  background: #f8fbff;
  padding: 12px;
  color: var(--ink);
  text-align: left;
}

.attention-row:disabled {
  cursor: default;
  opacity: 1;
}

.attention-row strong,
.attention-row small {
  display: block;
}

.attention-row strong {
  font-size: 16px;
}

.attention-row small {
  margin-top: 3px;
  color: #5f6f85;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.profile-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
}

.profile-stat strong,
.profile-stat span {
  display: block;
}

.profile-stat strong {
  font-size: 24px;
}

.profile-stat span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-list {
  display: grid;
  margin: 0 -20px 16px;
  border-top: 1px solid var(--line);
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 12px 20px;
  color: var(--ink);
  text-align: left;
  font-weight: 800;
}

.settings-row span {
  min-width: 0;
  max-width: 210px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.danger-row {
  color: #9a3412;
}

.link-button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.link-button.danger-link {
  color: #9a3412;
}

.standalone-row {
  width: 100%;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* ==========================================================================
   RIFF DETAIL & ACTIONS SHEET
   ========================================================================== */

.riff-detail-actions {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.riff-action-row {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 11px 16px;
  text-align: left;
  cursor: pointer;
}

.riff-action-row:first-child {
  border-top: 0;
}

.riff-action-row:active {
  background: #f5f5f3;
}

.ra-label {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.ra-desc {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.riff-action-row.danger .ra-label {
  color: #9a3412;
}

.riff-detail-modal {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}

.reaction-detail-modal {
  display: grid;
  gap: 10px;
}

.reaction-detail-modal .modal-header {
  justify-content: flex-end;
  margin-bottom: -4px;
}

.riff-detail-modal h2 {
  margin-bottom: 0;
}

.riff-detail-scroll {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 16px;
  overflow: auto;
  padding-bottom: calc(24px + env(safe-area-inset-bottom) + var(--visual-bottom-inset));
  -webkit-overflow-scrolling: touch;
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -20px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 22px 20px 12px;
}

.modal-header h2 {
  margin: 0;
}

.modal-close-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #555;
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}

.modal-close-button:hover,
.modal-close-button:focus-visible {
  border-color: #cfcfcf;
  background: var(--soft);
  color: var(--ink);
}

.riff-detail-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  padding: 14px;
}

.riff-detail-number {
  color: #aaa;
  font-size: 18px;
  font-weight: 800;
}

.riff-detail-text {
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.riff-detail-correction {
  grid-column: 2;
  margin-top: -4px;
  color: #666;
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.riff-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.riff-detail-meta div {
  min-width: 0;
}

.riff-detail-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.riff-detail-meta dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   STATS SHEET
   ========================================================================== */

.stats-modal {
  gap: 14px;
}

.stats-section {
  display: grid;
  gap: 8px;
}

.stats-section h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.stats-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.stats-list > .form-note {
  margin: 0;
  padding: 12px;
}

.stats-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: baseline;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.stats-row:last-child {
  border-bottom: 0;
}

.stats-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-row span {
  color: var(--ink);
  font-weight: 900;
}

.stats-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 800;
}

/* ==========================================================================
   REACTION PICKER & POPOVER
   ========================================================================== */

.reaction-panel h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.reaction-options {
  display: grid;
  gap: 8px;
}

.reaction-popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgb(0 0 0 / 18%);
  touch-action: none;
}

.reaction-popover-wrap {
  position: fixed;
  top: var(--reaction-popover-y, 50vh);
  left: var(--reaction-popover-x, 50vw);
  transform: translateX(-50%);
}

.reaction-popover {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 12px 34px rgb(0 0 0 / 18%);
}

.reaction-popover .reaction-options {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reaction-option {
  appearance: none;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px 12px 8px 8px;
  color: var(--ink);
  text-align: left;
}

.reaction-popover .reaction-option {
  position: relative;
  display: inline-flex;
  width: 64px;
  height: 64px;
  min-height: 64px;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
}

.reaction-option.is-active {
  border-color: var(--ink);
  background: #f4f4f4;
}

.reaction-popover .reaction-option.is-active {
  background: #efefef;
}

.reaction-option img {
  width: 48px;
  height: 48px;
}

.reaction-option strong,
.reaction-option em {
  display: block;
}

.reaction-option strong {
  font-size: 18px;
}

.reaction-option em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.reaction-option b {
  min-width: 26px;
  border-radius: 999px;
  background: var(--soft);
  padding: 4px 7px;
  text-align: center;
}

.reaction-popover .reaction-option b {
  position: absolute;
  right: -2px;
  bottom: -2px;
  min-width: 24px;
  border: 1px solid #fff;
  background: var(--ink);
  color: #fff;
  padding: 3px 6px;
  font-size: 12px;
}

/* ==========================================================================
   TEXT INPUTS
   ========================================================================== */

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
  font-size: 18px;
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

.comment-textarea {
  min-height: 240px;
}

.invite-link-textarea {
  min-height: 76px;
  font-size: 14px;
  line-height: 1.35;
}

.support-message-textarea {
  min-height: 180px;
  font-size: 18px;
  line-height: 1.35;
}

.segment-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

/* ==========================================================================
   FEED & ENTRY ROWS
   ========================================================================== */

.feed {
  margin: 0 -20px;
}

.entry-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
  user-select: none;
  -webkit-user-select: none;
}

.entry-row.is-tappable {
  cursor: pointer;
}

.entry-row.is-tappable:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.entry-number {
  color: #b8b8b8;
  font-size: 20px;
}

.entry-text {
  font-size: 24px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.entry-correction {
  margin-top: 6px;
  color: #666;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.comment-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0;
  margin-left: 2px;
  cursor: pointer;
  color: #9a9a93;
  vertical-align: middle;
}

.comment-toggle-icon {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.comment-toggle[aria-expanded="true"] {
  color: #444;
}

.entry-comment {
  display: none;
  margin: 8px 0 0;
  color: #4d4d4d;
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.entry-row.comment-open .entry-comment {
  display: block;
  max-height: 7em;
  overflow: hidden;
  -webkit-mask-image: none;
}

.entry-row.comment-open.comment-overflow .entry-comment {
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
}

.comment-readmore {
  display: none;
  margin: 5px 0 0;
  border: 0;
  background: transparent;
  padding: 0;
  color: #555;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.entry-row.comment-open.comment-overflow .comment-readmore {
  display: inline-block;
}

.comment-view-context {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.comment-view-text {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.entry-author {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: #9a9a9a;
  font-size: 17px;
}

.entry-timestamp {
  color: #b5b5b5;
  font-size: 14px;
  font-weight: 800;
}

/* ==========================================================================
   REACTION PILLS & ATTRIBUTION
   ========================================================================== */

.entry-reactions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.reaction-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #555;
  padding: 2px 8px 2px 5px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.reaction-pill.is-active {
  border-color: #cfcfcf;
  background: #f3f3f3;
  color: var(--ink);
}

.reaction-pill:hover,
.reaction-pill:focus-visible {
  border-color: #cfcfcf;
  background: #f6f6f6;
}

.reaction-pill img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.reaction-pill[data-reaction-type="sigh"] img {
  width: 34px;
  height: 24px;
}

.reaction-option img {
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.reaction-pill strong {
  color: var(--ink);
  font-size: 13px;
}

.reaction-people-names {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reaction-people-names span {
  border-radius: 999px;
  background: #f7f7f7;
  padding: 7px 11px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.reaction-people-list {
  display: grid;
  gap: 12px;
}

.reaction-attribution-summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  padding: 7px 12px 7px 8px;
}

.reaction-attribution-summary img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.reaction-attribution-summary img[src*="reaction-ohh"] {
  width: 44px;
  height: 31px;
}

.reaction-attribution-summary strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.reaction-attribution-summary span {
  min-width: 0;
  color: #555;
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   BADGES & HONESTY CHIPS
   ========================================================================== */

.badge {
  display: inline-block;
  margin-left: 8px;
  border-radius: 4px;
  background: #efefef;
  padding: 3px 7px;
  color: #555;
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

.badge-dupe {
  background: #ffe8df;
  color: var(--danger);
}

.badge-subtle {
  background: #eef4ff;
  color: #315c9d;
}

.badge.badge-raw {
  background: #e1f5ee;
  color: #085041;
}

.badge.badge-bee {
  background: #faeeda;
  color: #633806;
}

.honesty-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.badge-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 6px 14px;
  color: #9a9a93;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-decoration: line-through;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.badge-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cfcfc9;
}

.badge-toggle.is-lit {
  text-decoration: none;
}

.badge-raw.is-lit {
  background: #e1f5ee;
  border-color: #0f6e56;
  color: #085041;
}

.badge-raw.is-lit .badge-led {
  background: #0f6e56;
}

.badge-bee.is-lit {
  background: #faeeda;
  border-color: #854f0b;
  color: #633806;
}

.badge-bee.is-lit .badge-led {
  background: #ba7517;
}

/* ==========================================================================
   FEED EVENTS (DUPE / REWIND / SYSTEM / PASS / DEPARTURE)
   ========================================================================== */

.dupe-event {
  border-bottom: 1px solid var(--line);
  background: #fff7f4;
  padding: 14px 20px;
}

.dupe-event-kicker {
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.dupe-event-text {
  margin-top: 4px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dupe-event-meta {
  margin-top: 4px;
  color: #777;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.rewind-event {
  border-bottom: 1px solid var(--line);
  background: #f7f4ef;
  padding: 14px 20px;
}

.rewind-event-kicker {
  color: #6f4e16;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.rewind-event-text {
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.rewind-event-reason {
  margin-top: 5px;
  color: #5c4a2b;
  font-size: 15px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.system-event {
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  padding: 13px 20px;
}

.system-event-kicker {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.system-event-text {
  margin-top: 4px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.25;
}

.pass-event {
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
  padding: 12px 20px;
}

.pass-event-text {
  color: var(--muted);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.departure-event {
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
  padding: 12px 20px;
}

.departure-event-text {
  color: var(--muted);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   HOUSE RULES
   ========================================================================== */

.house-rules-block {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
}

.house-rules-block strong,
.house-rules-block summary {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.house-rules-block summary {
  cursor: pointer;
}

.house-rules-block p {
  margin: 8px 0 0;
  color: #555;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.house-rules-view {
  display: grid;
  gap: 12px;
}

.house-rules-text {
  margin: 0;
  color: #333;
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.label-optional {
  color: #888;
  font-weight: 400;
}

.house-rules-block details {
  margin-top: 0;
}

.house-rules-details summary {
  list-style: none;
}

.house-rules-details summary::-webkit-details-marker {
  display: none;
}

.house-rules-preview {
  display: block;
  margin: 8px 0 0;
  color: #555;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.house-rules-details[open] .house-rules-preview {
  display: none;
}

.house-rules-more {
  display: inline-block;
  margin-top: 6px;
}

.house-rules-more::after {
  content: "More";
}

.house-rules-details[open] .house-rules-more::after {
  content: "Less";
}

/* ==========================================================================
   REWIND & CORRECTION NOTES
   ========================================================================== */

.rewind-warning {
  display: grid;
  gap: 8px;
  border: 1px solid #ead8b7;
  border-radius: 8px;
  background: #fffaf0;
  padding: 12px;
}

.rewind-warning p {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.correction-original {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f8f8;
  padding: 12px;
  color: #555;
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   DUPE LISTS & SUMMARY
   ========================================================================== */

.dupe-list {
  margin: 14px -20px 0;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 0;
}

.dupe-summary {
  display: flex;
  width: calc(100% + 40px);
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 -20px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 12px 20px;
  text-align: left;
}

.dupe-summary strong,
.dupe-summary span span {
  display: block;
}

.dupe-summary strong {
  font-size: 17px;
}

.dupe-summary span span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.dupe-summary-action {
  color: var(--ink);
  font-weight: 800;
}

.dupe-list-group {
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 12px 20px;
}

.dupe-list-title {
  font-size: 17px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dupe-list-count {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
}

.dupe-list ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  color: #555;
  list-style: none;
}

.dupe-list li {
  border-radius: 5px;
  background: var(--soft);
  padding: 4px 7px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   COMPOSER, TURN BAR & DUPE-CHECK RESULT
   ========================================================================== */

.turn-bar {
  margin: 0 -20px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.turn-bar.is-active-turn {
  position: sticky;
  bottom: var(--visual-bottom-inset);
  z-index: 4;
  scroll-margin-bottom: calc(var(--sticky-bottom-space) + env(safe-area-inset-bottom) + var(--visual-bottom-inset));
}

body.has-composer-focus .feed,
body.has-composer-focus .turn-bar.is-active-turn,
body.has-composer-focus .entry-box {
  overflow-anchor: none;
}

.turn-helper {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.entry-box {
  display: grid;
  gap: 12px;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  scroll-margin-bottom: calc(var(--sticky-bottom-space) + env(safe-area-inset-bottom) + var(--visual-bottom-inset));
}

.composer-help {
  display: flex;
  justify-content: flex-start;
  margin-top: -4px;
}

.help-list {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding-left: 20px;
  color: #444;
  line-height: 1.35;
}

.install-steps {
  counter-reset: install-step;
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding-left: 0;
  color: #444;
  line-height: 1.35;
  list-style: none;
}

.install-steps li {
  counter-increment: install-step;
  position: relative;
  display: grid;
  gap: 2px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  padding: 12px 12px 12px 52px;
  font-weight: 800;
}

.install-steps li::before {
  content: counter(install-step);
  position: absolute;
  top: 10px;
  left: 12px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.install-steps small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.install-step-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.install-step-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.result-dupe {
  color: var(--danger);
  font-size: 22px;
  font-weight: 800;
}

.checked-text {
  margin: 0;
  color: #555;
  font-size: 20px;
  font-style: italic;
  overflow-wrap: anywhere;
}

.possible-dupes {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding-right: 2px;
}

.possible-dupe-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.possible-dupe-row strong,
.possible-dupe-row span,
.possible-dupe-row em {
  display: block;
}

.possible-dupe-row strong {
  color: var(--muted);
  font-size: 13px;
}

.possible-dupe-row span {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.possible-dupe-row em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.dupe-choice-button {
  min-height: 40px;
  padding: 0 12px;
  white-space: nowrap;
}

.row-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.compact-button {
  min-height: 40px;
  padding: 0 12px;
}

/* ==========================================================================
   PEOPLE & JOIN REQUESTS
   ========================================================================== */

.request-list {
  display: grid;
  gap: 10px;
}

.people-section {
  display: grid;
  gap: 10px;
}

.people-section + .people-section {
  margin-top: 18px;
}

.people-section h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  color: var(--muted);
  text-transform: uppercase;
}

.waiting-join-section {
  margin-bottom: 18px;
}

.people-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.request-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.people-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.request-row strong,
.request-row span,
.people-row strong,
.people-row span {
  display: block;
}

.request-row span,
.people-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.composer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 48px;
  gap: 10px;
}

.info-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #555;
  padding: 0;
  font-size: 20px;
  font-weight: 800;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

/* ==========================================================================
   MODALS (BACKDROP, SHEET, LEGAL / FAQ)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: end;
  background: rgb(0 0 0 / 25%);
  overflow: hidden;
}

.modal {
  max-height: 92vh;
  max-height: calc(100svh - env(safe-area-inset-top));
  max-height: calc(100dvh - env(safe-area-inset-top));
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 16px 16px 0 0;
  background: #fff;
  padding: 0 20px calc(24px + env(safe-area-inset-bottom) + var(--visual-bottom-inset));
  -webkit-overflow-scrolling: touch;
}

.modal h2 {
  margin: 0 0 18px;
  font-size: 28px;
}

.modal > h2:first-child {
  padding-top: 22px;
}

.legal-modal .modal-header {
  align-items: start;
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.faq-modal .modal-header {
  margin-bottom: 16px;
}

.faq-modal h3 {
  margin: 18px 0 8px;
  font-size: 18px;
}

.legal-modal h2 {
  margin-bottom: 4px;
}

.legal-updated {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.legal-content {
  color: #444;
  line-height: 1.48;
}

.legal-content h3 {
  margin: 24px 0 8px;
  color: var(--ink);
  font-size: 18px;
}

.legal-content p,
.legal-content ul {
  margin: 0 0 14px;
}

.legal-content ul {
  padding-left: 20px;
}

.legal-content a {
  color: var(--ink);
  font-weight: 800;
}

/* ==========================================================================
   TOAST & ERROR
   ========================================================================== */

.toast {
  position: fixed;
  right: max(16px, calc((100vw - 720px) / 2 + 16px));
  bottom: calc(108px + env(safe-area-inset-bottom) + var(--visual-bottom-inset));
  left: max(16px, calc((100vw - 720px) / 2 + 16px));
  z-index: 30;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  text-align: center;
  font-weight: 700;
}

.error {
  color: #b42318;
}

/* ==========================================================================
   RESPONSIVE OVERRIDES
   ========================================================================== */

@media (max-width: 480px) {
  .possible-dupe-row {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 760px) {
  body {
    background: #f3f3f3;
  }

  .app-shell {
    min-height: 100vh;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 5%);
  }
}
