/* liresale mini app — стилистика venk.app:
   тёплый почти-чёрный фон, кремовый текст, оранжевый акцент,
   карточки с тонкой светлой рамкой, крупная жирная типографика.
   Палитра снята с самого сайта, не на глаз. */

@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 900;
  font-display: swap; src: url("/fonts/golos-cyrillic.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 900;
  font-display: swap; src: url("/fonts/golos-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+2000-206F,U+2192,U+2212,U+2215;
}

:root {
  --bg:      #0F0E0C;   /* тёплый почти-чёрный */
  --card:    #171613;
  --card-2:  #1F1D19;
  --line:    rgba(241, 237, 225, .16);
  --line-2:  rgba(241, 237, 225, .09);
  --text:    #F1EDE1;   /* кремовый */
  --muted:   #8F8A7B;
  --accent:  #E2692E;   /* оранжевый venk */
  --accent-d:#C2551F;
  --ok:      #7FB069;
  --warn:    #D9A441;
  --danger:  #D9534F;
  --r:       12px;      /* venk использует именно 12, не «мягкие» 16-20 */
  --pill:    999px;
  --pad:     16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

body {
  margin: 0;
  padding: 0 0 calc(70px + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--text);
  font-family: "Golos Text", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.45;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- шапка */

.topbar {
  display: flex; align-items: center; gap: 11px;
  padding: calc(14px + env(safe-area-inset-top)) var(--pad) 14px;
  border-bottom: 1px solid var(--line-2);
  position: sticky; top: 0; z-index: 5;
  background: rgba(15, 14, 12, .88); backdrop-filter: blur(14px);
}
.topbar-duck { width: 30px; height: 30px; flex: none; }
.duck { width: 100%; height: 100%; display: block; }
.duck-mark { fill: var(--accent); }
.duck-eye { fill: var(--bg); }

.topbar-title {
  font-size: 19px; font-weight: 800; letter-spacing: -.4px; text-transform: uppercase;
}
.topbar-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topbar-sub b { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------------- блоки */

main { padding: var(--pad); }
.loader { color: var(--muted); text-align: center; padding: 48px; font-size: 13px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: var(--pad); margin-bottom: 10px;
}
.card-tap { cursor: pointer; transition: border-color .15s, background .15s; }
.card-tap:active { background: var(--card-2); border-color: rgba(226, 105, 46, .5); }

.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny  { font-size: 11.5px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt6 { margin-top: 6px; } .mt10 { margin-top: 10px; } .mt16 { margin-top: 18px; }

.title { font-weight: 700; letter-spacing: -.25px; }

/* white/black-листы: моноширинные, с буквенной меткой вместо эмодзи */
.expr-line {
  display: flex; gap: 7px; align-items: baseline; margin-top: 7px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
}
.expr-tag {
  flex: none; font-family: "Golos Text", sans-serif; font-size: 9.5px; font-weight: 700;
  letter-spacing: .8px; text-transform: uppercase; padding: 2px 6px; border-radius: 4px;
}
.expr-in  { background: rgba(226,105,46,.16); color: var(--accent); }
.expr-out { background: rgba(241,237,225,.08); color: var(--muted); }
.expr-text { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { font-size: 13px; font-weight: 700; color: var(--muted); }

/* мелкие капслок-подписи — фирменная деталь venk */
.section-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--muted); font-weight: 600; margin: 22px 2px 9px;
}

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-on  { background: var(--accent); }
.dot-off { background: #4A463E; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--pill); font-size: 11.5px; font-weight: 500;
  border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip-accent { border-color: rgba(226,105,46,.45); color: var(--accent); }
.chip-deal   { background: var(--accent); border-color: var(--accent); color: #14120F; font-weight: 650; }
.chip-warn   { border-color: rgba(217,164,65,.45); color: var(--warn); }
.chip-ok     { border-color: rgba(127,176,105,.45); color: var(--ok); }

.btn {
  appearance: none; border: 1px solid var(--accent); border-radius: var(--pill);
  padding: 13px 18px; font: inherit; font-weight: 650; font-size: 14px;
  color: #14120F; background: var(--accent); width: 100%; cursor: pointer;
  transition: transform .12s, background .15s;
}
.btn:active { transform: scale(.985); background: var(--accent-d); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:active { background: var(--card-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(217,83,79,.4); }
.btn-row { display: flex; gap: 8px; }

.field-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.1px;
  color: var(--muted); font-weight: 600; margin-bottom: 7px;
}
.input, .textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 13px; color: var(--text); font: inherit; font-size: 14px;
}
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); }
.textarea {
  min-height: 84px; resize: vertical; font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.input-error { border-color: var(--danger); }

.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; background: #33302A; border: 1px solid var(--line);
  border-radius: var(--pill); transition: background .18s, border-color .18s; cursor: pointer;
}
.switch span::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: var(--text); border-radius: 50%; transition: transform .18s, background .18s;
}
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::before { transform: translateX(18px); background: #14120F; }

/* -------------------------------------------------------------- находки */

.find { display: flex; gap: 12px; }
.find-thumb {
  width: 64px; height: 64px; border-radius: 8px; flex: none;
  object-fit: cover; background: var(--card-2); border: 1px solid var(--line-2);
}
.find-price { color: var(--accent); font-weight: 750; font-size: 16px; letter-spacing: -.3px; }
.find-desc {
  font-size: 12.5px; color: var(--muted); margin-top: 7px;
  padding-left: 9px; border-left: 2px solid var(--line);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ----------------------------------------------------------------- табы */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; background: rgba(15,14,12,.94); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-2); padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; appearance: none; border: 0; background: none; cursor: pointer;
  color: var(--muted); font: inherit; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .8px;
  padding: 12px 0 13px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  border-top: 2px solid transparent; margin-top: -1px;
}
.tab svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.tab.is-active { color: var(--accent); border-top-color: var(--accent); }

/* --------------------------------------------------------------- шторка */

.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.66); z-index: 10; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; top: 38px; z-index: 11;
  background: var(--bg); border-radius: 14px 14px 0 0; border-top: 1px solid var(--line);
  display: flex; flex-direction: column;
  animation: sheet-up .26s cubic-bezier(.2,.85,.3,1);
}
@keyframes sheet-up { from { transform: translateY(100%) } }
.sheet-head {
  display: flex; align-items: center; gap: 8px; padding: 13px var(--pad);
  border-bottom: 1px solid var(--line-2);
}
.sheet-title {
  flex: 1; font-weight: 700; text-align: center; font-size: 13px;
  text-transform: uppercase; letter-spacing: 1px;
}
.sheet-back, .sheet-close {
  appearance: none; border: 1px solid var(--line); background: transparent; color: var(--text);
  width: 32px; height: 32px; border-radius: 50%; font-size: 15px; cursor: pointer; line-height: 1;
}
.sheet-back { font-size: 20px; }
.sheet-body { flex: 1; overflow-y: auto; padding: var(--pad) var(--pad) 44px; -webkit-overflow-scrolling: touch; }

.pick {
  display: flex; align-items: center; gap: 11px; padding: 14px 13px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card); margin-bottom: 7px; cursor: pointer;
}
.pick:active { background: var(--card-2); }
.pick-check { width: 18px; text-align: center; color: var(--accent); font-weight: 700; }
.pick-arrow { color: var(--muted); }

