/* fedimarket — see design/look-and-feel.md */
:root {
  --color-primary: #6364ff;
  --color-primary-soft: #8f90ff;
  --color-primary-dark: #4a4bd6;
  --color-bg: #fff6ea;
  --color-surface: #ffffff;
  --color-text: #3d2f2f;
  --color-muted: #9a8579;
  --color-border: #f2e3cf;
  --color-gold: #f2b33d;
  --color-gold-dark: #d1942a;
  --color-success: #3fa46a;
  --color-error: #d64545;
  --shadow-card: 0 6px 24px rgba(61, 47, 47, 0.10);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Baloo 2", "Quicksand", ui-rounded, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100dvh;
}
@media (min-width: 520px) {
  body {
    background-image: radial-gradient(rgba(99, 100, 255, 0.07) 2.5px, transparent 2.5px);
    background-size: 34px 34px;
  }
}

h1 { font-size: 28px; line-height: 1.15; margin: 0 0 8px; font-weight: 800; }
h2 { font-size: 22px; line-height: 1.15; margin: 0 0 8px; font-weight: 800; }
h3 { font-size: 18px; margin: 0 0 6px; font-weight: 700; }
p { margin: 0 0 8px; }
.hidden { display: none !important; }
/* v3.6.4: instant, reliable taps on mobile — no 300 ms tap delay and no double-tap
   zoom on any control (Leaflet sets its own touch-action on the map container) */
button, a, select, input, textarea, label { touch-action: manipulation; }
.muted { color: var(--color-muted); font-size: 13px; }
/* bold numbered safety hint on the thread page (v3.2.6) */
.fulfill-hint { font-weight: 800; font-size: 13px; line-height: 1.45; white-space: pre-line; margin: 6px 0 0; padding: 8px 10px; border-left: 3px solid var(--color-gold); background: rgba(242, 179, 61, 0.14); border-radius: 0 8px 8px 0; }
/* login "what is fedimarket" card + cookie consent banner (v3.2.7) */
.about-card { text-align: left; margin-top: 14px; }
.about-card p { font-size: 14px; }
.about-flow { margin: 4px 0 0; padding-left: 20px; }
.about-flow li { margin: 2px 0; font-size: 14px; }
/* v3.6.6: z-index 35 — above page content/topbar/bottomnav (20) but BELOW the confirm
   modal (40), so the banner can never cover a modal's Confirm/Cancel buttons; while it
   is visible the page gets bottom padding (set from JS) so the last buttons on a page
   can always be scrolled above the banner */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--color-surface); border-top: 1px solid var(--color-border); box-shadow: 0 -6px 24px rgba(61, 47, 47, 0.14); }
.cookie-banner p { margin: 0; font-size: 13px; }
@media (max-width: 520px) { .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; } }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; }
/* link-looking button (e.g. a clickable @handle that checks the account's offers) */
.linklike {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--color-primary); font-weight: 800; font-size: inherit; font-family: inherit;
}
.linklike:hover { text-decoration: underline; }
/* animal-type multiselect on the offer form */
.pets-select {
  width: 100%; padding: 8px 10px; margin: 0;
  border: 2px solid var(--color-border); border-radius: 12px;
  background: var(--color-surface); color: var(--color-text);
  font: inherit; font-weight: 700;
}
.pets-select:focus { border-color: var(--color-primary); outline: none; }
.pets-select option { padding: 6px 8px; border-radius: 8px; }
.pets-select option:checked { background: var(--color-primary); color: #fff; }
/* the no-fee / P2P disclaimer on the login screen */
.disclaimer {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--color-primary-soft); color: var(--color-text);
  font-size: 13px; line-height: 1.45; text-align: left;
}

