:root {
  scrollbar-gutter: stable;
  --accent-foreground: #fff;
  --accent-hover: #a91840;
  --accent-text: #aa1740;
  --header-bg: rgba(250, 248, 244, .97);
  --reserve-bg: #fff0cf;
  --reserve-ink: #624915;
  --danger-bg: #f8e5df;
  --danger-ink: #9e3428;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151416;
  --surface: #211f22;
  --ink: #f6ede1;
  --line: #454047;
  --muted: #c1b7bc;
  --soft: #302d32;
  --olive: #b6be94;
  --olive-soft: #303426;
  --accent-soft: #41222d;
  --accent-text: #ff9bb4;
  --header-bg: rgba(21, 20, 22, .97);
  --reserve-bg: #44351e;
  --reserve-ink: #ffdfa0;
  --danger-bg: #482523;
  --danger-ink: #ffc1b6;
}
.wordmark { flex: 0 0 auto; }
.wordmark img { width: 105px; height: auto; }
.footer-mark img { width: 82px; }
.wordmark .logo-dark, .theme-sun { display: none; }
[data-theme="dark"] .wordmark .logo-light, [data-theme="dark"] .theme-moon { display: none; }
[data-theme="dark"] .wordmark .logo-dark, [data-theme="dark"] .theme-sun { display: block; }
.theme-toggle { width: 44px; height: 44px; }
.button-primary, .skip-link, .nav-count, .avatar-yellow,
.ad-symbol, .send-button, .favorite-button.active { color: var(--accent-foreground); }
.favorite-button.active svg { fill: currentColor; }
.highlight:after { background: var(--accent-soft); }
.category-button.active { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-text); }
.category-button.active svg { color: inherit; }
.status-reserved { color: var(--reserve-ink); background: var(--reserve-bg); }
.error-message { color: var(--danger-ink); background: var(--danger-bg); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
select option { color: var(--ink); background-color: var(--surface); }
select option:disabled { color: var(--muted); }
@media (hover: hover) and (pointer: fine) {
  @supports (appearance: base-select) {
    .sort-select, .sort-select::picker(select) { appearance: base-select; }
    .sort-select { gap: 6px; }
    .sort-select::picker(select) { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
    .sort-select option { padding: 8px 10px; border-radius: 6px; }
    .sort-select option:is(:checked,:hover,:focus-visible) { background: var(--accent-soft); color: var(--accent-text); }
  }
}
.photo-main { border-color: var(--line); }
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.home-actions .button { white-space: nowrap; }
.mobile-nav { display: none; }

@media (max-width: 1150px) {
  .header-inner { gap: 14px; }
}
@media (min-width: 701px) and (max-width: 950px) {
  .header-inner { gap: 10px; }
  .wordmark img { width: 88px; }
  .footer-mark img { width: 82px; }
  .desktop-nav { gap: 2px; }
  .desktop-nav .nav-link { padding: 10px 9px; font-size: 11px; }
  .desktop-nav .nav-link[data-page="favorites"] { font-size: 0; }
  .desktop-nav .nav-link[data-page="favorites"] > svg { display: block; width: 19px; }
  .header-actions { gap: 6px; }
  .theme-toggle { width: 38px; height: 38px; }
}
@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
  :root { --mobile-nav-height: calc(55px + env(safe-area-inset-bottom, 0px)); scroll-padding-bottom: calc(4px + var(--mobile-nav-height)); }
  .site-header { padding-top: env(safe-area-inset-top, 0px); }
  .header-inner { height: 72px; gap: 10px; }
  .header-inner .wordmark img { width: 93px; }
  .header-inner .location-button { flex: 0 1 auto; min-width: 0; min-height: 44px; margin-left: auto; }
  .location-button span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .location-button small { display: block; overflow: hidden; text-overflow: ellipsis; }
  .header-actions { flex-shrink: 0; }
  .desktop-nav, .header-profile, .header-actions > .button { display: none; }
  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(5, minmax(0,150px));
    justify-content: center;
    gap: 2px;
    min-height: var(--mobile-nav-height);
    padding: 5px max(5px, env(safe-area-inset-right, 0px)) calc(5px + env(safe-area-inset-bottom, 0px)) max(5px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--line);
    background: var(--header-bg);
    backdrop-filter: blur(15px);
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 44px; padding: 3px 0; gap: 3px; border: 1px solid transparent; border-radius: 11px; color: var(--muted); font-size: clamp(8px,2.3vw,11px); }
  .mobile-nav a span { line-height: 1.2; }
  .mobile-nav a[aria-current="page"] { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-text); font-weight: 800; }
  .main { padding-bottom: calc(20px + var(--mobile-nav-height)); }
  .site-footer { padding-bottom: calc(24px + var(--mobile-nav-height)); }
  .toasts { bottom: calc(15px + var(--mobile-nav-height)); }
  #message-input { font-size: 16px; }
}
@media (max-width: 700px) {
  .site-footer { display: none; }
  .home-actions .button { min-height: 44px; padding: 10px 14px; font-size: 12px; }
}
@media (max-width: 350px) {
  .header-inner { gap: 8px; }
  .header-inner .wordmark img { width: 81px; }
  .home-actions .button { padding-inline: 11px; }
  .home-actions .button svg { width: 16px; height: 16px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .site-header { position: relative; }
}


.message-form { display: block; }
.message-form-row { display: flex; align-items: center; gap: 8px; }
.message-form-row input { flex: 1; min-width: 0; }
.attach-button, .send-button { width: 44px; height: 44px; flex-shrink: 0; }
.draft-attachments { display: flex; align-items: center; gap: 6px; overflow-x: auto; }
.draft-attachments:not(:empty) { margin-bottom: 8px; padding-bottom: 3px; }
.draft-attachment { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; max-width: 100%; padding: 4px 4px 4px 8px; border-radius: 8px; background: var(--soft); font-size: 11px; }
.draft-attachment span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-attachment img { width: 22px; height: 22px; border-radius: 4px; flex: none; }
.draft-attachment button { width: 28px; height: 28px; border-radius: 5px; background: var(--surface); flex: none; }
.draft-attachment svg { width: 15px; height: 15px; }
.draft-loading { color: var(--muted); font-size: 11px; }
.message-attachment { display: flex; align-items: center; gap: 8px; margin: 3px 0; padding: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.message-attachment > span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.message-attachment:hover > span { text-decoration: underline; }
.message-attachment svg { width: 15px; height: 15px; }
.message-attachment.attachment-photo { display: grid; grid-template-columns: minmax(0,1fr) 16px; width: min(100%, 240px); }
.message-attachment.attachment-photo img, .message-attachment.attachment-photo .image-fallback { grid-column: 1 / -1; width: 100%; max-height: 190px; border-radius: 5px; object-fit: contain; }
@media (max-width: 700px) {
  .chat-layout { height: calc(100dvh - 116px - var(--mobile-nav-height) - env(safe-area-inset-top, 0px)); }
  .chat-layout.has-chat { min-height: 400px; }
  .message-form { padding: 8px 10px; }
  .message-form-row { gap: 6px; }
  .message-form-row input { padding-inline: 10px; }
  .attach-button, .send-button { width: 44px; height: 44px; }
}



.chat-keyboard { scroll-padding-bottom: 0; }
.chat-keyboard .site-header, .chat-keyboard .mobile-nav { visibility: hidden; }
.chat-keyboard #main { min-height: var(--chat-main-height); }
.chat-keyboard .chat-layout.has-chat {
  position: fixed;
  top: var(--chat-viewport-top);
  left: var(--chat-viewport-left);
  width: var(--chat-viewport-width);
  height: var(--chat-viewport-height);
  min-height: 0;
  display: block;
  padding-top: max(0px,calc(env(safe-area-inset-top, 0px) - var(--chat-viewport-top)));
  padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
  border: 0;
  border-radius: 0;
  z-index: 40;
}
.chat-keyboard .chat-sidebar, .chat-keyboard .chat-item, .chat-keyboard .chat-deal-actions,
.chat-keyboard .chat-safety, .chat-keyboard .chat-header small { display: none; }
.chat-keyboard .chat-pane { height: 100%; }
.chat-keyboard .chat-header { min-height: 44px; padding: 4px 10px; gap: 8px; }
.chat-keyboard .chat-header > .avatar { width: 30px; height: 30px; font-size: 10px; }
.chat-keyboard .chat-header .icon-button { width: 32px; height: 32px; }
.chat-keyboard .chat-back { display: grid; }
.chat-keyboard .messages { padding: 8px 12px; gap: 8px; overscroll-behavior: contain; }
.chat-keyboard .message-form { flex-shrink: 0; padding: 6px 8px; }
.chat-keyboard #message-input { min-height: 44px; padding-block: 8px; }
.chat-keyboard .toasts { top: calc(var(--chat-viewport-top) + 50px); bottom: auto; }

.home-hero { padding-top: 18px; padding-bottom: 48px; }
.home-sticker {
  --sticker-peel: 39px;
  position: relative;
  width: min(100% - 16px, 248px);
  justify-self: center;
  filter: drop-shadow(3px 8px 10px #68122d32);
  transform: rotate(-6deg);
}
.sticker-face {
  position: relative;
  padding: 25px 24px 24px;
  border-radius: 17px;
  background: var(--accent);
  color: var(--accent-foreground);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--sticker-peel)), calc(100% - var(--sticker-peel)) 100%, 0 100%);
}
.sticker-face::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: var(--sticker-peel);
  aspect-ratio: 1;
  border-radius: 9px 0 0;
  background: linear-gradient(135deg,#f3b8ca,#fff5e5 57%,#d892a8);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.sticker-kicker { display: block; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.sticker-title { margin-top: 13px; font-size: clamp(20px, 2.2vw, 27px); font-weight: 800; line-height: 1.08; letter-spacing: -.04em; overflow-wrap: anywhere; }
.sticker-mark { position: absolute; top: 25px; right: 23px; width: 23px; height: 23px; opacity: .85; }
:root[data-theme="dark"] .home-sticker { filter: drop-shadow(3px 8px 10px #0006); }

.home-section { border-top: 1px solid var(--line); padding-top: 25px; }
.home-section + .home-section { margin-top: 44px; }
.home-section-heading { margin-bottom: 20px; }
.home-about { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: clamp(20px,5vw,68px); }
.home-about-intro p { max-width: 43ch; margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.home-purpose-list { display: grid; gap: 10px; }
.home-purpose { display: flex; align-items: flex-start; gap: 13px; padding: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.home-purpose-icon { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); }
.home-purpose-icon svg { width: 20px; height: 20px; }
.home-purpose h3 { font-size: 15px; }
.home-purpose p { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.home-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.home-steps li { position: relative; padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; }
.home-step-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; background: var(--olive-soft); color: var(--olive); margin-bottom: 13px; }
.home-step-number { position: absolute; top: 17px; right: 17px; color: var(--muted); font-size: 11px; font-weight: 700; }
.home-step-copy h3 { font-size: 16px; }
.home-step-copy p { font-size: 12px; margin-top: 5px; color: var(--muted); }
.home-give {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 37px;
  padding: clamp(20px, 4vw, 36px);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-foreground);
}
.home-give p { font-size: 13px; margin-top: 7px; }
.home-give-button { flex-shrink: 0; background: #fff8f5; color: #8e1536; }
.home-give-button:hover { background: #fbe7ed; }
.home-give-button:focus-visible { outline-color: #fff; }

@media (max-width: 700px) {
  .home-hero { gap: 23px; padding: 0 0 29px; }
  .home-hero h1 { font-size: clamp(27px,7.4vw,34px); }
  .home-sticker { --sticker-peel: 32px; justify-self: end; width: min(100% - 26px, 220px); margin-right: 8px; transform: rotate(-3deg); }
  .sticker-face { padding: 19px 19px 21px; }
  .sticker-title { margin-top: 10px; font-size: 23px; }
  .sticker-mark { top: 19px; right: 18px; width: 21px; height: 21px; }
  .home-section { padding-top: 20px; }
  .home-section + .home-section { margin-top: 31px; }
  .home-section-heading { margin-bottom: 15px; }
  .home-section h2, .home-give h2 { font-size: 23px; }
  .home-about { grid-template-columns: 1fr; gap: 15px; }
  .home-about-intro p { font-size: 13px; }
  .home-purpose { padding: 12px; }
  .home-purpose p { font-size: 12px; }
  .home-steps { grid-template-columns: 1fr; gap: 8px; }
  .home-steps li { display: grid; grid-template-columns: 39px minmax(0, 1fr); gap: 10px; align-items: center; padding: 13px 37px 13px 13px; }
  .home-step-icon { margin: 0; }
  .home-step-number { top: 14px; right: 12px; }
  .home-give { align-items: flex-start; flex-direction: column; gap: 13px; margin-top: 28px; }
}

.avatar { position: relative; overflow: hidden; }
.avatar-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-person > div { min-width: 0; overflow-wrap: anywhere; }
.profile-bio { white-space: pre-line; overflow-wrap: anywhere; }
.profile-card .profile-bio { margin: 12px 0 15px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.profile-phone-toggle { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.profile-phone-toggle input { flex: none; width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--accent); }
.profile-phone-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.profile-phone-link svg { width: 15px; height: 15px; }
.profile-card [data-action="edit-profile"] { padding-inline: 10px; gap: 6px; }
.profile-card [data-action="edit-profile"] svg { width: 16px; height: 16px; }
.profile-card .profile-counts { margin-top: 12px; padding-top: 10px; }
.profile-avatar-editor {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.profile-avatar-preview { flex: none; }
.profile-avatar-controls { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.profile-avatar-controls .upload-label {
  position: relative;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 8px 12px;
  text-align: center;
  line-height: 1.3;
}
.profile-avatar-controls .upload-label:hover { background: var(--soft); }
.profile-avatar-controls .upload-label:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }
.profile-avatar-controls .text-link { min-height: 44px; }
.profile-avatar-controls .field-help { flex: 0 0 100%; margin: 3px 0 0; font-size: 11px; line-height: 1.45; }

@media (max-width: 700px) {
  .profile-avatar-editor { gap: 10px; padding: 10px; }
  .profile-avatar-editor .avatar-large { width: 60px; height: 60px; font-size: 18px; }
}

@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
  #profile-form .field input, #profile-form textarea { font-size: 16px; }
}

.district-search { margin-bottom: 8px; }
.district-search input { font-size: 16px; }
#extra-districts .district-checks {
  grid-template-columns: repeat(2, minmax(0,1fr));
  align-content: start;
  max-height: min(220px,32dvh);
  margin: 8px 0;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#extra-districts .district-checks label { min-height: 24px; overflow-wrap: anywhere; }
#extra-districts .district-checks input { flex: none; }
.district-selection-count { margin-bottom: 15px; }

.catalog-pagination { grid-column: 1 / -1; text-align: center; }
#auth-verify-form [data-action="login"] { margin-top: 8px; }
