/* =========================================================
   ConnecTeens — cobalt & lime on warm white.
   The palette lives in the tokens below; change --accent to reskin.
   ========================================================= */
:root {
  --paper: #fbfbf9;
  --card-bg: #ffffff;
  --text: #111116;
  --text-secondary: #6c6c7a;
  --text-body: #3a3a44;
  --border: #e9e8e3;

  --accent: #2547f0;
  --accent-light: #eef1fe;
  --lime: #d4f551;
  --success: #0ea860;
  --success-light: #e7f7ef;
  --danger: #e5484d;
  --danger-light: #fdecec;
  /* --danger itself stays tuned for white text ON it (buttons, badges) -
     as a red used FOR text, on the page's own background, it falls short
     of WCAG AA (4.5:1): ~3.9:1 on white. Darkened here for that specific
     use (.error-text and friends). In light mode a single darker red
     happens to satisfy both directions at once, since white is one
     endpoint of both pairings either way - contrast ratio is symmetric.
     That stops being true in dark mode (see the note below), which is
     why this needs its own variable rather than just changing --danger. */
  --danger-text: #c53030;
  --page-backdrop: #dedce4;

  --bg: var(--paper);
  --accent-gradient: linear-gradient(135deg, #2547f0, #6b46ff);

  /* Stays dark in both themes - for chips/toasts that put white text on a
     "--text-colored" surface (e.g. an active segmented control). Using
     --text directly there would go white-on-white once --text flips to a
     light color in dark mode. */
  --ink: #111116;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17171c;
    --card-bg: #1f1f26;
    --text: #f2f2f5;
    --text-secondary: #9d9da8;
    --text-body: #d4d4db;
    --border: #35353f;
    --accent-light: #1c2340;
    --success-light: #123322;
    --danger-light: #3a1f22;
    /* Dark mode breaks the "one red serves both directions" trick above:
       --danger (kept as-is) sits behind white text, so it needs to stay
       dark enough for that; --danger-text sits ON the page's dark
       background as text, which needs the opposite - light enough to
       read. The same value can't satisfy both once neither endpoint is
       white, so this is deliberately lighter than --danger, not the same
       color re-declared. */
    --danger-text: #f26d71;
    --page-backdrop: #0c0c10;
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--page-backdrop);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

#app {
  /* dvh tracks the visible area live, so the tab bar is never hidden behind
     mobile browser chrome. The vh line stays first as an old-browser fallback. */
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 50px rgba(17, 17, 22, 0.16);
}

.app-shell { display: flex; flex-direction: column; height: 100%; }

.app-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  position: relative;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.screen { display: flex; flex-direction: column; min-height: 100%; }