/* ---------- layout ---------- */
#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 96px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 480px;
  margin: 0 auto;
  padding: 10px 16px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 19px; color: var(--color-text); text-decoration: none;
}
.topbar-spacer { flex: 1; }
.count-badge {
  background: var(--color-error); color: #fff;
  border-radius: 999px; padding: 1px 9px; font-size: 13px; font-weight: 700;
}
.topbar-user {
  color: var(--color-muted);
  font-size: 13px; font-weight: 700;
  max-width: 40vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* v3.7.5: avatar + username chip, used wherever a handle is displayed */
.user-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; vertical-align: middle; }
.user-chip .fedi-link, .user-chip > span, .user-chip > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-wrap {
  position: relative; display: inline-flex; flex: 0 0 auto;
  align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden;
  background: var(--color-primary); color: #fff;
  font-weight: 800; line-height: 1; user-select: none;
}
.avatar-wrap .avatar-img {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;
  object-fit: cover; border-radius: 50%; background: var(--color-surface);
}
.avatar-wrap .avatar-fallback {
  position: absolute; inset: 0; z-index: 0;
  display: flex; align-items: center; justify-content: center;
}
.bottomnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}
.bottomnav a {
  flex: 1; max-width: 150px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; border-radius: 14px;
  color: var(--color-muted); text-decoration: none; font-size: 12px; font-weight: 700;
}
.bottomnav a.active { color: var(--color-primary); background: rgba(99, 100, 255, 0.10); }

/* ---------- cards & forms ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 14px;
}
label { display: block; font-weight: 700; font-size: 14px; margin: 10px 0 4px; }
input[type="text"], input[type="date"], textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}
textarea { border-radius: 18px; min-height: 72px; resize: vertical; }
/* native date pickers: same pill field, light popup, purple-tinted indicator */
input[type="date"] {
  min-height: 48px;
  color-scheme: light;
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.8;
  filter: invert(38%) sepia(98%) saturate(2400%) hue-rotate(222deg) brightness(98%);
}
.date-row { display: flex; gap: 10px; }
.date-row > div { flex: 1; min-width: 0; }
/* v3.6.0: photo picker (file input + thumbnail strip) and attached images */
input[type="file"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px dashed var(--color-border);
  border-radius: 18px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
}
.thumb-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumb { position: relative; width: 76px; height: 76px; flex: 0 0 auto; }
.thumb img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 12px; border: 2px solid var(--color-border); display: block;
}
.thumb-x {
  position: absolute; top: -7px; right: -7px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: var(--color-error); color: #fff;
  font-weight: 800; line-height: 1; cursor: pointer; padding: 0;
}
.media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px; margin-top: 8px;
}
.media-img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  border-radius: 12px; border: 2px solid var(--color-border);
}
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--color-primary-soft);
  outline-offset: 2px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;
  padding: 12px 22px;
  border: none;
  border-radius: 999px;
  font: inherit; font-weight: 800; font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease-out, box-shadow 160ms ease-out, background 160ms;
}
.btn-primary {
  background: var(--color-primary); color: #fff;
  box-shadow: 0 3px 0 var(--color-primary-dark);
}
.btn-primary:active { transform: translateY(3px); box-shadow: none; }
.btn-primary:disabled { background: var(--color-primary-soft); box-shadow: none; cursor: not-allowed; }
.btn-secondary {
  background: var(--color-surface); color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn-ghost { background: transparent; color: var(--color-muted); text-decoration: underline; }
.btn-danger { background: var(--color-surface); color: var(--color-error); border: 2px solid var(--color-error); }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 8px 12px;
  background: transparent; border: none; border-radius: 999px;
  color: var(--color-text); font: inherit; font-weight: 700; cursor: pointer;
}
.icon-btn:hover { background: rgba(99, 100, 255, 0.10); }

/* ---------- login ---------- */
.login-wrap { max-width: 400px; margin: 8vh auto 0; text-align: center; }
.login-logo { margin-bottom: 4px; }
.locale-row { display: flex; justify-content: center; margin: 12px 0; }
.locale-row select, .locale-menu select {
  padding: 10px 14px; border: 2px solid var(--color-border); border-radius: 999px;
  background: var(--color-surface); color: var(--color-text); font: inherit; font-weight: 700;
}
.locale-menu {
  position: fixed; z-index: 30;
  top: 56px; right: max(12px, calc(50vw - 228px));
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 16px; box-shadow: var(--shadow-card); padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.locale-menu label { margin: 0; font-size: 12px; color: var(--color-muted); }

/* ---------- post list / find ---------- */
.search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.search-row input { flex: 1; }
.post-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 20px;
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: border-color 160ms, transform 160ms;
}
.post-card:hover { border-color: var(--color-primary-soft); }
.post-card.picked { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(99, 100, 255, 0.25); }
.post-card .who { font-weight: 800; color: var(--color-primary); font-size: 14px; }
.post-card .what { margin: 4px 0; }
.post-card .when { color: var(--color-muted); font-size: 12px; }
.post-card .select-row { display: flex; justify-content: flex-end; margin-top: 8px; }
.post-card .select-row .btn { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding: 6px 16px; }

