/* ============================================================
   LAOWAI — design system
   Direction: 留白 (liúbái) — the seal on empty paper.
   One vermilion mark, used rarely, against generous space.
   Hairlines not borders. Depth from restraint, not decoration.
   ============================================================ */

:root,
[data-theme="light"] {
  /* Ink & paper */
  --paper:      #FAF8F3;   /* warm rice paper */
  --paper-2:    #F2EEE5;   /* recessed bands */
  --surface:    #FFFFFF;
  --ink:        #1A1917;   /* warm black, like ground inkstick */
  --stone:      #857E73;   /* secondary text */
  --hairline:   #E5DFD2;
  --hairline-2: #F0EBE0;

  /* The mark — used sparingly, so it still means something */
  --vermilion:      #C93F2E;
  --vermilion-deep: #A62F20;
  --vermilion-wash: rgba(201, 63, 46, .08);

  /* Semantics */
  --jade: #2E7D5B;         /* verification only */
  --gold: #A8842A;         /* membership tier only */

  --seal-ink: #FAF6EC;

  --lift-1: 0 1px 2px rgba(26,25,23,.04), 0 2px 8px rgba(26,25,23,.04);
  --lift-2: 0 2px 4px rgba(26,25,23,.05), 0 12px 32px rgba(26,25,23,.09);
  --lift-3: 0 24px 64px rgba(26,25,23,.16);

  /* Legacy aliases so existing page-level styles keep working */
  --bg: var(--paper);
  --bg-2: var(--paper-2);
  --text: var(--ink);
  --muted-c: var(--stone);
  --line: var(--hairline);
  --cinnabar: var(--vermilion);
  --cinnabar-soft: var(--vermilion-wash);
  --shadow: rgba(26,25,23,.10);
}