button, .clickable { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.hidden { display: none !important; }
.muted { color: var(--text-secondary); }
.small { font-size: 12.5px; }

/* ---------------- header ---------------- */
.screen-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.screen-header h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.025em;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-word { font-size: 18px; font-weight: 800; letter-spacing: -0.035em; }
.brand-word b { color: var(--accent); font-weight: 800; }

.icon-btn {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.icon-btn:active { background: var(--accent-light); }
.icon-btn.accept { color: var(--success); font-size: 17px; }
.icon-btn.decline { color: var(--danger-text); font-size: 17px; }

.header-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
  border: none; cursor: pointer; flex: none;
  background-size: cover; background-position: center;
  font-family: inherit;
}
.header-avatar.avatar-image { color: transparent; }

/* ---------------- category chips ---------------- */
.cat-chips {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}
.cat-chips::-webkit-scrollbar { display: none; }

.cat-chip {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.cat-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------------- lists ---------------- */
.scroll-area { padding: 0 14px 24px; display: flex; flex-direction: column; gap: 10px; }
.card-list { display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 28px; }

/* ---------------- post card ---------------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 13px;
}

.card-header { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.card-header-text { min-width: 0; flex: 1; }

.card-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.012em;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.card-subtitle { font-size: 12.5px; color: var(--text-secondary); }

.venture-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 6px; }
.venture-name {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.032em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
}

.card-body { font-size: 14px; line-height: 1.5; color: var(--text-body); margin: 0 0 10px; overflow-wrap: anywhere; }

.post-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  display: block;
  background: var(--paper);
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  border-top: 1px solid var(--border);
  padding-top: 9px;
  flex-wrap: wrap;
}

.react-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-secondary);
  padding: 7px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  min-height: 48px;
  transition: background 0.14s ease, color 0.14s ease;
}
.react-btn .react-icon { font-size: 14px; line-height: 1; }
.react-btn:active { background: var(--border); }
.react-btn.active { background: var(--lime); color: var(--ink); }

.comment-count {
  margin-left: auto;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  padding: 7px 10px;
  border-radius: 999px;
  min-height: 48px;
  white-space: nowrap;
}
.comment-count.clickable { cursor: pointer; }
.comment-count.clickable:active { background: var(--accent-light); }

.author-link { cursor: pointer; }

.timestamp { color: var(--text-secondary); font-size: 12.5px; font-weight: 500; white-space: nowrap; }

.admin-badge {
  font-size: 10px; font-weight: 700; color: var(--success);
  background: var(--success-light); padding: 2px 6px; border-radius: 5px; white-space: nowrap;
}

.handle { color: var(--text-secondary); font-weight: 500; font-size: 0.86em; }
.mention { color: var(--accent); font-weight: 650; cursor: pointer; }
.frozen-tag {
  font-size: 10px; font-weight: 700; color: var(--danger-text);
  background: var(--danger-light); padding: 2px 6px; border-radius: 5px; white-space: nowrap;
}
.blocked-badge {
  font-size: 10px; font-weight: 700; color: var(--danger-text);
  background: var(--danger-light); padding: 2px 6px; border-radius: 5px; white-space: nowrap;
}

/* ---------------- floating compose ---------------- */
.fab {
  position: fixed;
  right: max(16px, calc(50vw - 240px + 16px));
  bottom: calc(76px + env(safe-area-inset-bottom));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 27px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(37, 71, 240, 0.4);
  z-index: 30;
  font-family: inherit;
  transition: transform 0.12s ease;
}
.fab:active { transform: scale(0.94); }

/* ---------------- author filter chip ---------------- */
.filter-chip {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 12px 0; padding: 9px 12px;
  background: var(--accent-light); color: var(--accent);
  border-radius: var(--r-md); font-size: 13px; font-weight: 650;
}
.filter-chip button {
  margin-left: auto; background: none; border: none; color: var(--accent);
  font-weight: 700; font-size: 13px; font-family: inherit; cursor: pointer; padding: 4px;
}

/* ---------------- avatars ---------------- */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--accent-gradient);
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  background-size: cover; background-position: center;
}
.avatar.small { width: 30px; height: 30px; font-size: 11px; }
.avatar.avatar-image { color: transparent; }

.avatar-large {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff; font-size: 30px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  background-size: cover; background-position: center;
}
.avatar-large.avatar-image { color: transparent; }
.avatar-large-wrap { position: relative; width: 84px; margin: 0 auto; }
.avatar-edit-btn {
  position: absolute; right: -4px; bottom: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--card-bg); border: 1px solid var(--border);
  font-size: 14px; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.1); font-family: inherit;
}

/* ---------------- tab bar ---------------- */
.tab-bar {
  flex-shrink: 0;
  display: flex;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 25;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 2px 8px;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  font-family: inherit;
  transition: color 0.15s ease;
}
.tab-btn > span:last-child { font-size: 10px; font-weight: 600; letter-spacing: -0.01em; }
.tab-btn .tab-icon { display: block; width: 22px; height: 22px; }
.tab-btn .tab-icon svg {
  width: 22px; height: 22px; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.tab-btn.active { color: var(--accent); }

.tab-badge {
  position: absolute;
  top: 4px;
  left: 50%;
  margin-left: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
  border: 2px solid var(--card-bg);
  box-sizing: content-box;
}

/* ---------------- rows ---------------- */
.user-row {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r-md);
}
.user-row.clickable { cursor: pointer; }
.user-row.clickable:active { background: var(--paper); }
.user-row-text { min-width: 0; flex: 1; }