/* browse list — one full-width row per offer (marktplaats list style): square photo
   left, title + big gold price on the first line, chips, one-line snippet, and a
   footer with seller, time and the Select button. Rows fade/slide in with a small
   stagger (animation-delay set inline); hover lifts the row gently. */
.offer-list { display: flex; flex-direction: column; gap: 10px; }
.offer-row {
  display: flex; gap: 12px; align-items: stretch;
  padding: 10px; margin-bottom: 0;
  transition: border-color 160ms, transform 200ms ease-out, box-shadow 200ms ease-out;
  animation: card-in 240ms ease-out backwards;
}
.offer-row:hover { border-color: var(--color-primary-soft); transform: translateY(-2px); box-shadow: var(--shadow-card); }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pc-thumb {
  width: clamp(84px, 26vw, 104px); aspect-ratio: 1 / 1; flex: none; align-self: center;
  border-radius: 14px; overflow: hidden; background: var(--color-bg);
  display: flex; align-items: center; justify-content: center;
}
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-ph { color: #e3cda9; display: inline-flex; }
.pc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: 2px 0; }
.pc-top { display: flex; align-items: flex-start; gap: 8px; }
.pc-title { flex: 1; min-width: 0; font-weight: 800; font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-price { flex: none; display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 17px; color: var(--color-gold-dark); white-space: nowrap; }
.pc-price svg { color: var(--color-gold); }
.pc-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pc-snippet { font-size: 12.5px; color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-more-row { margin-top: 2px; }
.pc-more { font-size: 12px; padding: 0; }
.pc-details { margin-top: 4px; border-top: 1px dashed var(--color-border); padding-top: 6px; }
.pc-foot { margin-top: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.offer-row .who { font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offer-row .when { font-size: 11px; display: flex; align-items: center; flex-wrap: wrap; }
.offer-row .select-row { margin: 0 0 0 auto; padding: 0; }
.offer-row .select-row .btn { min-height: 36px; padding: 5px 14px; font-size: 13px; }

/* sort + filter toolbar above the results */
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 6px 10px; align-items: center; }
.filter-select, .filter-input {
  font: inherit; font-size: 13px; font-weight: 700; color: var(--color-text);
  background: var(--color-surface); border: 2px solid var(--color-border);
  border-radius: 999px; padding: 6px 10px; min-height: 36px;
}
.filter-input { width: 76px; }
.filter-select:focus, .filter-input:focus { outline: 3px solid var(--color-primary-soft); outline-offset: 2px; }
.load-more-row { text-align: center; margin: 4px 0 16px; }
.picked-chip {
  display: inline-block; margin-top: 6px;
  background: var(--color-primary); color: #fff;
  font-size: 12px; font-weight: 800; border-radius: 999px; padding: 2px 10px;
}
/* v3.6.7: picking a post scrolls the next step into view — keep it clear of the
   sticky topbar, and flash the freshly rendered request card so it is unmissable */
.post-card, #request-box .card { scroll-margin-top: 76px; }
@keyframes flash-ring {
  0% { box-shadow: 0 0 0 0 rgba(99, 100, 255, 0.55); }
  100% { box-shadow: 0 0 0 16px rgba(99, 100, 255, 0); }
}
.card.flash { animation: flash-ring 0.9s ease-out 2; border-color: var(--color-primary); }
.source-chip { font-size: 11px; color: var(--color-muted); border: 1px solid var(--color-border); border-radius: 999px; padding: 1px 8px; margin-left: 8px; }

/* ---------- map (find pets) ---------- */
.map-card { padding: 10px; }
#map {
  width: 100%; height: 240px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  z-index: 0; /* keep Leaflet panes under the sticky top bar */
}
.leaflet-container { font: inherit; background: #f3ead9; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, 0.8); }
.leaflet-control-attribution a { color: var(--color-primary-dark); }
.leaflet-bar { border-color: var(--color-border) !important; box-shadow: var(--shadow-card) !important; }
.leaflet-bar a { color: var(--color-primary-dark); }
/* pins: the author's fediverse avatar in a ring (paw print as fallback) */
.map-pin { background: transparent; border: none; }
.map-pin img {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2.5px solid #fff; background: var(--color-surface);
  box-shadow: 0 2px 6px rgba(61, 47, 47, 0.4);
  object-fit: cover; display: block;
  transition: transform 160ms ease-out;
}
.map-pin svg { color: var(--color-primary); filter: drop-shadow(0 2px 2px rgba(61, 47, 47, 0.35)); display: block; transition: transform 160ms ease-out; }
.map-pin.picked img { border-color: var(--color-gold); transform: scale(1.25); }
.map-pin.picked svg { color: var(--color-gold-dark); transform: scale(1.25); }
.leaflet-tooltip {
  border-radius: 999px; border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card); font: inherit; font-size: 12px; font-weight: 700;
  color: var(--color-text); background: var(--color-surface);
}

/* ---------- ask/offer: area chip + preview map ---------- */
#offer-map { width: 100%; height: 160px; border-radius: 12px; border: 1px solid var(--color-border); }
.rate-row { display: flex; gap: 10px; flex-wrap: wrap; }
.rate-row > div { min-width: 0; }
.rate-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(242, 179, 61, 0.18); color: var(--color-gold-dark);
  border-radius: 999px; padding: 3px 12px; font-size: 12.5px; font-weight: 800;
}
.rate-chip svg { color: var(--color-gold-dark); flex: none; }
/* clickable tag chips (place tags) and in-text hashtags */
button.rate-chip.tag-btn { cursor: pointer; font-family: inherit; border: none; }
button.rate-chip.tag-btn:hover { filter: brightness(0.94); }
/* v3.10: in-app user preview modal */
.user-preview { max-width: 560px; max-height: 84vh; overflow: auto; position: relative; }
.preview-close { position: absolute; top: 8px; right: 8px; font-size: 16px; }
.preview-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.preview-name { font-weight: 800; font-size: 18px; }
.preview-counts { font-size: 12.5px; margin-top: 2px; }
.preview-bio { font-size: 14px; white-space: pre-wrap; word-break: break-word; margin: 6px 0 10px; }
.preview-links { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; flex-wrap: wrap; }
.preview-offers-title { margin: 14px 0 6px; font-size: 14px; }
.avatar-preview-btn { padding: 0; border-radius: 50%; }
.tag-link { font-weight: 800; white-space: nowrap; }

/* ---------- thread (private messages under the offer post) ---------- */
.msg-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; max-height: 46dvh; overflow-y: auto; padding: 4px 2px; }
.msg-bubble {
  max-width: 82%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px 18px 18px 6px;
  padding: 8px 12px;
  box-shadow: var(--shadow-card);
  align-self: flex-start;
}
.msg-bubble.mine {
  align-self: flex-end;
  background: var(--color-primary);
  border-color: var(--color-primary-dark);
  border-radius: 18px 18px 6px 18px;
  color: #fff;
}
.msg-bubble.mine .msg-meta { color: rgba(255, 255, 255, 0.75); }
.msg-meta { font-size: 11px; font-weight: 700; color: var(--color-muted); margin-bottom: 2px; }
.msg-text { font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.msg-composer { position: sticky; bottom: 76px; }
.btn-row { display: flex; gap: 8px; margin: 4px 0 10px; }
.btn-row .btn { flex: 1; padding: 10px 12px; font-size: 14px; }
.area-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }
.area-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(99, 100, 255, 0.10); color: var(--color-primary-dark);
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 700;
}
.area-chip svg { color: var(--color-primary); flex: none; }

