:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #0c192a;
  --panel-strong: #10223a;
  --panel-soft: #132b47;
  --line-rgb: 139, 185, 236;
  --line: rgba(var(--line-rgb), 0.13);
  --line-strong: rgba(var(--line-rgb), 0.22);
  --text: #f4f8ff;
  --muted: #8399b4;
  --muted-light: #b5c6d9;
  --muted-dark: #607998;
  --accent: #66b7ff;
  --accent-rgb: 102, 183, 255;
  --accent-soft: rgba(var(--accent-rgb), 0.13);
  --accent-light: #a7dcff;
  --accent-dark: #3f8fe5;
  --accent-deep: #315fae;
  --accent-deep-rgb: 19, 66, 129;
  --accent-text: #dceeff;
  --cyan: #7c91ff;
  --cyan-rgb: 124, 145, 255;
  --cyan-soft: rgba(var(--cyan-rgb), 0.13);
  --cyan-light: #aab7ff;
  --deep-rgb: 4, 13, 24;
  --shadow-rgb: 0, 4, 14;
  --panel-rgb: 12, 25, 42;
  --panel-deep-rgb: 8, 21, 37;
  --panel-raised-rgb: 17, 41, 70;
  --warning: #ffc76b;
  --success: #61d7a5;
  --success-light: #78e8b9;
  --danger: #ff91a0;
  --danger-text: #ff9b9b;
  --danger-light: #ffb3b3;
  --bz-hero-from: rgba(14, 29, 25, 0.98);
  --bz-hero-to: rgba(11, 23, 20, 0.9);
  --bz-pulse-bg: rgba(4, 10, 9, 0.36);
  --bz-categories-bg: rgba(13, 24, 22, 0.75);
  --bz-favorite-bg: rgba(7, 16, 15, 0.56);
  --bz-empty-border: rgba(167, 205, 190, 0.15);
  --bz-muted-1: #71857e;
  --bz-muted-2: #8da9a1;
  --bz-muted-3: #61736d;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

/* Темы. Синяя — это значения :root выше. В остальных темах тёмно-зелёные оттенки Bazaar Flipper
   выводятся из палитры темы. Тема ставится атрибутом data-theme на <html> (theme-switcher.js). */

:root[data-theme]:not([data-theme="blue"]) {
  --bz-hero-from: rgba(var(--panel-rgb), 0.98);
  --bz-hero-to: rgba(var(--panel-deep-rgb), 0.9);
  --bz-pulse-bg: rgba(var(--deep-rgb), 0.36);
  --bz-categories-bg: rgba(var(--panel-rgb), 0.75);
  --bz-favorite-bg: rgba(var(--deep-rgb), 0.56);
  --bz-empty-border: rgba(var(--line-rgb), 0.15);
  --bz-muted-1: var(--muted);
  --bz-muted-2: var(--muted-light);
  --bz-muted-3: var(--muted-dark);
}

:root[data-theme="milk"] {
  color-scheme: light;
  --bg: #f3ece0;
  --panel: #fbf6ed;
  --panel-strong: #fffaf2;
  --panel-soft: #efe4d2;
  --line-rgb: 120, 92, 58;
  --text: #2e2518;
  --muted: #8a7a63;
  --muted-light: #5e5141;
  --muted-dark: #a6957c;
  --accent: #b07a3f;
  --accent-rgb: 176, 122, 63;
  --accent-light: #e8c79f;
  --accent-dark: #8d5e2c;
  --accent-deep: #6b4520;
  --accent-deep-rgb: 107, 69, 32;
  --accent-text: #5a3c1c;
  --cyan: #8a7d4a;
  --cyan-rgb: 138, 125, 74;
  --cyan-light: #6e6236;
  --deep-rgb: 255, 252, 246;
  --shadow-rgb: 90, 70, 40;
  --panel-rgb: 251, 246, 237;
  --panel-deep-rgb: 245, 238, 225;
  --panel-raised-rgb: 239, 228, 210;
  --warning: #b7791f;
  --success: #23875a;
  --success-light: #2e9b6a;
  --danger: #c2414f;
  --danger-text: #b83a3a;
  --danger-light: #a33a3a;
  --shadow: 0 24px 70px rgba(90, 70, 40, 0.16);
}

/* Латте — молочная, но приглушённая: фон темнее и теплее, чтобы не слепил. */
:root[data-theme="latte"] {
  color-scheme: light;
  --bg: #d6cab6;
  --panel: #ddd2c0;
  --panel-strong: #e2d8c7;
  --panel-soft: #cbbda6;
  --line-rgb: 92, 70, 44;
  --text: #2a2117;
  --muted: #6f604c;
  --muted-light: #4b3f31;
  --muted-dark: #85745d;
  --accent: #9a6533;
  --accent-rgb: 154, 101, 51;
  --accent-light: #d9b48a;
  --accent-dark: #7a4d24;
  --accent-deep: #5c3a1b;
  --accent-deep-rgb: 92, 58, 27;
  --accent-text: #4e3318;
  --cyan: #7a6e40;
  --cyan-rgb: 122, 110, 64;
  --cyan-light: #5f5530;
  --deep-rgb: 230, 222, 207;
  --shadow-rgb: 70, 52, 28;
  --panel-rgb: 221, 210, 192;
  --panel-deep-rgb: 214, 203, 184;
  --panel-raised-rgb: 203, 189, 166;
  --warning: #9c6416;
  --success: #1f7a50;
  --success-light: #26875a;
  --danger: #b0394a;
  --danger-text: #a63434;
  --danger-light: #8f3030;
  --shadow: 0 24px 70px rgba(70, 52, 28, 0.18);
}

:root[data-theme="green"] {
  --bg: #06130e;
  --panel: #0b1c16;
  --panel-strong: #0f2a20;
  --panel-soft: #133527;
  --line-rgb: 140, 220, 180;
  --text: #f2fbf6;
  --muted: #7fa595;
  --muted-light: #b2d2c4;
  --muted-dark: #5e8676;
  --accent: #4fd492;
  --accent-rgb: 79, 212, 146;
  --accent-light: #9ef0c6;
  --accent-dark: #2fa86b;
  --accent-deep: #1f7a4c;
  --accent-deep-rgb: 16, 82, 52;
  --accent-text: #d8f8e8;
  --cyan: #3fc9c2;
  --cyan-rgb: 63, 201, 194;
  --cyan-light: #9ce8e3;
  --deep-rgb: 3, 14, 10;
  --shadow-rgb: 0, 8, 5;
  --panel-rgb: 11, 28, 22;
  --panel-deep-rgb: 7, 20, 15;
  --panel-raised-rgb: 15, 46, 34;
}

:root[data-theme="red"] {
  --bg: #14090c;
  --panel: #1e0f14;
  --panel-strong: #2a141b;
  --panel-soft: #361a23;
  --line-rgb: 236, 150, 160;
  --text: #fff4f5;
  --muted: #b08890;
  --muted-light: #dcb9bf;
  --muted-dark: #8a6068;
  --accent: #ff6b7d;
  --accent-rgb: 255, 107, 125;
  --accent-light: #ffb0ba;
  --accent-dark: #e0485c;
  --accent-deep: #a62c3e;
  --accent-deep-rgb: 110, 24, 38;
  --accent-text: #ffe0e4;
  --cyan: #ff9f6b;
  --cyan-rgb: 255, 159, 107;
  --cyan-light: #ffc9a8;
  --deep-rgb: 16, 5, 8;
  --shadow-rgb: 10, 0, 3;
  --panel-rgb: 30, 15, 20;
  --panel-deep-rgb: 22, 10, 14;
  --panel-raised-rgb: 54, 24, 34;
}

:root[data-theme="gray"] {
  --bg: #0f1012;
  --panel: #17191c;
  --panel-strong: #1e2125;
  --panel-soft: #262a2f;
  --line-rgb: 200, 205, 215;
  --text: #f3f4f6;
  --muted: #8b9098;
  --muted-light: #c0c4cb;
  --muted-dark: #6a7079;
  --accent: #c5ccd6;
  --accent-rgb: 197, 204, 214;
  --accent-light: #e6eaf0;
  --accent-dark: #8f98a5;
  --accent-deep: #5d6570;
  --accent-deep-rgb: 60, 66, 75;
  --accent-text: #eef0f3;
  --cyan: #9aa7ba;
  --cyan-rgb: 154, 167, 186;
  --cyan-light: #ccd3de;
  --deep-rgb: 6, 7, 8;
  --shadow-rgb: 0, 0, 0;
  --panel-rgb: 23, 25, 28;
  --panel-deep-rgb: 16, 17, 19;
  --panel-raised-rgb: 38, 42, 47;
}

:root[data-theme="neon"] {
  --bg: #0d0614;
  --panel: #160a20;
  --panel-strong: #1f0e2c;
  --panel-soft: #2a1338;
  --line-rgb: 230, 150, 240;
  --text: #fdf3ff;
  --muted: #a387b0;
  --muted-light: #d6bfe0;
  --muted-dark: #7d6189;
  --accent: #ff00c8;
  --accent-rgb: 255, 0, 200;
  --accent-light: #ff8ce4;
  --accent-dark: #d400a6;
  --accent-deep: #8f0072;
  --accent-deep-rgb: 92, 0, 74;
  --accent-text: #ffe0f7;
  --cyan: #00ff9d;
  --cyan-rgb: 0, 255, 157;
  --cyan-light: #8affcf;
  --deep-rgb: 9, 3, 14;
  --shadow-rgb: 6, 0, 10;
  --panel-rgb: 22, 10, 32;
  --panel-deep-rgb: 15, 6, 22;
  --panel-raised-rgb: 42, 19, 56;
}

