.overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.42); z-index: 100; backdrop-filter: blur(10px); }
.overlay.open { display: block; }
.drawer { position: fixed; top: 50%; left: 50%; width: min(620px, calc(100vw - 32px)); max-height: min(84vh, 760px); background: var(--surface); z-index: 101; overflow: hidden; display: none; flex-direction: column; border-radius: 18px; border: 1px solid rgba(0,0,0,.08); box-shadow: 0 22px 70px rgba(0,0,0,.22); transform: translate(-50%, -48%) scale(.98); opacity: 0; transition: transform .2s cubic-bezier(.32,.72,0,1), opacity .2s; }
.drawer.open { display: flex; transform: translate(-50%, -50%) scale(1); opacity: 1; }
.d-head { padding: 16px 20px 13px; border-bottom: 0.5px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; flex-shrink: 0; }
.d-close { float: right; background: var(--bg); border: none; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--text2); cursor: pointer; font-family: var(--font); }
.d-close:hover { background: rgba(0,0,0,.08); }
.d-name { font-size: 17px; font-weight: 600; letter-spacing: -.3px; margin-bottom: 2px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-meta { font-size: 15px; font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-body { padding: 20px; flex: 1; overflow-y: auto; }
.dbl { margin-bottom: 18px; }
.dbl-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); margin-bottom: 7px; }
.dr { display: flex; align-items: flex-start; justify-content: space-between; padding: 8px 0; border-bottom: 0.5px solid var(--border); font-size: 14px; gap: 12px; min-width: 0; }
.dr:last-child { border-bottom: none; }
.dr-l { color: var(--text2); flex-shrink: 0; }
.dr-l-help { display: inline-flex; align-items: center; gap: 6px; position: relative; }
.rating-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #eef5ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
}
.rating-help::after {
  content: attr(data-tip);
  position: absolute;
  left: -74px;
  bottom: calc(100% + 8px);
  width: 230px;
  max-width: min(230px, calc(100vw - 48px));
  transform: translateY(4px);
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(20, 24, 33, .96);
  color: #fff;
  box-shadow: 0 12px 28px rgba(0,0,0,.22);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
  z-index: 5;
}
.rating-help:hover::after,
.rating-help:focus::after {
  opacity: 1;
  transform: translateY(0);
}
.dr-v { font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.phone-hidden  { filter: none; user-select: text; font-variant-numeric: tabular-nums; letter-spacing: .2px; font-weight: 700; color: var(--text2); }
.phone-revealed { font-variant-numeric: tabular-nums; letter-spacing: -.2px; font-weight: 600; color: var(--blue); }
.comment-box { background: var(--bg); border-radius: var(--r-s); padding: 11px 12px; font-size: 13px; color: var(--text2); line-height: 1.65; word-break: break-word; white-space: pre-wrap; }
.price-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; margin-bottom: 14px; }
.price-grid-single { grid-template-columns: minmax(0,1fr); }
.price-cell { background: var(--bg); border-radius: var(--r-s); padding: 10px 12px; text-align: center; min-width: 0; overflow: hidden; }
.price-lbl { font-size: 11px; color: var(--text3); margin-bottom: 3px; }
.price-num { font-size: 18px; font-weight: 700; letter-spacing: -.5px; }
.price-num.orange { color: var(--orange); }
.price-num.blue   { color: var(--blue); }
.price-num.red    { color: var(--red); }
.auction-expired-notice { font-size: 12px; color: var(--red); background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2); border-radius: var(--r-s); padding: 8px 12px; margin-bottom: 10px; }
.bid-row { display: flex; gap: 8px; margin-bottom: 10px; min-width: 0; }
.bid-inp { flex: 1; min-width: 0; height: 42px; background: var(--surface); border: 0.5px solid var(--border-med); border-radius: var(--r-s); padding: 0 12px; font-size: 16px; font-weight: 600; font-family: var(--font); color: var(--text); outline: none; }
.bid-inp:focus { border-color: var(--blue); }
.bid-go { height: 42px; padding: 0 16px; border-radius: var(--r-s); border: none; background: var(--green); color: #fff; font-size: 13px; font-weight: 700; font-family: var(--font); cursor: pointer; white-space: nowrap; transition: opacity .14s; flex-shrink: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.bid-go:hover { opacity: .85; }
.buy-full { display: block; width: 100%; padding: 13px; border-radius: var(--r-m); border: none; background: var(--blue); color: #fff; font-size: 15px; font-weight: 700; font-family: var(--font); cursor: pointer; letter-spacing: -.2px; transition: opacity .14s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buy-full:hover { opacity: .85; }
.bid-history { border: 0.5px solid var(--border); border-radius: var(--r-m); overflow: hidden; }
.bid-history-row { display: grid; grid-template-columns: 68px minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 0.5px solid var(--border); font-size: 12.5px; }
.bid-history-row:last-child { border-bottom: none; }
.bid-history-price { font-weight: 800; color: var(--orange-dark); }
.bid-history-user  { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bid-history-time  { color: var(--text3); white-space: nowrap; font-size: 11.5px; }

/* ── Premium drawer redesign (dx-*) ───────────────────────────────────────── */
.dx-svg { width: 15px; height: 15px; display: block; }

.dx-timer { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 14px; background: linear-gradient(135deg,#eef5ff,#eef1ff); border: 1px solid #deeaff; margin-bottom: 16px; }
.dx-timer-ico { color: var(--green-dark); display: flex; }
.dx-timer-lbl { font-size: 13px; color: var(--text2); font-weight: 600; }
.dx-timer-val { margin-left: auto; font-size: 19px; font-weight: 800; letter-spacing: -.4px; font-variant-numeric: tabular-nums; color: var(--green-dark); }
.dx-timer--soon { background: linear-gradient(135deg,#fff7ed,#fff3e2); border-color: #ffe1bb; }
.dx-timer--soon .dx-timer-ico, .dx-timer--soon .dx-timer-val { color: var(--orange); }
.dx-timer--urgent { background: linear-gradient(135deg,#fff1f0,#ffe9e7); border-color: #ffd1cc; animation: dxPulse 1.15s ease-in-out infinite; }
.dx-timer--urgent .dx-timer-ico, .dx-timer--urgent .dx-timer-val { color: var(--red); }
@keyframes dxPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,59,48,0); } 50% { box-shadow: 0 0 0 4px rgba(255,59,48,.12); } }

.dx-hero { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; margin-bottom: 16px; box-shadow: 0 2px 16px rgba(0,0,0,.05); }
.dx-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.dx-price { border-radius: 14px; padding: 12px 10px; text-align: center; background: var(--bg); border: 1px solid transparent; min-width: 0; }
.dx-price.buy { background: #eef4ff; border-color: #d6e4ff; }
.dx-price-lbl { font-size: 11px; color: var(--text3); font-weight: 600; margin-bottom: 4px; }
.dx-price-val { font-size: 22px; font-weight: 800; letter-spacing: -.6px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-price-val.cur { color: var(--orange); }
.dx-price.buy .dx-price-val { color: var(--blue); }

.dx-buy { width: 100%; border: none; border-radius: 15px; padding: 13px 16px; cursor: pointer; font-family: var(--font); color: #fff; background: linear-gradient(135deg,#0a84ff,#5e5ce6); box-shadow: 0 8px 22px rgba(10,132,255,.30); display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; overflow: hidden; transition: transform .12s ease, box-shadow .2s ease; }
.dx-buy:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(10,132,255,.38); }
.dx-buy:active { transform: translateY(0); }
.dx-buy > span:first-child { font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.dx-buy-sub { font-size: 11.5px; font-weight: 600; opacity: .88; }
.dx-buy::after { content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(90deg,transparent,rgba(255,255,255,.38),transparent); transform: skewX(-20deg); animation: dxShine 3.6s ease-in-out infinite; }
@keyframes dxShine { 0%,58% { left: -60%; } 100% { left: 135%; } }
.dx-buy:disabled { background: #c7c7cc; box-shadow: none; cursor: default; transform: none; }
.dx-buy:disabled::after { display: none; }

.dx-or { text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); margin: 14px 0 10px; position: relative; }
.dx-or::before, .dx-or::after { content: ''; position: absolute; top: 50%; width: 28%; height: 1px; background: var(--border); }
.dx-or::before { left: 0; } .dx-or::after { right: 0; }
.dx-bid { display: flex; gap: 8px; }
.dx-bid-inp { flex: 1; min-width: 0; height: 44px; border: 1.5px solid var(--border-med,#e5e5ea); border-radius: 12px; padding: 0 12px; font-size: 16px; font-weight: 700; font-family: var(--font); color: var(--text); background: var(--surface); outline: none; }
.dx-bid-inp:focus { border-color: var(--blue); }
.dx-bid-go { flex-shrink: 0; height: 44px; padding: 0 16px; border: 1.5px solid var(--blue); border-radius: 12px; background: var(--surface); color: var(--blue); font-size: 13px; font-weight: 800; font-family: var(--font); cursor: pointer; white-space: nowrap; transition: background .14s; }
.dx-bid-go:hover { background: #eef4ff; }
.dx-bid-hint { font-size: 11.5px; color: var(--text3); margin-top: 9px; text-align: center; line-height: 1.45; }
.dx-note-red { font-size: 12.5px; color: var(--red); background: rgba(255,59,48,.08); border: 1px solid rgba(255,59,48,.2); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }

.dx-mine { display: flex; align-items: center; gap: 7px; padding: 10px 13px; border-radius: 12px; font-size: 13px; font-weight: 700; margin-bottom: 16px; }
.dx-mine.lead { background: #e9f9ee; color: #137a32; }
.dx-mine.out  { background: #fff4e5; color: #8c5000; }

.dx-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.dx-chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 999px; background: var(--bg); font-size: 12px; font-weight: 700; color: var(--text2); }
.dx-chip.ok { background: #e9f9ee; color: #137a32; }
.dx-chip-muted { color: var(--text3); }

.dx-section { margin-bottom: 16px; }
.dx-sec-lbl { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); margin-bottom: 8px; }
.dx-contact { display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.dx-lock { color: var(--text3); display: flex; flex-shrink: 0; }
.dx-phone { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .3px; color: var(--text2); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-contact-note { margin-left: auto; font-size: 11.5px; color: var(--text3); flex-shrink: 0; }
.dx-comment { background: var(--bg); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; color: var(--text2); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.dx-activity { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.dx-act-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg); font-size: 12.5px; font-weight: 700; color: var(--text); }
.dx-act-fresh { color: var(--green-dark); background: #eefaf1; }
.dx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex-shrink: 0; animation: dxBlink 1.3s ease-in-out infinite; }
@keyframes dxBlink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.dx-act-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--border); font-size: 12.5px; }
.dx-act-price { font-weight: 800; color: var(--orange-dark); flex-shrink: 0; }
.dx-act-user { color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.dx-act-time { color: var(--text3); font-size: 11.5px; white-space: nowrap; flex-shrink: 0; }

@media (max-width: 640px) {
  .drawer {
    width: calc(100vw - 24px);
    max-height: 88vh;
    border-radius: 16px;
  }

  .d-head {
    padding: 14px 16px 12px;
  }

  .d-body {
    padding: 16px;
  }

  .rating-help::after {
    left: -112px;
    width: 210px;
  }
}

/* ── Drawer: кнопка «в избранное» ──────────────────────────────────────────── */
.d-fav { float: right; margin-right: 8px; height: 30px; padding: 0 13px 0 10px; border: 1px solid var(--border-med, #e5e5ea); background: var(--surface); border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-family: var(--font); font-size: 12.5px; font-weight: 700; color: var(--text2); white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.d-fav svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; transition: fill .14s, stroke .14s, transform .12s; }
.d-fav:hover { border-color: #ffc2cc; color: #ff2d55; }
.d-fav:active { transform: scale(.97); }
.d-fav.on { background: #fff0f3; border-color: #ffc2cc; color: #ff2d55; }
.d-fav.on svg { fill: #ff2d55; stroke: #ff2d55; }
@media (max-width: 640px) { .d-fav span { display: none; } .d-fav { padding: 0; width: 30px; justify-content: center; } }

/* ── Drawer: сообщение клиента как чат-баббл (высоко, для быстрого решения) ── */
.dx-msgblock { margin-bottom: 16px; }
.dx-msg { display: flex; align-items: flex-start; gap: 10px; }
.dx-msg-av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,#0a84ff,#5e5ce6); color: #fff; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dx-msg-bubble { position: relative; flex: 1; min-width: 0; background: #eef1f6; border-radius: 4px 16px 16px 16px; padding: 12px 15px; font-size: 14.5px; color: var(--text); line-height: 1.58; white-space: pre-wrap; word-break: break-word; }
.dx-msg-bubble::before { content: ''; position: absolute; left: -6px; top: 12px; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-right: 7px solid #eef1f6; }
.dx-msg-empty { color: var(--text3); font-style: italic; }