/* ---------- offer post preview (exact text before publishing) ---------- */
.post-preview {
  border: 2px dashed var(--color-primary-soft);
  border-radius: 16px;
  background: var(--color-bg);
  padding: 12px 14px;
}
.post-preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.post-preview-text {
  margin: 0; font: inherit; font-size: 14px; white-space: pre-wrap; word-break: break-word;
  color: var(--color-text);
}

/* ---------- bookings ---------- */
.status-chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 800; }
.status-pending { background: rgba(242, 179, 61, 0.18); color: var(--color-gold-dark); }
.status-sent { background: rgba(99, 100, 255, 0.14); color: var(--color-primary-dark); }
.status-confirmed { background: rgba(63, 164, 106, 0.16); color: var(--color-success); }
.status-failed { background: rgba(214, 69, 69, 0.14); color: var(--color-error); }
.legacy-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(242, 179, 61, 0.18); color: var(--color-gold-dark);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; margin-top: 4px;
}
.legacy-chip svg { flex: none; }
.booking-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.booking-row .grow { flex: 1; min-width: 0; }
/* action buttons of a deal card: ALWAYS a full-width row under the card text
   (v3.2.9 — never pinned to the right), two big touch targets per row, min 44px */
.booking-row .acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex-basis: 100%; }
.booking-row .acts .btn { flex: 1 1 45%; min-height: 44px; padding: 10px 12px; font-size: 15px; }
.ref-row { display: flex; align-items: center; gap: 8px; background: var(--color-bg); border-radius: 12px; padding: 8px 12px; }
/* the request reference + approval link sit inside a collapsed <details> so the
   long URL doesn't distract from the comment preview below it */