/* Неоновая тема: мятный (--cyan) — не только второй цвет, а часть градиентов фона, панелей,
   кнопок и значков. В остальных темах эти элементы остаются одноцветными. */
:root[data-theme="neon"] body {
  background:
    radial-gradient(circle at 8% 2%, rgba(var(--accent-rgb), 0.14), transparent 27rem),
    radial-gradient(circle at 92% 18%, rgba(var(--cyan-rgb), 0.14), transparent 34rem),
    radial-gradient(circle at 55% 100%, rgba(var(--cyan-rgb), 0.08), transparent 38rem),
    var(--bg);
}

:root[data-theme="neon"] .app-sidebar {
  background:
    radial-gradient(circle at 0% 100%, rgba(var(--cyan-rgb), 0.12), transparent 18rem),
    linear-gradient(180deg, rgba(var(--panel-raised-rgb), 0.82), rgba(var(--panel-deep-rgb), 0.96)),
    var(--panel);
}

:root[data-theme="neon"] .app-nav__link--active,
:root[data-theme="neon"] .app-nav__indicator {
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.16), rgba(var(--cyan-rgb), 0.08));
}

:root[data-theme="neon"] .app-nav__link--active::before,
:root[data-theme="neon"] .app-nav__indicator::before {
  background: linear-gradient(180deg, var(--accent), var(--cyan));
}

:root[data-theme="neon"] .hm-hero,
:root[data-theme="neon"] .overview-card {
  background:
    radial-gradient(circle at 88% 20%, rgba(var(--cyan-rgb), 0.2), transparent 22rem),
    radial-gradient(circle at 0% 100%, rgba(var(--accent-rgb), 0.12), transparent 20rem),
    linear-gradient(135deg, rgba(var(--panel-raised-rgb), 0.9), rgba(var(--panel-deep-rgb), 0.95));
}

:root[data-theme="neon"] .hm-feature {
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--accent-rgb), 0.14), transparent 14rem),
    radial-gradient(circle at 0% 100%, rgba(var(--cyan-rgb), 0.16), transparent 16rem),
    linear-gradient(160deg, rgba(var(--panel-raised-rgb), 0.95), rgba(var(--panel-deep-rgb), 0.95));
}

:root[data-theme="neon"] .card {
  background: linear-gradient(160deg, rgba(var(--panel-rgb), 0.62) 45%, rgba(var(--cyan-rgb), 0.1));
}

:root[data-theme="neon"] .hm-steps__number,
:root[data-theme="neon"] .hm-feature__icon {
  background: linear-gradient(145deg, var(--accent), var(--cyan));
}

:root[data-theme="neon"] .hm-steps li:not(:last-child)::after {
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.5), rgba(var(--cyan-rgb), 0.35));
}

:root[data-theme="neon"] .button:not(.button--ghost, .button--danger) {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.26), rgba(var(--cyan-rgb), 0.14));
}

:root[data-theme="neon"] .button:not(.button--ghost, .button--danger):hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.34), rgba(var(--cyan-rgb), 0.22));
}

:root[data-theme="neon"] .st-modal {
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--cyan-rgb), 0.1), transparent 16rem),
    var(--panel-strong);
}

* {
  box-sizing: border-box;
}

/* Системная подсветка при нажатии на телефоне не нужна: у кнопок и ссылок свои :hover и :active. */
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

/* Долгое нажатие на кнопку или пункт меню не выделяет текст. */
button,
.app-sidebar a {
  user-select: none;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 8% 2%, rgba(var(--accent-rgb), 0.12), transparent 27rem),
    radial-gradient(circle at 88% 22%, rgba(var(--cyan-rgb), 0.09), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select {
  cursor: pointer;
}

.site-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 48px;
}

.site-header {
  display: flex;
  align-items: center;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 11px;
  width: fit-content;
}

.brand__mark {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.17), rgba(var(--cyan-rgb), 0.08));
  box-shadow: inset 0 0 18px rgba(var(--accent-rgb), 0.08);
  transform: rotate(45deg) scale(0.82);
}

.brand__mark::before,
.brand__mark::after,
.brand__mark span {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid var(--accent);
  content: "";
}

.brand__mark::before {
  transform: translate(-5px, -5px);
}

.brand__mark::after {
  transform: translate(5px, 5px);
}

.brand__mark span {
  border-color: var(--cyan);
}

.brand > span:last-child {
  display: flex;
  align-items: baseline;
}

.brand strong {
  font-size: 18px;
  letter-spacing: -0.04em;
}

.brand small {
  margin-left: 6px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.main-nav {
  display: flex;
  align-self: stretch;
  gap: 34px;
}

.main-nav__link {
  position: relative;
  display: grid;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: color 180ms ease;
}

.main-nav__link:hover,
.main-nav__link--active {
  color: var(--text);
}

.main-nav__link--active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 999px 999px 0 0;
  background: var(--accent);
  box-shadow: 0 -3px 14px rgba(var(--accent-rgb), 0.55);
  content: "";
}

.connection-status {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.connection-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(255, 199, 107, 0.1);
}

.connection-status > span:last-child {
  display: flex;
  flex-direction: column;
}

.connection-status small,
.connection-status strong {
  font-size: 9px;
  line-height: 1.25;
}

.connection-status small {
  color: var(--muted);
}

.connection-status strong {
  font-weight: 700;
}

.hero {
  position: relative;
  overflow: hidden;
  margin-top: 34px;
  padding: 35px 38px 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(90deg, var(--bz-hero-from), var(--bz-hero-to)),
    var(--panel);
  box-shadow: var(--shadow);
}

.hero::before {
  position: absolute;
  top: -125px;
  right: 2%;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(var(--cyan-rgb), 0.09);
  border-radius: 50%;
  box-shadow:
    0 0 0 45px rgba(var(--cyan-rgb), 0.025),
    0 0 0 90px rgba(var(--accent-rgb), 0.018);
  content: "";
}

.hero::after {
  position: absolute;
  right: 37%;
  bottom: -38px;
  width: 300px;
  height: 110px;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.09), transparent 65%);
  content: "";
  filter: blur(8px);
}

.hero__eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero__eyebrow-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: var(--accent-soft);
  font-size: 13px;
}

.hero__body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

.hero h1 {
  max-width: 740px;
  margin: 0;
  font-size: clamp(34px, 4.35vw, 62px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.hero p {
  max-width: 600px;
  margin: 18px 0 0;
  color: var(--muted-light);
  font-size: 14px;
  line-height: 1.65;
}

.market-pulse {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 250px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bz-pulse-bg);
  backdrop-filter: blur(12px);
}

.market-pulse__icon {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 42px;
  height: 42px;
  padding: 11px 9px;
  border-radius: 12px;
  background: var(--accent-soft);
}

.market-pulse__icon i {
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.market-pulse__icon i:nth-child(1) { height: 7px; opacity: 0.55; }
.market-pulse__icon i:nth-child(2) { height: 12px; opacity: 0.72; }
.market-pulse__icon i:nth-child(3) { height: 17px; }
.market-pulse__icon i:nth-child(4) { height: 11px; opacity: 0.72; }

.market-pulse > div:last-child {
  display: flex;
  flex-direction: column;
}

.market-pulse small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.market-pulse strong {
  margin-top: 2px;
  font-size: 13px;
}

.market-pulse span {
  margin-top: 3px;
  color: var(--warning);
  font-size: 10px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  margin-top: 34px;
}

.search-field,
.filter-button,
.sort-field {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.search-field {
  display: flex;
  align-items: center;
  padding: 0 14px;
}

.search-field svg,
.filter-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.7;
}

.search-field input {
  min-width: 0;
  flex: 1;
  height: 100%;
  margin: 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.search-field input::placeholder {
  color: var(--bz-muted-1);
}

.search-field:focus-within {
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.05);
}

.search-field kbd {
  padding: 3px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: inherit;
  font-size: 9px;
}

.filter-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--muted-light);
}

.filter-button span {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 9px;
}

.sort-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 7px 0 15px;
  color: var(--muted);
  font-size: 10px;
}

.sort-field select {
  border: 0;
  outline: 0;
  background: var(--panel);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 34px 0 70px;
}

.categories {
  align-self: start;
  padding: 17px 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bz-categories-bg);
}

.categories__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.categories__heading button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.categories nav {
  display: grid;
  gap: 4px;
  padding: 10px 0;
}

.category {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 9px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease;
}

.category:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.category--active {
  background: var(--accent-soft);
  color: var(--accent);
}

.category__icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  font-size: 12px;
}

.category__count {
  color: var(--muted);
  font-size: 9px;
}

.category--active .category__count {
  color: var(--accent);
}

.categories__tip {
  display: flex;
  gap: 9px;
  margin-top: 7px;
  padding: 12px;
  border: 1px solid rgba(var(--cyan-rgb), 0.1);
  border-radius: 11px;
  background: var(--cyan-soft);
}

.categories__tip > span {
  display: grid;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid rgba(var(--cyan-rgb), 0.45);
  border-radius: 50%;
  color: var(--cyan);
  font-family: Georgia, serif;
  font-size: 10px;
}

.categories__tip p {
  margin: 0;
  color: var(--bz-muted-2);
  font-size: 9px;
  line-height: 1.55;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading p {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.section-heading > span {
  color: var(--muted);
  font-size: 10px;
}

.section-heading > span strong {
  color: var(--text);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 440px));
  gap: 18px;
}

.product-card {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.product-card:hover {
  border-color: rgba(var(--accent-rgb), 0.28);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.26);
  transform: translateY(-3px);
}