[data-theme="dark"] {
  --paper:      #131210;   /* warm dark, an inkstone not a screen */
  --paper-2:    #1A1917;
  --surface:    #1E1D1A;
  --ink:        #F4F0E6;
  --stone:      #948C80;
  --hairline:   #2E2C28;
  --hairline-2: #262420;

  --vermilion:      #E05744;
  --vermilion-deep: #C93F2E;
  --vermilion-wash: rgba(224, 87, 68, .12);

  --jade: #56B389;
  --gold: #CFAE55;

  --seal-ink: #FBF7ED;

  --lift-1: 0 1px 2px rgba(0,0,0,.3);
  --lift-2: 0 2px 6px rgba(0,0,0,.4), 0 16px 40px rgba(0,0,0,.36);
  --lift-3: 0 24px 64px rgba(0,0,0,.6);

  --bg: var(--paper);
  --bg-2: var(--paper-2);
  --text: var(--ink);
  --line: var(--hairline);
  --cinnabar: var(--vermilion);
  --cinnabar-soft: var(--vermilion-wash);
  --shadow: rgba(0,0,0,.5);
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Karla', system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .25s ease, color .25s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--vermilion); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--vermilion); color: #fff; }
.hidden { display: none !important; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 620px) { .container { padding: 0 18px; } }

/* ---------- Type ---------- */
.serif { font-family: 'Noto Serif SC', 'Songti SC', Georgia, serif; }

h1, h2, h3 {
  font-family: 'Noto Serif SC', 'Songti SC', Georgia, serif;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
h1 { font-size: clamp(1.9rem, 3.8vw, 2.7rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); letter-spacing: -0.01em; }
h3 { font-size: 1.06rem; font-weight: 700; letter-spacing: 0; }

/* Museum-placard label: small, wide-tracked, quiet. Carries metadata
   without competing with the object it describes. */
.sec-zh, .label {
  font-family: 'Noto Serif SC', serif;
  font-size: .72rem; font-weight: 700;
  letter-spacing: .34em; text-transform: uppercase;
  color: var(--stone); margin-bottom: 10px;
}
.sec-zh { color: var(--vermilion); }

.sub   { color: var(--stone); margin-top: 10px; font-size: 1.02rem; }
.muted { color: var(--stone); }

/* ---------- Nav ---------- */
nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 72px; }

.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand-text {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700; font-size: 1.02rem; letter-spacing: .22em;
}
.seal {
  width: 34px; height: 34px; background: var(--vermilion); border-radius: 6px;
  display: grid; place-items: center; transform: rotate(-2.5deg); flex: none;
  box-shadow: none;
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.brand:hover .seal { transform: rotate(2.5deg); }
.seal svg { width: 26px; height: 26px; }

.search {
  flex: 1; max-width: 340px; display: flex; align-items: center;
  border: 1px solid var(--hairline); border-radius: 999px;
  background: var(--surface); overflow: hidden;
  transition: border-color .18s;
}
.search:focus-within { border-color: var(--ink); }
.search input {
  flex: 1; border: none; padding: 9px 18px; font-family: inherit;
  font-size: .9rem; background: transparent; color: var(--ink);
  outline: none; min-width: 0;
}
.search input::placeholder { color: var(--stone); }
.search button {
  padding: 0 16px; font-family: 'Noto Serif SC', serif; border: none;
  font-weight: 700; color: var(--stone); font-size: .9rem;
  background: transparent; align-self: stretch;
}
.search button:hover { color: var(--vermilion); }

.nav-right { display: flex; gap: 22px; align-items: center; margin-left: auto; }
.menu-link {
  color: var(--stone); font-weight: 600; font-size: .88rem;
  letter-spacing: .02em; white-space: nowrap; position: relative; padding-bottom: 2px;
}
.menu-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: var(--vermilion); transform: scaleX(0); transform-origin: left;
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
.menu-link:hover { color: var(--ink); }
.menu-link:hover::after, .menu-link.on::after { transform: scaleX(1); }
.menu-link.on { color: var(--ink); }

.icon-btn {
  border: 1px solid var(--hairline); background: transparent; color: var(--stone);
  border-radius: 999px; width: 32px; height: 32px;
  font-size: .8rem; display: grid; place-items: center; flex: none;
  transition: border-color .18s, color .18s;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
[data-lang-toggle] { width: auto; padding: 0 13px; font-weight: 700; letter-spacing: .06em; }

.avatar-chip {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--hairline); border-radius: 999px; padding: 3px 12px 3px 3px;
  transition: border-color .18s;
}
.avatar-chip:hover { border-color: var(--ink); }
.avatar-chip.is-member { border-color: color-mix(in srgb, var(--jade) 45%, transparent); }
.avatar-chip .dot {
  width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font-weight: 700; font-size: .74rem;
}
.seal-badge { font-family: 'Noto Serif SC', serif; color: var(--jade); font-weight: 900; font-size: .86rem; }

/* ---------- Buttons ----------
   Solid vermilion is reserved for the single primary action on a screen.
   Everything else is a hairline outline, so the eye knows where to go. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--vermilion); color: #fff; border: none;
  font-weight: 700; font-size: .92rem; letter-spacing: .01em;
  padding: 12px 26px; border-radius: 999px; box-shadow: none;
  transition: background .18s, transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s;
  text-align: center; line-height: 1.2;
}
.btn:hover { background: var(--vermilion-deep); transform: translateY(-1px); box-shadow: var(--lift-2); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--hairline); box-shadow: none;
}
.btn.ghost:hover { background: transparent; color: var(--ink); border-color: var(--ink); box-shadow: var(--lift-1); }

.btn.jade { background: var(--jade); }
.btn.jade:hover { background: color-mix(in srgb, var(--jade) 85%, black); }

.btn.sm  { padding: 8px 18px; font-size: .84rem; }
.btn.big { padding: 15px 34px; font-size: 1rem; }
.btn.full { display: flex; width: 100%; }

/* ---------- Page scaffold ---------- */
.page { padding: 52px 0 110px; }
.page-head { margin-bottom: 40px; }

/* ---------- Categories ----------
   The Chinese characters are the icons. Emoji render differently on every
   platform and read as clip-art next to this typography; the characters are
   already in our display face, carry the brand's seal-carving motif, and
   teach an English reader a little Chinese on the way past. */
.cats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 0; margin-bottom: 48px;
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
.cat-tile {
  background: transparent; border: none; border-right: 1px solid var(--hairline);
  padding: 22px 8px 20px; text-align: center; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  position: relative; transition: color .18s;
}
.cat-tile:last-child { border-right: none; }

/* Chinese first, at display size — this is the icon */
.cat-tile .han {
  font-family: 'Noto Serif SC', 'Songti SC', serif;
  font-size: 1.32rem; font-weight: 700; letter-spacing: .16em;
  line-height: 1; text-indent: .16em;   /* recentre against the tracking */
  transition: color .18s;
}
/* English beneath, small and wide — a caption, not a competitor */
.cat-tile .en {
  font-size: .64rem; font-weight: 700; letter-spacing: .17em;
  text-transform: uppercase; color: var(--stone); transition: color .18s;
}

.cat-tile:hover .han { color: var(--vermilion); }
.cat-tile:hover .en  { color: var(--ink); }

/* Selected: a vermilion rule beneath, like a stroke of the seal */
.cat-tile.on .han { color: var(--vermilion); }
.cat-tile.on .en  { color: var(--ink); }
.cat-tile.on::after {
  content: ""; position: absolute; left: 18%; right: 18%; bottom: -1px;
  height: 2px; background: var(--vermilion);
}

/* ---------- Cards ----------
   The object is the hero. Chrome stays out of its way: no frame on the
   image, metadata in a quiet stack beneath. */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px 24px; }

.card {
  display: flex; flex-direction: column; background: transparent;
  border: none; border-radius: 0; overflow: visible; box-shadow: none;
  transition: none;
}
.card:hover { transform: none; box-shadow: none; }
.thumb {
  aspect-ratio: 4/5; background: var(--paper-2); border-radius: 10px;
  display: grid; place-items: center; font-size: 2.4rem; overflow: hidden;
  position: relative;
}
.thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
.card:hover .thumb img { transform: scale(1.035); }

.card-body { padding: 14px 2px 0; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.card-title {
  font-weight: 700; font-size: .93rem; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-sub {
  font-family: 'Noto Serif SC', serif; color: var(--stone); font-size: .8rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: auto; padding-top: 10px;
}
.price {
  font-family: 'Noto Serif SC', serif; font-weight: 900;
  font-size: 1.02rem; color: var(--ink); letter-spacing: -.01em;
}
.seller { font-size: .74rem; color: var(--stone); font-weight: 600; }

/* The seal is the verification mark — the one place vermilion earns its keep */
.verified {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .64rem; font-weight: 700; color: var(--jade);
  letter-spacing: .18em; text-transform: uppercase; margin-bottom: 2px;
}
.verified::before {
  content: "印"; font-family: 'Noto Serif SC', serif;
  background: var(--jade); color: #fff; border-radius: 3px;
  padding: 1px 4px; font-size: .62rem; transform: rotate(-3deg); letter-spacing: 0;
}

/* Reputation — the single most consulted piece of information on a card */
.rep {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .74rem; font-weight: 700; color: var(--stone);
}
.rep-stars { color: var(--gold); letter-spacing: .02em; }
.rep-trades { color: var(--stone); }
.rep-new {
  color: var(--stone); font-weight: 600; font-size: .72rem;
  letter-spacing: .04em; opacity: .8;
}

.pill {
  display: inline-block; background: transparent;
  border: 1px solid var(--hairline); border-radius: 999px;
  padding: 3px 11px; font-size: .7rem; font-weight: 700; color: var(--stone);
  letter-spacing: .04em;
}
.pill.china { border-color: color-mix(in srgb, var(--vermilion) 32%, transparent); color: var(--vermilion); background: transparent; }

/* ---------- Panels & forms ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 16px; padding: 32px;
}

.field { margin-bottom: 20px; }
.field label {
  display: block; font-weight: 700; font-size: .74rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--stone);
  margin-bottom: 8px;
}
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--hairline); border-radius: 9px;
  padding: 12px 14px; font-family: inherit; font-size: .95rem;
  background: var(--paper); color: var(--ink);
  transition: border-color .18s, background .18s;
}
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--stone) 72%, transparent); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--ink); background: var(--surface); outline: none;
}
.field .hint { font-size: .78rem; color: var(--stone); margin-top: 7px; line-height: 1.5; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: color-mix(in srgb, var(--ink) 66%, transparent);
  display: grid; place-items: center; z-index: 200; padding: 20px;
  animation: fade .2s ease;
}
.modal {
  background: var(--surface); border-radius: 18px; padding: 40px 36px;
  max-width: 420px; text-align: center; box-shadow: var(--lift-3);
  animation: rise .3s cubic-bezier(.2,.8,.2,1);
}
.modal-seal {
  width: 60px; height: 60px; background: var(--vermilion); color: var(--seal-ink);
  border-radius: 11px; display: grid; place-items: center;
  font-family: 'Noto Serif SC', serif; font-weight: 900; font-size: 1.9rem;
  margin: 0 auto 20px; transform: rotate(-3deg); box-shadow: none;
}
.modal p { color: var(--stone); margin: 12px 0 26px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: .9rem;
  z-index: 300; box-shadow: var(--lift-2); transition: opacity .3s;
  max-width: 90vw; animation: toastIn .3s cubic-bezier(.2,.8,.2,1);
}
.toast-error   { background: var(--vermilion); color: #fff; }
.toast-success { background: var(--jade); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } }

/* ---------- States ---------- */
.empty {
  text-align: center; padding: 84px 20px; color: var(--stone);
  border: 1px dashed var(--hairline); border-radius: 16px;
}
.spinner {
  width: 26px; height: 26px; border: 1.5px solid var(--hairline);
  border-top-color: var(--vermilion); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 56px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 26px 18px; }
  .search { display: none; }
  .nav-right .menu-link { display: none; }
  .nav-right { gap: 12px; }
  .row2 { grid-template-columns: 1fr; }
  .page { padding: 36px 0 80px; }
  .panel { padding: 24px; }
}
@media (max-width: 620px) {
  .cats { grid-template-columns: repeat(4, 1fr); }
  .cat-tile:nth-child(4n) { border-right: none; }
  .cat-tile:nth-child(-n+4) { border-bottom: 1px solid var(--hairline); }
}
@media (max-width: 480px) {
  .brand-text { display: none; }
  .cat-tile { padding: 16px 4px 14px; gap: 7px; }
  .cat-tile .han { font-size: 1.15rem; }
  .cat-tile .en { font-size: .58rem; letter-spacing: .12em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Install prompt ----------
   Appears once, after the visitor has had a proper look. Dismissing it is
   permanent — a nagging install banner is the fastest way to lose someone. */
.install-bar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 12px 14px 12px 16px;
  box-shadow: var(--lift-2); z-index: 250;
  width: calc(100% - 32px); max-width: 440px;
  animation: rise .35s cubic-bezier(.2,.8,.2,1);
}
.install-seal {
  width: 38px; height: 38px; background: var(--vermilion); color: var(--seal-ink);
  border-radius: 8px; display: grid; place-items: center; flex: none;
  font-family: 'Noto Serif SC', serif; font-weight: 900; font-size: 1.15rem;
  transform: rotate(-3deg);
}
.install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.install-text b { font-size: .88rem; font-weight: 700; }
.install-text span { font-size: .76rem; color: var(--stone); }
.install-x {
  background: none; border: none; color: var(--stone);
  font-size: 1.3rem; line-height: 1; padding: 0 4px; flex: none;
}
.install-x:hover { color: var(--ink); }
@media (max-width: 420px) { .install-text span { display: none; } }

/* ---------- Mobile tab bar ----------
   Desktop keeps the top nav; phones get a bottom bar. Safe-area inset so it
   clears the iPhone home indicator when installed as a PWA. */
.tabbar { display: none; }

@media (max-width: 820px) {
  /* Solid, not translucent. iOS Safari renders the page black beneath a
     fixed element carrying backdrop-filter — the blur isn't worth that. */
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: var(--paper);
    backdrop-filter: none;
    border-top: 1px solid var(--hairline);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  /* Same reason — the sticky top nav drops its blur on mobile. */
  nav {
    background: var(--paper);
    backdrop-filter: none;
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 4px 8px; color: var(--stone);
    font-size: .65rem; font-weight: 700; letter-spacing: .06em;
    transition: color .16s;
  }
  .tab-icon { display: grid; place-items: center; height: 22px; }
  .tab.on { color: var(--vermilion); }
  .tab:active { opacity: .6; }
  .tab-cta { color: var(--vermilion); }
  .seal-tab {
    font-family: 'Noto Serif SC', serif; font-weight: 900; font-size: 1.05rem;
    background: var(--vermilion); color: var(--seal-ink);
    border-radius: 6px; width: 24px; height: 22px;
    display: grid; place-items: center; transform: rotate(-3deg);
  }

  /* Room for the bar, plus the install prompt sits above it */
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .install-bar { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }

  /* The top nav keeps brand, theme and language on mobile; navigation
     itself moves to the tab bar. */
  .nav-right { gap: 10px; }
  .nav-right .btn.sm { display: none; }   /* the tab bar carries Join */
  .avatar-chip { padding: 3px 8px 3px 3px; }
  .nav-inner { height: 62px; }
}

/* ---------- Notification bell ---------- */
.bell { position: relative; }
.bell-dot {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px;
  background: var(--vermilion); color: #fff; border-radius: 999px;
  font-size: .62rem; font-weight: 700; display: grid; place-items: center;
  padding: 0 4px; border: 2px solid var(--paper);
}

/* ---------- Notification centre ---------- */
.notif {
  display: flex; gap: 14px; padding: 16px 0;
  border-bottom: 1px solid var(--hairline); align-items: flex-start;
}
.notif.unread { background: var(--vermilion-wash); margin: 0 -14px; padding: 16px 14px; border-radius: 8px; }
.notif-icon {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-family: 'Noto Serif SC', serif;
  font-weight: 900; font-size: .95rem;
  background: var(--paper-2); color: var(--stone);
}
.notif-icon.msg   { background: var(--vermilion); color: var(--seal-ink); }
.notif-icon.trade { background: var(--jade); color: #fff; }
.notif-icon.social{ background: var(--paper-2); color: var(--ink); }
.notif-main { flex: 1; min-width: 0; }
.notif-main b { display: block; font-size: .93rem; font-weight: 700; }
.notif-main p { font-size: .85rem; color: var(--stone); margin-top: 2px; }
.notif-time { font-size: .72rem; color: var(--stone); flex: none; }

/* Push toggle row */
.pref-row {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 0; border-bottom: 1px solid var(--hairline);
}
.pref-row .pref-main { flex: 1; min-width: 0; }
.pref-row b { display: block; font-size: .93rem; }
.pref-row span { font-size: .82rem; color: var(--stone); }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: var(--hairline);
  border-radius: 999px; transition: background .18s; cursor: pointer;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--surface);
  transition: transform .18s; box-shadow: var(--lift-1);
}
.switch input:checked + .track { background: var(--jade); }
.switch input:checked + .track::after { transform: translateX(20px); }

@media (max-width: 820px) {
  .tab-badge {
    position: absolute; top: 4px; right: calc(50% - 18px);
    width: 8px; height: 8px; background: var(--vermilion); border-radius: 50%;
  }
  .tab { position: relative; }
}

/* ---------- Install card ----------
   Appears on the homepage, after joining, and in profile settings. iPhone
   users get instructions rather than a button, because Safari offers no
   install prompt and they'd otherwise never know it was possible. */
.install-card {
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--hairline); border-radius: 14px;
  padding: 18px 20px; background: var(--surface);
}
.install-card.compact { padding: 14px 16px; gap: 13px; }
.install-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.install-copy b { font-size: .93rem; font-weight: 700; }
.install-copy span { font-size: .82rem; color: var(--stone); line-height: 1.5; }
.install-card .install-seal { width: 40px; height: 40px; font-size: 1.2rem; }
.ios-steps {
  font-size: .82rem; color: var(--ink); font-weight: 600;
  background: var(--paper-2); border-radius: 8px; padding: 8px 12px;
  flex: none; line-height: 1.5;
}
.ios-steps b { font-weight: 800; }
.ios-share {
  display: inline-block; color: var(--vermilion); font-weight: 700;
  transform: translateY(1px);
}
@media (max-width: 620px) {
  .install-card { flex-wrap: wrap; }
  .ios-steps { width: 100%; }
}