.ref-details { background: var(--color-bg); border-radius: 12px; padding: 10px 12px; }
.ref-details summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--color-primary-dark); list-style: none; display: flex; align-items: center; gap: 6px; min-height: 32px; }
.ref-details summary::-webkit-details-marker { display: none; }
.ref-details summary::before { content: '▸'; transition: transform .15s ease; }
.ref-details[open] summary::before { transform: rotate(90deg); }
/* inside a chat bubble the collapsed request message is a little tighter */
.msg-bubble .ref-details { padding: 8px 10px; }
.msg-bubble .ref-details summary { min-height: 28px; font-size: 13px; }

.msg-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(99, 100, 255, 0.10); color: var(--color-primary-dark);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; margin-top: 4px;
}

/* v3.7.0: the exact comment shown on the "Preview post" card before it is posted */
.preview-text {
  margin: 8px 0 4px; padding: 10px 12px;
  background: var(--color-bg); border-left: 3px solid var(--color-primary);
  border-radius: 8px; font-size: 14px; white-space: pre-wrap; word-break: break-word;
}

/* ---------- modal / toast / confirm ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(61, 47, 47, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  touch-action: manipulation; /* v3.6.8: no double-tap-zoom delay/zoom on the dim area */
}
.modal { max-width: 400px; width: 100%; }
.toast {
  position: fixed; z-index: 50; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--color-text); color: #fff;
  border-radius: 999px; padding: 10px 20px; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-card);
  animation: toast-in 200ms ease-out;
  max-width: min(90vw, 440px); text-align: center;
  pointer-events: none; /* v3.6.3: a visible toast must never swallow taps on the button beneath it */
}
.toast.success { background: var(--color-success); }
.toast.error { background: var(--color-error); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

.confirm-hero { text-align: center; }
.confirm-hero svg { color: var(--color-primary); }

.empty-state { text-align: center; color: var(--color-muted); padding: 28px 12px; }
.empty-state svg { color: var(--color-primary-soft); margin-bottom: 8px; }

/* ---------- motion ---------- */
.screen { animation: screen-in 220ms ease-out; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- loading indicators ---------- */
#loading-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: var(--color-border); overflow: hidden;
  pointer-events: none; /* v3.6.3: progress bar only — never block taps */
}
#loading-bar .loading-bar-fill {
  height: 100%; width: 40%; background: var(--color-primary);
  animation: bar-slide 900ms ease-in-out infinite;
}
@keyframes bar-slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.spinner {
  display: inline-block; width: 16px; height: 16px; flex: none;
  border: 2.5px solid var(--color-primary-soft); border-top-color: var(--color-primary);
  border-radius: 50%; animation: spin 700ms linear infinite; vertical-align: -3px;
}
.btn .spinner { width: 14px; height: 14px; margin-right: 7px; border-color: rgba(255, 255, 255, 0.45); border-top-color: #fff; vertical-align: -2px; }
.btn-secondary .spinner, .btn-ghost .spinner { border-color: var(--color-border); border-top-color: var(--color-primary); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 22px 12px; color: var(--color-muted); font-weight: 700; font-size: 14px;
}
/* full-screen branded splash — first paint and every cold /api/me (heavy derivation) */
.splash {
  min-height: 62vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 16px; color: var(--color-muted); font-weight: 700;
}
.spinner-lg { width: 36px; height: 36px; border-width: 4px; }
.btn.busy { opacity: 0.85; pointer-events: none; }
.map-pin.city-pin {
  background: var(--color-gold); border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(61, 47, 47, 0.35); border: 2px solid #fff;
}
.map-pin.city-pin svg { color: #fff; transform: rotate(45deg); }

/* ---------- calendar (#/calendar, since v3.3.0) ---------- */
.cal-head { display: flex; align-items: center; gap: 6px; }
.cal-head h2 { font-size: 19px; }
.cal-weekday, .cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.cal-weekday { margin-bottom: 2px; }
.cal-weekday span {
  text-align: center; font-size: 11px; font-weight: 800; color: var(--color-muted);
  text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 0;
}
.cal-cell {
  appearance: none; border: 1px solid transparent; background: transparent;
  min-height: 46px; border-radius: 12px; padding: 4px 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 2px; font: inherit; color: var(--color-text); cursor: pointer;
}
.cal-cell.cal-blank { cursor: default; }
.cal-cell:not(.cal-blank):hover { background: rgba(99, 100, 255, 0.08); }
.cal-cell:not(.cal-blank):focus-visible { outline: 3px solid var(--color-primary-soft); outline-offset: 1px; }
.cal-day-num { font-size: 14px; font-weight: 700; line-height: 1; }
.cal-cell.today .cal-day-num {
  background: var(--color-primary); color: #fff; border-radius: 999px;
  min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
}
.cal-cell.selected { background: rgba(99, 100, 255, 0.16); border-color: var(--color-primary); }
.cal-cell.has { background: rgba(99, 100, 255, 0.06); }
.cal-cell.selected.has { background: rgba(99, 100, 255, 0.16); }
.cal-dots { display: flex; align-items: center; gap: 3px; min-height: 8px; flex-wrap: wrap; justify-content: center; }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cal-dot.dot-accepted { background: var(--color-primary); }
.cal-dot.dot-completed { background: var(--color-success); }
.cal-more { font-size: 10px; font-weight: 800; color: var(--color-muted); }
.cal-legend { display: flex; gap: 16px; font-size: 12px; margin-top: 10px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
@media (prefers-reduced-motion: reduce) {
  .cal-cell { transition: none; }
}

/* v3.3.1: fediverse entry links (profiles, posts, the private conversation) + marker chips */
.fedi-link { color: var(--color-primary); font-weight: 800; text-decoration: none; }
.fedi-link:hover, .fedi-link:focus-visible { text-decoration: underline; }
.fedi-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.fedi-controls { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--color-border); }
.fedi-controls .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.marker-chip { cursor: pointer; font-family: inherit; }

/* v3.4.0: freshness indicator in the topbar + stats page + mini report/block buttons
   (v3.7.1: the pull-to-refresh pill is gone — only the browser's own refresh reloads) */
.freshness { color: var(--color-muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.stat-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 2px; border-bottom: 1px dashed var(--color-border); }
.stat-row:last-of-type { border-bottom: none; }
.stat-row strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.mini-btn {
  background: none; border: none; cursor: pointer; padding: 2px 7px;
  color: var(--color-muted); font-size: 13px; font-weight: 800; border-radius: 8px;
  font-family: inherit;
}
.mini-btn:hover, .mini-btn:focus-visible { color: var(--color-error); background: rgba(214, 69, 69, 0.10); }