.explain {
  border: 1px solid rgba(226,105,46,.4); border-radius: var(--r);
  padding: 11px 13px; font-size: 13px; margin-top: 9px; color: var(--text);
}
.explain b { color: var(--accent); }
.explain-bad { border-color: rgba(217,83,79,.45); color: #E9A9A7; }

.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: var(--pill);
  font-size: 13px; font-weight: 600; z-index: 20; max-width: 88vw; text-align: center;
  animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px) } }

.empty { text-align: center; color: var(--muted); padding: 54px 24px; font-size: 13.5px; }
.empty-mark { width: 52px; height: 52px; margin: 0 auto 16px; opacity: .5; }


/* ------------------------------------------- выбор одного из вариантов ---
   Тумблер годится только для «да/нет». Там, где выбор между двумя равными
   вариантами (сразу или сводкой), тумблер врёт: его подпись меняет смысл.
   Поэтому — сегменты, где оба варианта видно одновременно. */

.seg {
  display: flex; gap: 3px; padding: 3px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--pill);
}
.seg button {
  flex: 1; appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 8px; border-radius: var(--pill); transition: background .15s, color .15s;
}
.seg button.is-on { background: var(--accent); color: #14120F; }

/* --------------------------------------------------- строки настроек ---
   Настройки — плоский список строк с разделителями, а не гирлянда карточек:
   так видно структуру, а не 15 одинаковых прямоугольников. */

.rows { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.rows > * + * { border-top: 1px solid var(--line-2); }
.srow {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px; background: var(--card); min-height: 56px;
}
.srow-tap { cursor: pointer; }
.srow-tap:active { background: var(--card-2); }
.srow-label { font-weight: 600; font-size: 14px; }
.srow-hint { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.srow-value {
  color: var(--muted); font-size: 13.5px; text-align: right;
  max-width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.srow-value.is-set { color: var(--text); }
.srow-col { display: block; padding: 14px; background: var(--card); }

/* краткий пересказ поиска обычными словами */
.summary {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--r); padding: 13px 15px; margin-bottom: 14px;
  font-size: 13.5px; line-height: 1.5; color: var(--muted); background: var(--card);
}
.summary b { color: var(--text); font-weight: 650; }
.summary-off { border-left-color: #4A463E; }

.pct-input {
  width: 74px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px; color: var(--text); font: inherit; font-size: 13.5px; text-align: center;
}
.hours { display: flex; align-items: center; gap: 8px; }

/* строка «что ищет» в списке поисков */
.card-what {
  margin-top: 7px; font-size: 13.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-except {
  margin-top: 3px; font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.warn-text { color: var(--warn); }