.row-trailing { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.row-actions { gap: 4px; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.truncate-2 {
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.badge {
  min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 800;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}

/* ---------------- section headings ---------------- */
.section-heading {
  margin: 14px 0 2px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-secondary);
}
.section-heading b { color: var(--text); }

/* ---------------- discover ---------------- */
.search-bar { padding: 10px 14px; background: var(--card-bg); border-bottom: 1px solid var(--border); }

.trend-row {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--r-md); cursor: pointer;
}
.trend-row:active { background: var(--paper); }
.trend-rank {
  font-size: 17px; font-weight: 800; color: var(--text-secondary);
  width: 18px; flex: none; font-variant-numeric: tabular-nums;
}
.trend-rank.top { color: var(--text); }
.trend-text { min-width: 0; flex: 1; }
.trend-title { font-size: 14.5px; font-weight: 700; letter-spacing: -0.02em; }
.trend-sub { font-size: 12.5px; color: var(--text-secondary); }
.spark { margin-left: auto; display: flex; align-items: flex-end; gap: 2px; height: 24px; flex: none; }
.spark i { width: 4px; background: var(--lime); border-radius: 2px; display: block; min-height: 3px; }

.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px; text-align: left;
  font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--text); cursor: pointer;
}
.cat-card:active { background: var(--paper); }
.cat-card span { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-top: 2px; }

/* ---------------- comments ---------------- */
.comment-row { display: flex; gap: 9px; align-items: flex-start; }
.comment-bubble {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 4px 14px 14px 14px; padding: 9px 11px; min-width: 0;
}
.comment-author { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.comment-text { font-size: 13.5px; line-height: 1.45; color: var(--text-body); margin-top: 2px; overflow-wrap: anywhere; }

/* ---------------- composer ---------------- */
.composer {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--card-bg);
  position: sticky; bottom: 0;
}
.composer .text-input { border-radius: 999px; padding: 10px 14px; }
.send-btn {
  background: var(--accent); color: #fff; border: none; border-radius: 50%;
  width: 48px; height: 48px; flex: none; font-size: 16px; cursor: pointer; font-family: inherit;
}
.send-btn:active { transform: scale(0.94); }