.product-card__visual {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 235px;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% 58%, rgba(var(--accent-rgb), 0.22), transparent 34%),
    linear-gradient(145deg, var(--panel-strong), var(--bg));
  background-size: 25px 25px, 25px 25px, auto, auto;
}

.product-card__visual::after {
  position: absolute;
  right: 16%;
  bottom: 27px;
  left: 16%;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  content: "";
  filter: blur(8px);
}

.product-card__badges {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 6px;
}

.badge {
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge--demo {
  border-color: rgba(255, 199, 107, 0.26);
  background: rgba(255, 199, 107, 0.11);
  color: var(--warning);
}

.badge--rare {
  border-color: rgba(var(--cyan-rgb), 0.2);
  background: var(--cyan-soft);
  color: var(--cyan);
}

.favorite-button {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bz-favorite-bg);
  backdrop-filter: blur(8px);
}

.favorite-button svg {
  width: 14px;
  fill: none;
  stroke: var(--muted-light);
  stroke-width: 1.6;
}

.item-orbit {
  position: relative;
  z-index: 1;
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(var(--accent-rgb), 0.04);
}

.item-orbit::before {
  position: absolute;
  width: 105px;
  height: 105px;
  border: 1px dashed rgba(var(--accent-rgb), 0.12);
  border-radius: 50%;
  content: "";
  transform: rotate(-18deg);
}

.orbit-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.8);
}

.orbit-dot--one { top: 25px; right: 26px; }
.orbit-dot--two { bottom: 18px; left: 39px; width: 3px; height: 3px; background: var(--cyan); }

.diamond {
  position: relative;
  width: 78px;
  height: 78px;
  background:
    linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.45) 50%, transparent 52%),
    linear-gradient(135deg, var(--accent-light) 0 25%, var(--accent-dark) 25% 50%, var(--accent) 50% 75%, var(--accent-deep) 75%);
  clip-path: polygon(50% 0, 100% 37%, 73% 100%, 27% 100%, 0 37%);
  filter: drop-shadow(0 14px 18px rgba(var(--accent-rgb), 0.3));
  transform: rotate(2deg);
}

.diamond::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(65deg, transparent 48%, rgba(var(--accent-deep-rgb), 0.48) 49% 51%, transparent 52%),
    linear-gradient(-65deg, transparent 48%, rgba(var(--accent-deep-rgb), 0.48) 49% 51%, transparent 52%);
  content: "";
}

.diamond__shine {
  position: absolute;
  top: 17px;
  left: 18px;
  width: 16px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  filter: blur(1px);
  transform: rotate(-28deg);
}

.product-card__content {
  padding: 23px;
}

.product-card__title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.product-card__id {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.product-card h2 {
  margin: 4px 0 0;
  font-size: 21px;
  letter-spacing: -0.025em;
}

.trend {
  display: grid;
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
}

.craft-quantity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 17px;
  padding: 11px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.14);
  border-radius: 11px;
  background: rgba(var(--accent-rgb), 0.055);
}

.craft-quantity__label {
  max-width: 180px;
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.4;
}

.quantity-stepper {
  display: inline-grid;
  grid-template-columns: 32px 64px 32px;
  align-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 9px;
  background: rgba(var(--deep-rgb), 0.38);
}

.quantity-stepper button {
  display: grid;
  width: 32px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
  transition: background 150ms ease, color 150ms ease, opacity 150ms ease;
}

.quantity-stepper button:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.quantity-stepper button:disabled {
  cursor: not-allowed;
  opacity: 0.28;
}

.quantity-stepper__value {
  display: flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.price-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.price-row > span {
  display: flex;
  flex-direction: column;
  color: var(--muted-light);
  font-size: 13px;
}

.price-row span small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.price-row > strong {
  font-size: 16px;
}

.price-row > strong small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.order-execution {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: 11px;
  background: rgba(var(--deep-rgb), 0.3);
}

.order-execution__header,
.order-execution__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-execution__header > span,
.order-execution__footer > span {
  color: var(--muted-light);
  font-size: 10px;
}

.order-execution__header strong {
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(97, 215, 165, 0.1);
  color: var(--success-light);
  font-size: 8px;
  font-weight: 800;
}

.order-execution__header strong.order-execution__status--partial {
  background: rgba(255, 113, 130, 0.12);
  color: var(--danger);
}

.order-execution__levels {
  display: grid;
  gap: 5px;
  max-height: 140px;
  margin: 10px 0;
  padding: 8px 0;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.order-execution__levels > p {
  margin: 2px 0;
  color: var(--muted);
  font-size: 9px;
}

.order-level {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 25px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 9px;
}

.order-level:nth-child(odd) {
  background: rgba(255, 255, 255, 0.018);
}

.order-level span {
  color: var(--muted-light);
}

.order-level strong {
  color: var(--text);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.order-level--unfilled {
  border: 1px solid rgba(255, 113, 130, 0.12);
  background: rgba(255, 113, 130, 0.06) !important;
}

.order-level--unfilled span,
.order-level--unfilled strong {
  color: var(--danger);
}

.order-execution__footer strong {
  color: var(--accent);
  font-size: 11px;
}

.profit-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.14);
  border-radius: 11px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.1), rgba(var(--accent-rgb), 0.03));
}

.profit-block > span {
  color: var(--muted-light);
  font-size: 12px;
}

.profit-block div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.profit-block strong {
  color: var(--accent);
  font-size: 18px;
}

.profit-block div span {
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.details-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  margin-top: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted-light);
  font-size: 13px;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.details-link:hover {
  border-color: rgba(var(--accent-rgb), 0.25);
  background: var(--accent-soft);
  color: var(--accent);
}

.details-link span {
  font-size: 15px;
}

.empty-card {
  display: flex;
  min-height: 485px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px dashed var(--bz-empty-border);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}

.empty-card__icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 13px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--muted-light);
  font-size: 20px;
}

.empty-card strong {
  color: var(--muted-light);
  font-size: 10px;
}

.empty-card span {
  margin-top: 5px;
  font-size: 8px;
}

.demo-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.demo-note span {
  display: grid;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid rgba(255, 199, 107, 0.3);
  border-radius: 50%;
  color: var(--warning);
  font-size: 9px;
  font-weight: 800;
}

