/* Fendi Rental — storefront (website + Telegram Mini App)
   Polished with unslop by Damir Sokolovsky (@heydamir), CC BY 4.0.
   Direction: exact, market-like, calm. Graphite chrome, white accent, the gift art carries the colour. */

@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-medium.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-semibold.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  /* graphite ramp */
  --bg-deep: #0f0f10;
  --bg: #141415;
  --bg-elev: #19191b;
  --surface: #1c1c1e;
  --surface-2: #232325;
  --surface-3: #2c2c2f;
  --line: rgba(237, 237, 237, .08);
  --line-strong: rgba(237, 237, 237, .16);
  /* three text roles */
  --text-strong: #ededed;
  --text: #a1a1a6;
  --muted: #85858b;
  /* accent: off-white with dark ink */
  --accent: #ededed;
  --accent-hover: #ffffff;
  --on-accent: #141415;
  /* semantic, toned down */
  --positive: #4cc38a;
  --negative: #e5484d;
  --caution: #d9a84e;
  --radius-sm: 6px;
  --radius-ctl: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --header-h: 64px;
  --sidebar-w: 280px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 150ms;
  --shadow: 0 16px 48px rgba(0, 0, 0, .45);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text-strong);
  font: 400 15px/1.45 var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}
b, strong { font-weight: 600; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 2px solid rgba(237, 237, 237, .7); outline-offset: 2px; }
::selection { background: rgba(237, 237, 237, .24); }
.num, .card-price, .price-big, .sum-row, .balance-chip, .meta, .stats b, .media-badge, .tag, .order .right { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border: 0; border-radius: var(--radius-ctl);
  font-weight: 500; font-size: 15px; white-space: nowrap;
  background: var(--surface-2); color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; box-shadow: none; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text-strong); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-lg { min-height: 48px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text-strong);
  transition: background-color var(--fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn[aria-pressed="true"] { background: var(--surface-3); }
.link { color: var(--text-strong); font-weight: 500; background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.link:hover { text-decoration-color: var(--text-strong); }

/* ---------- header ---------- */
.header {
  position: sticky; top: 0; z-index: 30; background: rgba(20, 20, 21, .9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent; transition: border-color var(--fast) var(--ease);
}
.header.scrolled { border-bottom-color: var(--line); }
.header-row { display: flex; align-items: center; gap: 16px; height: var(--header-h); max-width: 1600px; margin: 0 auto; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand img { height: 32px; width: auto; }
.brand:hover img { opacity: .85; }
.nav { display: flex; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 18px;
  border: 1px solid var(--line-strong); font-weight: 500; font-size: 14px; white-space: nowrap; color: var(--text);
  background: transparent; transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.pill:hover { background: var(--surface-2); color: var(--text-strong); }
.pill.active { border-color: var(--text-strong); color: var(--text-strong); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.counter {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}
.balance-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 20px;
  background: var(--surface-2); font-weight: 500; color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color var(--fast) var(--ease);
}
.balance-chip:hover { background: var(--surface-3); }
.balance-chip svg { color: var(--muted); }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; }
.avatar {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: var(--surface-3); color: var(--text-strong); font-weight: 500; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- layout ---------- */
.view { flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; padding: 8px 24px 48px; outline: none; }
.page-title { display: flex; align-items: baseline; gap: 12px; margin: 16px 0; }
.page-title h1 { margin: 0; font-size: 28px; font-weight: 500; line-height: 1.15; color: var(--text-strong); }
.page-title .count { color: var(--muted); font-size: 15px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 12px 16px; border: 0; background: none; font-weight: 500; color: var(--muted); white-space: nowrap; transition: color var(--fast) var(--ease); }
.tab:hover { color: var(--text-strong); }
.tab.active { color: var(--text-strong); }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--text-strong); }
.footer { border-top: 1px solid var(--line); }
.footer-row { display: flex; flex-wrap: wrap; gap: 8px 20px; max-width: 1600px; margin: 0 auto; padding: 20px 24px 28px; font-size: 13px; color: var(--muted); }
.footer-row a { transition: color var(--fast) var(--ease); }
.footer-row a:hover { color: var(--text-strong); }
.footer-row .muted { margin-left: auto; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.search {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 44px; padding: 0 16px;
  border-radius: var(--radius-ctl); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow var(--fast) var(--ease);
}
.search:focus-within { box-shadow: inset 0 0 0 1px var(--line-strong); }
.search svg { color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 15px; color: var(--text-strong); }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { border: 0; background: none; color: var(--muted); padding: 4px; display: grid; }
.drop {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 0; border-radius: var(--radius-ctl);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; font-size: 14px; white-space: nowrap; color: var(--text-strong);
  transition: background-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.drop:hover { background: var(--surface-3); }
.drop .chev { color: var(--muted); width: 16px; height: 16px; }
.drop.has-value { box-shadow: inset 0 0 0 1px var(--text-strong); }
.drop .badge-n { min-width: 20px; height: 20px; border-radius: 10px; padding: 0 4px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }
.select-wrap { position: relative; }
.select-wrap select {
  appearance: none; -webkit-appearance: none; height: 44px; padding: 0 40px 0 16px; border: 0; border-radius: var(--radius-ctl);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; font-size: 14px; color: var(--text-strong); cursor: pointer;
}
.select-wrap select:hover { background: var(--surface-3); }
.select-wrap select option { background: var(--bg-elev); color: var(--text-strong); }
.select-wrap svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.segmented { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.segmented button { width: 36px; height: 36px; border: 0; border-radius: var(--radius-ctl); background: none; color: var(--muted); display: grid; place-items: center; transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.segmented button[aria-pressed="true"] { background: var(--surface-3); color: var(--text-strong); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chips:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px 0 12px; border-radius: var(--radius-ctl);
  background: var(--surface-2); border: 0; box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 500; color: var(--text-strong);
  transition: background-color var(--fast) var(--ease);
}
.chip:hover { background: var(--surface-3); }
.chip small { color: var(--muted); font-weight: 400; }
.chip svg { width: 16px; height: 16px; color: var(--muted); }
.chip.reset { background: none; box-shadow: none; color: var(--text); padding: 0 8px; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.mobile-filters { display: none; }

/* ---------- catalog layout ---------- */
.catalog { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: 24px; align-items: start; }
.catalog.no-sidebar { grid-template-columns: minmax(0, 1fr); }
.catalog.no-sidebar .sidebar { display: none; }
.sidebar {
  position: sticky; top: calc(var(--header-h) + 8px); max-height: calc(100vh - var(--header-h) - 24px);
  overflow-y: auto; padding-right: 8px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent;
}
.sidebar-head { display: none; }
.sidebar-foot { display: none; }
.f-section { border-bottom: 1px solid var(--line); }
.f-section > summary {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 0; cursor: pointer;
  list-style: none; font-weight: 500; color: var(--text-strong);
}
.f-section > summary::-webkit-details-marker { display: none; }
.f-section > summary .chev { transition: transform 200ms var(--ease); color: var(--muted); }
.f-section[open] > summary .chev { transform: rotate(180deg); }
.f-section > summary .sel { margin-left: auto; margin-right: 8px; font-size: 12px; font-weight: 600; color: var(--on-accent); background: var(--accent); border-radius: 10px; min-width: 20px; height: 20px; line-height: 20px; text-align: center; padding: 0 4px; }
.f-body { padding: 0 0 16px; }
.f-sub { display: block; margin: 8px 0 8px; font-size: 13px; color: var(--muted); }
.f-hint { margin: 4px 0; font-size: 13px; color: var(--muted); }
.range-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.field {
  width: 100%; height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-ctl); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line); outline: none; font-size: 15px; color: var(--text-strong);
  transition: box-shadow var(--fast) var(--ease);
}
.field:focus { box-shadow: inset 0 0 0 1px var(--text-strong); }
.field::placeholder { color: var(--muted); }
textarea.field { height: 96px; padding: 12px; resize: vertical; }
.facet-search { height: 36px; margin-bottom: 8px; font-size: 14px; }
.facet-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; margin-right: -8px; padding-right: 8px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.facet-list.tall { max-height: none; }
.facet {
  display: grid; grid-template-columns: 20px 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%;
  min-height: 44px; padding: 4px 8px; border: 0; border-radius: var(--radius-ctl); background: none; text-align: left;
  transition: background-color var(--fast) var(--ease);
}
.facet.no-visual { grid-template-columns: 20px minmax(0, 1fr) auto; }
.facet:hover { background: var(--surface-2); }
.facet .box { display: grid; place-items: center; width: 20px; height: 20px; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1.5px var(--line-strong); transition: background-color var(--fast) var(--ease); }
.facet[aria-checked="true"] .box { background: var(--accent); box-shadow: none; }
.facet .box svg { width: 14px; height: 14px; stroke: var(--on-accent); stroke-width: 2.5; opacity: 0; }
.facet[aria-checked="true"] .box svg { opacity: 1; }
.facet .vis { width: 32px; height: 32px; border-radius: var(--radius-ctl); background: var(--surface-3); object-fit: cover; }
.facet .vis.round { border-radius: 50%; }
.gift-filter-art { display: inline-grid; place-items: center; flex: none; }
.facet .vis.gift-filter-art { background: transparent; border-radius: 0; }
.gift-filter-art > img { width: 100%; height: 100%; object-fit: contain; }
.gift-filter-art > svg { width: 24px; height: 24px; color: var(--muted); }
.collection-art { width: 100%; height: 100%; }
.facet .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--text-strong); }
.facet .meta { text-align: right; font-size: 12px; color: var(--muted); line-height: 16px; }
.facet .meta b { display: block; color: var(--text); font-weight: 500; font-size: 13px; }
.facet.zero .name { color: var(--muted); }
.facet-empty { padding: 12px 8px; color: var(--muted); font-size: 14px; }

/* ---------- grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px; }
.grid.dense { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.card { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: var(--radius); }
.card-media { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface); transition: transform 200ms var(--ease); }
.card:hover .card-media { transform: translateY(-2px); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .ph, .item-media .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; font-weight: 500; font-size: 18px; color: var(--text-strong); text-align: center; word-break: break-all; }
.card-media .ph svg { width: 40px; height: 40px; color: var(--muted); stroke-width: 1.25; }
.card-media.username, .card-media.number, .item-media.username, .item-media.number { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
/* Signature: the rental term, always the same small numeric tag */
.media-badge {
  position: absolute; top: 8px; right: 8px; height: 24px; padding: 0 8px; border-radius: var(--radius-sm);
  background: rgba(15, 15, 16, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 12px; font-weight: 500; line-height: 24px; color: var(--text-strong);
}
.card-title { margin: 8px 0 0; font-size: 14px; font-weight: 500; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { margin: 0; font-size: 12px; line-height: 16px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-price { display: flex; align-items: baseline; gap: 4px; margin: 4px 0 0; font-weight: 600; color: var(--text-strong); }
.card-price small { font-weight: 400; color: var(--muted); font-size: 12px; }
.card-link { position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); }
.skeleton .card-media { animation: pulse 1.2s var(--ease) infinite; }
.skeleton .card-title, .skeleton .card-price { height: 12px; border-radius: 4px; background: var(--surface); width: 70%; }
.skeleton .card-price { width: 40%; margin-top: 8px; }
@keyframes pulse { 50% { opacity: .5; } }
.more-row { display: flex; justify-content: center; padding: 24px 0 8px; }
.empty-state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 16px; text-align: center; color: var(--muted); }
.empty-state svg { width: 40px; height: 40px; color: var(--surface-3); stroke-width: 1.25; }
.empty-state h3 { margin: 0; color: var(--text-strong); font-size: 18px; font-weight: 500; }
.empty-state p { margin: 0; max-width: 36rem; }
.updated { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }

/* ---------- collections ---------- */
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.coll-card { display: flex; flex-direction: column; border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; transition: background-color var(--fast) var(--ease), transform 200ms var(--ease); }
.coll-card:hover { background: var(--surface-2); transform: translateY(-2px); }
.coll-card .cover { aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; }
.coll-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.coll-card .info { padding: 12px 16px 16px; }
.coll-card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 500; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { min-width: 0; }
.stats small { display: block; font-size: 12px; color: var(--muted); }
.stats b { font-size: 14px; font-weight: 500; color: var(--text-strong); white-space: nowrap; }
.coll-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.coll-strip .coll-pill { display: flex; align-items: center; gap: 8px; flex: none; padding: 4px 16px 4px 4px; border-radius: 24px; background: var(--surface-2); border: 0; box-shadow: inset 0 0 0 1px var(--line); transition: background-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.coll-strip .coll-pill:hover { background: var(--surface-3); }
.coll-strip .coll-pill.active { box-shadow: inset 0 0 0 1px var(--text-strong); }
.coll-strip img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-3); }
.coll-strip .gift-filter-art { width: 40px; height: 40px; }
.coll-strip .gift-filter-art img { background: transparent; border-radius: 0; object-fit: contain; }
.coll-strip .t { text-align: left; line-height: 16px; }
.coll-strip .t b { display: block; font-size: 13px; font-weight: 500; color: var(--text-strong); white-space: nowrap; }
.coll-strip .t small { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- item page ---------- */
.back-link { display: inline-flex; align-items: center; gap: 4px; margin: 8px 0 12px; color: var(--muted); font-weight: 500; background: none; border: 0; padding: 0; transition: color var(--fast) var(--ease); }
.back-link:hover { color: var(--text-strong); }
.item { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 32px; align-items: start; }
.item-media { position: sticky; top: calc(var(--header-h) + 12px); aspect-ratio: 1; border-radius: var(--radius-xl); overflow: hidden; background: var(--surface); }
.item-media img { width: 100%; height: 100%; object-fit: cover; }
.item-media .ph { font-size: 32px; padding: 24px; }
.item-media .ph svg { width: 64px; height: 64px; color: var(--muted); stroke-width: 1.25; }
.item h1 { margin: 0; font-size: 32px; font-weight: 500; line-height: 1.15; color: var(--text-strong); word-break: break-word; }
.item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.tag.green { color: var(--positive); }
.tag.green::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.item-coll { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-weight: 500; color: var(--text); transition: color var(--fast) var(--ease); }
.item-coll:hover { color: var(--text-strong); }
.panel { margin-top: 20px; padding: 20px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.panel h2, .panel h3 { margin: 0 0 12px; font-size: 16px; font-weight: 500; color: var(--text-strong); }
.price-big { display: flex; align-items: baseline; gap: 8px; font-size: 32px; font-weight: 500; line-height: 1.1; color: var(--text-strong); }
.price-big small { font-size: 15px; font-weight: 400; color: var(--muted); }
.label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.stepper { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 8px; }
.stepper button { height: 48px; border: 0; border-radius: var(--radius-ctl); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 20px; color: var(--text-strong); transition: background-color var(--fast) var(--ease); }
.stepper button:hover { background: var(--surface-3); }
.stepper button:disabled { opacity: .35; }
.stepper input { height: 48px; text-align: center; font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.presets button, .amounts button, .assets button {
  height: 32px; padding: 0 12px; border: 0; border-radius: var(--radius-ctl); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 500; font-size: 13px; color: var(--text-strong); font-variant-numeric: tabular-nums;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.presets button:hover, .amounts button:hover, .assets button:hover { background: var(--surface-3); }
.presets button[aria-pressed="true"], .assets button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.sum { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--text); }
.sum-row b { color: var(--text-strong); font-weight: 500; }
.sum-row.total { color: var(--text-strong); font-size: 18px; font-weight: 500; padding-top: 8px; }
.sum-row.total b { font-weight: 600; }
.msg { margin: 12px 0 0; padding: 12px; border-radius: var(--radius-ctl); background: var(--surface-2); font-size: 14px; color: var(--text); }
.msg.warn { background: rgba(217, 168, 78, .1); color: #e2c48c; }
.msg.error { background: rgba(229, 72, 77, .1); color: #f0a3a5; }
.msg.ok { background: rgba(76, 195, 138, .1); color: #8fd6b2; }
.actions { display: grid; gap: 8px; margin-top: 16px; }
.actions.two { display: flex; flex-wrap: wrap; }
.actions.two > * { flex: 1 1 180px; }
.attrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.attr { padding: 8px 12px; border-radius: var(--radius-ctl); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; transition: background-color var(--fast) var(--ease); }
.attr small { display: block; font-size: 12px; color: var(--muted); }
.attr b { display: flex; align-items: center; gap: 8px; color: var(--text-strong); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.attr:hover { background: var(--surface-2); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 12px; }
.steps li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; color: var(--text); font-size: 14px; }
.steps li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); font-size: 12px; font-weight: 500; color: var(--text-strong); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 40px 0 16px; }
.section-title h2 { margin: 0; font-size: 20px; font-weight: 500; color: var(--text-strong); }
.section-title .link { white-space: nowrap; margin-left: 12px; }

/* ---------- shop (stars / premium) ---------- */
.shop { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; align-items: start; }
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 24px; align-items: center; padding: 32px; border-radius: var(--radius-xl); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.hero h1 { margin: 0 0 8px; font-size: 32px; font-weight: 500; line-height: 1.15; color: var(--text-strong); }
.hero p { margin: 0; max-width: 36rem; color: var(--text); }
/* Moment: a rendered object instead of colour washes */
.hero .object { width: 160px; height: 160px; }
.hero .object svg { width: 100%; height: 100%; stroke: none; filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .45)); }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 20px; }
.pack {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border-radius: var(--radius); border: 0;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-align: left; color: var(--text-strong);
  transition: background-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.pack:hover { background: var(--surface-2); }
.pack[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--text-strong); background: var(--surface-2); }
.pack b { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.pack b svg { color: var(--muted); }
.pack span { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.pack .save { font-size: 12px; color: var(--muted); }
.recipient { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.recipient button { height: 36px; border: 0; border-radius: var(--radius-ctl); background: none; font-weight: 500; color: var(--text); transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.recipient button[aria-pressed="true"] { background: var(--surface-3); color: var(--text-strong); }
.sticky-panel { position: sticky; top: calc(var(--header-h) + 12px); margin-top: 0; }

/* ---------- profile ---------- */
.profile { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
.profile-card { padding: 24px; border-radius: var(--radius-xl); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-align: center; }
.profile-card .avatar { width: 88px; height: 88px; margin: 0 auto 12px; font-size: 32px; }
.profile-card h2 { margin: 0; font-size: 20px; font-weight: 500; color: var(--text-strong); }
.profile-card p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.balance-box { margin-top: 20px; padding: 16px; border-radius: var(--radius); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); text-align: left; }
.balance-box small { color: var(--muted); font-size: 13px; }
.balance-box strong { display: block; margin: 4px 0 12px; font-size: 32px; font-weight: 500; line-height: 1.1; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.order-list { display: grid; gap: 8px; }
.order {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; align-items: center; width: 100%;
  padding: 12px; border: 0; border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-align: left;
  transition: background-color var(--fast) var(--ease);
}
.order:hover { background: var(--surface-2); }
.order .thumb { width: 56px; height: 56px; border-radius: var(--radius-ctl); overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.order .thumb img { width: 100%; height: 100%; object-fit: cover; }
.order h3 { margin: 0; font-size: 15px; font-weight: 500; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order p { margin: 4px 0 8px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order .right { text-align: right; font-weight: 500; color: var(--text-strong); white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 8px; height: 24px; font-size: 12px; font-weight: 500; padding: 0 8px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--positive); }
.status.wait { color: var(--caution); }
.status.bad { color: var(--negative); }
.status.info { color: var(--text-strong); }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.detail-rows { display: grid; gap: 0; margin: 12px 0; }
.code-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 12px; border-radius: var(--radius-ctl); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; color: var(--text-strong); }
.code-box button { flex: none; }
.login-code { font-size: 32px; font-weight: 500; letter-spacing: .3em; text-align: center; color: var(--text-strong); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- rental receipt ---------- */
.rental-receipt { width: 100%; max-width: 480px; margin: 0 auto; padding: 12px 0 24px; text-align: center; }
.rental-receipt-image { width: min(100%, 300px); aspect-ratio: 1; margin: 0 auto 24px; border-radius: var(--radius-xl); overflow: hidden; background: var(--surface); display: grid; place-items: center; }
.rental-receipt-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.rental-receipt-image svg { width: 64px; height: 64px; color: var(--muted); stroke-width: 1.25; }
.rental-receipt h1 { margin: 0 0 12px; font-size: 24px; font-weight: 500; line-height: 1.2; color: var(--text-strong); }
.rental-receipt h2 { margin: 0 0 12px; font-size: 18px; font-weight: 500; color: var(--text); }
.rental-receipt .detail-rows { margin: 20px 0; text-align: left; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, .6); animation: fade 200ms var(--ease); }
.modal { display: flex; flex-direction: column; width: min(520px, 100%); max-height: min(86vh, 860px); border-radius: var(--radius-xl); background: var(--bg-elev); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); animation: pop 220ms var(--ease); }
.modal.wide { width: min(640px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 20px 12px; }
.modal-head h2 { flex: 1; margin: 0; font-size: 20px; font-weight: 500; color: var(--text-strong); }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 20px; }
.modal-body .label { margin-top: 16px; }
.modal-body .label:first-child, .panel > .label:first-child { margin-top: 0; }
.modal-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 20px 20px; border-top: 1px solid var(--line); }
.modal-foot.one { grid-template-columns: 1fr; }
.list-head { display: grid; grid-template-columns: 20px 32px minmax(0, 1fr) auto; gap: 12px; padding: 0 8px 8px; font-size: 12px; color: var(--muted); }
.list-head span:last-child { text-align: right; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
@keyframes rise { from { transform: translateY(100%); } }

.methods { display: grid; gap: 8px; }
.method {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 12px;
  border: 0; border-radius: var(--radius); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); text-align: left;
  transition: background-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.method:hover { background: var(--surface-3); }
.method[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--text-strong); }
.method:disabled { opacity: .4; cursor: not-allowed; }
.method img { width: 40px; height: 40px; border-radius: var(--radius-ctl); }
.method b { display: block; color: var(--text-strong); font-weight: 500; }
.method small { color: var(--muted); font-size: 13px; }
.method .radio { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.method[aria-pressed="true"] .radio { box-shadow: inset 0 0 0 6px var(--accent); }
.amounts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.assets { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.cart-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item .thumb { width: 56px; height: 56px; border-radius: var(--radius-ctl); overflow: hidden; background: var(--surface-2); }
.cart-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item h3 { margin: 0; font-size: 15px; font-weight: 500; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.cart-item .err { color: #f0a3a5; }
.cart-item .right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cart-item .right b { color: var(--text-strong); font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 90; display: grid; gap: 8px; transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface-3); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); color: var(--text-strong); font-size: 14px; animation: pop 220ms var(--ease); pointer-events: auto; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.toast.error::before { background: var(--negative); }
.toast.ok::before { background: var(--positive); }

.tabbar { display: none; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(20, 20, 21, .25); border-top-color: currentColor; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .item { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 24px; }
  .shop { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 1023px) {
  :root { --header-h: 56px; }
  .header-row { padding: 0 16px; gap: 8px; }
  .nav { display: none; }
  .brand img { height: 28px; }
  .view { padding: 4px 16px calc(80px + var(--safe-bottom)); }
  .footer { display: none; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(3, 1fr);
    padding: 4px 4px calc(4px + var(--safe-bottom)); background: rgba(15, 15, 16, .94); border-top: 1px solid var(--line);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 4px; font-size: 11px; font-weight: 500; color: var(--muted); transition: color var(--fast) var(--ease); }
  .tabbar a.active { color: var(--text-strong); }
  .catalog { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0; z-index: 70; max-height: none; padding: 0; background: var(--bg-elev); display: none; flex-direction: column; overflow: hidden; }
  .sidebar.open { display: flex; animation: rise 300ms var(--ease); }
  .catalog.no-sidebar .sidebar.open { display: flex; }
  .sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); }
  .sidebar-head h2 { margin: 0; font-size: 20px; font-weight: 500; color: var(--text-strong); }
  .sidebar-body { flex: 1; overflow-y: auto; padding: 0 16px; }
  .sidebar-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); }
  .toolbar .desk { display: none; }
  .mobile-filters { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
  .mobile-filters::-webkit-scrollbar { display: none; }
  .mobile-filters .drop { height: 36px; flex: none; padding: 0 12px; }
  .mobile-filters .select-wrap select { height: 36px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }
  .grid.dense { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .grid.dense .card-sub { display: none; }
  .item, .shop, .profile { grid-template-columns: minmax(0, 1fr); }
  .item-media { position: relative; top: 0; max-width: 520px; width: 100%; margin: 0 auto; }
  .sticky-panel { position: static; }
  .item h1 { font-size: 24px; }
  .page-title { flex-wrap: wrap; }
  .page-title h1 { font-size: 24px; }
  .page-title .count { white-space: nowrap; }
  .updated { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr) 88px; gap: 16px; padding: 20px; }
  .hero h1 { font-size: 24px; }
  .hero .object { width: 88px; height: 88px; }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; animation: rise 300ms var(--ease); padding-bottom: var(--safe-bottom); }
  .modal.wide { width: 100%; }
  .toasts { bottom: calc(80px + var(--safe-bottom)); }
  .coll-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .balance-chip { height: 36px; padding: 0 12px; font-size: 14px; }
  .avatar-btn { display: none; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats b { font-size: 13px; }
}

.in-telegram .footer { display: none; }

/* Telegram auto-bind */
.tg-bind > .muted { margin: 0 0 16px; font-size: 14px; }
.tg-bind-state:empty { display: none; }
.tg-bind-state .actions { margin-top: 12px; }
.tg-wait { display: flex; align-items: center; gap: 12px; }
.tg-spin { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: tg-spin 800ms linear infinite; }
@keyframes tg-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tg-spin { animation-duration: 2400ms; } }
.tg-manual > summary { cursor: pointer; list-style: none; font-size: 14px; color: var(--text); }
.tg-manual > summary::-webkit-details-marker { display: none; }
.tg-manual > summary::after { content: "+"; float: right; color: var(--muted); }
.tg-manual[open] > summary { margin-bottom: 16px; }
.tg-manual[open] > summary::after { content: "−"; }
.tg-manual:not([open]) > :not(summary) { display: none; }

.tg-auth-link { display:block; overflow-wrap:anywhere; font-size:13px; margin:12px 0; color:var(--accent); }

/* Confirmed gift binding receipt */
.binding-success { max-width: 400px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 4px 0 8px; }
.binding-success-check { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #153d2c; color: #6ee7a0; }
.binding-success-check svg { width: 30px; height: 30px; stroke-width: 2.5; }
.binding-success h2 { margin: 0; color: var(--text-strong); font-size: 22px; font-weight: 600; line-height: 1.3; outline: none; }
.binding-success-image { width: min(100%, 224px); aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-xl); background: var(--surface); display: grid; place-items: center; }
.binding-success-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.binding-success-image svg { width: 64px; height: 64px; color: var(--muted); }
.binding-success-name { margin: 0; font-size: 20px; line-height: 1.3; color: var(--text-strong); overflow-wrap: anywhere; }
.binding-success p { margin: 0 0 4px; font-size: 14px; line-height: 1.6; }
.binding-success .btn { width: 100%; }