/* ---------------- messages ---------------- */
.bubble-row { display: flex; padding: 3px 14px; }
.bubble-row.mine { justify-content: flex-end; }
.bubble {
  max-width: 78%; padding: 9px 13px; border-radius: 18px;
  font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere;
}
.bubble-row.theirs .bubble {
  background: var(--card-bg); border: 1px solid var(--border); border-bottom-left-radius: 5px;
}
.bubble-row.mine .bubble {
  background: var(--accent); color: #fff; border-bottom-right-radius: 5px;
}
.bubble-time { display: block; margin-top: 4px; font-size: 11px; opacity: 0.75; }
.bubble-row.mine .bubble-time { color: rgba(255,255,255,.9); text-align: right; }
.bubble-row.mine .mention { color: #fff; text-decoration: underline; }

/* ---------------- profile ---------------- */
.profile-head {
  padding: 20px 14px 14px; text-align: center;
  background: var(--card-bg); border-bottom: 1px solid var(--border);
}
.profile-username {
  font-size: 19px; font-weight: 800; letter-spacing: -0.03em; margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap;
}
.profile-joined { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.profile-bio {
  font-size: 13.5px; color: var(--text); margin-top: 10px; line-height: 1.4;
  white-space: pre-wrap; word-break: break-word;
}
.profile-bio.clickable { cursor: pointer; }
.profile-bio.clickable:active { opacity: 0.7; }
.profile-stats { display: flex; margin-top: 16px; }
.profile-stats > div { flex: 1; }
.profile-stats strong { display: block; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.profile-stats span {
  font-size: 10px; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--text-secondary);
}

/* ---------------- activity ---------------- */
.activity-row {
  display: flex; gap: 11px; align-items: center; padding: 11px 12px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r-md);
}
.activity-row.clickable { cursor: pointer; }
.activity-row.clickable:active { background: var(--paper); }
.activity-icon {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: var(--accent-light); display: grid; place-items: center; font-size: 15px;
}
.activity-text { min-width: 0; flex: 1; }
.activity-title { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.activity-body { font-size: 12.5px; color: var(--text-secondary); margin-top: 1px; overflow-wrap: anywhere; }
.activity-meta { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

/* ---------------- segmented ---------------- */
.segmented { display: flex; gap: 5px; padding: 12px 14px 4px; }
.segmented.scrollable { overflow-x: auto; scrollbar-width: none; }
.segmented.scrollable::-webkit-scrollbar { display: none; }
.segment-btn {
  flex: 1; text-align: center; font-family: inherit; min-height: 48px;
  font-size: 13px; font-weight: 650; padding: 9px 12px;
  border: none; border-radius: var(--r-sm);
  background: none; color: var(--text-secondary); cursor: pointer; white-space: nowrap;
}
.segmented.scrollable .segment-btn { flex: none; }
.segment-btn.active { background: var(--ink); color: #fff; }

/* ---------------- buttons ---------------- */
.primary-btn {
  display: block; width: 100%; text-align: center;
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--r-md); padding: 14px;
  font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.primary-btn:active { transform: scale(0.985); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.secondary-btn {
  width: 100%; background: var(--card-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 13px; font-size: 14.5px; font-weight: 650; font-family: inherit; cursor: pointer;
}
.secondary-btn:active { background: var(--paper); }

.danger-btn {
  width: 100%; background: var(--danger-light); color: var(--danger-text);
  border: none; border-radius: var(--r-md); padding: 13px;
  font-size: 14.5px; font-weight: 700; font-family: inherit; cursor: pointer;
}
.danger-btn.ghost { background: none; }
.danger-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pill-btn {
  background: var(--accent); color: #fff; border: none;
  border-radius: 999px; padding: 8px 16px;
  font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer; min-height: 34px;
}
.pill-btn:active { transform: scale(0.96); }
.pill-btn:disabled { opacity: 0.5; }

.link-btn {
  display: block; width: 100%; text-align: center;
  background: none; border: none; color: var(--text);
  font-size: 14px; font-family: inherit; cursor: pointer; padding: 10px;
}
.link-btn strong { color: var(--accent); }

.text-btn {
  background: none; border: none; font-size: 15px; font-family: inherit;
  color: var(--text-secondary); cursor: pointer; padding: 6px 10px;
  min-height: 48px; min-width: 48px;
}
.text-btn.primary { color: var(--accent); font-weight: 700; }
.text-btn:disabled { opacity: 0.5; }

/* ---------------- inputs ---------------- */
.text-input {
  width: 100%;
  font-family: inherit;
  font-size: 16px; /* 16px stops iOS zooming the page on focus */
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card-bg);
  color: var(--text);
}
.text-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
textarea.text-input { resize: vertical; line-height: 1.5; }

.password-field { position: relative; display: flex; }
.password-field .text-input { flex: 1; padding-right: 48px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-size: 17px; line-height: 1;
  padding: 9px; cursor: pointer; opacity: 0.5; border-radius: var(--r-sm); font-family: inherit;
}
.password-toggle:hover, .password-toggle.active { opacity: 1; }

.error-text { color: var(--danger-text); font-size: 13.5px; }

/* ---------------- auth ---------------- */
.auth-screen {
  display: flex; align-items: flex-start; justify-content: center;
  min-height: 100%; padding: 0 20px 40px; overflow-y: auto;
  background: var(--accent-gradient);
}
.auth-card {
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--card-bg); border-radius: 22px;
  padding: 30px 22px 22px; margin-top: 46px;
  box-shadow: 0 20px 50px rgba(11, 11, 40, 0.28);
}
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card .muted.small { text-align: center; }
.auth-card .muted.small a { color: var(--accent); }

.auth-brand { text-align: center; margin-bottom: 8px; }
.auth-brand h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.035em; }
.auth-brand p { margin: 4px 0 0; font-size: 14px; }
.brand-icon {
  font-size: 34px; width: 66px; height: 66px; margin: 0 auto 12px;
  border-radius: 22px; background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
}

/* ---------------- empty states ---------------- */
.empty-state { text-align: center; padding: 44px 22px; }
.empty-title { font-size: 16px; font-weight: 750; letter-spacing: -0.02em; }
.empty-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 5px; }

/* ---------------- modals ---------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(17, 17, 22, 0.5);
  display: flex; align-items: flex-end; justify-content: center; z-index: 100;
}
.modal {
  background: var(--card-bg);
  width: 100%; max-width: 480px;
  border-radius: 20px 20px 0 0;
  max-height: 92vh; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 14px 10px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; font-size: 16px; font-weight: 750; letter-spacing: -0.02em; }
.modal-body {
  padding: 16px 14px 22px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.modal-body label { font-size: 12.5px; font-weight: 650; color: var(--text-secondary); }
.modal-body .text-input + label { margin-top: 6px; }

.image-preview {
  width: 100%; max-height: 220px; object-fit: cover;
  border-radius: var(--r-md); border: 1px solid var(--border);
}

.warning-modal { border-radius: 20px; margin: auto 14px; padding: 26px 20px 20px; text-align: center; }
.warning-icon { font-size: 38px; }
.warning-modal h2 { margin: 10px 0 8px; font-size: 18px; font-weight: 750; }
.warning-text { font-size: 14px; line-height: 1.5; color: var(--text-secondary); margin: 0 0 18px; }
.notice-modal .warning-text { white-space: pre-wrap; text-align: left; }

.legal-modal { border-radius: 20px 20px 0 0; }
.legal-body { font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.legal-updated { font-size: 12.5px; color: var(--text-secondary); }

/* ---------------- kebab ---------------- */
.kebab-wrap { position: relative; flex: none; }
.kebab-btn { font-size: 17px; color: var(--text-secondary); padding: 6px 8px; min-width: 48px; min-height: 48px; }
.kebab-menu {
  position: absolute; right: 0; top: 100%; z-index: 60;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: 0 10px 28px rgba(17,17,22,.16);
  min-width: 180px; overflow: hidden; padding: 4px;
}
.kebab-item {
  display: block; width: 100%; text-align: left;
  background: none; border: none; font-family: inherit;
  font-size: 14px; padding: 11px 12px; cursor: pointer;
  color: var(--text); border-radius: var(--r-sm);
}
.kebab-item:active { background: var(--paper); }
.kebab-item.danger { color: var(--danger-text); }

/* ---------------- admin ---------------- */
.wipe-panel {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px;
}
.checkbox-row {
  display: flex; align-items: center; gap: 11px; min-height: 48px;
  font-size: 14px; padding: 8px 4px; cursor: pointer; border-radius: var(--r-sm);
}
.checkbox-row:hover { background: var(--paper); }
.checkbox-row input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--accent); flex: none; cursor: pointer; }

