:root {
  --paper: #f3f7fc;
  --paper-deep: #eaf0f8;
  --ink: #192b50;
  --muted: #65718a;
  --line: rgba(157, 181, 218, 0.22);
  --blue: #1656d8;
  --blue-dark: #103c98;
  --tomato: #ef5b3f;
  --white: #ffffff;
  --radius-card: 20px;
  --radius-control: 14px;
  --radius-pill: 999px;
  --shadow-card: 0 2px 4px rgba(56, 89, 137, 0.04), 0 6px 16px rgba(56, 89, 137, 0.07);
  --shadow-float: 0 20px 50px rgba(25, 43, 80, 0.14);
  --shadow: var(--shadow-float);
  --runtime-safe-top: 0px;
  --runtime-safe-right: 0px;
  --runtime-safe-bottom: 0px;
  --runtime-safe-left: 0px;
  --photo-viewer-counter-top: 12px;
  --app-safe-top: max(
    env(safe-area-inset-top, 0px),
    var(--tg-safe-area-inset-top, 0px),
    var(--tg-content-safe-area-inset-top, 0px),
    var(--runtime-safe-top)
  );
  --app-safe-right: max(
    env(safe-area-inset-right, 0px),
    var(--tg-safe-area-inset-right, 0px),
    var(--tg-content-safe-area-inset-right, 0px),
    var(--runtime-safe-right)
  );
  --app-safe-bottom: max(
    env(safe-area-inset-bottom, 0px),
    var(--tg-safe-area-inset-bottom, 0px),
    var(--tg-content-safe-area-inset-bottom, 0px),
    var(--runtime-safe-bottom)
  );
  --app-safe-left: max(
    env(safe-area-inset-left, 0px),
    var(--tg-safe-area-inset-left, 0px),
    var(--tg-content-safe-area-inset-left, 0px),
    var(--runtime-safe-left)
  );
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-border: rgba(157, 181, 218, .22);
  --nav-base: #fff;
  --nav-ink: #344564;
  --category-control-radius: 20px;
  --home-candy-fill:
    radial-gradient(ellipse at 22% 0%, rgba(255,255,255,.65), transparent 52%),
    radial-gradient(ellipse at 100% 100%, rgba(97,206,255,.5), transparent 56%),
    linear-gradient(125deg, #348cf3, #2254dc 44%, #2b48df 76%, #4097ff);
  --home-candy-shadow: inset 0 1px 1px rgba(255,255,255,.8), inset 0 0 0 1px rgba(225,243,255,.38), 0 3px 8px rgba(33,99,232,.18);
}

* {
  box-sizing: border-box;
}

html {
  position: relative;
  min-height: 100%;
  touch-action: pan-x pan-y;
}

body {
  position: relative;
  z-index: 1;
  min-width: 300px;
  min-height: var(--tg-viewport-stable-height, 100vh);
  margin: 0;
  color: var(--ink);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  touch-action: pan-x pan-y;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Programmatic destinations are not interactive keyboard stops. */
[tabindex="-1"]:focus {
  outline: none;
}

/* Override component/ID rings only for touch/mouse; Tab restores their rules. */
html[data-focus-input="pointer"] :focus-visible {
  outline: none !important;
}

.shell {
  width: min(100%, 820px);
  min-height: 100vh;
  margin: 0 auto;
  padding:
    0
    calc(18px + var(--app-safe-right))
    calc(104px + var(--app-safe-bottom))
    calc(18px + var(--app-safe-left));
}

.topbar {
  display: flex;
}

.search-panel {
  position: relative;
  padding: 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 7px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h2,
p {
  overflow-wrap: anywhere;
}

h2 {
  margin: 0;
  font-family: var(--font-ui);
}

.search-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.search-box {
  display: flex;
  min-width: 0;
  align-items: center;
  color: var(--ink);
}

.search-icon {
  display: grid;
  flex: none;
  place-items: center;
}

.search-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.9;
}

.search-box:focus-within {
  border-color: rgba(22, 86, 216, 0.48);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  display: grid;
  width: 28px;
  height: 28px;
  flex: none;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(25, 43, 80, 0.09);
  font-size: 20px;
  font-weight: 500;
}

.search-box input:focus-visible {
  outline: 0;
}

.search-box input::placeholder {
  color: #7b8580;
}

.search-submit {
  font-size: 13px;
  font-weight: 900;
}

.active-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 4px 0 12px;
  min-height: 32px;
  max-width: 100%;
  border: 0;
  border-radius: var(--category-control-radius);
  color: #fff;
  background: var(--home-candy-fill);
  box-shadow: var(--home-candy-shadow);
  font: 600 12px/1.4 var(--font-ui);
}

.active-filter button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin-block: -6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  font-size: 22px;
  line-height: 1;
}

main {
  min-height: 400px;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 19px 2px 13px;
}

.section-head > div:first-child {
  min-width: 0;
}

.section-actions {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  overflow: hidden;
  gap: 0;
  margin-left: auto;
  border: 1px solid rgba(25, 43, 80, 0.55);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: none;
}

.section-head.hidden ~ .status-card:not(.hidden),
.section-head.hidden ~ .listing-grid:not(.hidden) {
  margin-top: 16px;
}

.section-kicker {
  color: var(--blue);
}

.section-head .section-kicker,
#resultTitle {
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.text-button.is-saved {
  border-color: var(--blue);
  color: var(--white);
  background: var(--blue);
  box-shadow: none;
}

.text-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.listing-toolbar {
  display: grid;
}

.feed-category-control,
.sort-control {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

.feed-category-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 650;
}

.feed-category-chevron {
  color: var(--ink);
  font-size: 19px;
  font-weight: 650;
  line-height: 1;
  transform: translateY(-1px);
}

.feed-listing-count {
  grid-column: 1 / -1;
  margin: -1px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
}

.sort-control {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
}

.sort-control svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sort-prefix {
  display: none;
}

.listing-toolbar .sort-control {
  gap: 3px;
  padding: 0 8px;
}

.listing-toolbar .sort-control svg {
  flex: none;
}

