/* VapeMarket — закрытый мини-аукцион. Утверждённый дизайн: макет 390 px, колонка до 480 px. */
:root {
  --ink: #171B19;
  --accent: #2E7659;
  --bg: #F3F5F4;
  --card: #FFFFFF;
  --line: #DDE2DF;
  --muted: #5A625E;
  --ok-bg: #E3F1EA;   --ok-ink: #1E5A42;
  --warn-bg: #FCEBDD; --warn-ink: #8A3A0B;
  --neu-bg: #ECEEED;  --neu-ink: #4A514E;
  --safe: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.num, input { font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
svg { display: block; flex: none; }

.app { max-width: 480px; margin: 0 auto; padding: 0 16px 40px; }
.app--pad { padding-bottom: 180px; }

/* ——— шапка ——— */
.appbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.appbar__in { max-width: 480px; margin: 0 auto; padding: 0 16px; min-height: 56px; display: flex; align-items: center; gap: 12px; }
.logo { font-weight: 800; font-size: 18px; letter-spacing: -.02em; color: var(--ink); }
.logo i { font-style: normal; color: var(--accent); }
.appbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.appbar__role { color: var(--muted); font-size: 15px; }
.me { color: var(--muted); font-size: 14px; white-space: nowrap; }

/* ——— вкладки с зелёным подчёркиванием ——— */
.tabs { display: flex; gap: 4px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 56px; z-index: 19; }
.tabs__in { max-width: 480px; margin: 0 auto; padding: 0 16px; display: flex; gap: 18px; width: 100%; }
.tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--muted);
  padding: 14px 2px 12px; min-height: 44px; cursor: pointer;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ——— секции и карточки ——— */
.sec { display: flex; align-items: center; gap: 12px; margin: 22px 2px 10px; }
.sec h2 { font-size: 15px; font-weight: 700; }
.sec__aside { margin-left: auto; color: var(--muted); font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.card--tap { cursor: pointer; }
.card--tap:active { background: #FAFBFA; }
.card--off { opacity: .55; }
.row { display: flex; gap: 12px; }
.row--mid { align-items: center; }
.row--between { justify-content: space-between; align-items: center; }
.grow { flex: 1; min-width: 0; }
.rule { height: 1px; background: var(--line); margin: 12px -14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.title { font-weight: 650; font-size: 16px; letter-spacing: -.01em; }
.price { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.price--xl { font-size: 32px; font-weight: 750; letter-spacing: -.03em; }
.thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--neu-bg); flex: none; }
.thumb--ph { display: grid; place-items: center; color: #9AA3A0; }

/* ——— плашки статусов ——— */
.chip { display: inline-flex; align-items: center; font-size: 13px; font-weight: 650; padding: 5px 11px; border-radius: 999px; white-space: nowrap; background: var(--neu-bg); color: var(--neu-ink); }
.chip--ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip--warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip--dark { background: var(--ink); color: #fff; }

/* ——— таймер ——— */
.timer { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-weight: 650; font-size: 14px; }
.timer svg { color: var(--muted); }
.timer--dark { background: var(--ink); color: #fff; border-radius: 999px; padding: 7px 12px; font-size: 14px; }
.timer--dark svg { color: #fff; opacity: .7; }
.timer--soon { color: var(--warn-ink); }

/* ——— кнопки ——— */
.btn {
  appearance: none; font: inherit; font-weight: 650; font-size: 16px;
  min-height: 48px; padding: 12px 18px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { filter: brightness(.97); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--block { width: 100%; }
.btn--sm { min-height: 44px; font-size: 15px; padding: 10px 14px; border-radius: 10px; }
.btn--text { border: 0; background: none; color: var(--accent); min-height: 44px; padding: 10px 2px; font-size: 15px; }
.btn--text.is-danger { color: var(--warn-ink); }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

/* ——— поля ——— */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px; min-height: 48px;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.field .err { display: none; color: var(--warn-ink); font-size: 13px; margin-top: 6px; }
.field.is-bad input, .field.is-bad textarea { border-color: var(--warn-ink); background: #FFFCFA; }
.field.is-bad .err { display: block; }
.cols { display: flex; gap: 12px; }
.cols > * { flex: 1; min-width: 0; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ——— серая плашка-пояснение ——— */
.note { display: flex; gap: 10px; background: var(--neu-bg); color: var(--neu-ink); border-radius: 14px; padding: 13px 14px; font-size: 13.5px; line-height: 1.45; }
.note svg { color: var(--neu-ink); margin-top: 1px; }
.note--warn { background: var(--warn-bg); color: var(--warn-ink); }
.note--ok { background: var(--ok-bg); color: var(--ok-ink); }

/* ——— вход: логотип, PIN-клетки ——— */
.enter { max-width: 390px; margin: 0 auto; padding: 36px 16px 32px; text-align: center; }
.enter__kicker { margin: 10px 0 24px; font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.enter .card { text-align: left; }
.pins { display: flex; gap: 8px; margin: 14px 0 6px; }
.pins input {
  flex: 1; width: 100%; aspect-ratio: 1/1; min-height: 48px; text-align: center;
  font-size: 24px; font-weight: 700; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink); padding: 0;
}
.pins input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.pins.is-bad input { border-color: var(--warn-ink); }
.err-line { color: var(--warn-ink); font-size: 14px; font-weight: 600; margin: 8px 0 0; min-height: 20px; }

/* ——— лот: фото ——— */
.shots { position: relative; margin: -14px -14px 12px; }
.shots__strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.shots__strip::-webkit-scrollbar { display: none; }
.shots__strip img { width: 100%; height: 180px; flex: none; object-fit: cover; scroll-snap-align: center; background: var(--neu-bg); }
.shots__badge { position: absolute; right: 10px; bottom: 10px; background: rgba(23,27,25,.72); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; }
.shots--ph { height: 180px; display: grid; place-items: center; background: var(--neu-bg); color: #9AA3A0; }

/* ——— три колонки Шаг / Старт / Ваша ставка ——— */
.kv3 { display: flex; gap: 10px; }
.kv3 > div { flex: 1; min-width: 0; }
.kv3 .k { font-size: 12.5px; color: var(--muted); }
.kv3 .v { font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ——— ставка ——— */
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 52px; height: 52px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.stepper button:active { background: var(--neu-bg); }
.stepper button[disabled] { opacity: .35; }
.stepper .sum { flex: 1; text-align: center; font-size: 28px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.bidbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--card); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + var(--safe)); }
.bidbar__in { max-width: 480px; margin: 0 auto; }

/* ——— история ставок ——— */
.hist { margin: 0; padding: 0; list-style: none; }
.hist li { display: flex; align-items: baseline; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist li:last-child { border-bottom: 0; }
.hist .who { font-weight: 600; }
.hist .who.is-me { color: var(--accent); }
.hist .at { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.hist .amt { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ——— тёмная сводка (итоги) ——— */
.summary { background: var(--ink); color: #fff; border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.summary .k { color: #9FA8A4; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.summary .v { font-size: 28px; font-weight: 750; letter-spacing: -.03em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.summary .cols { gap: 20px; }

/* ——— шторка снизу ——— */
.backdrop { position: fixed; inset: 0; background: rgba(23,27,25,.45); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.backdrop.is-on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--card);
  border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + var(--safe));
  transform: translateY(102%); transition: transform .22s cubic-bezier(.2,.8,.2,1);
  max-height: 92vh; overflow: auto;
}
.sheet.is-on { transform: translateY(0); }
.sheet__in { max-width: 480px; margin: 0 auto; }
.sheet__grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { font-size: 19px; margin-bottom: 8px; }

/* ——— фото в форме лота ——— */
.shots-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.shots-pick figure { position: relative; margin: 0; width: 76px; height: 76px; }
.shots-pick img { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; }
.shots-pick figure button { position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 999px; border: 0; background: var(--ink); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; }
.shots-pick .add { width: 76px; height: 76px; border-radius: 12px; border: 1.5px dashed var(--line); background: var(--card); color: var(--muted); font-size: 12px; cursor: pointer; display: grid; place-items: center; gap: 2px; align-content: center; }

/* ——— мелочи ——— */
.empty { text-align: center; color: var(--muted); padding: 26px 12px; font-size: 15px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 0 4px; }
.linkbox { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--neu-ink); word-break: break-all; margin: 10px 0 8px; }
.pinline { font-size: 19px; font-weight: 700; letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe)); transform: translate(-50%, 10px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 999px; font-size: 14.5px; font-weight: 600; z-index: 60; opacity: 0; transition: opacity .2s ease, transform .2s ease; pointer-events: none; max-width: 86vw; text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.spin { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 999px; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