.demo-note .demo-note__text {
  display: inline;
  min-width: 0;
  flex: 1 1 auto;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-size: inherit;
  font-weight: 400;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 88px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.site-footer p {
  margin: 0;
}

.site-footer > span {
  justify-self: end;
  color: var(--bz-muted-3);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand--footer {
  opacity: 0.78;
  transform: scale(0.86);
  transform-origin: left center;
}

.visually-hidden {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .site-shell {
    padding: 0 28px;
  }

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

  .hero h1 {
    font-size: clamp(34px, 5.2vw, 54px);
  }
}

@media (max-width: 820px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    display: none;
  }

  .hero__body {
    align-items: flex-start;
    flex-direction: column;
  }

  .market-pulse {
    width: 100%;
  }

  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .categories {
    overflow-x: auto;
  }

  .categories__heading,
  .categories__tip {
    display: none;
  }

  .categories nav {
    display: flex;
    width: max-content;
    padding: 0;
  }

  .category {
    grid-template-columns: 22px auto auto;
  }

  .site-footer {
    grid-template-columns: 1fr auto;
  }

  .site-footer p {
    display: none;
  }
}

@media (max-width: 620px) {
  .site-shell {
    padding: 0 16px;
  }

  .site-header {
    min-height: 72px;
  }

  .connection-status small {
    display: none;
  }

  .hero {
    margin-top: 20px;
    padding: 26px 22px 24px;
  }

  .hero__body {
    gap: 28px;
  }

  .hero h1 {
    font-size: clamp(32px, 10vw, 46px);
  }

  .hero p {
    font-size: 12px;
  }

  .search-panel {
    grid-template-columns: 1fr auto;
  }

  .sort-field {
    display: none;
  }

  .filter-button {
    font-size: 0;
  }

  .filter-button span {
    font-size: 9px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .empty-card {
    min-height: 150px;
  }

  .section-heading > span {
    display: none;
  }

  .site-footer > span {
    font-size: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Desktop product expansion and live Bazaar data */

.site-header {
  justify-content: space-between;
}

.product-grid {
  align-items: start;
  overflow: visible;
}

.product-card {
  --card-width: 440px;
  --detail-width: 480px;
  --card-shift-x: 0px;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-areas: "main recipe";
  grid-template-columns: var(--card-width) 0;
  width: var(--card-width);
  max-width: none;
  transform: translateX(var(--card-shift-x));
  transition:
    width 320ms cubic-bezier(0.22, 1, 0.36, 1),
    grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.product-card:hover {
  transform: translateX(var(--card-shift-x));
}

.product-card--open {
  z-index: 20;
  grid-template-columns: var(--card-width) var(--detail-width);
  width: calc(var(--card-width) + var(--detail-width));
  border-color: rgba(var(--accent-rgb), 0.34);
  box-shadow: 0 28px 80px rgba(var(--shadow-rgb), 0.48);
}

.product-card--open.product-card--expand-left {
  --card-shift-x: calc(var(--detail-width) * -1);
  grid-template-areas: "recipe main";
  grid-template-columns: var(--detail-width) var(--card-width);
}

.product-card__main {
  grid-area: main;
  min-width: 0;
  background: var(--panel);
}

.product-card--open.product-card--expand-right .product-card__main {
  border-right: 1px solid var(--line-strong);
}

.product-card--open.product-card--expand-left .product-card__main {
  border-left: 1px solid var(--line-strong);
}

.badge--live {
  border-color: rgba(97, 215, 165, 0.3);
  background: rgba(97, 215, 165, 0.11);
  color: var(--success-light);
}

.badge--live.badge--error {
  border-color: rgba(255, 113, 130, 0.28);
  background: rgba(255, 113, 130, 0.11);
  color: var(--danger);
}

.badge--batch {
  border-color: rgba(var(--accent-rgb), 0.26);
  background: var(--accent-soft);
  color: var(--accent);
}

.powder-icon {
  position: relative;
  width: 88px;
  height: 82px;
  filter: drop-shadow(0 15px 20px rgba(249, 133, 77, 0.28));
}

.powder-icon i {
  position: absolute;
  display: block;
  border: 1px solid rgba(255, 224, 194, 0.5);
  background: linear-gradient(145deg, #ffd29b, #f77a4b 58%, #a6384d);
  box-shadow: inset -5px -6px 8px rgba(91, 28, 57, 0.34);
  transform: rotate(45deg);
}

.powder-icon i:nth-child(1) {
  top: 18px;
  left: 28px;
  width: 37px;
  height: 37px;
  border-radius: 8px 3px 9px 4px;
}

.powder-icon i:nth-child(2) {
  top: 4px;
  left: 11px;
  width: 25px;
  height: 25px;
  border-radius: 7px 3px 7px 3px;
  opacity: 0.92;
}

.powder-icon i:nth-child(3) {
  right: 2px;
  bottom: 9px;
  width: 28px;
  height: 28px;
  border-radius: 4px 8px 4px 7px;
  opacity: 0.9;
}

.powder-icon i:nth-child(4) {
  bottom: 2px;
  left: 9px;
  width: 20px;
  height: 20px;
  border-radius: 5px 2px 6px 3px;
  opacity: 0.76;
}

.powder-icon i:nth-child(5) {
  top: 5px;
  right: 8px;
  width: 14px;
  height: 14px;
  border-radius: 4px 2px;
  opacity: 0.68;
}

.trend--negative {
  background: rgba(255, 113, 130, 0.12);
  color: var(--danger);
  transform: rotate(90deg);
}

.profit-block--negative {
  border-color: rgba(255, 113, 130, 0.16);
  background: linear-gradient(90deg, rgba(255, 113, 130, 0.1), rgba(255, 113, 130, 0.025));
}

.profit-block--negative strong,
.profit-block--negative div span {
  color: var(--danger);
}

.profit-block--negative div span {
  background: rgba(255, 113, 130, 0.12);
}

.details-link {
  width: 100%;
  appearance: none;
  background: transparent;
  text-align: left;
}

.details-link__arrow {
  transition: transform 220ms ease;
}

.product-card--open .details-link__arrow {
  transform: rotate(180deg);
}

.recipe-panel {
  position: absolute;
  visibility: hidden;
  grid-area: recipe;
  min-width: 0;
  width: var(--detail-width);
  padding: 23px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(var(--panel-raised-rgb), 0.72), rgba(var(--panel-deep-rgb), 0.96)),
    var(--panel);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-14px);
  transition:
    opacity 180ms ease 40ms,
    transform 260ms ease 30ms;
}

.product-card--expand-left .recipe-panel {
  transform: translateX(14px);
}

.product-card--open .recipe-panel {
  position: relative;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.recipe-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.recipe-panel__eyebrow {
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.recipe-panel h3 {
  margin: 6px 0 0;
  font-size: 21px;
  letter-spacing: -0.035em;
}

.recipe-panel__header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.recipe-panel__close {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(var(--deep-rgb), 0.46);
  color: var(--muted-light);
  font-size: 20px;
  line-height: 1;
}

.recipe-formula {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.07);
}

.recipe-formula > span {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.recipe-formula p {
  margin: 0;
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.45;
}

.recipe-list {
  display: grid;
  gap: 4px;
  margin-top: 14px;
}

.recipe-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 105px;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 5px 8px;
  border-radius: 10px;
  transition: background 150ms ease;
}

.recipe-row:hover,
.recipe-row--primary {
  background: rgba(255, 255, 255, 0.025);
}

.recipe-row__icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(var(--cyan-rgb), 0.24);
  border-radius: 8px;
  background: rgba(var(--cyan-rgb), 0.1);
  color: var(--cyan-light);
  font-size: 8px;
  font-weight: 800;
}

.recipe-row__icon--ash {
  border-color: rgba(255, 159, 101, 0.24);
  background: rgba(255, 122, 75, 0.1);
  color: #ffaf7e;
}

.recipe-row__name {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.recipe-row__name strong {
  overflow: hidden;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-row__name small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.recipe-row__quantity {
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 700;
}

.recipe-row__price {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  flex-direction: column;
}

.recipe-row__price strong {
  color: var(--text);
  font-size: 10px;
}

.recipe-row__price small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.recipe-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 8px 5px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recipe-divider small {
  color: var(--accent);
  font-size: 8px;
}

.craft-cost-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
}

.craft-cost-split__item {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 82px;
  justify-content: center;
  flex-direction: column;
  padding: 11px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(var(--deep-rgb), 0.32);
}

.craft-cost-split__item::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--accent);
  content: "";
  opacity: 0.72;
}

.craft-cost-split__item--ash::before {
  background: #ff916a;
}

.craft-cost-split__item--crimsolite::before {
  background: var(--cyan);
}

.craft-cost-split__item > span {
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.35;
}

.craft-cost-split__item > small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.craft-cost-split__item > strong {
  margin-top: 8px;
  color: var(--text);
  font-size: 13px;
}

.craft-cost-split__item > strong small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
}

.recipe-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.recipe-summary > div {
  display: flex;
  min-height: 58px;
  justify-content: center;
  flex-direction: column;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(var(--deep-rgb), 0.28);
}

.recipe-summary span {
  color: var(--muted);
  font-size: 8px;
}

.recipe-summary strong {
  margin-top: 4px;
  font-size: 13px;
}

.recipe-summary__result {
  grid-column: 1 / -1;
  border-color: rgba(var(--accent-rgb), 0.18) !important;
  background: rgba(var(--accent-rgb), 0.07) !important;
}

.recipe-summary__result strong {
  color: var(--accent);
}

.recipe-summary__result--negative {
  border-color: rgba(255, 113, 130, 0.18) !important;
  background: rgba(255, 113, 130, 0.07) !important;
}

.recipe-summary__result--negative strong {
  color: var(--danger);
}

.recipe-panel__updated {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 8px;
}

.recipe-panel__live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(97, 215, 165, 0.08);
}

@media (max-width: 1050px) {
  .product-card {
    --detail-width: 450px;
  }
}

/* Application shell and section navigation */

.site-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 32px;
  width: 100%;
  max-width: none;
  padding: 0 32px 0 0;
}

/* z-index поднимает сайдбар над содержимым страницы: палитра тем вылетает за его край. */
.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 100vh;
  align-self: start;
  flex-direction: column;
  overflow-y: auto;
  padding: 28px 18px 18px;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(var(--panel-raised-rgb), 0.82), rgba(var(--panel-deep-rgb), 0.96)),
    var(--panel);
  box-shadow: 0 20px 60px rgba(var(--shadow-rgb), 0.26);
}

.app-sidebar::before {
  position: absolute;
  top: 0;
  right: 18px;
  left: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.7), transparent);
  content: "";
}

.app-sidebar__brand {
  margin: 2px 8px 36px;
  gap: 14px;
}

.app-sidebar__brand .brand__mark {
  width: 42px;
  height: 42px;
}

.app-sidebar__brand > span:last-child {
  flex-direction: column;
  align-items: flex-start;
}

.app-sidebar__brand strong {
  font-size: 23px;
  line-height: 1.1;
}

.app-sidebar__brand small {
  margin: 3px 0 0;
  font-size: 10px;
}

.app-nav {
  position: relative;
  display: grid;
  gap: 7px;
}

.app-nav__label {
  margin: 0 12px 10px;
  color: var(--muted-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.app-nav__link {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--muted-light);
  font-size: 14px;
  font-weight: 650;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.app-nav__link:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
}

.app-nav__link--active,
.app-nav__indicator {
  border-color: rgba(var(--accent-rgb), 0.17);
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.14), rgba(var(--accent-rgb), 0.045));
  color: var(--accent-text);
}

/* Подсветка активного пункта — отдельный блок, который переезжает к новому пункту (app.js).
   Пока скрипт его не расставил, подсвечивается сама ссылка. */
.app-nav__indicator {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: none;
  border-width: 1px;
  border-style: solid;
  border-radius: 13px;
  pointer-events: none;
}

.app-nav.has-indicator .app-nav__indicator {
  display: block;
}

.app-nav.is-animated .app-nav__indicator {
  transition: transform 320ms cubic-bezier(0.3, 0.8, 0.3, 1), height 320ms cubic-bezier(0.3, 0.8, 0.3, 1);
}

.app-nav.has-indicator .app-nav__link--active {
  border-color: transparent;
  background: none;
}

.app-nav.has-indicator .app-nav__link--active::before {
  content: none;
}

.app-nav__link--active::before,
.app-nav__indicator::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: -19px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.55);
  content: "";
}

.app-nav__icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(var(--deep-rgb), 0.3);
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
}

.app-nav__link--active .app-nav__icon {
  border-color: rgba(var(--accent-rgb), 0.22);
  background: var(--accent-soft);
  color: var(--accent);
}

.app-workspace {
  min-width: 0;
  padding-top: 28px;
}

.app-workspace > main {
  min-height: calc(100vh - 120px);
}

.app-page[hidden] {
  display: none !important;
}

