:root {
  --bg: #ffffff;
  --text: #050505;
  --muted: #6f6f73;
  --soft: #f5f5f6;
  --line: #ececec;
  --line-strong: #dedede;
  --selected: #078b42;
  --shadow-soft: 0 18px 42px rgba(0, 0, 0, 0.11);
  --page-x: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  overflow-x: clip;
  overscroll-behavior-x: none;
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  position: relative;
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

input {
  min-width: 0;
  border: 0;
  background: transparent;
  outline: 0;
}

.app-shell {
  --app-padding-top: max(20px, env(safe-area-inset-top));
  --app-padding-bottom: max(108px, calc(env(safe-area-inset-bottom) + 98px));
  width: min(100%, 430px);
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  margin: 0 auto;
  padding: var(--app-padding-top) var(--page-x) var(--app-padding-bottom);
  background: var(--bg);
}

.telegram-webapp .app-shell {
  --app-padding-top: max(18px, calc(env(safe-area-inset-top) + 12px));
}

.app-shell:has(.alerts-screen:not([hidden])) {
  min-height: 0;
  padding-bottom: 0;
}

.screen[hidden],
[hidden] {
  display: none !important;
}

.explore-segment {
  width: 100%;
  height: 47px;
  padding: 1px;
  border: 1px solid #e8e8e8;
  border-radius: 999px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  background: #fff;
}

.segment-button {
  height: 43px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: 0;
}

.segment-button.active {
  background: #000;
  color: #fff;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.18);
}

.explore-pane {
  padding-top: 22px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 63px;
  gap: 17px;
  align-items: center;
}

.search-box {
  height: 58px;
  min-width: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 18px;
  background: #f4f4f5;
  color: #68686d;
}

.search-box svg,
.bookmark-button svg,
.collapse-button svg,
.channel-hint svg,
.nav-item svg,
.icon-button svg,
.track-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-box svg {
  width: 27px;
  height: 27px;
  stroke-width: 1.8;
  flex: 0 0 auto;
}

.search-box input {
  width: 100%;
  font-size: 18px;
  font-weight: 430;
}

.search-box input::placeholder {
  color: #68686d;
  opacity: 1;
}

.bookmark-button {
  width: 63px;
  height: 58px;
  border: 1px solid #e6e6e6;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #55565b;
  background: #fff;
}

.bookmark-button svg {
  width: 27px;
  height: 27px;
  stroke-width: 1.9;
}

.collections-section {
  padding-top: 22px;
}

.section-title-row {
  display: flex;
  align-items: center;
  min-height: 29px;
}

.section-title-row h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1;
  font-weight: 780;
  letter-spacing: 0;
}

.collapse-button {
  width: 46px;
  height: 40px;
  margin-right: -6px;
  display: grid;
  place-items: center;
  color: #111;
}

.collapse-button svg {
  width: 27px;
  height: 27px;
  stroke-width: 2.25;
}

.collection-strip {
  width: calc(100% + var(--page-x));
  margin: 0 calc(-1 * var(--page-x)) 0 0;
  padding: 12px var(--page-x) 0 0;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.collection-strip::-webkit-scrollbar {
  display: none;
}

.collection-card {
  position: relative;
  /* Wide enough for the longest untranslated name ("Alternative") to sit on
     one line without ellipsis. */
  flex: 0 0 106px;
  height: 182px;
  min-height: 0;
  border-radius: 23px;
  overflow: hidden;
  scroll-snap-align: start;
}

.collection-card.selected {
  z-index: 1;
}

.collection-card.selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #242424;
  border-radius: 23px;
  box-shadow: inset 0 0 0 2px #fff;
  pointer-events: none;
}

.collection-label {
  position: absolute;
  z-index: 3;
  left: 6px;
  right: 6px;
  bottom: 50px;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.012em;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

.store-collection-card .collection-label,
.store-collection-card.selected .collection-label {
  bottom: 20px;
}

.store-source-filters {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: var(--space-section);
}

.store-source-filter {
  min-width: 66px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  font-weight: 620;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease,
    transform 160ms cubic-bezier(.2, .7, .2, 1), box-shadow 160ms ease;
}

.store-source-filter.active {
  border-color: var(--text);
  background: var(--text);
  color: #fff;
  box-shadow: 0 5px 12px rgba(17, 17, 20, 0.14);
}

.store-source-filter:active {
  transform: scale(0.95);
}

.store-directory {
  min-height: 190px;
  margin-top: var(--space-micro);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 30px 20px;
  text-align: center;
}

.store-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--text);
}

.store-empty-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.store-directory h2 {
  margin: 14px 0 5px;
  font-family: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 19px;
  line-height: 1.1;
  font-weight: 740;
  letter-spacing: -0.02em;
}

.store-directory p {
  max-width: 280px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 430;
}

.channel-section {
  min-height: 222px;
}

.empty-state {
  min-height: 222px;
  display: grid;
  place-items: center;
  padding: 24px 34px 0;
  color: #6a6a6f;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 520;
  text-align: center;
}

.channel-hint {
  min-height: 47px;
  padding: 12px 0;
  border-bottom: 1px solid #eeeeee;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #6f6f73;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 450;
}

.channel-hint svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.8;
  flex: 0 0 auto;
}

.channel-list {
  display: flex;
  flex-direction: column;
}

.channel-row {
  min-height: 103px;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 105px;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid #eeeeee;
}

.channel-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #050505;
  color: #fff;
  font-size: 11px;
  line-height: 0.95;
  font-weight: 820;
  letter-spacing: 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.channel-avatar .channel-avatar-label {
  max-width: 100%;
  padding: 0 5px;
}