.inbox-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--r-md);
}
.inbox-row.resolved { opacity: 0.6; }
.inbox-main { flex: 1; min-width: 0; }
.inbox-main .comment-text { color: var(--text); }
.resolved-note { margin-top: 6px; font-size: 12.5px; color: var(--text-secondary); }
.resolve-btn { flex: none; background: var(--success); }
.inbox-controls { display: flex; gap: 8px; }
.inbox-controls .secondary-btn { flex: 1; }

/* ---------------- banners ---------------- */
.error-banner {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 200;
  background: var(--danger); color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: calc(13px + env(safe-area-inset-top)) 14px 13px;
  font-size: 13.5px; line-height: 1.4;
}
.error-banner span { flex: 1; }
.error-banner button {
  background: none; border: none; color: #fff; font-size: 15px;
  cursor: pointer; padding: 4px 6px; flex: none; font-family: inherit;
}

.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600;
  max-width: min(88vw, 420px); text-align: center;
  opacity: 0; pointer-events: none; z-index: 150;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------- app store compliance ---------------- */

/*
 * Standalone /privacy.html, /terms.html and /delete-account.html. These are
 * plain documents rather than app screens: both stores fetch the privacy
 * policy URL during review and it has to render without signing in.
 */
.legal-page {
  max-width: 680px;
  margin: 0 auto;
  padding:
    calc(24px + env(safe-area-inset-top))
    calc(20px + env(safe-area-inset-right))
    calc(48px + env(safe-area-inset-bottom))
    calc(20px + env(safe-area-inset-left));
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}
.legal-page h3 { margin: 26px 0 8px; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.legal-page h3:first-of-type { margin-top: 12px; }
.legal-page p { margin: 0 0 12px; }
.legal-page a { color: var(--accent); }
.legal-back {
  display: inline-flex; align-items: center; min-height: 48px;
  font-weight: 700; text-decoration: none;
}

/*
 * Visible keyboard focus. Both stores' accessibility reviews check that
 * every control can be reached and seen with an external keyboard or
 * switch control, and :focus-visible keeps the ring off pointer taps so
 * the touch UI is unchanged.
 */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/*
 * Honour the OS text-size setting instead of overriding it. Apple's HIG
 * expects Dynamic Type support and Play's accessibility scan flags UI that
 * breaks when the system font scale is raised, so nothing here pins a
 * viewport-relative or absolute root size.
 */
@media (prefers-contrast: more) {
  :root { --text-secondary: var(--text); --border: var(--text); }
}