/* Новая страница проявляется. Только opacity: transform сделал бы страницу контейнером
   для position: fixed внутри неё (панель рецепта). */
.app-page--active {
  animation: app-page-in 220ms ease;
}

@keyframes app-page-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-page--active {
    animation: none;
  }
}

.overview-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 32px;
  overflow: hidden;
  padding: 30px 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 85% 30%, rgba(var(--cyan-rgb), 0.11), transparent 24rem),
    linear-gradient(135deg, rgba(var(--panel-raised-rgb), 0.9), rgba(var(--panel-deep-rgb), 0.95));
  box-shadow: 0 20px 60px rgba(var(--shadow-rgb), 0.22);
}

.overview-card::after {
  position: absolute;
  right: 29%;
  bottom: -55px;
  width: 240px;
  height: 130px;
  border: 1px solid rgba(var(--accent-rgb), 0.08);
  border-radius: 50%;
  content: "";
}

.overview-card__copy {
  position: relative;
  z-index: 1;
}

.overview-card__eyebrow,
.page-heading > span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.overview-card h1 {
  max-width: 680px;
  margin: 10px 0 0;
  font-size: clamp(28px, 3vw, 43px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.overview-card__copy p {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted-light);
  font-size: 12px;
  line-height: 1.65;
}

.overview-features {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 8px;
}

.overview-features div {
  display: flex;
  min-height: 50px;
  justify-content: center;
  flex-direction: column;
  padding: 9px 12px 9px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(var(--deep-rgb), 0.3);
}

.overview-features strong {
  color: var(--text);
  font-size: 10px;
}

.overview-features span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.app-workspace .search-panel {
  margin-top: 18px;
}

.page-heading {
  padding: 10px 4px 26px;
  border-bottom: 1px solid var(--line);
}

.page-heading h1 {
  margin: 8px 0 0;
  font-size: 38px;
  letter-spacing: -0.045em;
}

.page-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.page-placeholder {
  display: flex;
  min-height: 520px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin-top: 24px;
  border: 1px dashed rgba(var(--line-rgb), 0.18);
  border-radius: 20px;
  background: rgba(var(--panel-rgb), 0.42);
  text-align: center;
}

.page-placeholder > span {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
}

.page-placeholder strong {
  font-size: 14px;
}

.page-placeholder p {
  max-width: 420px;
  margin: 7px 20px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.app-workspace .site-footer {
  grid-template-columns: 1fr auto;
  min-height: 72px;
}

.app-workspace .site-footer p {
  display: block;
}

@media (max-width: 1180px) {
  .site-shell {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 22px;
    padding: 0 20px 0 0;
  }

  .overview-card {
    grid-template-columns: 1fr;
  }

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

/* Основная страница: описание сайта и частые вопросы */

.hm-hero {
  position: relative;
  overflow: hidden;
  padding: 34px 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 88% 20%, rgba(var(--cyan-rgb), 0.12), transparent 22rem),
    linear-gradient(135deg, rgba(var(--panel-raised-rgb), 0.9), rgba(var(--panel-deep-rgb), 0.95));
  box-shadow: 0 20px 60px rgba(var(--shadow-rgb), 0.22);
}

.hm-hero__eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hm-hero h1 {
  max-width: 640px;
  margin: 10px 0 0;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.hm-hero p {
  max-width: 600px;
  margin: 14px 0 0;
  color: var(--muted-light);
  font-size: 13px;
  line-height: 1.65;
}

.hm-hero__telegram {
  margin-top: 22px;
}

.hm-section {
  margin-top: 30px;
}

.hm-section > h2 {
  margin: 0 0 14px 4px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

/* «Как это работает» — инструкция: одна плоская панель, шаги соединены линией. */
.hm-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin: 0;
  padding: 24px 26px;
  border: 1px dashed rgba(var(--line-rgb), 0.24);
  border-radius: 20px;
  list-style: none;
}

.hm-steps li {
  position: relative;
}

/* Линия от номера шага к следующему. */
.hm-steps li:not(:last-child)::after {
  position: absolute;
  top: 17px;
  left: 48px;
  right: -20px;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.45), rgba(var(--accent-rgb), 0.08));
  content: "";
}

.hm-steps__number {
  display: grid;
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0.12);
}

.hm-steps strong {
  font-size: 14px;
}

.hm-steps p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* «Разделы» — выпуклые карточки-ссылки. Auction House на две колонки, чтобы ряды были полными. */
.hm-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hm-feature {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  padding: 22px;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--accent-rgb), 0.14), transparent 14rem),
    linear-gradient(160deg, rgba(var(--panel-raised-rgb), 0.95), rgba(var(--panel-deep-rgb), 0.95));
  box-shadow: 0 14px 34px rgba(var(--shadow-rgb), 0.22);
  color: var(--text);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.hm-feature:first-child {
  grid-column: span 2;
}

.hm-feature:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 18px 40px rgba(var(--shadow-rgb), 0.3);
  transform: translateY(-2px);
}

.hm-feature__icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--accent), var(--accent-dark));
  color: var(--bg);
}

.hm-feature__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hm-feature strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.hm-feature p {
  flex: 1;
  margin: 8px 0 0;
  color: var(--muted-light);
  font-size: 12px;
  line-height: 1.6;
}

.hm-feature__open {
  margin-top: 16px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.hm-feature__open span {
  display: inline-block;
  transition: transform 160ms ease;
}

.hm-feature:hover .hm-feature__open span {
  transform: translateX(3px);
}

.hm-faq {
  display: grid;
  gap: 8px;
}

.hm-faq__item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(var(--panel-rgb), 0.62);
}

.hm-faq__item[open] {
  border-color: rgba(var(--accent-rgb), 0.25);
}

.hm-faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.hm-faq__item summary::-webkit-details-marker {
  display: none;
}

/* Стрелка: уголок из рамки, поворачивается при открытии. */
.hm-faq__item summary::after {
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-right: 1.7px solid var(--muted);
  border-bottom: 1.7px solid var(--muted);
  content: "";
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.hm-faq__item[open] summary::after {
  margin-top: 3px;
  transform: rotate(225deg);
}

.hm-faq__item summary:hover {
  color: var(--accent-light);
}

.hm-faq__item p,
.hm-faq__item ul {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--muted-light);
  font-size: 12px;
  line-height: 1.65;
}

.hm-faq__item ul {
  display: grid;
  gap: 6px;
  padding-left: 34px;
}

.hm-faq__item b {
  color: var(--text);
}

@media (max-width: 1180px) {
  .hm-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hm-steps {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .hm-steps li {
    padding-left: 52px;
  }

  .hm-steps__number {
    position: absolute;
    top: 0;
    left: 0;
  }

  .hm-steps li:not(:last-child)::after {
    top: 46px;
    bottom: -18px;
    left: 18px;
    right: auto;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.45), rgba(var(--accent-rgb), 0.08));
  }
}

/* Auction House: отслеживание лотов */

.ah-layout {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.ah-layout[hidden] {
  display: none;
}

.card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(var(--panel-rgb), 0.62);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.st-section__hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.st-section__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
}

/* Без видимых кнопок блок не оставляет пустой отступ. */
.st-section__actions:not(:has(> :not([hidden]))) {
  display: none;
}

.tg-status {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.tg-status[data-state="linked"] {
  border-color: rgba(97, 215, 165, 0.3);
  background: rgba(97, 215, 165, 0.1);
  color: var(--success);
}

.tg-status[data-state="pending"] {
  border-color: rgba(255, 199, 107, 0.3);
  background: rgba(255, 199, 107, 0.08);
  color: var(--warning);
}

.tg-code {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed rgba(var(--accent-rgb), 0.3);
  border-radius: 14px;
  background: var(--accent-soft);
}

.tg-code[hidden] {
  display: none;
}

.tg-code span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tg-code strong {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 24px;
  letter-spacing: 0.12em;
  user-select: all;
}

.tg-code a {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.24), rgba(var(--accent-rgb), 0.12));
  color: var(--accent-text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease;
}

.button:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.6);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.32), rgba(var(--accent-rgb), 0.16));
}

.button:disabled {
  cursor: progress;
  opacity: 0.55;
}

.button--ghost {
  border-color: var(--line);
  background: rgba(var(--deep-rgb), 0.3);
  color: var(--muted-light);
}

.button--ghost:hover:not(:disabled) {
  border-color: rgba(255, 120, 120, 0.35);
  background: rgba(255, 120, 120, 0.08);
  color: var(--danger-light);
}

.button[hidden] {
  display: none;
}

.ah-form {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  margin-top: 16px;
}

.ah-field {
  position: relative;
  display: grid;
  gap: 6px;
}

.ah-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ah-field input,
.ah-field .dropdown__field {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  background: rgba(var(--deep-rgb), 0.45);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.ah-field input:focus,
.ah-field .dropdown__field:focus-visible,
.ah-field .dropdown.is-open .dropdown__field {
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.ah-pet-filters {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 240px));
  gap: 12px;
}

.ah-pet-filters[hidden] {
  display: none;
}

.ah-pet-filters__hint {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.ah-field__preview {
  min-height: 15px;
  color: var(--muted);
  font-size: 11px;
}

.ah-field__preview.is-invalid {
  color: var(--danger-text);
}

.ah-form__submit {
  margin-top: 23px;
  min-height: 42px;
}

.ah-form__error {
  margin: 10px 0 0;
  color: var(--danger-text);
  font-size: 12px;
}

.ah-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 20;
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  list-style: none;
}

.ah-suggestions li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.ah-suggestions li:hover,
.ah-suggestions li.is-active {
  background: var(--accent-soft);
}