.channel-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.channel-avatar.tone-1 {
  background: radial-gradient(circle at 38% 28%, #3f3f3f, #070707 68%);
}

.channel-avatar.tone-2 {
  border: 1px solid #e4e4e4;
  background: #fbfbfb;
  color: #111;
}

.channel-avatar.tone-3 {
  background: radial-gradient(circle at 70% 20%, #414141, #080808 58%);
}

.channel-text {
  min-width: 0;
  padding-top: 2px;
}

.channel-text h2 {
  margin: 0 0 3px;
  overflow: hidden;
  color: #111;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-text p {
  margin: 0;
  overflow: hidden;
  color: #707075;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 430;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-row .channel-text h2 {
  margin-bottom: 0;
}

.channel-row .channel-text.has-common-items h2 {
  margin-bottom: 3px;
}

.channel-row .channel-common-items {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted, #707075);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 480;
  letter-spacing: 0.005em;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.track-button {
  justify-self: end;
  width: 97px;
  height: 49px;
  border: 1px solid #e4e4e4;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #fff;
  color: #111;
  font-size: 16px;
  line-height: 1;
  font-weight: 760;
}

.track-button.tracked {
  border-color: #000;
  background: #000;
  color: #fff;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.17);
}

.track-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.6;
}

.store-placeholder,
.placeholder-screen {
  min-height: calc(100vh - 170px);
  display: grid;
  place-content: center;
  text-align: center;
}

.store-placeholder h1,
.placeholder-screen h1 {
  margin: 0 0 8px;
  font-size: 27px;
  line-height: 1.1;
  font-weight: 780;
}

.store-placeholder p,
.placeholder-screen p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(15px, env(safe-area-inset-bottom));
  width: min(calc(100% - 32px), 430px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 73px;
  gap: 18px;
  pointer-events: none;
}

.nav-tray {
  height: 76px;
  padding: 8px;
  border-radius: 999px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.nav-item {
  min-width: 0;
  height: 60px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  color: #56565b;
  font-size: 12px;
  line-height: 1;
  font-weight: 520;
  letter-spacing: 0;
  pointer-events: auto;
}

.nav-item svg {
  width: 29px;
  height: 29px;
  stroke-width: 1.8;
}

.nav-item.active:not(.alert-nav) {
  background: #f0f0f1;
  color: #000;
}

.alert-nav {
  width: 73px;
  height: 73px;
  align-self: center;
  border-radius: 50%;
  background: #111116;
  color: #fff;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.alert-nav.active {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #111116, 0 14px 28px rgba(0, 0, 0, 0.22);
}

.alert-nav svg {
  width: 29px;
  height: 29px;
}

.alerts-screen {
  --alert-action-height: 50px;
  --alert-action-bottom: calc(var(--nav-bottom) + var(--nav-height) + 12px);
  --alert-scroll-end: calc(var(--alert-action-bottom) + var(--alert-action-height) + 10px);
  position: relative;
  height: calc(100vh - var(--app-padding-top));
  height: calc(100dvh - var(--app-padding-top));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.alerts-screen > .primary-action {
  position: absolute;
  z-index: 1;
  inset: auto 0 var(--alert-action-bottom);
  height: var(--alert-action-height);
  min-height: var(--alert-action-height);
  margin-top: 0;
}

.alert-scroll-content {
  width: calc(100% + var(--page-x));
  margin-right: calc(-1 * var(--page-x));
  padding-right: var(--page-x);
  padding-bottom: var(--alert-scroll-end);
  scroll-padding-bottom: var(--alert-scroll-end);
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}

.alert-scroll-content::-webkit-scrollbar {
  display: none;
}

.alerts-title {
  margin: 0;
  font-size: 25px;
  line-height: 1.1;
  text-align: center;
  font-weight: 780;
  letter-spacing: 0;
}

.alert-segment {
  height: 47px;
  margin-top: 21px;
  padding: 1px;
  border: 1px solid #e8e8e8;
  border-radius: 999px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: center;
  background: #fff;
}

.alert-segment-button {
  min-width: 0;
  height: 43px;
  border-radius: 999px;
  background: transparent;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: 0;
}

.alert-segment-button.active {
  background: #000;
  color: #fff;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.18);
}

.alert-step-pane {
  padding-bottom: 18px;
}

.alert-channels-collections {
  padding-top: 18px;
  overflow: visible;
}

.alert-channels-collections h2,
.alert-channels-block h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1;
  font-weight: 780;
  letter-spacing: 0;
}

.alert-collection-strip {
  gap: 10px;
}

.alert-collection-strip .collection-card {
  border-radius: 23px;
}

.alert-collection-strip .collection-card.selected::after {
  inset: 0;
  border-width: 2px;
  border-radius: 23px;
}

.alert-collection-strip .collection-label {
  bottom: 50px;
}

.alert-collection-hint {
  min-height: 47px;
  padding: 12px 0;
  border-bottom: 1px solid #eeeeee;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #6f6f73;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 450;
}

.alert-collection-hint span {
  width: 23px;
  color: #111;
  font-size: 18px;
  line-height: 1;
  text-align: center;
}

.alert-collection-hint p {
  margin: 0;
}

.alert-channels-block {
  padding-top: 18px;
}

.alert-channel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.alert-channel-actions {
  display: inline-flex;
  align-items: center;
  gap: 17px;
  font-size: 16px;
  line-height: 1;
  font-weight: 430;
}

.alert-channel-actions button:first-child {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.alert-channel-actions span {
  width: 1px;
  height: 20px;
  background: #e0e0e0;
}

.alert-channel-list {
  padding-top: 13px;
}

.alert-channel-row {
  min-height: 86px;
  display: grid;
  grid-template-columns: 75px minmax(0, 1fr) 42px;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid #eeeeee;
}

.alert-channel-check {
  justify-self: end;
  width: 32px;
  height: 32px;
  border: 1.5px solid #8a8a8f;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #111;
}

.alert-channel-check.selected {
  border-color: #000;
  background: #000;
  color: #fff;
}

.alert-channel-check svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.7;
}

.alert-empty-state {
  min-height: 160px;
  font-size: 17px;
}

.alert-category-grid {
  margin-top: 19px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.alert-category-card {
  position: relative;
  min-width: 0;
  height: 91px;
  border: 1px solid #eeeeee;
  border-radius: 12px;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 10px 5px 11px;
  background: #fff;
  color: #111;
}

.alert-category-card.active {
  border: 1.8px solid #111;
}

.alert-category-card svg {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.alert-category-card span {
  max-width: 100%;
  overflow: visible;
  font-size: 11.5px;
  line-height: 1.05;
  font-weight: 430;
  text-align: center;
  white-space: nowrap;
}

.alert-category-card em {
  position: absolute;
  top: 13px;
  right: 11px;
  width: 10px;
  font-size: 12px;
  line-height: 1.25;
  font-style: normal;
  font-weight: 430;
  white-space: pre-line;
}

.alert-block {
  padding-top: 19px;
}

.alert-block h2 {
  margin: 0 0 12px;
  font-size: 23px;
  line-height: 1.08;
  font-weight: 780;
  letter-spacing: 0;
}

.alert-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px 14px;
}

.alert-product-button {
  min-width: 0;
  height: 43px;
  border: 1px solid #ededed;
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
  line-height: 1;
  font-weight: 430;
  white-space: nowrap;
}

.alert-product-button.selected {
  border: 1.8px solid #111;
}

.alert-sizes-block {
  padding-top: 19px;
}

.alert-size-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 11px;
}

.alert-size-chip {
  min-width: 0;
  height: 43px;
  border: 1px solid #ededed;
  border-radius: 10px;
  background: #fff;
  font-size: 18px;
  font-weight: 430;
}

.alert-size-chip.selected {
  border: 1.8px solid #111;
}

.alert-price-block {
  padding-top: 19px;
}

.price-row {
  height: 51px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 88px;
  gap: 18px;
  align-items: center;
}

.price-any-button {
  width: 82px;
  height: 51px;
  border: 1px solid #dddddd;
  border-radius: 10px;
  background: #fff;
  font-size: 18px;
  font-weight: 430;
}

.price-any-button.active {
  border-color: #111;
}

.price-slider {
  position: relative;
  height: 32px;
}

.price-slider input {
  --price-progress: 8.16%;
  width: 100%;
  height: 32px;
  margin: 0;
  display: block;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.price-slider input::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background:
    linear-gradient(#000, #000) 0 / var(--price-progress) 100% no-repeat,
    radial-gradient(circle, #d9d9d9 1.7px, transparent 1.9px) var(--price-progress) 50% / 9px 5px repeat-x,
    #efefef;
}

.price-slider input::-webkit-slider-thumb {
  width: 21px;
  height: 21px;
  margin-top: -8px;
  border: 0;
  border-radius: 50%;
  appearance: none;
  background: #000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.price-slider input::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: #efefef;
}

.price-slider input::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: #000;
}

.price-slider input::-moz-range-thumb {
  width: 21px;
  height: 21px;
  border: 0;
  border-radius: 50%;
  background: #000;
}

.price-row.price-any .price-slider input {
  cursor: default;
}

.price-row.price-any .price-slider input::-webkit-slider-runnable-track {
  background:
    linear-gradient(#cfcfcf, #cfcfcf) 0 / var(--price-progress) 100% no-repeat,
    radial-gradient(circle, #dedede 1.7px, transparent 1.9px) var(--price-progress) 50% / 9px 5px repeat-x,
    #f2f2f2;
}

.price-row.price-any .price-slider input::-webkit-slider-thumb {
  background: #c9c9c9;
  box-shadow: none;
}

.price-row.price-any .price-slider input::-moz-range-progress {
  background: #cfcfcf;
}

.price-row.price-any .price-slider input::-moz-range-thumb {
  background: #c9c9c9;
}

.price-value {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: #111;
}

.price-value span {
  font-size: 13px;
  line-height: 1;
  font-weight: 430;
}

.price-value strong {
  font-size: 22px;
  line-height: 1;
  font-weight: 430;
}

.saved-panel {
  display: none;
  min-height: 0;
  margin-top: 6px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.saved-panel.visible {
  display: block;
}

.alerts-screen .saved-panel.visible {
  display: none;
}

.primary-action {
  width: 100%;
  height: 58px;
  margin-top: auto;
  border-radius: 9px;
  background: #000;
  color: #fff;
  font-size: 22px;
  font-weight: 560;
  letter-spacing: 0;
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(101px, calc(env(safe-area-inset-bottom) + 92px));
  transform: translate(-50%, 18px);
  max-width: min(88vw, 360px);
  padding: 12px 16px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 374px) {
  :root {
    --page-x: 14px;
  }

  .app-shell {
    width: 100%;
  }

  .search-row {
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 12px;
  }

  .search-box {
    height: 54px;
    padding: 0 14px;
  }

  .bookmark-button {
    width: 56px;
    height: 54px;
  }

  .collection-strip {
    gap: 9px;
  }

  .collection-card {
    flex-basis: 100px;
    height: 174px;
  }

  .collection-label {
    font-size: 12.5px;
  }

  .channel-row {
    grid-template-columns: 58px minmax(0, 1fr) 86px;
    gap: 10px;
  }

  .channel-avatar {
    width: 52px;
    height: 52px;
    font-size: 10px;
  }

  .channel-text h2 {
    font-size: 18px;
  }

  .channel-text p {
    font-size: 15px;
  }

  .track-button {
    width: 84px;
    height: 46px;
    font-size: 15px;
  }

  .bottom-nav {
    width: min(calc(100% - 20px), 430px);
    grid-template-columns: minmax(0, 1fr) 66px;
    gap: 10px;
  }

  .nav-tray {
    height: 70px;
    padding: 7px;
  }

  .nav-item {
    height: 56px;
  }

  .alert-nav {
    width: 66px;
    height: 66px;
  }

  .alert-segment {
    gap: 10px;
  }

  .alert-category-grid {
    gap: 7px;
  }

  .alert-category-card {
    height: 86px;
    padding-right: 3px;
    padding-left: 3px;
  }

  .alert-category-card span {
    font-size: 10px;
  }

  .alert-product-grid {
    gap: 10px;
  }

  .alert-product-button {
    font-size: 15px;
  }

  .alert-size-row {
    gap: 8px;
  }

  .price-row {
    grid-template-columns: 74px minmax(0, 1fr) 78px;
    gap: 12px;
  }

  .price-any-button {
    width: 74px;
  }

  .price-value strong {
    font-size: 20px;
  }
}

/* Unified Explore / Alerts interface */
:root {
  --bg: #ffffff;
  --text: #111114;
  --muted: #74747c;
  --soft: #f3f3f5;
  --line: #e7e7ea;
  --line-strong: #d7d7dc;
  --shadow-soft: 0 16px 40px rgba(17, 17, 20, 0.1);
  --page-x: 16px;
  --space-micro: 8px;
  --space-control: 12px;
  --space-section: 16px;
  --nav-bottom: max(10px, env(safe-area-inset-bottom));
  --nav-height: 72px;
}

body {
  color: var(--text);
  font-family: "SF Pro Text", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "kern" 1, "ss01" 1;
}

.planet-stage {
  position: relative;
  width: 100%;
}

.explore-segment,
.alert-segment {
  height: 50px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(17, 17, 20, 0.04);
}

.segment-button,
.alert-segment-button {
  height: 42px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 680;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.segment-button.active,
.alert-segment-button.active {
  background: var(--text);
  box-shadow: 0 5px 14px rgba(17, 17, 20, 0.14);
}

.explore-pane {
  padding-top: var(--space-section);
}

.search-row {
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 10px;
}

.telegram-search-row {
  grid-template-columns: minmax(0, 1fr);
}

.search-box,
.bookmark-button {
  height: 54px;
  border-radius: 16px;
}

.search-box {
  gap: 12px;
  padding: 0 16px;
  border: 1px solid transparent;
  background: var(--soft);
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.search-box:focus-within {
  border-color: #b9b9c0;
  background: #fcfcfd;
  box-shadow: 0 0 0 3px rgba(17, 17, 20, 0.06);
}

.search-box svg,
.bookmark-button svg {
  width: 23px;
  height: 23px;
}

.search-box input {
  font-size: 16px;
  font-weight: 450;
}

.search-box input:focus-visible {
  outline: 0;
}

.bookmark-button {
  width: 54px;
  border-color: var(--line);
}

.collections-section,
.alert-channels-collections {
  padding-top: var(--space-section);
}

.section-title-row h1,
.alert-channels-collections h2,
.alert-channels-block h2,
.alert-block h2 {
  font-family: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 23px;
  line-height: 1.08;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.collection-strip,
.alert-collection-strip {
  gap: 10px;
  padding-top: var(--space-micro);
}

.collection-card,
.alert-collection-strip .collection-card {
  flex-basis: 94px;
  height: 174px;
  border-radius: 20px;
  transition: transform 180ms ease;
}

.collection-card:active {
  transform: scale(0.975);
}

.collection-card.selected::after,
.alert-collection-strip .collection-card.selected::after {
  inset: 0;
  border: 2px solid var(--text);
  border-radius: 20px;
  box-shadow: inset 0 0 0 2px #fff;
}

.collection-label,
.alert-collection-strip .collection-label {
  bottom: 48px;
  font-size: clamp(13px, 3.7vw, 15px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.channel-section {
  margin-top: var(--space-micro);
}

.channel-hint,
.alert-collection-hint {
  min-height: 40px;
  padding: 7px 2px;
  border-color: var(--line);
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25;
}

.channel-hint svg,
.alert-collection-hint svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.channel-row,
.alert-channel-row {
  min-height: 92px;
  border-color: var(--line);
  gap: 12px;
}

.channel-row {
  grid-template-columns: 60px minmax(0, 1fr) 92px;
}

.alert-channel-row {
  grid-template-columns: 60px minmax(0, 1fr) 38px;
}

.channel-avatar {
  width: 54px;
  height: 54px;
  font-size: 10px;
}

.channel-text {
  padding-top: 0;
}

.channel-text h2 {
  margin-bottom: 3px;
  padding-bottom: 3px;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 740;
  letter-spacing: -0.02em;
}

.channel-text p {
  font-size: 15px;
  line-height: 1.25;
  font-weight: 430;
}

.track-button {
  width: 90px;
  height: 42px;
  border-color: var(--line-strong);
  font-size: 14px;
  font-weight: 680;
  box-shadow: none;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.track-button.tracked {
  border-color: var(--text);
  background: var(--text);
  box-shadow: 0 7px 16px rgba(17, 17, 20, 0.14);
}

.track-button:active,
.alert-channel-check:active {
  transform: scale(0.96);
}

.bottom-nav {
  bottom: var(--nav-bottom);
  width: min(calc(100% - 24px), 414px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 10px;
  align-items: end;
}

.nav-tray {
  position: relative;
  height: var(--nav-height);
  padding: 7px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid rgba(17, 17, 20, 0.06);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(17, 17, 20, 0.12);
  backdrop-filter: blur(20px) saturate(1.25);
  transform-origin: 50% 50%;
}

.nav-active-indicator {
  position: absolute;
  z-index: 0;
  top: 7px;
  left: 7px;
  width: calc((100% - 14px) / 3);
  height: 58px;
  border-radius: 18px;
  background: var(--soft);
  pointer-events: none;
  transform: translateX(100%);
  transition: transform 210ms cubic-bezier(.2, .7, .2, 1), opacity 120ms ease;
  will-change: transform;
}

.nav-active-indicator.hidden {
  opacity: 0;
}

.nav-item,
.alert-nav {
  position: relative;
  z-index: 1;
  width: auto;
  height: 58px;
  border-radius: 18px;
  color: #66666e;
  background: transparent;
  box-shadow: none;
  font-size: 11px;
  font-weight: 570;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.nav-item svg,
.alert-nav svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.9;
}

.nav-item.active:not(.alert-nav) {
  background: transparent;
  color: var(--text);
}

.bottom-nav > .alert-nav {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  box-shadow: 0 12px 26px rgba(17, 17, 20, 0.2);
  pointer-events: auto;
}

.bottom-nav > .alert-nav.active {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--text), 0 12px 26px rgba(17, 17, 20, 0.2);
}

.alert-nav-status {
  position: absolute;
  z-index: 2;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  opacity: 0;
  pointer-events: none;
  animation: alert-nav-status-pulse 2.6s ease-out infinite;
}

.alert-nav.alerts-idle .alert-nav-status {
  border-color: rgba(255, 81, 89, 0.88);
  box-shadow: 0 0 8px rgba(255, 62, 73, 0.42);
}

.alert-nav.alerts-running .alert-nav-status {
  display: none;
}

@keyframes alert-nav-status-pulse {
  0%,
  38% {
    opacity: 0;
    transform: scale(0.96);
  }
  46% {
    opacity: 0.9;
    transform: scale(1);
  }
  68% {
    opacity: 0.32;
    transform: scale(1.08);
  }
  80%,
  100% {
    opacity: 0;
    transform: scale(1.13);
  }
}

.nav-item:active {
  transform: scale(0.97);
}

.page-transitioning .planet-stage {
  overflow: hidden;
  isolation: isolate;
  contain: paint;
}

.page-transition-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  margin: 0;
  pointer-events: none;
  contain: paint;
  will-change: transform, opacity;
}

.page-transition-source {
  z-index: 2;
}

.page-transition-target {
  z-index: 1;
  opacity: 0;
}

.alerts-title {
  margin: 2px 0 0;
  font-family: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 27px;
  line-height: 1.05;
  text-align: left;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.alert-segment {
  margin-top: var(--space-section);
}

.alert-step-pane {
  padding-bottom: 16px;
}

.alert-collection-hint {
  margin-top: var(--space-micro);
}

.alert-channels-block {
  padding-top: 0;
}

.alert-channel-actions {
  gap: 12px;
  font-size: 14px;
}

.alert-channel-actions button {
  min-height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  background: transparent;
  transition: background-color 140ms ease, transform 140ms cubic-bezier(.2, .7, .2, 1);
}

.alert-channel-actions button:first-child {
  text-decoration: none;
}

.alert-channel-actions button:active {
  background: var(--soft);
  transform: scale(0.94);
}

.alert-channel-actions span {
  height: 16px;
  background: var(--line-strong);
}

.alert-channel-list {
  padding-top: 0;
}

.alert-channel-title-row {
  min-height: 44px;
}

.alert-channel-check {
  width: 34px;
  height: 34px;
  border-color: var(--line-strong);
  transition: transform 180ms ease, color 180ms ease, background 180ms ease;
}

.alert-channel-check.selected {
  border-color: var(--text);
  background: var(--text);
}

.alert-category-grid {
  margin-top: var(--space-section);
  gap: var(--space-micro);
}

.alert-block,
.alert-sizes-block,
.alert-price-block {
  padding-top: var(--space-section);
}

.alert-block h2 {
  margin-bottom: var(--space-control);
}

.alert-product-grid {
  gap: var(--space-micro) 10px;
}

.alert-size-row {
  gap: var(--space-micro);
}

.price-row {
  gap: var(--space-control);
}

.alert-category-card,
.alert-product-button,
.alert-size-chip,
.price-any-button {
  border-color: var(--line);
  border-radius: 14px;
  background: #fff;
}

.alert-category-card.active,
.alert-product-button.selected,
.alert-size-chip.selected {
  border-color: var(--text);
  box-shadow: inset 0 0 0 0.5px var(--text);
}

.primary-action {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: 54px;
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--text);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(17, 17, 20, 0.16);
  transition:
    color 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 160ms ease;
}

.primary-action:not(:disabled):active {
  transform: scale(0.985);
}

.primary-action.save-changes {
  box-shadow: 0 8px 20px rgba(17, 17, 20, 0.16);
}

.primary-action.alert-ready {
  border-color: rgba(255, 76, 84, 0.38);
  background: #0b0b0e;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 55, 65, 0.06);
}

.primary-action.alert-channel-ready {
  border-color: rgba(255, 255, 255, 0.16);
  background: #0b0b0e;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.primary-action.alert-ready::before,
.primary-action.alert-channel-ready::before,
.primary-action.alert-running::before {
  content: "";
  position: absolute;
  top: -45%;
  bottom: -45%;
  left: -48%;
  width: 42%;
  pointer-events: none;
  transform: skewX(-18deg);
}

.primary-action.alert-ready::before {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 51, 61, 0.02),
    rgba(255, 72, 80, 0.15),
    rgba(255, 51, 61, 0.02),
    transparent
  );
  filter: blur(4px);
  animation: alert-red-sweep 3s cubic-bezier(.35, 0, .2, 1) infinite;
}

.primary-action.alert-channel-ready::before {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0.02),
    transparent
  );
  filter: blur(3px);
  animation: alert-light-sweep 3s cubic-bezier(.35, 0, .2, 1) infinite;
}

.primary-action.alert-running {
  border-color: rgba(255, 255, 255, 0.10);
  background: #0b0b0e;
  color: #fff;
  box-shadow: none;
}

.primary-action.alert-running::before {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.17),
    rgba(255, 255, 255, 0.02),
    transparent
  );
  filter: blur(3px);
  animation: alert-light-sweep 2.8s cubic-bezier(.35, 0, .2, 1) infinite;
}

.primary-action.alert-ready::after,
.primary-action.alert-running::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 22px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateY(-50%);
  animation: alert-status-dot 1.4s ease-in-out infinite;
}

.primary-action.alert-ready::after {
  background: #ff5159;
  box-shadow: 0 0 9px rgba(255, 62, 73, 0.72);
}

.primary-action.alert-running::after {
  background: #45d46d;
  box-shadow: 0 0 10px rgba(58, 214, 103, 0.80);
}

.primary-action:disabled {
  border-color: transparent;
  background: #d9d9dd;
  color: #8b8b92;
  box-shadow: none;
  cursor: default;
  animation: none;
}

.primary-action:disabled::before,
.primary-action:disabled::after {
  content: none;
}

.primary-action.alert-busy:disabled {
  background: #0b0b0e;
  color: #bfbfc5;
}

@keyframes alert-light-sweep {
  0%,
  18% {
    transform: translateX(0) skewX(-18deg);
  }
  72%,
  100% {
    transform: translateX(365%) skewX(-18deg);
  }
}

@keyframes alert-red-sweep {
  0%,
  16% {
    transform: translateX(0) skewX(-18deg);
  }
  70%,
  100% {
    transform: translateX(365%) skewX(-18deg);
  }
}

@keyframes alert-status-dot {
  0%,
  100% {
    opacity: 0.72;
    transform: translateY(-50%) scale(0.9);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) scale(1.16);
  }
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

@media (max-width: 374px) {
  :root {
    --page-x: 12px;
  }

  .bottom-nav {
    width: min(calc(100% - 16px), 414px);
  }

  .channel-row {
    grid-template-columns: 56px minmax(0, 1fr) 82px;
    gap: 9px;
  }

  .alert-channel-row {
    grid-template-columns: 56px minmax(0, 1fr) 34px;
    gap: 9px;
  }

  .track-button {
    width: 80px;
  }

  .store-source-filters {
    gap: 8px;
  }

  .store-source-filter {
    min-width: 58px;
    padding: 0 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Alerts / Products — saved filter layout */
.alerts-header {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  gap: 12px;
  align-items: start;
  padding-top: 2px;
}

.alerts-heading {
  min-width: 0;
  padding-top: 4px;
}

.alerts-title {
  margin: 0;
  font-size: 34px;
  line-height: 0.98;
  font-weight: 780;
  letter-spacing: -0.045em;
}

.alerts-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.25;
  font-weight: 450;
  /* Wraps instead of being clipped: the Russian subtitle does not fit on one
     line next to the preset picker. */
  overflow-wrap: anywhere;
}

.alert-preset-picker {
  position: relative;
}

.alert-preset-trigger {
  width: 100%;
  height: 64px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  /* Tight icon and chevron columns leave room for "Пресет 1" without an
     ellipsis. */
  grid-template-columns: 22px minmax(0, 1fr) 16px;
  gap: 7px;
  align-items: center;
  background: #fff;
  box-shadow: 0 5px 16px rgba(17, 17, 20, 0.05);
  text-align: left;
}

.alert-preset-icon,
.alert-preset-chevron {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.alert-preset-icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.alert-preset-chevron {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
  transition: transform 160ms ease;
}

.alert-preset-trigger[aria-expanded="true"] .alert-preset-chevron {
  transform: rotate(180deg);
}

.alert-preset-copy,
.alert-preset-option > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.alert-preset-copy strong,
.alert-preset-option strong {
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.3;
  font-weight: 680;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-preset-copy small,
.alert-preset-option small {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1;
  font-weight: 450;
}

.alert-preset-menu {
  position: absolute;
  z-index: 20;
  top: 70px;
  right: 0;
  width: 178px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(17, 17, 20, 0.14);
  backdrop-filter: blur(18px);
}

.alert-preset-option {
  width: 100%;
  min-height: 54px;
  border-radius: 12px;
  display: grid;
  align-items: center;
  text-align: left;
}

.alert-preset-option {
  grid-template-columns: minmax(0, 1fr) 20px;
  gap: 10px;
  padding: 9px 10px;
}

.alert-preset-option.active {
  background: var(--soft);
}

.alert-preset-option svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  opacity: 0;
}

.alert-preset-option.active svg {
  opacity: 1;
}

.alert-segment {
  margin-top: 18px;
}

#alertProductsPane {
  padding-bottom: 8px;
}

.alert-category-grid {
  margin-top: 15px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px 3px;
}

.alert-category-card {
  height: 34px;
  grid-column: span 2;
  border: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  padding: 0 3px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1;
  font-weight: 660;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 150ms ease, background-color 150ms ease;
}

.alert-category-card:nth-child(4) {
  grid-column: 2 / span 2;
}

.alert-category-card:nth-child(5) {
  grid-column: 4 / span 2;
}

.alert-category-card.active {
  border: 0;
  background: var(--soft);
  color: var(--text);
  box-shadow: none;
}

.alert-product-grid {
  margin-top: 15px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  padding-bottom: 12px;
}

.alert-product-group {
  margin: 16px 0 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.alert-product-group:first-child {
  margin-top: 0;
}

.alert-product-card {
  width: 100%;
  min-height: 66px;
  padding: 7px 11px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 43px;
  gap: 10px;
  align-items: center;
  background: #fff;
  box-shadow: 0 7px 22px rgba(17, 17, 20, 0.045);
  text-align: left;
  transition:
    border-color 260ms ease,
    box-shadow 280ms cubic-bezier(.22, 1, .36, 1),
    background-color 260ms ease;
}

.alert-product-card.selected {
  border-color: var(--line-strong);
  box-shadow: 0 9px 25px rgba(17, 17, 20, 0.065);
}

.alert-product-icon {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #fff;
}

.alert-product-icon img {
  display: block;
  width: 39px;
  height: 39px;
  object-fit: contain;
}

.alert-product-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 6px;
}

.alert-product-copy strong {
  overflow: hidden;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 750;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-product-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.3;
  font-weight: 450;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-product-actions {
  height: 48px;
  display: grid;
  justify-items: end;
  align-content: space-between;
}

.alert-product-toggle {
  width: 42px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  display: block;
  padding: 3px;
  background: #d8d8dc;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 20, 0.025);
  transition:
    background-color 260ms ease,
    box-shadow 260ms ease,
    transform 160ms ease;
}

.alert-product-toggle > span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: block;
  background: #fff;
  box-shadow: 0 1px 3px rgba(17, 17, 20, 0.2);
  transform: translateX(0);
  transition:
    transform 320ms cubic-bezier(.22, 1, .36, 1),
    box-shadow 220ms ease;
  will-change: transform;
}

.alert-product-toggle:active {
  transform: scale(0.96);
}

.alert-product-card.selected .alert-product-toggle {
  background: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 12px rgba(17, 17, 20, 0.12);
}

.alert-product-card.selected .alert-product-toggle > span {
  transform: translateX(18px);
  box-shadow: 0 2px 5px rgba(17, 17, 20, 0.22);
}

.alert-product-expand {
  width: 32px;
  height: 27px;
  margin-right: -2px;
  border-radius: 9px;
  display: grid;
  place-items: center;
}

.alert-product-expand svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.alert-product-expand:active {
  background: var(--soft);
}

.primary-action {
  height: 50px;
  min-height: 50px;
  margin-top: 10px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 720;
  box-shadow: 0 9px 22px rgba(17, 17, 20, 0.18);
}

.product-filter-open {
  overflow: hidden;
}

.channel-detail-open {
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.channel-detail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.34);
  backdrop-filter: blur(5px);
  animation: channel-detail-fade 190ms ease both;
}

.channel-detail-backdrop {
  z-index: 50;
}

.channel-detail-sheet {
  position: fixed;
  z-index: 51;
  left: 50%;
  bottom: 0;
  width: min(100%, 430px);
  height: min(94dvh, 900px);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 30px 30px 0 0;
  overflow: hidden;
  background: var(--surface, #fff);
  box-shadow: 0 -26px 74px rgba(5, 5, 5, 0.2);
  transform: translateX(-50%);
  animation: channel-detail-sheet-in 260ms cubic-bezier(.2, .78, .2, 1) both;
}

.channel-detail-sheet:focus {
  outline: 0;
}

.channel-detail-sheet.dragging {
  transition: none;
  user-select: none;
}

.channel-detail-handle {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 50%;
  width: 82px;
  height: 27px;
  transform: translateX(-50%);
  touch-action: none;
  cursor: grab;
}

.channel-detail-handle::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 38px;
  height: 5px;
  border-radius: 999px;
  background: var(--line-strong);
  transform: translateX(-50%);
}

.channel-detail-sheet.dragging .channel-detail-handle {
  cursor: grabbing;
}

.channel-detail-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--surface, #fff) 92%, transparent);
  color: var(--text);
  backdrop-filter: blur(12px);
}

.channel-detail-close {
  position: absolute;
  z-index: 5;
  top: 22px;
  right: 16px;
}

.channel-detail-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.channel-detail-scroll {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.channel-detail-scroll::-webkit-scrollbar,
.channel-detail-gallery::-webkit-scrollbar {
  display: none;
}

.channel-detail-content,
.channel-detail-state {
  padding: 47px 20px max(30px, calc(env(safe-area-inset-bottom) + 24px));
}

.channel-detail-identity {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 15px;
  align-items: center;
  padding-right: 42px;
}

.channel-detail-avatar {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #09090a;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.channel-detail-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.channel-detail-copy {
  min-width: 0;
}

.channel-detail-copy h2 {
  margin: 0;
  font-family: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(25px, 7.2vw, 31px);
  line-height: 1.02;
  font-weight: 790;
  letter-spacing: -0.052em;
  overflow-wrap: anywhere;
}

.channel-detail-copy p,
.channel-detail-copy span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-detail-copy p {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.1;
  font-weight: 520;
}

.channel-detail-copy span {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 470;
}

.channel-detail-description {
  margin: 24px 0 0;
  color: color-mix(in srgb, var(--text) 84%, var(--muted));
  font-size: 15px;
  line-height: 1.52;
  font-weight: 455;
  letter-spacing: -0.01em;
}

.channel-detail-description.empty {
  color: var(--muted);
}

.channel-detail-actions {
  margin-top: 23px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.channel-detail-actions button {
  min-width: 0;
  min-height: 46px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface, #fff);
  color: var(--text);
  font-size: 11.5px;
  line-height: 1;
  font-weight: 590;
  white-space: nowrap;
  transition: transform 150ms ease, border-color 170ms ease, background-color 170ms ease, color 170ms ease;
}

.channel-detail-actions button:active {
  transform: scale(0.97);
}

.channel-detail-action-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  display: inline-grid;
  place-items: center;
}

.channel-detail-action-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.channel-detail-actions #channelTrackToggle[aria-pressed="true"] {
  border-color: var(--line);
  background: var(--surface, #fff);
  color: var(--text);
}

.channel-detail-actions #channelTrackToggle[aria-pressed="true"] svg {
  fill: currentColor;
}

.channel-detail-gallery-section {
  margin-top: 31px;
}

.channel-detail-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.channel-detail-section-heading h3,
.channel-detail-facts h3 {
  margin: 0;
  font-family: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 20px;
  line-height: 1.05;
  font-weight: 750;
  letter-spacing: -0.035em;
}

.channel-detail-section-heading > span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  font-weight: 560;
}

.channel-detail-gallery {
  margin: 13px -20px 0;
  padding: 0 20px 4px;
  display: flex;
  gap: 9px;
  overflow-x: auto;
  scroll-padding-inline: 20px;
  scroll-snap-type: x proximity;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.channel-gallery-card {
  position: relative;
  width: 126px;
  aspect-ratio: 3 / 4;
  flex: 0 0 126px;
  margin: 0;
  border-radius: 15px;
  overflow: hidden;
  background: var(--soft);
  scroll-snap-align: start;
  box-shadow: inset 0 0 0 1px rgba(5, 5, 5, 0.05);
}

.channel-gallery-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.002);
}

.channel-gallery-card figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 24px 9px 9px;
  overflow: hidden;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  color: #fff;
  font-size: 10px;
  line-height: 1.15;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-detail-empty {
  margin: 13px 0 0;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 17px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}

.channel-detail-facts {
  margin-top: 31px;
  border-top: 1px solid var(--line);
}

.channel-detail-collection-mark {
  min-height: 66px;
  padding: 17px 0 15px;
  display: grid;
  gap: 8px;
}

.channel-detail-collection-mark > span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  font-weight: 680;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.channel-detail-collections {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  color: var(--text);
  font-family: "SF Pro Display", Inter, sans-serif;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.channel-detail-collections span + span::before {
  content: "&";
  margin-right: 8px;
  color: var(--muted);
}

.channel-detail-facts dl {
  margin: 0;
}

.channel-detail-facts dl > div {
  min-height: 64px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 14px;
  align-items: baseline;
}

.channel-detail-facts dt,
.channel-detail-facts dd {
  margin: 0;
}

.channel-detail-facts dt {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 520;
}

.channel-detail-facts dd {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 660;
  letter-spacing: -0.012em;
  text-align: right;
}

.channel-detail-loading {
  display: grid;
  gap: 13px;
}

.channel-detail-loading-head {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 15px;
  align-items: center;
  margin-bottom: 9px;
}

.channel-detail-loading-head > span,
.channel-detail-loading i,
.channel-detail-loading-gallery span {
  display: block;
  border-radius: 12px;
  background: linear-gradient(100deg, var(--soft) 28%, var(--line) 42%, var(--soft) 58%);
  background-size: 220% 100%;
  animation: channel-detail-shimmer 1.25s ease-in-out infinite;
}

.channel-detail-loading-head > span {
  width: 72px;
  height: 72px;
  border-radius: 50%;
}

.channel-detail-loading-head > div {
  display: grid;
  gap: 9px;
}

.channel-detail-loading-head i {
  height: 13px;
}

.channel-detail-loading-head i:first-child {
  width: 82%;
  height: 24px;
}

.channel-detail-loading-head i:last-child {
  width: 46%;
}

.channel-detail-loading > i {
  width: 100%;
  height: 12px;
}

.channel-detail-loading > i:nth-child(3) {
  width: 88%;
}

.channel-detail-loading > i:nth-child(4) {
  width: 64%;
}

.channel-detail-loading-gallery {
  margin-top: 28px;
  display: flex;
  gap: 9px;
}

.channel-detail-loading-gallery span {
  width: 126px;
  aspect-ratio: 3 / 4;
  flex: 0 0 126px;
  border-radius: 15px;
}

.channel-detail-error {
  min-height: 70%;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
}

.channel-detail-error:not([hidden]) {
  display: grid;
}

.channel-detail-error-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--muted);
}

.channel-detail-error-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.channel-detail-error strong {
  font-size: 17px;
}

.channel-detail-error > span:not(.channel-detail-error-icon) {
  max-width: 260px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.channel-detail-error button {
  height: 42px;
  margin-top: 10px;
  padding: 0 19px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 680;
}

.channel-row {
  cursor: pointer;
}

.channel-row:focus-visible {
  position: relative;
  z-index: 1;
  border-radius: 16px;
  outline: 2px solid var(--text);
  outline-offset: -2px;
}

.toast.has-action {
  padding-right: 8px;
  display: flex;
  align-items: center;
  gap: 11px;
  pointer-events: auto;
}

.toast-action {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  color: #050505;
  font-size: 12px;
  font-weight: 720;
}

@keyframes channel-detail-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes channel-detail-sheet-in {
  from { transform: translate(-50%, 42px); opacity: 0.7; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes channel-detail-shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

@media (max-width: 374px) {
  .channel-detail-content,
  .channel-detail-state {
    padding-right: 16px;
    padding-left: 16px;
  }

  .channel-detail-gallery {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .channel-gallery-card,
  .channel-detail-loading-gallery span {
    width: 112px;
    flex-basis: 112px;
  }

  .channel-detail-actions button {
    min-height: 44px;
    padding: 0 7px;
    gap: 6px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .channel-detail-backdrop,
  .channel-detail-sheet,
  .channel-detail-loading-head > span,
  .channel-detail-loading i,
  .channel-detail-loading-gallery span {
    animation: none;
  }
}

.product-filter-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: rgba(17, 17, 20, 0.18);
  backdrop-filter: blur(2px);
  animation: product-filter-fade 180ms ease both;
}

.product-filter-sheet {
  position: fixed;
  z-index: 41;
  left: 50%;
  bottom: 0;
  width: min(100%, 430px);
  max-height: min(100dvh, 620px, max(72dvh, 320px));
  padding: 10px 20px max(24px, calc(env(safe-area-inset-bottom) + 18px));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -22px 60px rgba(17, 17, 20, 0.16);
  transform: translateX(-50%);
  backdrop-filter: blur(22px) saturate(1.1);
  animation: product-filter-sheet-in 220ms cubic-bezier(.2, .75, .2, 1) both;
}

.product-filter-sheet:focus {
  outline: 0;
}

.product-filter-handle {
  position: relative;
  width: 68px;
  height: 24px;
  margin: -4px auto 4px;
  flex: 0 0 auto;
  cursor: grab;
  touch-action: none;
  background: transparent;
}

.product-filter-handle::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 48px;
  height: 5px;
  border-radius: 999px;
  background: var(--line-strong);
  transform: translateX(-50%);
}

.product-filter-sheet.dragging {
  user-select: none;
  will-change: transform;
}

.product-filter-sheet.dragging .product-filter-handle {
  cursor: grabbing;
}

.product-filter-header {
  display: flex;
  align-items: flex-start;
}

.product-filter-header h2 {
  margin: 0;
  font-family: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 28px;
  line-height: 1;
  font-weight: 780;
  letter-spacing: -0.035em;
}

.product-filter-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
}

.product-filter-content {
  min-height: 0;
  padding-top: 24px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}

.product-filter-content::-webkit-scrollbar {
  display: none;
}

.product-filter-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.product-filter-fieldset:not([hidden]) ~ .product-filter-fieldset:not([hidden]) {
  margin-top: 24px;
}

.product-filter-fieldset legend {
  margin-bottom: 12px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
  font-weight: 730;
  letter-spacing: -0.015em;
}

.product-filter-sizes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.product-filter-coverage {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 14px;
  margin: 0 0 22px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
}

.product-filter-coverage dt {
  color: var(--muted);
  font-weight: 600;
}

.product-filter-coverage dd {
  margin: 0;
  font-weight: 500;
}

.saved-panel a {
  color: inherit;
  text-underline-offset: 3px;
}

.product-filter-sizes button {
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 15px;
  font-weight: 520;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.product-filter-sizes button.active {
  border-color: var(--text);
  background: var(--text);
  color: #fff;
}

.product-price-modes {
  height: 48px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #fff;
}

.product-price-modes button {
  min-width: 0;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 610;
}

.product-price-modes button.active {
  background: var(--text);
  color: #fff;
  box-shadow: 0 5px 14px rgba(17, 17, 20, 0.14);
}

.product-price-inputs {
  padding-top: 12px;
}

.product-price-input,
.product-price-range {
  min-width: 0;
}

.product-price-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.product-price-input {
  height: 58px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: grid;
  gap: 3px;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(17, 17, 20, 0);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.product-price-input:focus-within {
  border-color: #b9b9c0;
  background: #fcfcfd;
  box-shadow: 0 0 0 3px rgba(17, 17, 20, 0.06);
}

.product-price-input.invalid {
  border-color: #c96868;
  background: #fffafa;
  box-shadow: 0 0 0 3px rgba(177, 55, 55, 0.07);
}

.product-price-input span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  font-weight: 520;
}

.product-price-input input {
  width: 100%;
  padding: 0;
  appearance: textfield;
  caret-color: var(--text);
  font-size: 17px;
  line-height: 1;
  font-weight: 560;
}

.product-price-input input:focus-visible {
  outline: 0;
}

.product-price-input input::-webkit-inner-spin-button,
.product-price-input input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.product-price-input input::placeholder {
  color: #a3a3a9;
}

.product-filter-footer {
  min-height: 48px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex: none;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
}

.product-filter-reset {
  min-height: 38px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.product-filter-status {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  line-height: 1.15;
  text-align: right;
}

.product-filter-status svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.product-filter-status.invalid {
  color: #ad4242;
}

.product-filter-status.adjusted {
  color: var(--text);
}

@keyframes product-filter-fade {
  from {
    opacity: 0;
  }
}

@keyframes product-filter-sheet-in {
  from {
    opacity: 0;
    transform: translate(-50%, 28px);
  }
}

@media (max-width: 374px) {
  .alerts-header {
    grid-template-columns: minmax(0, 1fr) 136px;
    gap: 10px;
  }

  .alerts-title {
    font-size: 31px;
  }

  .alerts-subtitle {
    font-size: 12.5px;
  }

  .alert-preset-trigger {
    padding: 0 10px;
    grid-template-columns: 23px minmax(0, 1fr) 16px;
    gap: 7px;
  }

  .alert-category-card {
    font-size: 11.5px;
  }

  .alert-product-card {
    grid-template-columns: 46px minmax(0, 1fr) 41px;
    gap: 9px;
    padding-left: 8px;
  }

  .alert-product-icon {
    width: 46px;
    height: 46px;
  }

  .alert-product-copy strong {
    font-size: 17px;
  }

  .product-filter-sheet {
    padding-right: 14px;
    padding-left: 14px;
  }

  .product-filter-sizes {
    gap: 6px;
  }

  .product-filter-sizes button {
    height: 43px;
    border-radius: 12px;
    font-size: 13px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .alert-preset-chevron,
  .alert-category-card,
  .alert-product-card,
  .alert-product-toggle,
  .alert-product-toggle > span,
  .product-filter-backdrop,
  .product-filter-sheet,
  .product-filter-sizes button {
    animation: none;
    transition: none;
  }

  .primary-action {
    transition: none;
  }

  .primary-action.alert-ready::before,
  .primary-action.alert-channel-ready::before,
  .primary-action.alert-running::before {
    display: none;
  }

  .primary-action.alert-ready::after,
  .primary-action.alert-running::after,
  .alert-nav-status {
    animation: none;
  }
}

/* Profile */
:root {
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --inverse-surface: #0b0b0e;
  --inverse-text: #ffffff;
}

.profile-screen {
  width: 100%;
}

.profile-scroll-content {
  width: 100%;
  padding: 8px 0 18px;
}

.profile-identity-card {
  padding: 0 2px;
  color: var(--text);
}

.profile-identity-main {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 17px;
  align-items: center;
  padding: 0 4px;
}

.profile-avatar {
  width: 78px;
  height: 78px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--soft);
  color: var(--text);
  box-shadow: 0 7px 18px rgba(17, 17, 20, 0.08);
  font-size: 22px;
  line-height: 1;
  font-weight: 780;
  letter-spacing: -0.035em;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-identity-copy {
  min-width: 0;
}

.profile-account-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1;
  font-weight: 590;
  letter-spacing: 0.02em;
}

.profile-account-label > span:first-child {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #34c96f;
  box-shadow: 0 0 0 3px rgba(52, 201, 111, 0.12);
}

.profile-identity-copy h2 {
  margin: 0 0 3px;
  overflow: hidden;
  font-family: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 760;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-identity-copy > p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.35;
  font-weight: 460;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-stats {
  min-height: 76px;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(17, 17, 20, 0.07);
}

.profile-stat {
  min-width: 0;
  padding: 13px 8px 12px;
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: center;
}

.profile-stat + .profile-stat {
  border-left: 1px solid var(--line);
}

.profile-stat strong {
  font-family: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 23px;
  line-height: 1;
  font-weight: 730;
  letter-spacing: -0.025em;
}

.profile-stat span {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.15;
  font-weight: 520;
}

.profile-section {
  padding-top: 25px;
}

.profile-section-heading {
  padding: 0 2px 10px;
}

.profile-section-heading h2 {
  margin: 0;
  font-family: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 21px;
  line-height: 1.05;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.profile-section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 450;
}

.profile-settings-card,
.profile-link-card,
.profile-topic-card,
.profile-topic-empty {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 7px 22px rgba(17, 17, 20, 0.04);
}

.profile-settings-card,
.profile-link-card {
  overflow: hidden;
}

.profile-setting-row {
  min-height: 76px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.profile-setting-row + .profile-setting-row {
  border-top: 1px solid var(--line);
}

.profile-hidden-entry {
  width: 100%;
  color: var(--text);
  text-align: left;
  transition: background-color 150ms ease;
}

.profile-hidden-entry:active {
  background: var(--soft);
}

.profile-hidden-summary {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.profile-hidden-count {
  min-width: 28px;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  font-weight: 690;
}

.profile-hidden-summary svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.profile-setting-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.profile-setting-copy strong {
  font-size: 15px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.profile-setting-copy span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 450;
}

.profile-control-host,
.profile-topic-list-contents,
.profile-link-action {
  display: contents;
}

.profile-choice-control,
.profile-topic-modes {
  height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: grid;
  align-items: center;
  background: var(--soft);
}

.profile-language-control {
  width: 116px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-theme-control,
.profile-topic-modes {
  /* Columns are sized by content, not forced into equal thirds: a fixed
     192px / 3 gave every label 48px, so the Russian labels ("Системная",
     "Отправлять") overflowed their pills. */
  grid-template-columns: repeat(3, auto);
}

.profile-topic-modes {
  /* Keeps the left-aligned placement the fixed 192px width used to give it. */
  justify-self: start;
}

.profile-choice-button,
.profile-topic-mode,
.profile-topic-modes button {
  min-width: 0;
  height: 32px;
  padding: 0 7px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  font-weight: 650;
  white-space: nowrap;
  transition:
    color 170ms ease,
    background-color 170ms ease,
    box-shadow 170ms ease,
    transform 140ms ease;
}

.profile-choice-button.active,
.profile-topic-mode.active,
.profile-topic-modes button.active,
.profile-topic-mode[aria-pressed="true"],
.profile-topic-modes button[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 4px 11px rgba(17, 17, 20, 0.13);
}

.profile-choice-button:active,
.profile-topic-mode:active,
.profile-topic-modes button:active {
  transform: scale(0.96);
}

.profile-topic-list {
  display: grid;
  gap: 11px;
}

.profile-topic-empty {
  min-height: 154px;
  padding: 23px 28px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  text-align: center;
}

.profile-topic-empty-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 2px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--muted);
}

.profile-topic-empty-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.profile-topic-empty strong {
  font-size: 15px;
  line-height: 1.15;
  font-weight: 690;
}

.profile-topic-empty > span:last-child {
  max-width: 275px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 450;
}

.profile-topic-card {
  position: relative;
  min-height: 112px;
  padding: 10px 10px 10px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-color: transparent;
  transition:
    border-color 170ms ease,
    box-shadow 170ms ease,
    opacity 170ms ease,
    transform 140ms ease;
}

.profile-topic-card.active {
  border-color: var(--text);
  box-shadow:
    0 0 0 1px var(--text),
    0 10px 28px rgba(17, 17, 20, 0.07);
}

.profile-topic-card.inactive {
  opacity: 0.58;
}

.profile-topic-card.inactive:focus-within,
.profile-topic-card.inactive:hover {
  opacity: 0.78;
}

.profile-topic-card.inactive.menu-open {
  opacity: 1;
}

.profile-topic-select {
  width: 100%;
  min-height: 78px;
  padding: 8px 6px;
  border-radius: 15px;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 7px;
  text-align: left;
}

.profile-topic-select:active {
  transform: scale(0.985);
}

.profile-topic-select:focus-visible,
.profile-topic-mode:focus-visible,
.profile-topic-menu-button:focus-visible,
.profile-topic-menu button:focus-visible,
.profile-hidden-entry:focus-visible,
.profile-hidden-restore:focus-visible,
.profile-alert-dialog button:focus-visible,
.profile-alert-name-field input:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.profile-topic-title {
  overflow: hidden;
  font-family: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 19px;
  line-height: 1.12;
  font-weight: 750;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 480;
}

.profile-topic-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-topic-mode {
  min-width: 92px;
  height: 46px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  line-height: 1;
  font-weight: 680;
  transition: transform 140ms ease, opacity 170ms ease, background-color 170ms ease;
}

.profile-topic-mode.silent {
  border-color: var(--line);
  background: var(--soft);
  color: var(--muted);
}

.profile-topic-card.inactive .profile-topic-mode {
  border-color: var(--line);
  background: var(--soft);
  color: var(--muted);
}

.profile-topic-mode:active,
.profile-topic-menu-button:active,
.profile-topic-menu button:active {
  transform: scale(0.96);
}

.profile-topic-mode svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.profile-topic-menu-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--text);
  transition: transform 140ms ease, background-color 150ms ease;
}

.profile-topic-menu-button svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.profile-topic-menu {
  position: absolute;
  z-index: 8;
  top: 72px;
  right: 10px;
  width: min(210px, calc(100% - 20px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 17px;
  display: grid;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 18px 45px rgba(17, 17, 20, 0.17);
  backdrop-filter: blur(18px);
}

.profile-topic-menu button {
  min-height: 43px;
  padding: 0 11px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 13px;
  font-weight: 580;
  text-align: left;
  transition: background-color 140ms ease, transform 140ms ease;
}

.profile-topic-menu button:hover,
.profile-topic-menu button:focus-visible {
  background: var(--soft);
}

.profile-topic-menu button.danger {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 11px 11px;
  color: #df2b31;
}

.profile-topic-menu svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.profile-link-row {
  width: 100%;
  min-height: 68px;
  padding: 11px 13px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 22px;
  gap: 11px;
  align-items: center;
  text-align: left;
  transition: background-color 150ms ease;
}

.profile-link-action + .profile-link-action .profile-link-row {
  border-top: 1px solid var(--line);
}

.profile-link-row:active {
  background: var(--soft);
}

.profile-link-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--text);
}

.profile-link-icon svg,
.profile-link-chevron {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-link-icon svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.7;
}

.profile-link-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.profile-link-copy strong {
  font-size: 15px;
  line-height: 1;
  font-weight: 690;
}

.profile-link-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.3;
  font-weight: 450;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-link-chevron {
  width: 20px;
  height: 20px;
  color: var(--muted);
  stroke-width: 1.9;
}

.profile-footer {
  min-height: 45px;
  padding: 16px 4px 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  font-weight: 460;
}

.profile-footer strong {
  font-weight: 630;
}

.profile-info-open {
  overflow: hidden;
}

.profile-info-backdrop {
  position: fixed;
  z-index: 48;
  inset: 0;
  background: rgba(17, 17, 20, 0.2);
  backdrop-filter: blur(2px);
  animation: profile-info-fade 180ms ease both;
}

.profile-info-sheet {
  position: fixed;
  z-index: 49;
  left: max(0px, calc(50% - 215px));
  bottom: 0;
  width: min(100%, 430px);
  max-height: min(72dvh, 620px);
  padding: 10px 20px max(22px, calc(env(safe-area-inset-bottom) + 16px));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -22px 60px rgba(17, 17, 20, 0.16);
  backdrop-filter: blur(22px) saturate(1.1);
  animation: profile-info-sheet-in 220ms cubic-bezier(.2, .75, .2, 1) both;
}

.profile-info-sheet:focus {
  outline: 0;
}

.profile-info-sheet.dragging {
  user-select: none;
  will-change: transform;
}

.profile-info-handle {
  position: relative;
  width: 70px;
  height: 24px;
  margin: -4px auto 5px;
  flex: 0 0 auto;
  cursor: grab;
  touch-action: none;
}

.profile-info-handle::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 48px;
  height: 5px;
  border-radius: 999px;
  background: var(--line-strong);
  transform: translateX(-50%);
}

.profile-info-sheet.dragging .profile-info-handle {
  cursor: grabbing;
}

.profile-info-content {
  min-height: 0;
  padding: 1px 1px 22px;
  overflow-y: auto;
  scrollbar-width: none;
}

.profile-info-content::-webkit-scrollbar {
  display: none;
}

.profile-info-content h2 {
  margin: 0 0 15px;
  font-family: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 28px;
  line-height: 1;
  font-weight: 770;
  letter-spacing: -0.035em;
}

.profile-info-body {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.48;
  font-weight: 450;
}

.profile-info-body p {
  margin: 0;
}

.profile-info-body p + p {
  margin-top: 13px;
}

.profile-info-body strong {
  color: var(--text);
  font-weight: 680;
}

.profile-hidden-intro {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.profile-hidden-list {
  display: grid;
  gap: 8px;
}

.profile-hidden-channel {
  min-height: 64px;
  padding: 8px 9px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 17px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  background: var(--surface);
  transition: opacity 160ms ease, transform 160ms ease;
}

.profile-hidden-channel.restoring {
  opacity: 0.5;
  transform: scale(0.985);
}

.profile-hidden-avatar {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--soft);
  color: var(--text);
  font-size: 11px;
  line-height: 1;
  font-weight: 720;
}

.profile-hidden-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-hidden-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.profile-hidden-copy strong,
.profile-hidden-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-hidden-copy strong {
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.1;
  font-weight: 690;
}

.profile-hidden-copy span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.profile-hidden-restore {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 11.5px;
  line-height: 1;
  font-weight: 660;
  transition: transform 140ms ease, background-color 150ms ease;
}

.profile-hidden-restore:active {
  background: var(--soft);
  transform: scale(0.96);
}

.profile-hidden-restore:disabled {
  cursor: default;
}

.profile-hidden-empty {
  min-height: 174px;
  padding: 30px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 19px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  text-align: center;
}

.profile-hidden-empty strong {
  color: var(--text);
  font-size: 15px;
}

.profile-hidden-empty span {
  max-width: 245px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.profile-info-done {
  width: 100%;
  min-height: 50px;
  flex: 0 0 auto;
  border-radius: 16px;
  background: var(--text);
  color: var(--bg);
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  transition: transform 150ms ease;
}

.profile-info-done:active {
  transform: scale(0.985);
}

@keyframes profile-info-fade {
  from {
    opacity: 0;
  }
}

@keyframes profile-info-sheet-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
}

html.profile-alert-dialog-open body {
  overflow: hidden;
}

.profile-alert-dialog-backdrop {
  position: fixed;
  z-index: 58;
  inset: 0;
  background: rgba(17, 17, 20, 0.3);
  opacity: 0;
  backdrop-filter: blur(4px);
  transition: opacity 180ms ease;
}

.profile-alert-dialog-backdrop.visible {
  opacity: 1;
}

.profile-alert-dialog {
  position: fixed;
  z-index: 59;
  top: 50%;
  left: 50%;
  width: min(calc(100% - 34px), 340px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  box-shadow: 0 28px 75px rgba(17, 17, 20, 0.24);
  opacity: 0;
  backdrop-filter: blur(24px) saturate(1.12);
  transform: translate(-50%, calc(-50% + 12px)) scale(0.97);
  transition: opacity 180ms ease, transform 180ms cubic-bezier(.2, .75, .2, 1);
}

.profile-alert-dialog.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.profile-alert-dialog-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 15px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--text);
}

.profile-alert-dialog-icon.danger {
  background: rgba(223, 43, 49, 0.1);
  color: #df2b31;
}

.profile-alert-dialog-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.profile-alert-dialog h2 {
  margin: 0;
  font-family: "SF Pro Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 22px;
  line-height: 1.08;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.profile-alert-dialog > p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.profile-alert-name-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 590;
}

.profile-alert-name-field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 570;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.profile-alert-name-field input.invalid {
  border-color: #df2b31;
  box-shadow: 0 0 0 3px rgba(223, 43, 49, 0.1);
}

.profile-alert-dialog-actions {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.profile-alert-dialog-actions button {
  min-height: 46px;
  border-radius: 14px;
  background: var(--soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 670;
  transition: opacity 150ms ease, transform 140ms ease;
}

.profile-alert-dialog-actions button.primary {
  background: var(--text);
  color: var(--bg);
}

.profile-alert-dialog-actions button.danger {
  background: #df2b31;
  color: #fff;
}

.profile-alert-dialog-actions button:disabled {
  opacity: 0.48;
}

.profile-alert-dialog-actions button:active {
  transform: scale(0.975);
}

/* Whole-app dark theme */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0c0f;
  --text: #f4f4f6;
  --muted: #a0a0a9;
  --soft: #1a1a1f;
  --line: #29292f;
  --line-strong: #3b3b43;
  --surface: #141418;
  --surface-raised: #19191e;
  --inverse-surface: #050507;
  --inverse-text: #f7f7f8;
  --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}

html[data-theme="dark"] .explore-segment,
html[data-theme="dark"] .alert-segment,
html[data-theme="dark"] .bookmark-button,
html[data-theme="dark"] .store-source-filter,
html[data-theme="dark"] .alert-preset-trigger,
html[data-theme="dark"] .alert-preset-menu,
html[data-theme="dark"] .alert-category-card,
html[data-theme="dark"] .alert-product-card,
html[data-theme="dark"] .alert-product-icon,
html[data-theme="dark"] .alert-product-button,
html[data-theme="dark"] .alert-size-chip,
html[data-theme="dark"] .price-any-button,
html[data-theme="dark"] .alert-channel-check,
html[data-theme="dark"] .product-filter-sizes button,
html[data-theme="dark"] .product-price-modes,
html[data-theme="dark"] .product-price-input {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] .alert-product-icon img {
  filter: invert(1);
}

html[data-theme="dark"] .segment-button.active,
html[data-theme="dark"] .alert-segment-button.active,
html[data-theme="dark"] .store-source-filter.active,
html[data-theme="dark"] .track-button.tracked,
html[data-theme="dark"] .alert-channel-check.selected,
html[data-theme="dark"] .product-filter-sizes button.active,
html[data-theme="dark"] .product-price-modes button.active {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
  box-shadow: none;
}

html[data-theme="dark"] .search-box {
  border-color: transparent;
  background: var(--soft);
  color: var(--muted);
}

html[data-theme="dark"] .search-box:focus-within,
html[data-theme="dark"] .product-price-input:focus-within {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .search-box input::placeholder,
html[data-theme="dark"] .product-price-input input::placeholder {
  color: #777780;
}

html[data-theme="dark"] .channel-row,
html[data-theme="dark"] .alert-channel-row,
html[data-theme="dark"] .channel-hint,
html[data-theme="dark"] .alert-collection-hint,
html[data-theme="dark"] .store-directory {
  border-color: var(--line);
}

html[data-theme="dark"] .channel-text h2,
html[data-theme="dark"] .price-value,
html[data-theme="dark"] .collapse-button,
html[data-theme="dark"] .alert-collection-hint span {
  color: var(--text);
}

html[data-theme="dark"] .channel-text p,
html[data-theme="dark"] .channel-hint,
html[data-theme="dark"] .alert-collection-hint,
html[data-theme="dark"] .empty-state {
  color: var(--muted);
}

html[data-theme="dark"] .track-button {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] .channel-avatar.tone-2 {
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--text);
}

html[data-theme="dark"] .collection-card.selected::after,
html[data-theme="dark"] .alert-collection-strip .collection-card.selected::after {
  border-color: var(--text);
  box-shadow: inset 0 0 0 2px var(--bg);
}

html[data-theme="dark"] .nav-tray {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(20, 20, 24, 0.92);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .nav-item {
  color: #95959e;
}

html[data-theme="dark"] .nav-item.active:not(.alert-nav) {
  color: var(--text);
}

html[data-theme="dark"] .bottom-nav > .alert-nav {
  background: #f4f4f6;
  color: #0c0c0f;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .bottom-nav > .alert-nav.active {
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 5px #f4f4f6,
    0 12px 26px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .alert-preset-menu {
  background: rgba(20, 20, 24, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
}

html[data-theme="dark"] .alert-product-card.selected,
html[data-theme="dark"] .alert-category-card.active {
  border-color: var(--line-strong);
}

html[data-theme="dark"] .alert-product-toggle {
  background: #3a3a42;
}

html[data-theme="dark"] .alert-product-card.selected .alert-product-toggle {
  background: #f4f4f6;
  box-shadow: none;
}

html[data-theme="dark"] .alert-product-toggle > span {
  background: #ededf0;
}

html[data-theme="dark"] .alert-product-card.selected .alert-product-toggle > span {
  background: #111114;
}

html[data-theme="dark"] .product-filter-backdrop,
html[data-theme="dark"] .profile-info-backdrop,
html[data-theme="dark"] .profile-alert-dialog-backdrop {
  background: rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .product-filter-sheet,
html[data-theme="dark"] .profile-info-sheet {
  border-color: var(--line);
  background: rgba(20, 20, 24, 0.98);
  box-shadow: 0 -22px 60px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .profile-alert-dialog,
html[data-theme="dark"] .profile-topic-menu {
  border-color: var(--line);
  background: rgba(20, 20, 24, 0.98);
  box-shadow: 0 28px 75px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .product-price-input.invalid {
  border-color: #8f5155;
  background: #211517;
  box-shadow: 0 0 0 3px rgba(190, 80, 88, 0.08);
}

html[data-theme="dark"] .primary-action:disabled:not(.alert-busy) {
  background: #2a2a30;
  color: #6f6f78;
}

html[data-theme="dark"] .profile-identity-card {
  color: var(--text);
  box-shadow: none;
}

html[data-theme="dark"] .profile-avatar,
html[data-theme="dark"] .profile-stats {
  box-shadow: none;
}

html[data-theme="dark"] .profile-settings-card,
html[data-theme="dark"] .profile-link-card,
html[data-theme="dark"] .profile-topic-card,
html[data-theme="dark"] .profile-topic-empty {
  box-shadow: none;
}

html[data-theme="dark"] .toast {
  border: 1px solid var(--line);
  background: #f4f4f6;
  color: #111114;
}

@media (max-width: 374px) {
  .profile-identity-card {
    padding-right: 0;
    padding-left: 0;
  }

  .profile-identity-main {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 14px;
  }

  .profile-avatar {
    width: 70px;
    height: 70px;
  }

  .profile-setting-row {
    padding-right: 12px;
    padding-left: 12px;
  }

  .profile-theme-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-theme-control {
    /* On its own row there is room to spare, so share it evenly again. */
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-self: stretch;
  }

  .profile-info-sheet {
    padding-right: 14px;
    padding-left: 14px;
  }

  .profile-topic-card {
    padding-right: 8px;
    padding-left: 10px;
    gap: 6px;
  }

  .profile-topic-title {
    font-size: 17px;
  }

  .profile-topic-mode {
    min-width: 78px;
    padding: 0 11px;
    gap: 7px;
  }

  .profile-topic-menu-button {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-info-backdrop,
  .profile-info-sheet,
  .profile-alert-dialog-backdrop,
  .profile-alert-dialog,
  .profile-topic-card,
  .profile-topic-mode {
    animation: none;
    transition: none;
  }
}

/* Collection text remains the fallback when no cover is assigned. */
.collection-strip .collection-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  flex: 0 0 148px;
  min-width: 148px;
  max-width: 148px;
  height: 204px;
  min-height: 204px;
  padding: 14px;
  text-align: left;
  background: var(--surface, #f5f5f7);
  border: 1px solid var(--line, #e5e5e8);
}
.collection-card .collection-label {
  position: static;
  order: -1;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--text);
  text-shadow: none;
  text-align: left;
  line-height: 1.3;
}
.collection-card .collection-description {
  font-size: 12px;
  line-height: 1.4;
  opacity: .75;
  overflow-wrap: anywhere;
}
.collection-strip .collection-card.has-cover {
  isolation: isolate;
  padding: 0;
  border: 0;
  background: #f4f2f0;
}

.collection-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  /* Crop the white frame baked into the supplied artwork. The card provides
     the single outer edge and corner radius. */
  transform: scale(1.08);
  pointer-events: none;
}

.collection-card.has-cover .collection-label,
.collection-card.has-cover .collection-description {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.collection-card.has-cover.selected::before {
  content: "✓";
  position: absolute;
  z-index: 4;
  top: 10px;
  right: 10px;
  width: 21px;
  height: 21px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #111114;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

#channelDetailDescription { white-space: pre-line; }