.listing-toolbar .sort-prefix {
  display: inline;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.listing-toolbar .sort-control select {
  max-width: 70px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.sort-control select {
  max-width: 120px;
  padding: 0;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  appearance: none;
  -webkit-appearance: none;
}

.section-actions .sort-control {
  width: auto;
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.section-actions .text-button {
  width: auto;
  min-height: 42px;
  justify-content: center;
  padding: 0 13px;
  border: 0;
  border-left: 1px solid rgba(25, 43, 80, 0.18);
  border-radius: 0;
  box-shadow: none;
}

.section-actions .sort-control select {
  max-width: 82px;
  padding-right: 0;
  font-size: 12px;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.listing-card {
  cursor: pointer;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.listing-card.has-gallery {
  display: flex;
}

.listing-visual {
  position: relative;
  display: flex;
  min-height: 0;
  aspect-ratio: 1 / 1;
  align-items: end;
  overflow: hidden;
  padding: 9px 8px;
  color: var(--ink);
  background: var(--paper-deep);
}

.listing-placeholder-label {
  position: relative;
  z-index: 1;
  align-self: center;
  margin: auto;
  border-radius: 999px;
  text-align: center;
}

.listing-card.has-gallery .listing-visual {
  min-height: 0;
  aspect-ratio: 1 / 1;
  padding: 0;
  background: rgba(234, 240, 248, 0.82);
}

.listing-gallery {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.listing-gallery::-webkit-scrollbar {
  display: none;
}

.listing-cover {
  display: block;
  width: 100%;
  min-width: 100%;
  height: 100%;
  flex: 0 0 100%;
  object-fit: cover;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  user-select: none;
}

.listing-cover[data-src] {
  visibility: hidden;
}

.listing-cover.is-broken,
.detail-photo.is-broken {
  visibility: hidden;
}

.media-dot,
.photo-count {
  position: absolute;
  z-index: 2;
  top: 9px;
  left: 8px;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 8px rgba(25, 43, 80, 0.1);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.photo-count {
  right: 9px;
  left: auto;
}

.listing-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.listing-meta {
  display: flex;
  justify-content: space-between;
  min-width: 0;
  gap: 5px;
  color: var(--muted);
}

.listing-meta span {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
}

.listing-meta time {
  flex: none;
}

.listing-body h3 {
  overflow: hidden;
  margin: 7px 0 0;
  font-size: 16px;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
}

.listing-price {
  margin: 7px 0 0;
  line-height: 1;
  letter-spacing: 0.01em;
}

.listing-copy {
  display: none;
}

.status-card,
.saved-empty {
  border: 1px solid rgba(157, 181, 218, 0.2);
  border-radius: var(--radius-card);
  color: #65718a;
  background: #fff;
  box-shadow: 0 2px 4px rgba(56, 89, 137, 0.03), 0 6px 16px rgba(56, 89, 137, 0.04);
  font-size: 13px;
  line-height: 1.5;
}

.status-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 18px;
  text-align: left;
}

.status-indicator {
  position: relative;
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--blue);
  background: rgba(22, 86, 216, 0.09);
}

.status-card[data-state="empty"] .status-indicator::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.status-card[data-state="empty"] .status-indicator::after {
  content: "";
  position: absolute;
  top: 23px;
  left: 23px;
  width: 7px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.status-card[data-state="loading"] .status-indicator::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 2px solid rgba(22, 86, 216, 0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: status-spin 0.8s linear infinite;
}

.status-card[data-state="error"] {
  border-color: rgba(239, 91, 63, 0.42);
}

.status-card[data-state="error"] .status-indicator {
  color: var(--tomato);
  background: rgba(239, 91, 63, 0.1);
}

.status-card[data-state="error"] .status-indicator::before {
  content: "!";
  display: grid;
  height: 100%;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
}

.feed-load-status {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 13px;
  padding: 13px;
  color: var(--muted);
  font-size: 12px;
  cursor: default;
}

.feed-load-status[aria-busy="true"]::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: status-spin 0.8s linear infinite;
}

.load-more {
  width: 100%;
  margin-top: 13px;
  padding: 13px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-control);
  background: transparent;
  font-size: 12px;
  font-weight: 850;
}

.saved-list {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.saved-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.saved-card button {
  border: 0;
  background: transparent;
}

.saved-main {
  text-align: left;
}

.saved-main strong,
.saved-main small {
  display: block;
}

.saved-main strong {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 600;
}

.saved-main small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.saved-delete {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line) !important;
  border-radius: 50%;
  color: var(--muted);
}

.saved-delete svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.saved-empty {
  display: grid;
  gap: 5px;
  padding: 22px;
}

.saved-empty strong {
  color: var(--ink);
  font-family: var(--font-ui);
}

.bottom-nav {
  --nav-offset: 0%;
  --nav-drag-x: 0px;
  position: fixed;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 auto;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  isolation: isolate;
  touch-action: none;
  user-select: none;
  /* Keep feed geometry unchanged while moving the fixed navigation. */
  transform: translateY(0);
  transition: transform 180ms ease-out, visibility 0s;
}

.bottom-nav.is-scroll-hidden {
  transform: translateY(calc(100% + var(--app-safe-bottom) + 48px));
  visibility: hidden;
  pointer-events: none;
  transition: transform 180ms ease-out, visibility 0s 180ms;
}

body.search-editing > .bottom-nav {
  display: none;
}

.bottom-nav::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 7px;
  bottom: 7px;
  left: 7px;
  width: calc(25% - 3.5px);
  border-radius: var(--radius-pill);
  pointer-events: none;
  transform: translate3d(calc(var(--nav-offset) + var(--nav-drag-x)), 0, 0);
  transition: transform 230ms cubic-bezier(0.18, 0.82, 0.24, 1),
    box-shadow 150ms ease;
  will-change: transform;
}

.bottom-nav.is-pressed::before {
  transform: translate3d(calc(var(--nav-offset) + var(--nav-drag-x)), -1px, 0)
    scale(1.055, 1.06);
}

.bottom-nav.is-dragging::before {
  transform: translate3d(calc(var(--nav-offset) + var(--nav-drag-x)), -2px, 0)
    scale(1.12, 1.1);
  transition: none;
}

.nav-item {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
}

.nav-item span {
  font-size: 20px;
  line-height: 1;
}

.nav-item.active {
  background: transparent;
}

.catalog-panel {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: transparent;
  box-shadow: var(--shadow);
  animation: reveal 0.35s both;
}

.catalog-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 3px 2px 18px;
  border-bottom: 1px solid var(--line);
}

.catalog-intro .eyebrow {
  color: var(--tomato);
}

.catalog-intro > span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.category-list {
  display: grid;
  gap: 10px;
  padding: 16px 0 2px;
}

body.detail-open,
body.seller-open,
body.photo-viewer-open {
  overflow: hidden;
}

.detail-view {
  --detail-swipe-x: 0px;
  position: fixed;
  z-index: 30;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  isolation: isolate;
}

.detail-view.is-opening {
  animation: detail-in 0.28s both;
}

.detail-view:not(.hidden) {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
}

.detail-view.is-swiping,
.detail-view.is-settling {
  animation: none;
  transform: translate3d(var(--detail-swipe-x), 0, 0);
  box-shadow: -18px 0 44px rgba(16, 32, 27, 0.22);
}

.detail-view.is-swiping {
  transition: none;
}

.detail-view.is-settling {
  transition: transform 190ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.detail-swipe-edge {
  position: fixed;
  z-index: 7;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(30px + var(--app-safe-left));
  touch-action: none;
}

.detail-shell {
  width: min(100%, 820px);
  min-height: 100%;
  margin: 0 auto;
}

.detail-topbar {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: calc(8px + var(--app-safe-top))
    calc(16px + var(--app-safe-right))
    8px
    calc(16px + var(--app-safe-left));
}

.telegram-native-back .detail-back {
  display: none;
}

.telegram-native-back .detail-topbar {
  position: relative;
  min-height: calc(var(--app-safe-top) + 12px);
  padding: 0;
  background: transparent;
}

.detail-back {
  display: grid;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  font-size: 23px;
}

.detail-main {
  min-height: 0;
  margin: 0
    calc(12px + var(--app-safe-right))
    0
    calc(12px + var(--app-safe-left));
}

.detail-gallery-wrap {
  position: relative;
  overflow: hidden;
  margin: 0;
  border: 0;
  box-shadow: none;
}

.detail-gallery {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.detail-gallery::-webkit-scrollbar {
  display: none;
}

.detail-photo,
.detail-placeholder {
  width: 100%;
  min-width: 100%;
  height: 100%;
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.detail-photo {
  display: block;
  cursor: zoom-in;
}

.detail-placeholder {
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.detail-placeholder span {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.detail-photo-counter {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}

.photo-viewer {
  --photo-viewer-swipe-y: 0px;
  --photo-viewer-backdrop-opacity: 1;
  position: fixed;
  z-index: 80;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  color: var(--white);
  background: transparent;
  animation: viewer-in 0.2s both;
}

.photo-viewer.is-preparing {
  visibility: hidden;
  pointer-events: none;
  animation: none;
}

.photo-viewer::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  opacity: var(--photo-viewer-backdrop-opacity);
  background: #08100e;
}

.photo-viewer.is-swiping .photo-viewer-gallery,
.photo-viewer.is-settling .photo-viewer-gallery {
  animation: none;
  transform: translate3d(0, var(--photo-viewer-swipe-y), 0);
  will-change: transform;
}

.photo-viewer.is-swiping .photo-viewer-gallery {
  transition: none;
}

.photo-viewer.is-settling .photo-viewer-gallery {
  transition: transform 220ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.photo-viewer.is-settling::before,
.photo-viewer.is-settling .photo-viewer-topbar,
.photo-viewer.is-settling .photo-viewer-nav {
  opacity: var(--photo-viewer-backdrop-opacity);
  transition: opacity 220ms ease;
}

.photo-viewer-topbar {
  position: absolute;
  z-index: 3;
  top: var(--photo-viewer-counter-top);
  right: 0;
  left: 0;
  display: flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 calc(86px + var(--app-safe-right)) 0 calc(86px + var(--app-safe-left));
  pointer-events: none;
}

.photo-viewer-nav {
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--white);
  background: rgba(8, 16, 14, 0.7);
  backdrop-filter: blur(9px);
}

.photo-viewer-counter {
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
}

.photo-viewer-gallery {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overscroll-behavior: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  background: transparent;
}

.photo-viewer.is-horizontal-gesture .photo-viewer-gallery,
.photo-viewer.is-vertical-gesture .photo-viewer-gallery {
  scroll-snap-type: none;
}

.photo-viewer.is-vertical-gesture .photo-viewer-gallery {
  overflow-x: hidden;
}

.photo-viewer.is-photo-zoomed .photo-viewer-gallery,
.photo-viewer.is-zooming .photo-viewer-gallery {
  overflow: hidden;
  scroll-snap-type: none;
  touch-action: none;
}

.photo-viewer-gallery::-webkit-scrollbar {
  display: none;
}

.photo-viewer-photo {
  --photo-viewer-scale: 1;
  --photo-viewer-pan-x: 0px;
  --photo-viewer-pan-y: 0px;
  display: block;
  width: 100%;
  min-width: 100%;
  height: 100%;
  flex: 0 0 100%;
  /* Match both sides so contain and zoom share the viewport center. */
  padding:
    max(var(--app-safe-top), var(--app-safe-bottom), calc(var(--photo-viewer-counter-top) + 40px))
    max(var(--app-safe-left), var(--app-safe-right));
  object-fit: contain;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  transform: translate3d(
    var(--photo-viewer-pan-x),
    var(--photo-viewer-pan-y),
    0
  ) scale(var(--photo-viewer-scale));
  transform-origin: center;
  user-select: none;
  will-change: transform;
}

.photo-viewer.is-zoom-settling .photo-viewer-photo {
  transition: transform 180ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.photo-viewer-nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  font-size: 34px;
  line-height: 1;
  transform: translateY(-50%);
}

.photo-viewer-nav:disabled {
  opacity: 0.25;
}

.photo-viewer-previous {
  left: calc(14px + var(--app-safe-left));
}

.photo-viewer-next {
  right: calc(14px + var(--app-safe-right));
}

.detail-content {
  margin: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  touch-action: pan-y;
}

.detail-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.detail-seller-profile {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 42px minmax(0, 1fr) auto 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(234, 240, 248, 0.64);
  text-align: left;
}

.seller-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: var(--white);
  background: var(--blue);
  box-shadow: none;
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
}

.seller-profile-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.seller-profile-copy small,
.seller-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.seller-profile-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seller-listing-count {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.seller-profile-arrow {
  font-size: 17px;
  font-weight: 850;
}

.detail-primary-actions {
  display: grid;
  gap: 8px;
  align-items: stretch;
}

.seller-button {
  min-width: 0;
  min-height: 52px;
  padding: 0 10px;
  border: 0;
  border-radius: 16px;
  color: var(--white);
  background: var(--blue);
  box-shadow: none;
  font-size: clamp(11px, 3.5vw, 15px);
  font-weight: 900;
  white-space: nowrap;
}

.seller-button.is-compact {
  font-size: clamp(10px, 2.8vw, 12px);
  letter-spacing: -0.015em;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.seller-button:disabled {
  opacity: 0.45;
  box-shadow: none;
}

.detail-action-button {
  display: grid;
  width: 48px;
  min-height: 52px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(25, 43, 80, 0.08);
  font-size: 22px;
  font-weight: 750;
}

.detail-action-button svg {
  width: 22px;
  height: 22px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.detail-action-button.active svg path {
  fill: currentColor;
}

.detail-action-button.active {
  border-color: var(--blue);
  color: var(--white);
  background: var(--blue);
  box-shadow: none;
}

.detail-description > p {
  margin: 0;
  white-space: pre-wrap;
}

.detail-description > p a {
  color: var(--blue);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.detail-description > p s {
  color: var(--muted);
  text-decoration-thickness: 1.5px;
}

.detail-description > p code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgb(8 16 14 / 8%);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
}

.detail-description > p pre,
.detail-description > p blockquote {
  margin: 10px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  background: rgb(8 16 14 / 5%);
  white-space: pre-wrap;
}

.detail-description > p pre code {
  padding: 0;
  background: transparent;
}

.telegram-spoiler {
  border-radius: 3px;
  color: transparent;
  background: var(--ink);
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease;
}

.telegram-spoiler.is-revealed {
  color: inherit;
  background: rgb(8 16 14 / 10%);
}

.original-link {
  width: 100%;
  margin-top: 22px;
  padding: 12px;
  border: 1px solid var(--ink);
  border-radius: 13px;
  background: transparent;
  font-size: 12px;
  font-weight: 850;
}

.detail-report-link {
  display: block;
  padding: 8px 10px;
  border: 0;
  color: var(--muted);
  background: transparent;
  text-decoration: underline;
  text-decoration-color: rgba(101, 113, 138, 0.45);
  text-underline-offset: 3px;
}

html.header-refine:has(body.seller-open) { background: #f3f7fc; }

.seller-view {
  --ink: #192b50;
  --muted: #65718a;
  --paper: #f3f7fc;
  --paper-deep: #eaf0f8;
  --white: #fff;
  color: var(--ink);
  --seller-swipe-x: 0px;
  position: relative;
  z-index: 40;
  width: 100%;
  min-height: 100vh;
  overflow: visible;
  background: var(--paper);
}

.seller-view.is-swiping,
.seller-view.is-settling {
  transform: translate3d(var(--seller-swipe-x), 0, 0);
  box-shadow: -18px 0 44px rgba(16, 32, 27, 0.22);
  will-change: transform;
}

.seller-view.is-swiping {
  transition: none;
}

.seller-view.is-settling {
  transition: transform 190ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.seller-swipe-edge {
  position: fixed;
  z-index: 7;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(30px + var(--app-safe-left));
  touch-action: none;
}

body.seller-open {
  overflow-x: hidden;
  overflow-y: auto;
}

body.seller-open > .shell,
body.seller-open > .bottom-nav {
  display: none;
}

.seller-shell {
  width: min(100%, 820px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(30px + var(--app-safe-bottom));
}

.seller-topbar {
  min-height: calc(58px + var(--app-safe-top));
  padding:
    calc(8px + var(--app-safe-top))
    calc(16px + var(--app-safe-right))
    8px
    calc(16px + var(--app-safe-left));
}

.telegram-native-back .seller-topbar {
  min-height: calc(var(--app-safe-top) + 14px);
  padding: 0;
}

.seller-main {
  padding:
    4px
    calc(18px + var(--app-safe-right))
    28px
    calc(18px + var(--app-safe-left));
  touch-action: pan-x pan-y;
}

.seller-heading {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid rgba(157, 181, 218, 0.2);
  border-radius: var(--category-control-radius);
  background: var(--white);
  box-shadow: 0 2px 4px rgba(56, 89, 137, 0.03), 0 6px 16px rgba(56, 89, 137, 0.04);
}

.seller-view .listing-card {
  background: var(--white);
  animation: none;
}

.seller-avatar-large {
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 50%;
  background: #eaf2ff;
  color: var(--blue);
  box-shadow: none;
  font-size: 25px;
}

.seller-heading h2 {
  overflow: hidden;
  margin: 3px 0 2px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seller-heading > div {
  min-width: 0;
}

.seller-heading > div > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.seller-heading p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

.seller-empty { grid-column: 1 / -1; }

.header-refine .seller-view .listing-card {
  border-color: rgba(157, 181, 218, 0.2);
  box-shadow: 0 2px 4px rgba(56, 89, 137, 0.03), 0 6px 16px rgba(56, 89, 137, 0.04);
}
.seller-view .listing-price { color: var(--blue); }

.seller-loading {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.seller-loading span {
  display: block;
  min-height: 220px;
  border: 1px solid rgba(25, 43, 80, 0.08);
  border-radius: var(--radius-card);
  background:
    linear-gradient(
      105deg,
      #eaf0f8 35%,
      #fff 48%,
      #eaf0f8 61%
    );
  background-size: 220% 100%;
  animation: seller-loading 1.1s linear infinite;
}

@keyframes seller-loading {
  to {
    background-position-x: -220%;
  }
}

.seller-block-button,
.complaint-block-seller {
  width: 100%;
  padding: 14px 16px;
  min-height: 48px;
  border: 1px solid #f0cfd5;
  border-radius: var(--category-control-radius);
  color: #a52b35;
  background: #fff0ee;
  font-size: 13px;
  font-weight: 600;
}

.seller-block-button {
  margin-top: 22px;
}

.seller-load-more {
  min-height: 48px;
  margin-top: 18px;
  border: 1px solid rgba(157, 181, 218, 0.2);
  border-radius: var(--category-control-radius);
  background: #fff;
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
}

.seller-block-button:disabled,
.complaint-block-seller:disabled {
  opacity: 0.5;
}

.sheet-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: flex;
  align-items: end;
  justify-content: center;
  padding-top: calc(16px + var(--app-safe-top));
  background: rgba(25, 43, 80, 0.3);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.complaint-sheet {
  --ink: #192b50;
  --muted: #65718a;
  --paper: #f3f7fc;
  --white: #fff;
  color: var(--ink);
  width: min(100%, 620px);
  max-height: calc(100dvh - 16px - var(--app-safe-top));
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding:
    10px
    calc(18px + var(--app-safe-right))
    calc(22px + var(--app-safe-bottom))
    calc(18px + var(--app-safe-left));
  border-radius: 28px 28px 0 0;
  background: var(--paper);
  box-shadow: 0 -8px 32px rgba(25, 43, 80, 0.1);
  animation: sheet-in 0.25s both;
}

.feed-category-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.feed-category-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.feed-category-section-head h3 {
  margin: 0;
  font-size: 15px;
}

.feed-category-section-head button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--paper);
  font-size: 12px;
  font-weight: 800;
}

.feed-seen-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--paper);
  cursor: pointer;
}

.feed-seen-option > span:first-child { flex: 1; min-width: 0; }
.feed-seen-option strong { font-size: 14px; line-height: 1.4; }
.feed-seen-option .feed-category-hint { display: block; margin-top: 5px; }
.feed-seen-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.feed-seen-switch {
  flex: 0 0 44px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--muted);
  padding: 3px;
}

.feed-seen-switch::after {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
}

.feed-seen-option input:checked + .feed-seen-switch { background: var(--blue); }
.feed-seen-option input:checked + .feed-seen-switch::after { transform: translateX(16px); }
.feed-seen-option input:focus-visible + .feed-seen-switch { outline: 2px solid var(--ink); outline-offset: 3px; }
.feed-seen-option input:disabled + .feed-seen-switch { opacity: 0.5; }

.feed-category-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.feed-category-option {
  position: relative;
  min-height: 50px;
  padding: 10px 38px 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(234, 240, 248, 0.74);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
}

.feed-category-option::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 17px;
  height: 17px;
  border: 1.5px solid rgba(25, 43, 80, 0.35);
  border-radius: 50%;
  transform: translateY(-50%);
}

.feed-category-option[aria-pressed="true"] {
  border-color: rgba(22, 86, 216, 0.3);
  background: rgba(22, 86, 216, 0.07);
}

.feed-category-option[aria-pressed="true"]::after {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: inset 0 0 0 4px var(--white);
}

.feed-category-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 9px;
  margin-top: 18px;
}

.feed-category-actions button {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--paper);
  font-size: 12px;
  font-weight: 850;
}

.feed-category-actions .feed-category-save {
  border-color: var(--blue);
  color: var(--white);
  background: var(--blue);
}

.feed-category-actions button:disabled {
  opacity: 0.5;
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 15px;
  border-radius: 999px;
  background: var(--line);
}

.complaint-sheet header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 15px;
}

.complaint-sheet header > button {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: #344564;
  font-size: 22px;
}

.complaint-options {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.complaint-options button {
  min-height: 48px;
  padding: 15px 16px;
  border: 1px solid rgba(157, 181, 218, 0.2);
  border-radius: var(--category-control-radius);
  background: var(--white);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.complaint-options button:disabled {
  opacity: 0.5;
}

.complaint-options button[aria-expanded="true"] {
  border-color: #b8cdf3;
  background: #e5eeff;
  color: var(--blue);
}

.complaint-block-seller {
  margin-top: 18px;
}

.complaint-other-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.complaint-other-form label {
  font-size: 13px;
  font-weight: 800;
}

.complaint-other-form textarea {
  min-height: 104px;
  padding: 13px 14px;
  resize: vertical;
  border: 1px solid #c7d2e5;
  border-radius: var(--category-control-radius);
  background: var(--white);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-ui);
}

.complaint-other-form textarea:focus {
  border-color: var(--blue);
}

.complaint-other-form .complaint-submit {
  padding: 14px 16px;
  min-height: 48px;
  border: 0;
  border-radius: var(--category-control-radius);
  background: var(--home-candy-fill);
  box-shadow: var(--home-candy-shadow);
  color: var(--white);
  font-weight: 600;
}

.complaint-other-form .complaint-submit:disabled {
  opacity: 0.5;
}

.toast {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: calc(92px + var(--app-safe-bottom));
  left: 20px;
  width: fit-content;
  max-width: calc(100% - 40px);
  margin: auto;
  padding: 11px 15px;
  border-radius: 999px;
  color: #fff;
  background: #192b50;
  box-shadow: 0 6px 18px rgba(25, 43, 80, 0.16);
  font-size: 13px;
  font-weight: 500;
}

.hidden {
  display: none !important;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes detail-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sheet-in {
  from {
    transform: translateY(40px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes viewer-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@media (hover: hover) and (pointer: fine) {

  button:not(:disabled) {
    cursor: pointer;
  }

  .saved-delete:hover {
    border-color: rgba(239, 91, 63, 0.35) !important;
    color: var(--tomato);
    background: rgba(239, 91, 63, 0.07);
  }

  .photo-viewer-nav {
    display: grid;
    place-items: center;
  }
}

@media (min-width: 620px) {

  .shell {
    padding-right: calc(28px + var(--app-safe-right));
    padding-left: calc(28px + var(--app-safe-left));
  }

  .listing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-main {
    margin-right: calc(28px + var(--app-safe-right));
    margin-left: calc(28px + var(--app-safe-left));
  }
}

@media (prefers-reduced-motion: reduce) {

  .bottom-nav,
  .bottom-nav.is-scroll-hidden {
    transition: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.saved-card:has(.saved-notifications) { grid-template-columns: minmax(0,1fr) 44px 44px; gap:8px; }
.saved-notifications { width:44px; height:44px; border-radius:14px; color:#64748b; }
.saved-notifications svg,.notification-sheet header svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; pointer-events:none; }
.saved-card .saved-notifications[aria-pressed="true"] { color:#2451e8; background:#e5eeff; }
.saved-schedule { display:block; margin-top:5px; font:500 12px/1.4 system-ui; color:#2451e8; }
body.notification-settings-open { overflow:hidden; }
.notification-sheet { color:#203153; font:15px/1.45 var(--font-ui,system-ui); width:min(100%,480px); max-height:calc(100dvh - var(--app-safe-top,40px) - 24px); overflow:auto; margin:auto auto 0; padding:24px 24px calc(24px + env(safe-area-inset-bottom)); border:0; border-radius:24px 24px 0 0; background:#f5f8fd; overscroll-behavior:contain; }
.notification-sheet::backdrop { background:rgba(24,43,72,.32); }
.notification-sheet header { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.notification-sheet h2 { font-size:20px; margin:0; }
.notification-sheet button { cursor:pointer; font:600 15px/1.3 var(--font-ui,system-ui); min-height:44px; border:0; border-radius:20px; -webkit-user-select:none; user-select:none; }
.notification-sheet header button { width:44px; flex-shrink:0; background:#e8eef7; color:#203153; }
.notification-sheet #notificationSearchName { margin:0 0 16px; color:#637089; overflow-wrap:anywhere; }
.notification-sheet fieldset { padding:0; margin:0; border:0; }
.notification-sheet legend { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.notification-sheet fieldset label { display:flex; align-items:center; gap:12px; padding:12px; min-height:48px; margin-bottom:8px; border-radius:20px; background:white; }
.notification-sheet input[type="radio"] { width:20px; height:20px; accent-color:#2451e8; }
.notification-sheet #notificationTimeRow:not([hidden]) { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; padding:12px; }
.notification-sheet input[type="time"] { min-height:44px; padding:8px; border:1px solid #c7d2e5; border-radius:12px; background:white; color:#203153; font:inherit; }
.notification-sheet #notificationTimeRow span { flex-basis:100%; color:#637089; font-size:13px; }
.notification-sheet .notification-explanation { font-size:13px; color:#637089; }
.notification-sheet #notificationError { color:#a52b35; }
.notification-sheet #notificationOpenBot { background:transparent; color:#2451e8; padding:8px 0; margin-bottom:8px; }
.notification-sheet .notification-save { width:100%; color:white; background:linear-gradient(140deg,#72b7fa,#2451e8 65%,#449ff5); padding:12px; }
.notification-sheet button:disabled { opacity:.6; cursor:wait; }

/* Primary public interface styles, loaded with the document. */

.header-refine body,
.header-refine :is(button, input, select, textarea, option, optgroup) {
  font-family: var(--font-ui);
}
.header-refine :is(h1, h2, h3, h4, h5, h6),
.header-refine :is(.saved-main strong, .saved-empty strong, .seller-avatar) {
  font-family: var(--font-ui);
}
.header-refine h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.header-refine h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.015em;
}
.header-refine .saved-empty strong {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.015em;
}
.header-refine .seller-heading h2 {
  font-family: var(--font-ui);
  font-size: 20px;
  line-height: 1.25;
}
.header-refine #resultTitle {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.01em;
}
.header-refine :is(
  .text-button, .seller-button, .photo-viewer-counter,
  .feed-category-option, .feed-category-section-head button, .feed-category-actions button,
  .feed-seen-option strong, .complaint-options button, .complaint-block-seller,
  .complaint-other-form label, .complaint-other-form .complaint-submit
),
.header-refine .section-actions .sort-control select {
  font-weight: 600;
}
.header-refine .listing-price {
  font-size: 14px;
  font-weight: 700;
}
html.header-refine { background: var(--paper); }
.header-refine .topbar {
  --city-gutter: 18px;
  position: relative;
  justify-content: flex-end;
  align-items: flex-start;
  min-height: calc(var(--app-safe-top) + clamp(112px, 36vw, 180px));
  padding: calc(12px + var(--app-safe-top)) 0 12px;
}
@media (min-width: 620px) {

  .header-refine .topbar { --city-gutter: 28px; }
}
@media (max-height: 500px) and (orientation: landscape) {

  .header-refine .topbar { min-height: calc(var(--app-safe-top) + 100px); }
}
.header-refine #feedCategoryControl {
  position: relative;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  box-shadow: none;
}
.header-refine #feedCategoryControlLabel {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.header-refine #feedCategoryControl .feed-category-chevron { display: none; }
.header-refine #feedCategoryControl svg {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header-refine .search-form {
  display: flex;
  gap: 0;
  align-items: center;
  min-height: 56px;
  padding: 5px;
  border: 1px solid var(--header-border);
  border-radius: 19px;
  background: var(--white);
}
.header-refine .search-form:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22,86,216,.09);
}
.header-refine .search-box {
  flex: 1;
  height: 44px;
  padding: 0 7px;
  gap: 6px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
}
.header-refine .search-box:focus-within { border: 0; box-shadow: none; }
.header-refine .search-box input {
  appearance: none;
  -webkit-appearance: none;
  height: 100%;
  margin: 0;
  padding: 0;
  font-size: 15px;
  line-height: normal;
}
.header-refine .search-icon { color: var(--muted); }
.header-refine .search-submit {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 14px;
  color: var(--ink);
  background: var(--blue);
}
.header-refine .search-submit svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header-refine .header-category-wrap {
  position: relative;
  --rail-gutter: 18px;
  margin: 14px calc(-1 * (var(--rail-gutter) + var(--app-safe-right))) 8px calc(-1 * (var(--rail-gutter) + var(--app-safe-left)));
}
@media (min-width: 620px) {

  .header-refine .header-category-wrap { --rail-gutter: 28px; }
}
.header-refine .header-category-wrap[hidden] { display: none; }
.header-refine .header-categories {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 4px calc(var(--rail-gutter) + var(--app-safe-right)) 4px calc(var(--rail-gutter) + var(--app-safe-left));
  scroll-padding-inline: calc(var(--rail-gutter) + var(--app-safe-left)) calc(var(--rail-gutter) + var(--app-safe-right));
  margin: 0;
  scrollbar-width: none;
}
.header-refine .header-categories[hidden] { display: none; }
.header-refine .header-categories button[hidden] { display: none; }
.header-refine .header-categories.is-reset-animating { scroll-snap-type: none; overflow-anchor: none; }
.header-refine .header-categories::-webkit-scrollbar { display: none; }
.header-refine .header-categories button {
  display: grid;
  align-content: center;
  justify-items: center;
  grid-template-rows: 20px 26px;
  gap: 4px;
  min-height: 64px;
  min-width: 0;
  padding: 6px 3px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  line-height: 13px;
  scroll-snap-align: start;
}
.header-refine .header-categories button span {
  display: grid;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}
.header-refine .header-categories button.selected {
  border-color: rgba(22,35,31,.04);
  color: var(--ink);
  background: var(--blue);
}
.header-refine .header-categories svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header-refine .listing-toolbar {
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 0;
}
.header-refine .home-candy .listing-toolbar {
  grid-template-rows: 44px auto;
  row-gap: 0;
  padding-bottom: 8px;
}
.header-refine #feedListingCount {
  margin: 0;
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.3;
}
.header-refine #feedListingCount strong { font: inherit; }
.header-refine #sortControl {
  grid-column: 2;
  grid-row: 1;
  width: auto;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
}
.header-refine #sortControl .sort-prefix { display: none; }
.header-refine #sortSelect { max-width: 104px; font-size: 13px; }
.header-refine .section-head.hidden ~ .listing-grid:not(.hidden) { margin-top: 8px; }
.header-refine-filtered #activeFilter { display: none; }
.header-refine .bottom-nav {
  --nav-base: #fff;
  --nav-ink: #344564;
  background: var(--nav-base);
  border-color: rgba(25,43,80,.14);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.header-refine .nav-item,
.header-refine .bottom-nav.is-pressed .nav-item.active,
.header-refine .bottom-nav.is-pressed .nav-item.is-preview { color: var(--nav-ink); }
/* Candy-blue selection: translucent edges, a glossy rim and a deeper text area. */
.header-refine .bottom-nav::before {
  background:
    radial-gradient(ellipse at 22% 0%, rgba(255,255,255,.7), transparent 52%),
    radial-gradient(ellipse at 100% 100%, rgba(97,206,255,.55), transparent 56%),
    linear-gradient(125deg, rgba(43,137,246,.94), rgba(31,79,217,.98) 44%, rgba(41,69,226,.97) 76%, rgba(64,151,255,.92));
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.8),
    inset 0 0 0 1px rgba(225,243,255,.38),
    inset 0 -2px 5px rgba(133,211,255,.4),
    0 3px 10px rgba(33,99,232,.24);
}
.header-refine .bottom-nav.is-pressed::before,
.header-refine .bottom-nav.is-dragging::before {
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.85),
    inset 0 0 0 1px rgba(225,243,255,.45),
    inset 0 -2px 6px rgba(133,211,255,.5),
    0 5px 14px rgba(33,99,232,.32);
}
.header-refine .nav-item.active,
.header-refine .bottom-nav.is-pressed .nav-item.is-preview {
  color: #fff;
  text-shadow: 0 1px 2px rgba(16,51,144,.28);
}
.header-refine .bottom-nav.is-pressed .nav-item.active:not(.is-preview) {
  text-shadow: none;
}
.header-refine .nav-item small {
  font-size: 12px;
  font-weight: 600;
  line-height: 14px;
  letter-spacing: -.02em;
}
.header-refine .nav-item {
  grid-template-rows: 22px 14px;
  min-height: 48px;
  padding: 5px 0;
}
.header-refine .nav-item > span {
  display: grid;
  place-items: center;
}
.header-refine .nav-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header-refine .listing-grid { gap: 16px 12px; align-items: stretch; }
.header-refine .listing-card {
  border-color: rgba(56, 89, 137, .12);
  background: var(--white);
  box-shadow: 0 2px 4px rgba(56, 89, 137, .05), 0 6px 16px rgba(56, 89, 137, .08);
}
.header-refine .listing-body { padding: 10px 9px 9px; }
.header-refine .listing-meta {
  align-items: flex-start;
  min-height: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}
.header-refine .listing-meta span {
  display: block;
  white-space: nowrap;
}
.header-refine .listing-body h3 {
  font-family: inherit;
  font-weight: 600;
  display: block;
  min-height: 0;
  line-height: 1.1;
  white-space: nowrap;
}
.header-refine .listing-card:not(.has-gallery) .listing-visual { background: var(--paper-deep); }
.header-refine .listing-placeholder-label {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.header-refine .listing-placeholder-label::before {
  content: "";
  width: 28px;
  height: 28px;
  background: center / contain no-repeat url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%236e7066" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"%3E%3Crect x="3" y="3" width="18" height="18" rx="3"/%3E%3Ccircle cx="8" cy="8" r="1.5"/%3E%3Cpath d="m3 17 5-5 4 4 4-6 5 7"/%3E%3C/svg%3E');
}
.header-refine button:active { opacity: .8; }
@media (prefers-reduced-motion: reduce) {

  .header-refine .header-categories { scroll-behavior: auto; }
}

/* Adaptive navigation gutters. */
.header-refine .bottom-nav {
  --nav-gap: clamp(16px, 4.6vw, 20px);
  --nav-left-gap: max(var(--nav-gap), var(--app-safe-left));
  --nav-right-gap: max(var(--nav-gap), var(--app-safe-right));
  left: var(--nav-left-gap);
  right: var(--nav-right-gap);
  bottom: max(var(--nav-gap), var(--app-safe-bottom));
  width: min(calc(100% - var(--nav-left-gap) - var(--nav-right-gap)), 780px);
}

/* Feed surfaces and blue/mint artwork. */
html.header-refine:has(body.home-candy) { background: #f3f7fc; }
.header-refine .header-categories button > .category-candy-icon { display: none; pointer-events: none; }
.header-refine body.home-candy {
  --ink: #192b50;
  --muted: #65718a;
  --paper: #f3f7fc;
  --white: #ffffff;
  --header-border: rgba(255,255,255,.78);
  --nav-ink: #344564;
  --nav-base: rgba(255,255,255,.94);
  --category-control-radius: 20px;
  --home-candy-fill:
    radial-gradient(ellipse at 22% 0%, rgba(255,255,255,.65), transparent 52%),
    radial-gradient(ellipse at 100% 100%, rgba(97,206,255,.5), transparent 56%),
    linear-gradient(125deg, #348cf3, #2254dc 44%, #2b48df 76%, #4097ff);
  --home-candy-shadow: inset 0 1px 1px rgba(255,255,255,.8), inset 0 0 0 1px rgba(225,243,255,.38), 0 3px 8px rgba(33,99,232,.18);
  background:
    radial-gradient(ellipse at 95% 280px, rgba(163,224,210,.29), transparent 370px),
    radial-gradient(ellipse at 0 370px, rgba(174,211,251,.3), transparent 380px),
    #f3f7fc;
}
.header-refine .home-candy > .shell .topbar::before {
  content: '';
  position: absolute;
  inset: 0 calc(-1 * (var(--city-gutter) + var(--app-safe-right))) -125px calc(-1 * (var(--city-gutter) + var(--app-safe-left)));
  background: url('/static/assets/blue-mint-header-v2.webp') top right / cover no-repeat;
  pointer-events: none;
  z-index: -1;
}
.header-refine .home-candy > .shell .search-form {
  border-radius: 28px;
  background: rgba(255,255,255,.75);
  box-shadow: inset 0 1px 0 #fff, 0 5px 20px rgba(65,100,160,.05);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.header-refine .home-candy > .shell .search-submit {
  color: #fff;
  border-radius: 50%;
  background: var(--home-candy-fill);
  box-shadow: var(--home-candy-shadow);
}
.header-refine .home-candy > .shell .search-box input,
.header-refine .home-candy > .shell .search-icon {
  transform: translateY(2px);
}
.header-refine .search-clear { line-height: 0; }
.header-refine .search-clear svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.header-refine .home-candy > .shell .header-categories button {
  padding: 4px 3px;
  gap: 2px;
  border-color: rgba(255,255,255,.8);
  border-radius: var(--category-control-radius);
  background: rgba(255,255,255,.66);
  color: #334365;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.header-refine .home-candy > .shell .header-categories button.selected {
  background: rgba(224,238,255,.9);
  border-color: rgba(70,131,232,.6);
  color: #143e92;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8), 0 2px 6px rgba(49,100,187,.1);
}
.header-refine .home-candy > .shell .header-categories button.candy-icon-ready > svg { display: none; }
.header-refine .home-candy > .shell .header-categories button.candy-icon-ready > .category-candy-icon {
  position: relative;
  display: block;
  overflow: hidden;
}
.header-refine .home-candy > .shell .category-candy-icon img {
  position: absolute;
  width: 500%;
  height: 200%;
  max-width: none;
  left: calc(var(--icon-x) * -100%);
}
.header-refine .home-candy > .shell #sortControl {
  grid-column: 2;
  grid-row: 1;
  width: 92px;
  height: 44px;
  padding: 0 2px 0 0;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #334365;
  box-shadow: none;
  justify-content: flex-end;
}
.header-refine .home-candy > .shell #sortControl::after {
  content: none;
}
.header-refine .home-candy #resultActions {
  gap: 8px;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.header-refine .home-candy #resultActions .text-button,
.header-refine .feed-search-actions .text-button {
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  color: #334365;
  font-size: 13px;
  font-weight: 600;
}
.header-refine .feed-search-actions {
  display: flex;
  margin: 0;
}
.header-refine .header-refine-filtered .listing-toolbar {
  grid-template-columns: minmax(0,1fr) max-content;
  grid-template-rows: minmax(44px,auto);
  align-items: start;
}
.header-refine .home-candy.header-refine-filtered > .shell #sortControl { grid-column: 2; grid-row: 1; }
.header-refine .header-refine-filtered .header-category-wrap { margin-bottom: 4px; }
.header-refine #feedCategoryControl[hidden] { display: none; }
.header-refine .feed-filter-actions {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 8px;
  min-width: 0;
  padding-block: 6px;
}
.header-refine .feed-filter-reset,
.header-refine .feed-search-actions .text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 32px;
  padding: 5px 12px;
  border: 0;
  border-radius: var(--category-control-radius);
  background: rgba(255,255,255,.78);
  box-shadow: var(--home-candy-shadow);
  color: #334365;
  font: 600 12px/1.4 var(--font-ui);
  text-align: left;
  cursor: pointer;
}
.header-refine .feed-search-actions .text-button { white-space: nowrap; }
.header-refine .feed-filter-reset,
.header-refine .feed-search-actions .text-button.is-saved {
  background: var(--home-candy-fill);
  color: #fff;
}
.header-refine .feed-search-actions .text-button:disabled { cursor: wait; }
.header-refine .feed-filter-reset > span:last-child {
  flex-shrink: 0;
  color: inherit;
  font-size: 20px;
  line-height: 1;
}
.header-refine .feed-search-actions[hidden],
.header-refine .feed-filter-actions[hidden],
.header-refine .feed-filter-reset[hidden] { display: none; }
.header-refine .home-candy > .shell #sortSelect {
  width: auto;
  field-sizing: content;
  text-align: right;
  text-align-last: right;
  max-width: none;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
}
.header-refine .home-candy > .shell #sortControl svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}
.header-refine .home-candy > .shell .listing-card {
  border-color: rgba(157,181,218,.17);
  background: rgba(255,255,255,.95);
  box-shadow: 0 2px 4px rgba(56,89,137,.04), 0 6px 16px rgba(56,89,137,.07);
}
.header-refine .home-candy > .shell .topbar::before {
  bottom: auto;
}
@media (max-height: 500px) and (orientation: landscape) {

  .header-refine .home-candy > .shell .topbar::before {
    height: calc(var(--app-safe-top) + 225px);
  }
}
.header-refine #feedCategoryControl {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-self: start;
  width: auto;
  padding: 0;
  color: #334365;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  justify-content: flex-start;
}
.header-refine #feedCategoryControl svg {
  flex: none;
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}
.header-refine .home-candy > .shell #feedCategoryControl svg { stroke: currentColor; }
.header-refine #feedCategoryControl:active { opacity: .65; }
.header-refine #feedCategoryControl:focus-visible,
.header-refine #sortControl:not(.is-pointer-focus) #sortSelect:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.header-refine #feedListingCount {
  grid-column: 1;
  grid-row: 2;
  font-size: 12px;
}
.header-refine .home-candy:not(.header-refine-filtered) #feedListingCount {
  margin-top: -4px;
}
.header-refine :is(.home-candy,.utility-screen) > .shell .listing-price {
  font-size: 14px;
  color: var(--blue);
  font-weight: 700;
}
/* Reference wordmark and original blue/mint arcs below native system controls. */
.home-wordmark[hidden] { display: none; }
.header-refine .home-candy > .shell .topbar {
  justify-content: flex-start;
  align-items: flex-end;
  min-height: calc(var(--app-safe-top) + 112px);
  padding: calc(var(--app-safe-top) + 16px) 0 20px;
}
.header-refine .home-candy > .shell .topbar::before {
  top: 0;
  height: calc(100% + 125px);
  background-image: url('/static/assets/blue-mint-wordmark-v1.webp');
  background-size: 100% auto;
  background-position: center top;
  transform: none;
  -webkit-mask-image: linear-gradient(#000 45%, transparent 100%);
  mask-image: linear-gradient(#000 45%, transparent 100%);
}
.header-refine .home-wordmark { position: relative; z-index: 1; max-width: 100%; }
.header-refine .home-wordmark h1 {
  margin: 0;
  color: #082da2;
  font-family: var(--font-ui);
  font-size: clamp(34px, 10vw, 46px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.055em;
}
.header-refine .home-wordmark p {
  margin: 7px 0 0;
  color: #647391;
  font-size: clamp(13px, 4vw, 17px);
  font-weight: 500;
  line-height: 1.3;
}
@media (max-height: 500px) and (orientation: landscape) {

  .header-refine .home-candy > .shell .topbar {
    min-height: calc(var(--app-safe-top) + 96px);
    padding-top: calc(var(--app-safe-top) + 8px);
    padding-bottom: 12px;
  }
}
.header-refine .home-candy > .shell .header-categories button.candy-icon-ready > .category-candy-icon {
  width: 44px;
  height: 44px;
  transform: scale(.86);
}

.header-refine .home-candy > .shell .category-candy-icon img {
  top: calc(var(--icon-y) * -100%);
}

.header-refine .home-candy > .shell .header-categories button {
  grid-template-rows: 44px 26px;
  min-height: 82px;
}

/* Labels define tile width; every tile keeps the existing height and artwork. */
.header-refine .home-candy > .shell .header-categories button {
  padding-inline: 12px;
  letter-spacing: normal;
}
.header-refine .home-candy > .shell .header-categories button > span:last-child {
  white-space: nowrap;
}
.header-refine .home-candy > .shell .category-single-icon img {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.header-refine .home-candy > .shell .category-reset { overflow: hidden; }
.header-refine .home-candy > .shell .category-reset > svg {
  width: 44px;
  height: 44px;
  stroke: none;
  transform: scale(.86);
  filter: drop-shadow(0 1px 1px rgba(29,64,116,.16));
}

/* Personal feed settings: the home surfaces, with a scrollable body and fixed actions. */
.header-refine #feedCategorySheet {
  background: rgba(25,43,80,.3);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.header-refine .feed-category-sheet {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 16px - var(--app-safe-top));
  padding: 12px 0 0;
  overflow: hidden;
  border-radius: 28px 28px 0 0;
  background: #f3f7fc;
  color: #192b50;
  box-shadow: 0 -8px 32px rgba(25,43,80,.1);
}
.header-refine .feed-category-sheet .sheet-handle {
  flex: none;
  margin-bottom: 12px;
  background: #cad5e5;
}
.header-refine .feed-category-sheet header {
  flex: none;
  align-items: center;
  padding: 0 calc(18px + var(--app-safe-right)) 12px calc(18px + var(--app-safe-left));
}
.header-refine .feed-category-sheet header .section-kicker { display: none; }
.header-refine .feed-category-sheet header h2 { margin: 0; font-size: 22px; }
.header-refine .feed-category-sheet header > button {
  flex: 0 0 44px;
  height: 44px;
  border: 0;
  background: #fff;
  color: #344564;
  box-shadow: 0 2px 6px rgba(56,89,137,.05);
}
.header-refine .feed-settings-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 0 calc(18px + var(--app-safe-right)) 8px calc(18px + var(--app-safe-left));
}
.header-refine .feed-category-sheet .feed-category-hint {
  margin-top: 4px;
  color: #65718a;
  font-size: 12px;
  line-height: 1.45;
}
.header-refine .feed-category-sheet .feed-category-options { margin-top: 0; gap: 8px; }
.header-refine .feed-category-sheet .feed-category-option {
  min-height: 60px;
  padding: 10px 26px 10px 40px;
  border: 1px solid rgba(157,181,218,.23);
  border-radius: var(--category-control-radius);
  background: #fff;
  color: #344564;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: normal;
  box-shadow: 0 2px 5px rgba(56,89,137,.03);
}
.header-refine .feed-category-sheet .feed-category-option::before {
  content: '';
  position: absolute;
  left: 6px;
  top: calc(50% - 16px);
  width: 32px;
  height: 32px;
  background-image: url('/static/assets/category-natural-v4.png');
  background-size: 500% 200%;
  background-position: var(--settings-icon-x) var(--settings-icon-y);
  background-repeat: no-repeat;
  clip-path: inset(3px 2px 1px);
}
.header-refine .feed-category-option[data-feed-category="Бытовая_электроника"] { --settings-icon-x: 25%; --settings-icon-y: 0%; }
.header-refine .feed-category-option[data-feed-category="Для_дома_и_дачи"] { --settings-icon-x: 50%; --settings-icon-y: 0%; }
.header-refine .feed-category-option[data-feed-category="Личные_вещи"] { --settings-icon-x: 75%; --settings-icon-y: 0%; }
.header-refine .feed-category-option[data-feed-category="Хобби_и_отдых"] { --settings-icon-x: 100%; --settings-icon-y: 0%; }
.header-refine .feed-category-option[data-feed-category="Транспорт"] { --settings-icon-x: 0%; --settings-icon-y: 100%; }
.header-refine .feed-category-option[data-feed-category="Недвижимость"] { --settings-icon-x: 25%; --settings-icon-y: 100%; }
.header-refine .feed-category-option[data-feed-category="Услуги"] { --settings-icon-x: 50%; --settings-icon-y: 100%; }
.header-refine .feed-category-option[data-feed-category="Для_бизнеса"] { --settings-icon-x: 75%; --settings-icon-y: 100%; }
.header-refine .feed-category-sheet .feed-category-option[data-feed-category="Животные"]::before {
  background-image: url('/static/assets/category-cat-v1.png');
  background-size: contain;
  background-position: center;
}
.header-refine .feed-category-sheet .feed-category-option[data-feed-category="Детское"]::before {
  background-image: url('/static/assets/category-kids-v2.png');
  background-size: contain;
  background-position: center;
  clip-path: none;
}
.header-refine .feed-category-sheet .feed-category-option::after {
  right: 10px;
  width: 16px;
  height: 16px;
  border: 1px solid #b7c6db;
  border-radius: 5px;
}
.header-refine .feed-category-sheet .feed-category-option[aria-pressed="true"] {
  border-color: rgba(70,131,232,.3);
  background: #eaf2ff;
  color: #213c75;
}
.header-refine .feed-category-sheet .feed-category-option[aria-pressed="true"]::after {
  border-color: transparent;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='m4.5 9 3 3 6-6' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), var(--home-candy-fill);
  box-shadow: none;
}
.header-refine .feed-category-sheet .feed-seen-option {
  gap: 12px;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid rgba(157,181,218,.23);
  border-radius: var(--category-control-radius);
  background: #fff;
}
.header-refine .feed-category-sheet .feed-seen-option strong { font-size: 14px; }
.header-refine .feed-support-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 12px;
  color: var(--blue);
  font: 400 14px/1.4 var(--font-ui);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.header-refine .feed-category-sheet .feed-seen-option .feed-category-hint { margin-top: 4px; }
.header-refine .feed-category-sheet .feed-seen-switch { background: #bac7da; }
.header-refine .feed-category-sheet .feed-seen-switch::after { background: #fff; }
.header-refine .feed-category-sheet .feed-seen-option input:checked + .feed-seen-switch {
  background: var(--home-candy-fill);
  box-shadow: var(--home-candy-shadow);
}
.header-refine .feed-category-sheet #feedCategoryError {
  flex: none;
  margin: 8px calc(18px + var(--app-safe-right)) 0 calc(18px + var(--app-safe-left));
  padding: 12px;
  border-radius: 12px;
  background: #fff0ee;
  color: #a12b20;
}
.header-refine .feed-category-sheet .feed-category-actions {
  flex: none;
  margin-top: 0;
  padding: 14px calc(18px + var(--app-safe-right)) calc(16px + var(--app-safe-bottom)) calc(18px + var(--app-safe-left));
  gap: 8px;
  border-top: 1px solid rgba(157,181,218,.16);
  background: #f3f7fc;
}
.header-refine .feed-category-sheet .feed-category-actions button {
  min-height: 48px;
  padding: 10px;
  border: 0;
  border-radius: var(--category-control-radius);
  background: #fff;
  color: #344564;
  font-size: 13px;
  line-height: 1.3;
}
.header-refine .feed-category-sheet .feed-category-actions .feed-category-save {
  background: var(--home-candy-fill);
  box-shadow: var(--home-candy-shadow);
  color: #fff;
}
.header-refine .feed-category-sheet button:active:not(:disabled) { filter: brightness(.96); }
.header-refine .feed-category-sheet button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
@media (max-width: 374px) {

  .header-refine .feed-category-sheet .feed-category-options { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {

  .header-refine .feed-category-sheet { animation: none; }
}

/* Listing detail: the same quiet surfaces and candy action as the feed. */
.header-refine .detail-view {
  color: var(--ink);
  --ink: #192b50;
  --muted: #65718a;
  --paper: #f3f7fc;
  --white: #fff;
  background: #f3f7fc;
  scroll-padding-bottom: calc(96px + var(--app-safe-bottom));
}
.header-refine .detail-shell { padding-bottom: 0; }
.header-refine #detailSwipeEdge { bottom: calc(84px + var(--app-safe-bottom)); }
.header-refine .detail-topbar { background: linear-gradient(#f3f7fc 72%, transparent); }
.header-refine .detail-back {
  width: 44px;
  height: 44px;
  border: 0;
  background: #fff;
  color: #344564;
  box-shadow: 0 2px 6px rgba(56,89,137,.05);
  font-weight: 600;
}
.header-refine .detail-main {
  margin-inline: calc(18px + var(--app-safe-left)) calc(18px + var(--app-safe-right));
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.header-refine .detail-gallery-wrap {
  height: auto;
  min-height: 0;
  aspect-ratio: var(--detail-preview-ratio, 1);
  border-radius: 24px;
  background: #eaf0f8;
}
.header-refine .detail-gallery-wrap[data-photo-layout="landscape"] { --detail-preview-ratio: 3 / 2; }
.header-refine .detail-gallery-wrap[data-photo-layout="portrait"] { --detail-preview-ratio: 4 / 5; }
.header-refine .detail-gallery-wrap[data-photo-layout="square"] { --detail-preview-ratio: 1; }
.header-refine .detail-gallery-wrap:has(.detail-placeholder) {
  height: 180px;
  aspect-ratio: auto;
}
.header-refine .detail-photo { object-fit: cover; object-position: center; background: #eaf0f8; }
.header-refine .detail-placeholder { background: #eaf0f8; color: #65718a; }
.header-refine .detail-placeholder span {
  padding: 0;
  background: transparent;
  box-shadow: none;
  font: 500 13px/1.4 var(--font-ui);
  text-transform: none;
  letter-spacing: normal;
}
.header-refine .detail-photo-counter {
  top: auto;
  right: auto;
  bottom: 12px;
  left: 12px;
  color: #344564;
  background: rgba(255,255,255,.92);
  font: 600 12px/1.3 var(--font-ui);
  padding: 6px 10px;
}

.header-refine .detail-thumbnails {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(44px, calc((100% - 32px) / 5), 104px);
  justify-content: start;
  gap: 8px;
  margin-top: 8px;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: none;
  touch-action: pan-x;
  scrollbar-width: none;
}

.header-refine .detail-thumbnails[hidden] { display: none; }
.header-refine .detail-thumbnails::-webkit-scrollbar { display: none; }

.header-refine .detail-thumbnail {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  touch-action: pan-x;
}

.header-refine .detail-thumbnail img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  background: #eaf0f8;
}

.header-refine .detail-view .detail-thumbnail:focus {
  outline: none;
}

.header-refine .detail-view .detail-thumbnail:not(.is-pointer-focus):focus-visible {
  outline: 2px solid #192b50;
  outline-offset: -2px;
}
.header-refine .detail-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}
.header-refine :is(.detail-seller-profile, .detail-description) {
  border: 1px solid rgba(157,181,218,.17);
  border-radius: var(--category-control-radius);
  background: #fff;
  box-shadow: 0 2px 4px rgba(56,89,137,.03), 0 6px 16px rgba(56,89,137,.04);
}
.header-refine .detail-meta {
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}
.header-refine .detail-category-link {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.header-refine .detail-category-link:disabled {
  padding-inline: 0;
  background: transparent;
  color: var(--muted);
  cursor: default;
}
.header-refine .detail-category-link:not(:disabled)::after {
  content: '';
  flex: none;
  width: 4px;
  height: 4px;
  margin-left: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translateY(1px) rotate(45deg);
}
.header-refine :is(.detail-back, .complaint-sheet header > button) svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header-refine .detail-category-link:not(:disabled):active { color: var(--blue); }
.header-refine .seller-view button:focus-visible,
.header-refine .complaint-sheet :is(button, textarea):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.header-refine .detail-meta time { white-space: nowrap; }
.header-refine .detail-seller-profile { margin: 0; padding: 14px; gap: 10px; }
.header-refine .detail-seller-profile .seller-avatar {
  border-radius: 50%;
  background: #eaf2ff;
  color: var(--blue);
  box-shadow: none;
  font-size: 18px;
}
.header-refine .detail-seller-profile .seller-profile-copy small {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}
.header-refine .detail-seller-profile .seller-profile-copy strong { font-size: 14px; font-weight: 600; }
.header-refine .detail-seller-profile .seller-listing-count { font-size: 11px; font-weight: 400; }
.header-refine .detail-description { margin: 0; padding: 16px; }
.header-refine .detail-description > p { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.header-refine .detail-primary-actions {
  position: sticky;
  z-index: 6;
  left: auto;
  bottom: 0;
  transform: none;
  width: 100%;
  margin-top: 16px;
  grid-template-columns: minmax(0,1fr) 48px 48px;
  padding: 12px calc(18px + var(--app-safe-right)) calc(12px + var(--app-safe-bottom)) calc(18px + var(--app-safe-left));
  border-top: 1px solid rgba(157,181,218,.16);
  background: #f3f7fc;
}
.header-refine .detail-primary-actions :is(.seller-button, .detail-action-button) {
  min-height: 48px;
  border: 0;
  border-radius: var(--category-control-radius);
  font-weight: 600;
}
.header-refine .detail-primary-actions .seller-button {
  background: var(--home-candy-fill);
  box-shadow: var(--home-candy-shadow);
  color: #fff;
}
.header-refine .detail-primary-actions .seller-button:disabled { background: #dce6f6; color: #65718a; opacity: 1; box-shadow: none; }
.header-refine .detail-primary-actions .detail-action-button { background: #fff; color: #344564; box-shadow: none; }
.header-refine .detail-primary-actions .detail-action-button.active {
  background: #e4edff;
  color: var(--blue);
}
.header-refine .detail-content .original-link {
  min-height: 44px;
  margin-top: 0;
  border: 1px solid rgba(157,181,218,.25);
  border-radius: var(--category-control-radius);
  background: #fff;
  color: #344564;
  font-size: 13px;
  font-weight: 600;
}
.header-refine .detail-report-link { min-height: 44px; margin: 0 auto; font-size: 12px; font-weight: 400; }
.header-refine .detail-view button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (max-width: 359px) {

  .header-refine .detail-seller-profile { grid-template-columns: 36px minmax(0,1fr) 16px; }
  .header-refine .detail-seller-profile .seller-avatar { width: 36px; height: 36px; }
  .header-refine .detail-seller-profile .seller-listing-count { display: none; }
}

/* Catalog: photographic entrances, followed by the existing taxonomy. */
html.header-refine:has(body:is(.catalog-screen,.utility-screen):not(.detail-open)) { background: #f3f7fc; }
.header-refine body:is(.catalog-screen,.utility-screen) {
  --ink: #192b50;
  --muted: #65718a;
  --paper: #f3f7fc;
  --white: #fff;
  --line: rgba(157,181,218,.22);
  background:
    radial-gradient(ellipse at 100% 0, rgba(163,224,210,.35), transparent 340px),
    radial-gradient(ellipse at 0 60px, rgba(174,211,251,.35), transparent 320px),
    #f3f7fc;
}
.header-refine .catalog-screen .topbar {
  min-height: 0;
  align-items: stretch;
  padding: calc(var(--app-safe-top) + 16px) 0 16px;
}
.header-refine .catalog-masthead { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; }
.header-refine .catalog-masthead[hidden] { display: none; }
.header-refine .catalog-masthead h1 {
  margin: 0;
  font: 700 clamp(26px, 7vw, 34px)/1.15 var(--font-ui);
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
/* Small, non-interactive titles share the gap between Telegram controls.
   Browser/desktop clients receive a separate row instead of assumed controls. */
.header-refine :is(.catalog-root-screen,.catalog-results,.utility-screen,.search-focused) .topbar {
  height: var(--compact-header-bottom, calc(var(--app-safe-top) + 52px));
  min-height: 0;
  padding: 0;
}
.header-refine .catalog-root-screen .catalog-masthead,
.header-refine .compact-page-title {
  position: absolute;
  top: var(--compact-title-center, 26px);
  left: 50%;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: max(80px, calc(100vw - 216px));
  margin: 0;
  text-align: center;
  pointer-events: none;
}
.header-refine .catalog-root-screen .catalog-masthead { align-items: center; }
.header-refine .catalog-root-screen .catalog-masthead h1,
.header-refine .compact-page-title {
  font: 600 clamp(12px, 4vw, 16px)/1.25 var(--font-ui);
  letter-spacing: -.015em;
  color: var(--ink);
}
.header-refine .compact-page-title[hidden] { display: none; }
.header-refine .utility-screen .search-panel { display: none; }
.header-refine .utility-summary {
  margin: 4px 0 16px;
  color: var(--muted);
  font: 400 13px/1.5 var(--font-ui);
}
.header-refine .utility-summary[hidden] { display: none; }
.header-refine .search-history {
  max-height: min(320px, 45vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 10px;
  padding: 8px;
  border-radius: var(--category-control-radius);
  background: rgba(255,255,255,.96);
  color: var(--nav-ink);
}
.header-refine .search-history[hidden] { display: none; }
.header-refine .search-history > p { margin: 8px 12px; font-size: 13px; color: #65718a; }
.header-refine .search-history-row { display: grid; grid-template-columns: minmax(0,1fr) 44px; gap: 8px; }
.header-refine .search-history-row button {
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font: 400 15px/1.4 var(--font-ui);
  color: inherit;
}
.header-refine .search-history-query { text-align: left; overflow-wrap: anywhere; }
.header-refine .search-history-remove { display: grid; place-items: center; color: var(--muted); }
.header-refine .search-history-remove svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
/* Editing is a separate mode; moving focus to history must not reveal the feed. */
.header-refine body.search-focused:not(.detail-open) .topbar {
  height: var(--compact-header-bottom, calc(var(--app-safe-top) + 52px));
  min-height: 0;
  padding: 0;
}
.header-refine body.search-focused:not(.detail-open) .topbar::before { display: none; }
.header-refine .search-focused :is(.home-wordmark,.header-category-wrap,.feed-search-actions,.listing-toolbar,.active-filter) { display: none !important; }
.header-refine .search-focused .shell > main,
.header-refine .search-focused > .bottom-nav { display: none !important; }
.header-refine .search-focused .search-history { max-height: none; }
.header-refine .search-focused .search-panel { padding-bottom: 20px; }

.header-refine .search-history-row button:active { background: #e3ecf8; }
.header-refine .utility-screen .saved-list { gap: 12px; margin: 0; }
.header-refine .utility-screen .saved-card {
  gap: 8px;
  padding: 8px;
  border: 0;
  border-radius: var(--category-control-radius);
  background: rgba(255,255,255,.9);
  box-shadow: 0 3px 12px rgba(45,75,113,.035);
}
.header-refine .utility-screen .saved-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 72px;
  padding: 12px 4px 12px 8px;
  border-radius: 14px;
  color: var(--ink);
}
.header-refine .saved-query-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.header-refine .saved-copy { min-width: 0; overflow-wrap: anywhere; }
.header-refine .utility-screen .saved-main strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.35;
}
.header-refine .utility-screen .saved-main small {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.45;
}
.header-refine .utility-screen .saved-delete {
  width: 44px;
  height: 44px;
  border: 0 !important;
  border-radius: 14px;
  color: var(--muted);
  background: #edf2f8;
}
.header-refine .utility-screen .saved-card button:active { background: #e3ecf8; }
.header-refine .utility-screen .saved-empty {
  gap: 10px;
  padding: 24px;
  border-radius: var(--category-control-radius);
  background: rgba(255,255,255,.9);
  font-size: 14px;
  line-height: 1.5;
}
.header-refine .catalog-results #sectionHead > div:first-child { display: none; }
.header-refine .catalog-results #sectionHead {
  display: grid;
  grid-template-columns: minmax(0,1fr) max-content;
  align-items: start;
  gap: 8px;
  padding: 16px 0 12px;
}
.header-refine .catalog-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.header-refine .catalog-filter-actions[hidden] { display: none; }
.header-refine .catalog-results #resultActions {
  grid-column: 2;
  grid-row: 1;
  width: auto;
  min-width: 0;
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.header-refine .catalog-results #sortControl {
  width: auto;
  min-height: 44px;
  padding: 0;
  gap: 6px;
  justify-content: flex-end;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.header-refine .catalog-results #sortControl::after { content: none; }
.header-refine .catalog-results #sortSelect {
  width: auto;
  min-width: 0;
  max-width: 72px;
  padding: 0;
  font: 600 13px/1.4 var(--font-ui);
  text-align: right;
  text-align-last: right;
}
.header-refine .catalog-results #sortControl svg { width: 16px; height: 16px; }
.header-refine .catalog-screen .search-form {
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 28px;
  background: rgba(255,255,255,.82);
  box-shadow: inset 0 1px 0 #fff, 0 5px 20px rgba(65,100,160,.05);
}
.header-refine .catalog-screen .search-submit {
  border-radius: 50%;
  color: #fff;
  background: var(--home-candy-fill);
  box-shadow: var(--home-candy-shadow);
}
.header-refine .catalog-screen .catalog-panel {
  margin-top: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
}
.header-refine .catalog-screen .catalog-intro { display: none; }
.header-refine .catalog-screen .category-list {
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  padding: 0;
}
.header-refine .catalog-cover {
  position: relative;
  display: block;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--category-control-radius);
  background: #344564;
  color: #fff;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}
.header-refine .catalog-cover img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #eaf0f8;
}
.header-refine .catalog-cover::after {
  content: '';
  position: absolute;
  inset: 36% 0 0;
  background: linear-gradient(to bottom, transparent, rgba(15,25,39,.22) 36%, rgba(15,25,39,.78));
  pointer-events: none;
}
.header-refine .catalog-cover > span {
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  display: block;
  padding: 12px;
  font: 600 clamp(14px, 3.8vw, 17px)/1.25 var(--font-ui);
  text-align: left;
  text-shadow: 0 1px 2px rgba(15,25,39,.3);
  overflow-wrap: anywhere;
}
.header-refine .catalog-screen .category-list.catalog-subcategories { grid-template-columns: minmax(0,1fr); gap: 12px; }
.header-refine .catalog-section-rows {
  overflow: hidden;
  border-radius: var(--category-control-radius);
  background: rgba(255,255,255,.86);
}
.header-refine .catalog-subcategory {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 14px;
  min-height: 68px;
  padding: 12px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #344564;
  font: 500 15px/1.4 var(--font-ui);
  text-align: left;
  cursor: pointer;
}
.header-refine .catalog-section-rows .catalog-subcategory + .catalog-subcategory {
  border-top: 1px solid rgba(52,69,100,.09);
}
.header-refine .catalog-option-copy { display: block; flex: 1; min-width: 0; }
.header-refine .catalog-option-label { display: block; overflow-wrap: anywhere; }
.header-refine .catalog-option-count {
  display: block;
  min-height: 17px;
  margin-top: 2px;
  color: #66748a;
  font: 400 12px/1.4 var(--font-ui);
  font-variant-numeric: tabular-nums;
}
.header-refine :is(.catalog-option-icon, .catalog-option-arrow) {
  flex: none;
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header-refine .catalog-option-arrow { width: 18px; height: 18px; }
.header-refine .catalog-subcategory.catalog-all {
  border: 0;
  border-radius: var(--category-control-radius);
  background: var(--home-candy-fill);
  box-shadow: var(--home-candy-shadow);
  color: #fff;
  font-weight: 600;
}
.header-refine .catalog-all .catalog-option-count { color: #fff; }
.header-refine :is(.catalog-cover, .catalog-subcategory):active { filter: brightness(.97); }
.header-refine :is(.catalog-cover, .catalog-subcategory):focus-visible { outline: 2px solid #192b50; outline-offset: 2px; }

/* Outside Telegram a small Back control replaces the unavailable native one. */
.header-refine .search-mode-back { display: none; }
.header-refine:not(.telegram-native-back) .search-focused .search-mode-back {
  display: grid;
  place-items: center;
  position: absolute;
  left: 0;
  top: var(--compact-title-center, 26px);
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.8);
  color: var(--ink);
}
.header-refine .search-mode-back svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* Controls are actions, never text-selection targets on mobile WebKit. */
.header-refine :is(button,.sort-control,.active-filter,.feed-filter-reset) {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.header-refine :is(.feed-filter-reset,#activeFilter button) svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.header-refine .feed-filter-reset > span:last-child { display: inline-flex; }
/* Real select overlays a tightly grouped icon and label; no intrinsic option gap. */
.header-refine #sortControl { position: relative; }
.header-refine #sortControl .sort-current-value {
  font: 600 13px/20px var(--font-ui);
  white-space: nowrap;
  pointer-events: none;
}
.header-refine body #sortControl #sortSelect {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  padding: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
/* Use the feed's compact controls in query results; keep 44px touch extents. */
.header-refine .catalog-results #sectionHead { padding-block: 10px 12px; }
.header-refine .catalog-results .catalog-filter-actions { padding-block: 6px; }
.header-refine .catalog-results .feed-search-actions .text-button {
  position: relative;
  min-height: 32px;
}
.header-refine .catalog-results .feed-search-actions .text-button::after {
  content: '';
  position: absolute;
  inset: -6px 0;
}
.header-refine[data-focus-input="keyboard"] #sortControl:has(select:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: var(--category-control-radius);
}

.header-refine .home-candy.header-refine-filtered > .shell #sortControl { width: auto; }

.header-refine .utility-screen .saved-notifications {
  border:0; border-radius:14px; color:var(--muted); background:#edf2f8;
}
.header-refine .utility-screen .saved-notifications[aria-pressed="true"] {
  color:var(--blue); background:#e5eeff;
}

.header-refine .header-category-wrap:has(.header-categories[aria-busy="true"]) { min-height: 82px; }

/* Keep the original complaint panel attached to the keyboard, scrolling its contents. */
#complaintSheet.is-writing {
  top: var(--complaint-viewport-top, 0px);
  bottom: auto;
  height: var(--complaint-viewport-height, 100dvh);
  padding-top: var(--app-safe-top);
  align-items: flex-end;
}
#complaintSheet.is-writing .complaint-sheet {
  height: var(--complaint-panel-height);
  max-height: 100%;
  overscroll-behavior-y: contain;
  scroll-behavior: auto;
}
#complaintSheet.is-writing.has-keyboard .complaint-sheet { padding-bottom: 12px; }
#complaintSheet.is-writing textarea {
  min-height: 48px;
  height: clamp(48px, calc(var(--complaint-viewport-height, 100dvh) - var(--app-safe-top) - 140px), 104px);
  resize: none;
}

/* The detail layer is visible while its cancellable request is pending. */
.detail-view.is-request-pending .detail-main,
.detail-view.is-request-pending .detail-primary-actions { display: none; }
.detail-request-state { margin: 24px 12px; min-height: 140px; }
.detail-request-state button { grid-column: 2; justify-self: start; }