.ah-suggestions small,
.ah-subscription__item small {
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ah-count {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
}

.ah-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.ah-subscription {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 12px 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(var(--deep-rgb), 0.3);
}

.ah-subscription__item {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.ah-subscription__item strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ah-subscription__rule {
  padding: 6px 11px;
  border: 1px solid rgba(97, 215, 165, 0.25);
  border-radius: 999px;
  background: rgba(97, 215, 165, 0.08);
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ah-subscription__rule--any {
  border-color: rgba(var(--cyan-rgb), 0.28);
  background: var(--cyan-soft);
  color: var(--cyan-light);
}

.ah-empty {
  display: grid;
  gap: 6px;
  padding: 28px;
  border: 1px dashed rgba(var(--line-rgb), 0.18);
  border-radius: 14px;
  text-align: center;
}

.ah-empty strong {
  font-size: 14px;
}

.ah-empty span {
  color: var(--muted);
  font-size: 12px;
}

.ah-monitor {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.ah-monitor::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--warning);
  content: "";
}

.ah-monitor[data-state="ok"]::before {
  background: var(--success);
}

.ah-monitor[data-state="error"]::before {
  background: var(--danger);
}

.ah-own-head {
  flex-wrap: wrap;
}

.ah-own-form {
  display: grid;
  grid-template-columns: minmax(0, 320px) auto;
  justify-content: start;
  align-items: start;
  gap: 12px;
  margin-top: 16px;
}

/* У игрока бывают десятки лотов: список прокручивается внутри карточки. */
.ah-own-list {
  max-height: 520px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.ah-lot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 12px 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(var(--deep-rgb), 0.3);
}

.ah-lot__item {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.ah-lot__item strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ah-lot__item small {
  color: var(--muted);
  font-size: 11px;
}

.ah-lot__price {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ah-lot.is-ended {
  opacity: 0.6;
}

.ah-own-hint {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.page-placeholder[hidden] {
  display: none;
}

.page-placeholder code {
  color: var(--muted-light);
}

@media (max-width: 1180px) {
  .ah-form {
    grid-template-columns: 1fr 1fr;
  }

  .ah-field--item {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .ah-form,
  .ah-own-form,
  .ah-pet-filters,
  .ah-subscription {
    grid-template-columns: 1fr;
  }

  .ah-form__submit {
    margin-top: 0;
  }
}

.button--danger {
  border-color: rgba(255, 120, 120, 0.32);
  background: rgba(255, 120, 120, 0.1);
  color: var(--danger-light);
}

.button--danger:hover:not(:disabled) {
  border-color: rgba(255, 120, 120, 0.55);
  background: rgba(255, 120, 120, 0.16);
}

.notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 199, 107, 0.3);
  border-radius: 16px;
  background: rgba(255, 199, 107, 0.07);
}

.notice[hidden] {
  display: none;
}

.notice__icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 199, 107, 0.16);
  color: var(--warning);
  font-weight: 800;
}

.notice div {
  display: grid;
  gap: 3px;
}

.notice strong {
  color: var(--warning);
  font-size: 13px;
}

.notice div span {
  color: var(--muted-light);
  font-size: 12px;
}

/* Настройки: кнопка в сайдбаре */

.st-trigger {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 13px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 13px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.05));
  color: var(--accent-text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease;
}

.st-trigger:hover {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.24), rgba(var(--accent-rgb), 0.08));
}

.st-trigger__icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}

.st-trigger__icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

/* Низ сайдбара: кнопка настроек и кнопка темы в одной строке. */

.app-sidebar__bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: auto;
}

/* Переключатель тем: при открытии кружки тем разлетаются по дуге вокруг кнопки. */

.theme-switcher__toggle {
  display: grid;
  width: 52px;
  height: 100%;
  min-height: 52px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(var(--deep-rgb), 0.28);
  color: var(--accent);
  transition: border-color 160ms ease, background 160ms ease;
}

.theme-switcher__toggle:hover,
.theme-switcher.is-open .theme-switcher__toggle {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: var(--accent-soft);
}

.theme-switcher__toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  transition: transform 420ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.theme-switcher__toggle svg circle {
  fill: currentColor;
  stroke: none;
}

.theme-switcher.is-open .theme-switcher__toggle svg {
  transform: rotate(-35deg);
}

.theme-switcher__palette {
  position: fixed;
  top: var(--theme-y, 0);
  left: var(--theme-x, 0);
  z-index: 100;
  width: 0;
  height: 0;
}

.theme-switcher__swatch {
  --angle: -170deg;
  --radius: 80px;
  position: absolute;
  top: -17px;
  left: -17px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid var(--swatch-ring);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  /* Все кружки стартуют из центра кнопки под углом первого и разлетаются по дуге в свои точки. */
  transform: rotate(-170deg) translateX(0) rotate(170deg) scale(0.2);
  transition:
    transform 460ms cubic-bezier(0.2, 0.9, 0.3, 1.15),
    opacity 220ms ease,
    box-shadow 160ms ease;
  transition-delay: calc((6 - var(--index)) * 30ms);
}

.theme-switcher.is-open .theme-switcher__swatch {
  opacity: 1;
  pointer-events: auto;
  transform: rotate(var(--angle)) translateX(var(--radius)) rotate(calc(-1 * var(--angle))) scale(1);
  transition-delay: calc(var(--index) * 55ms);
}

.theme-switcher__swatch:hover,
.theme-switcher__swatch:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 6px 16px rgba(0, 0, 0, 0.35);
}

.theme-switcher__swatch[aria-checked="true"] {
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--swatch-ring), 0 6px 16px rgba(0, 0, 0, 0.35);
}

.theme-switcher__swatch[data-theme-option="milk"] {
  --index: 0;
  --angle: -170deg;
  --swatch: #f1e6d1;
  --swatch-ring: #c4945e;
}

.theme-switcher__swatch[data-theme-option="latte"] {
  --index: 1;
  --angle: -140deg;
  --swatch: #cfc1a8;
  --swatch-ring: #9a6533;
}

.theme-switcher__swatch[data-theme-option="blue"] {
  --index: 2;
  --angle: -110deg;
  --swatch: #66b7ff;
  --swatch-ring: #a7dcff;
}

.theme-switcher__swatch[data-theme-option="green"] {
  --index: 3;
  --angle: -80deg;
  --swatch: #4fd492;
  --swatch-ring: #9ef0c6;
}

.theme-switcher__swatch[data-theme-option="red"] {
  --index: 4;
  --angle: -50deg;
  --swatch: #ff6b7d;
  --swatch-ring: #ffb0ba;
}

.theme-switcher__swatch[data-theme-option="gray"] {
  --index: 5;
  --angle: -20deg;
  --swatch: #a3a9b2;
  --swatch-ring: #dfe3e8;
}

.theme-switcher__swatch[data-theme-option="neon"] {
  --index: 6;
  --angle: 10deg;
  --swatch: linear-gradient(135deg, #ff00c8 50%, #00ff9d 50%);
  --swatch-ring: #ff8ce4;
}

/* Смена темы: вместо стандартного перетекания новая тема раскрывается кругом (theme-switcher.js). */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

.st-modal {
  width: min(440px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  color: var(--text);
}

.st-modal::backdrop {
  background: rgba(var(--deep-rgb), 0.7);
  backdrop-filter: blur(3px);
}

/* Появление окна: подъём с лёгким увеличением, затемнение проявляется. */
.st-modal[open] {
  animation: st-modal-in 240ms cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

.st-modal[open]::backdrop {
  animation: st-backdrop-in 240ms ease;
}

@keyframes st-modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
}

@keyframes st-backdrop-in {
  from {
    opacity: 0;
  }
}

/* Закрытие (telegram-link.js): после анимации скрипт вызывает close(). */
.st-modal[open].is-closing {
  animation: st-modal-out 180ms ease forwards;
}

.st-modal[open].is-closing::backdrop {
  animation: st-backdrop-out 180ms ease forwards;
}

@keyframes st-modal-out {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}

@keyframes st-backdrop-out {
  to {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-modal[open],
  .st-modal[open]::backdrop,
  .st-modal[open].is-closing,
  .st-modal[open].is-closing::backdrop {
    animation: none;
  }
}

.st-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.st-modal h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.st-modal__close {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(var(--deep-rgb), 0.3);
  color: var(--muted-light);
}

.st-modal__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.st-modal__close:hover {
  color: var(--text);
}

.st-modal .tg-status {
  display: inline-block;
}

.st-section {
  display: flex;
  flex-direction: column;
}

.st-section + .st-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.st-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.st-section h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.01em;
}

/* Переключатель: скрытый чекбокс и дорожка с кружком. */

.st-switch {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.st-switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}

.st-switch span {
  position: relative;
  width: 40px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(var(--deep-rgb), 0.45);
  transition: background 160ms ease, border-color 160ms ease;
}

.st-switch span::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: transform 160ms ease, background 160ms ease;
}

.st-switch input:checked + span {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.25);
}

.st-switch input:checked + span::after {
  background: var(--accent);
  transform: translateX(18px);
}

.st-switch input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25);
}

.st-switch input:disabled + span {
  opacity: 0.5;
}

.st-quiet__range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  transition: opacity 160ms ease;
}

[data-quiet-section][data-enabled="false"] .st-quiet__range {
  opacity: 0.5;
}

.st-field {
  display: grid;
  gap: 6px;
}

.st-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.st-field .dropdown__field {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  background: rgba(var(--deep-rgb), 0.45);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.st-field .dropdown__field:focus-visible,
.st-field .dropdown.is-open .dropdown__field {
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.st-field .dropdown__field:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Поля часов стоят внизу окна настроек, поэтому меню открывается вверх и не выходит за окно. */
.dropdown--up .dropdown__menu {
  top: auto;
  bottom: calc(100% + 6px);
  max-height: 220px;
}

/* Выбор времени (time-picker.js): меню из двух столбцов, прокручиваются сами столбцы. */

.time-picker .dropdown__menu {
  grid-template-columns: 1fr 1fr;
  max-height: none;
  overflow: visible;
}

.time-picker__column {
  position: relative;
  display: grid;
  align-content: start;
  gap: 2px;
  max-height: 210px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.time-picker__column + .time-picker__column {
  padding-left: 4px;
  border-left: 1px solid var(--line);
}

.time-picker .dropdown__option {
  justify-content: center;
  padding: 8px 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.time-picker .dropdown__option[aria-selected="true"] {
  background: var(--accent-soft);
}

.time-picker .dropdown__option[aria-selected="true"]::after {
  content: none;
}

.time-picker .dropdown__field strong {
  font-variant-numeric: tabular-nums;
}

.time-picker .dropdown__field svg {
  stroke-width: 1.7;
}

/* Иконка часов не переворачивается, как стрелка обычного списка. */
.dropdown.time-picker.is-open .dropdown__field svg {
  transform: none;
}

.st-quiet__note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.st-quiet__note[data-state="error"] {
  color: var(--danger);
}

/* Раздел «Подписки» (notification-settings.js): список прокручивается внутри окна. */

.st-count {
  min-width: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.st-count[hidden] {
  display: none;
}

.st-subscriptions {
  display: grid;
  gap: 6px;
  max-height: 260px;
  margin: 14px 0 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}

.st-subscriptions[hidden] {
  display: none;
}

.st-subscription {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px 9px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(var(--deep-rgb), 0.3);
}

.st-subscription > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.st-subscription strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-subscription small {
  color: var(--muted);
  font-size: 11px;
}

.st-subscription .button {
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

@media (max-width: 620px) {
  .notice {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .notice .button {
    grid-column: 1 / -1;
  }
}

/* Events: календарь и Roadmap ивентов */

.ev-layout {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.ev-layout[hidden] {
  display: none;
}

.ev-hint,
.ev-muted {
  color: var(--muted);
  font-size: 12px;
}

.ev-overview {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 24px;
}

.ev-overview > div {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.ev-overview > div > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ev-clock strong {
  font-size: 24px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.ev-mayor strong {
  font-size: 20px;
}

.ev-clock small,
.ev-mayor small {
  color: var(--muted-light);
  font-size: 12px;
  line-height: 1.5;
}

.ev-active ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ev-active li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(97, 215, 165, 0.25);
  border-radius: 11px;
  background: rgba(97, 215, 165, 0.07);
  font-size: 13px;
}

.ev-active li.ev-muted {
  border-color: var(--line);
  background: none;
}

.ev-active .ev-countdown {
  margin-left: auto;
  color: var(--success);
}

.ev-roadmap {
  display: grid;
  gap: 22px;
  margin-top: 18px;
}

.ev-day h3 {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ev-day ol {
  position: relative;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 0 0 18px;
  list-style: none;
}

.ev-day ol::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 4px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.5), rgba(var(--accent-rgb), 0.08));
  content: "";
}

.ev-day--unavailable h3 {
  color: var(--muted);
}

.ev-day--unavailable ol::before {
  background: var(--line);
}

.ev-row {
  position: relative;
  display: grid;
  grid-template-columns: 52px 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(var(--deep-rgb), 0.3);
}

.ev-row::before {
  position: absolute;
  top: 50%;
  left: -18px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--accent);
  content: "";
  transform: translateY(-50%);
}

.ev-day--unavailable .ev-row::before {
  background: var(--muted);
}

.ev-row.is-tracked,
.ev-card.is-tracked {
  border-color: rgba(97, 215, 165, 0.3);
}

.ev-row time {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ev-row__icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(var(--deep-rgb), 0.35);
  font-size: 18px;
}

.ev-row__body {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.ev-row__body strong {
  font-size: 14px;
}

.ev-row__body small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ev-countdown {
  color: var(--muted-light);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ev-track {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color 160ms ease, background 160ms ease;
}

.ev-track:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.6);
}

.ev-track.is-tracked {
  border-color: rgba(97, 215, 165, 0.35);
  background: rgba(97, 215, 165, 0.1);
  color: var(--success);
}

.ev-track:disabled {
  cursor: progress;
  opacity: 0.55;
}

.ev-frequent {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.ev-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(var(--deep-rgb), 0.3);
}

.ev-card__head {
  display: flex;
  gap: 12px;
}

.ev-card__head div {
  display: grid;
  gap: 4px;
}

.ev-card__head strong {
  font-size: 14px;
}

.ev-card__head small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.ev-card p {
  margin: 0;
  font-size: 12px;
}

.ev-card__next b {
  font-size: 14px;
}

.ev-card__crops {
  color: var(--success-light);
}

.ev-card__later {
  color: var(--muted);
}

.ev-card .ev-track {
  justify-self: start;
  margin-top: 4px;
}

@media (max-width: 1180px) {
  .ev-overview,
  .ev-frequent {
    grid-template-columns: 1fr;
  }

  .ev-row {
    grid-template-columns: 52px 38px minmax(0, 1fr) auto;
  }

  .ev-row .ev-countdown {
    display: none;
  }
}

@media (max-width: 620px) {
  .ev-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .ev-row .ev-row__icon {
    display: none;
  }

  .ev-row .ev-track {
    grid-column: 1 / -1;
  }
}

/* Mayors: мэр, кандидаты и рассылка о выборах */

.my-layout {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.my-layout[hidden] {
  display: none;
}

.my-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.my-status__text,
.my-status__subscribe {
  display: grid;
  gap: 6px;
}

.my-status__subscribe {
  justify-items: end;
  max-width: 320px;
  text-align: right;
}

.my-status__subscribe small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.my-status__badge {
  justify-self: start;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.my-status__badge[data-state="open"] {
  border-color: rgba(97, 215, 165, 0.3);
  background: rgba(97, 215, 165, 0.1);
  color: var(--success);
}

.my-status__text strong {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.my-status__text small {
  color: var(--muted-light);
  font-size: 13px;
}

.my-officials {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.my-official,
.my-candidate {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(var(--deep-rgb), 0.3);
}

.my-official h3,
.my-candidate h3 {
  margin: 0;
  font-size: 18px;
}

.my-official__role {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.my-perks {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.my-perks li {
  display: grid;
  gap: 2px;
  padding-left: 10px;
  border-left: 2px solid rgba(var(--accent-rgb), 0.3);
}

.my-perks strong {
  font-size: 13px;
}

.my-perks span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.my-candidates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.my-candidate.is-elected {
  border-color: rgba(97, 215, 165, 0.3);
}

.my-candidate__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.my-candidate__place {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.my-role {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.my-role--mayor {
  background: rgba(255, 199, 107, 0.12);
  color: var(--warning);
}

.my-role--minister {
  background: var(--cyan-soft);
  color: var(--cyan-light);
}

.my-votes {
  display: grid;
  gap: 6px;
}

.my-votes__numbers {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.my-votes__numbers strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.my-votes__numbers span {
  color: var(--muted-light);
  font-size: 12px;
}

.my-votes__bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--line-rgb), 0.1);
}

.my-votes__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}

.my-star {
  font-size: 11px;
}

@media (max-width: 1180px) {
  .my-status,
  .my-officials {
    grid-template-columns: 1fr;
  }

  .my-status__subscribe {
    justify-items: start;
    max-width: none;
    text-align: left;
  }
}

/* Fire Sales: распродажи и подписка на уведомления */

.fs-layout {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.fs-layout[hidden] {
  display: none;
}

.fs-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.fs-status__text,
.fs-status__subscribe {
  display: grid;
  gap: 6px;
}

.fs-status__subscribe {
  justify-items: end;
  max-width: 320px;
  text-align: right;
}

.fs-status__subscribe small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.fs-status__badge,
.fs-sale__badge {
  justify-self: start;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.fs-status__badge[data-state="open"],
.fs-sale[data-state="active"] .fs-sale__badge {
  border-color: rgba(97, 215, 165, 0.3);
  background: rgba(97, 215, 165, 0.1);
  color: var(--success);
}

.fs-status__badge[data-state="soon"],
.fs-sale[data-state="upcoming"] .fs-sale__badge {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.fs-status__text strong {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.fs-status__text small {
  color: var(--muted-light);
  font-size: 13px;
}

.fs-sales {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.fs-sale {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(var(--deep-rgb), 0.3);
}

.fs-sale[data-state="active"] {
  border-color: rgba(97, 215, 165, 0.3);
}

.fs-sale__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.fs-sale__head h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.fs-sale__id {
  margin-top: -6px;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.fs-sale__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.fs-sale__stats div {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(var(--line-rgb), 0.05);
}

.fs-sale__stats dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fs-sale__stats dd {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.fs-sale__time {
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.fs-sale__time small {
  color: var(--muted);
  font-size: 12px;
}

.fs-sale__bar {
  height: 6px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--line-rgb), 0.1);
}

.fs-sale__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}

@media (max-width: 1180px) {
  .fs-status {
    grid-template-columns: 1fr;
  }

  .fs-status__subscribe {
    justify-items: start;
    max-width: none;
    text-align: left;
  }
}

/* Мобильная версия (до 640 px): верхняя панель с логотипом, кнопка меню во всю ширину
   внизу экрана, сайдбар выезжает слева. Ширина совпадает с mobile-nav.js. */

.mobile-bar,
.mobile-bar__menu,
.nav-backdrop,
.app-sidebar__close {
  display: none;
}

@media (max-width: 640px) {
  .site-shell {
    display: block;
    padding: 0;
  }

  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 62px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(var(--panel-deep-rgb), 0.92);
    backdrop-filter: blur(12px);
  }

  .mobile-bar__brand {
    gap: 10px;
  }

  .mobile-bar__brand > span:last-child {
    flex-direction: column;
    align-items: flex-start;
  }

  .mobile-bar__brand strong {
    font-size: 19px;
    line-height: 1.1;
  }

  .mobile-bar__brand small {
    margin: 2px 0 0;
  }

  .mobile-bar__menu,
  .app-sidebar__close {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(var(--deep-rgb), 0.28);
    color: var(--text);
  }

  /* Под затемнением (z-index 40): при открытом меню кнопка не видна. */
  .mobile-bar__menu {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: 16px;
    z-index: 30;
    width: auto;
    height: 52px;
    border-radius: 14px;
    background: rgba(var(--panel-deep-rgb), 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }

  .mobile-bar__menu svg,
  .app-sidebar__close svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    width: min(320px, 88vw);
    height: 100dvh;
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform 260ms ease, visibility 0s linear 260ms;
  }

  /* transform: none у открытого меню нужен палитре тем: внутри трансформированного
     предка position: fixed отсчитывался бы от сайдбара, а не от экрана. */
  .is-nav-open .app-sidebar {
    visibility: visible;
    transform: none;
    transition: transform 260ms ease;
  }

  .app-sidebar__close {
    position: absolute;
    top: 26px;
    right: 14px;
  }

  .app-sidebar__brand {
    margin-right: 56px;
    margin-bottom: 28px;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: block;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 260ms ease;
  }

  .is-nav-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .is-nav-open body {
    overflow: hidden;
  }

  /* Нижний отступ, чтобы кнопка меню не закрывала конец страницы. */
  .app-workspace {
    padding: 20px 16px calc(84px + env(safe-area-inset-bottom));
  }

  /* Палитра тем на телефоне — столбик кружков вверх от кнопки. Список функций transform
     тот же, что у дуги, чтобы переход анимировался так же плавно. */
  .theme-switcher__swatch {
    transform: rotate(-90deg) translateX(0) rotate(90deg) scale(0.2);
  }

  .theme-switcher.is-open .theme-switcher__swatch {
    /* 56px до центра первого кружка: половина кнопки (~27px) + радиус кружка (17px) + зазор 12px. */
    transform: rotate(-90deg) translateX(calc(var(--index) * 42px + 56px)) rotate(90deg) scale(1);
  }
}

/* Bazaar Flipper на телефоне: карточка во всю ширину, расчёт крафта открывается
   экраном поверх страницы вместо панели сбоку. */
@media (max-width: 640px) {
  .hm-hero {
    padding: 24px 18px;
  }

  .hm-hero__telegram {
    width: 100%;
  }

  .hm-steps {
    padding: 20px 18px;
  }

  .hm-features {
    grid-template-columns: minmax(0, 1fr);
  }

  .hm-feature:first-child {
    grid-column: auto;
  }

  .hm-faq__item summary {
    padding: 13px 14px;
  }

  .hm-faq__item p,
  .hm-faq__item ul {
    padding: 0 14px 14px;
  }

  .hm-faq__item ul {
    padding-left: 30px;
  }

  .search-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    margin-top: 0;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .search-field kbd {
    display: none;
  }

  .filter-button {
    justify-content: center;
    padding: 0 12px;
    font-size: inherit;
  }

  .filter-button svg {
    flex: 0 0 auto;
  }

  .sort-dropdown {
    min-width: 0;
  }

  .sort-field {
    display: flex;
    width: 100%;
  }

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

  .product-grid .product-card,
  .product-grid .product-card.product-card--open,
  .product-grid .product-card.product-card--open.product-card--expand-left {
    --card-width: 100%;
    --card-shift-x: 0px;
    grid-template-areas: "main recipe";
    grid-template-columns: minmax(0, 1fr) 0;
    width: 100%;
    transform: none;
  }

  /* Выше верхней панели: панель расчёта внутри карточки не может подняться выше её слоя. */
  .product-grid .product-card.product-card--open {
    z-index: 60;
  }

  .product-card--open .product-card__main {
    border-right: 0;
    border-left: 0;
  }

  .recipe-panel,
  .product-card--expand-left .recipe-panel {
    position: fixed;
    inset: 0;
    z-index: 60;
    width: auto;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateY(16px);
  }

  .product-card--open .recipe-panel {
    position: fixed;
    transform: none;
  }

  .recipe-panel__close {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  body:has(.product-card--open) {
    overflow: hidden;
  }
}

/* Кастомный скролл. Chrome, Edge и Safari берут ::-webkit-scrollbar, Firefox — scrollbar-color.
   Цвет — от акцента темы. */

@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-color: rgba(var(--accent-rgb), 0.35) transparent;
    scrollbar-width: thin;
  }
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.28) padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(var(--accent-rgb), 0.5);
}

::-webkit-scrollbar-thumb:active {
  background-color: rgba(var(--accent-rgb), 0.65);
}

/* На сенсорных устройствах полосу страницы CSS не перекрашивает: custom-scrollbar.js прячет
   системные полосы классом на <html> и рисует свой ползунок .scroll-thumb. */

.has-overlay-scrollbars,
.has-overlay-scrollbars * {
  scrollbar-width: none;
}

.has-overlay-scrollbars::-webkit-scrollbar,
.has-overlay-scrollbars ::-webkit-scrollbar {
  display: none;
}

/* Сам элемент шире видимой полоски, чтобы по нему было легче попасть пальцем. */
.scroll-thumb {
  position: fixed;
  z-index: 200;
  width: 16px;
  opacity: 0;
  pointer-events: none;
  touch-action: none;
  transition: opacity 300ms ease;
}

.scroll-thumb::before {
  position: absolute;
  top: 0;
  right: 3px;
  bottom: 0;
  width: 4px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.55);
  content: "";
  transition: width 150ms ease, background-color 150ms ease;
}

.scroll-thumb.is-visible {
  opacity: 1;
  pointer-events: auto;
  transition-duration: 120ms;
}

.scroll-thumb.is-dragging::before {
  width: 6px;
  background: rgba(var(--accent-rgb), 0.85);
}

/* Иконки меню и кнопок-крестиков — контурные SVG в одном стиле. */

.app-nav__icon svg,
.recipe-panel__close svg,
.empty-card__icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.recipe-panel__close svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.recipe-panel__close:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  color: var(--text);
}

/* Выпадающие списки: свои вместо системного <select> (сортировка Bazaar Flipper и .dropdown из dropdown.js). */

.sort-dropdown,
.dropdown {
  position: relative;
}

.dropdown__field {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  transition: border-color 160ms ease;
}

.dropdown__field:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
}

.dropdown__field strong {
  flex: 1;
  overflow: hidden;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown__field svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted-light);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 200ms ease;
}

.dropdown.is-open .dropdown__field svg {
  transform: rotate(180deg);
}

.dropdown__menu {
  left: 0;
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sort-field {
  width: 100%;
  height: 100%;
  font: inherit;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease;
}

.sort-field:hover,
.sort-dropdown.is-open .sort-field {
  border-color: rgba(var(--accent-rgb), 0.4);
}

.sort-field strong {
  flex: 1;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.sort-field svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted-light);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 200ms ease;
}

.sort-dropdown.is-open .sort-field svg {
  transform: rotate(180deg);
}

.sort-menu,
.dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 100%;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  animation: sort-menu-in 160ms ease;
}

.sort-menu[hidden],
.dropdown__menu[hidden] {
  display: none;
}

@keyframes sort-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.sort-menu__option,
.dropdown__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  outline: none;
  background: transparent;
  color: var(--muted-light);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.sort-menu__option:hover,
.sort-menu__option:focus-visible,
.dropdown__option:hover,
.dropdown__option:focus-visible {
  background: var(--accent-soft);
  color: var(--text);
}

.sort-menu__option[aria-selected="true"],
.dropdown__option[aria-selected="true"] {
  color: var(--accent);
}

.sort-menu__option[aria-selected="true"]::after,
.dropdown__option[aria-selected="true"]::after {
  content: "✓";
}

/* Поиск Bazaar Flipper: скрытые карточки и пустой результат. */

.product-card[hidden],
.empty-card[hidden] {
  display: none;
}

.products-empty {
  min-height: 240px;
  padding: 24px;
}

.products-empty strong {
  font-size: 14px;
}

.products-empty > span {
  max-width: 320px;
  margin-top: 6px;
  font-size: 12px;
}

@media (max-width: 640px) {
  .st-trigger {
    gap: 10px;
    padding: 0 11px;
    font-size: 13px;
  }
}

/* Страница входа (login.html). */

.lg-page {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
  place-items: center;
}

.lg-card {
  display: grid;
  width: min(380px, 100%);
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(var(--panel-rgb), 0.62);
  box-shadow: 0 24px 60px rgba(var(--shadow-rgb), 0.35);
}

.lg-card__brand {
  margin-bottom: 4px;
}

.lg-card__title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.lg-card__hint {
  margin: -10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.lg-card__error {
  margin: 0;
  color: var(--danger-text);
  font-size: 12px;
  line-height: 1.5;
}

.lg-card__error[hidden] {
  display: none;
}

.lg-card__submit {
  min-height: 42px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .lg-card {
    padding: 22px 18px;
  }
}
