/* Velvet — Telegram Mini App.
   Committed dark palette: the brand is "velvet glove", and a discreet dark
   surface is also what this audience expects on a phone screen someone else
   might glance at. */

:root {
  --bg: #0d0a10;
  --surface: #171220;
  --surface-2: #201a2b;
  --surface-3: #2a2237;
  --text: #f3eef8;
  --muted: #a294b4;
  --faint: #6f6480;
  --accent: #8e1d4e;
  --accent-2: #c62a63;
  --border: #2c2438;
  --ok: #35c07a;
  --warn: #f0b23a;
  --danger: #e0526a;
  --radius: 16px;
  --tabbar-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  overscroll-behavior-y: none;
}

button { font-family: inherit; font-size: inherit; color: inherit; }

.screen {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
}

.boot { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---------------------------------------------------------------- header */
.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 18px;
}
.app-header .mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 20px; font-weight: 700; color: #fff;
  box-shadow: 0 8px 22px rgba(198, 42, 99, .28);
  flex: none;
}
.app-header h1 { font-size: 19px; margin: 0; letter-spacing: .4px; }
.app-header .sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.app-header .spacer { flex: 1; }

.icon-btn {
  border: 1px solid var(--border); background: var(--surface);
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; flex: none;
}

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card.tight { padding: 13px 14px; }
.card.flat { background: var(--surface-2); }

.section-title {
  font-size: 12px; color: var(--muted); margin: 22px 3px 10px;
  text-transform: uppercase; letter-spacing: 1.1px; font-weight: 600;
}
.section-title:first-child { margin-top: 4px; }

h2 { font-size: 17px; margin: 0 0 6px; }
h3 { font-size: 15px; margin: 0 0 4px; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); font-size: 13.5px; }
.faint { color: var(--faint); font-size: 12.5px; }

/* ----------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 14px; border-radius: 999px; font-size: 14px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  cursor: pointer; user-select: none; transition: background .12s ease, border-color .12s ease;
}
.chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff; font-weight: 600;
}
.chip.sm { padding: 6px 11px; font-size: 12.5px; }
/* Filter rows: one swipeable line instead of four stacked ones, so the goods
   stay above the fold on a phone. */
.chips.scroll {
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 0 16px;
}
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip { flex: none; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: block; width: 100%; padding: 15px; border: none; border-radius: 14px;
  font-size: 16px; font-weight: 700; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.btn:disabled { opacity: .45; }
.btn.secondary {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-weight: 600;
}
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); font-weight: 600; }
.btn.sm { padding: 11px; font-size: 14px; border-radius: 12px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ------------------------------------------------------------ traffic UI */
.tl-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.tl-row:last-child { border-bottom: none; }
.tl-row .label { flex: 1; font-size: 14.5px; }
.tl-opts { display: flex; gap: 6px; flex: none; }
.tl {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.tl.on-yes { background: rgba(53, 192, 122, .18); border-color: var(--ok); }
.tl.on-curious { background: rgba(240, 178, 58, .18); border-color: var(--warn); }
.tl.on-stop { background: rgba(224, 82, 106, .18); border-color: var(--danger); }

/* --------------------------------------------------------------- catalog */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px; cursor: pointer; display: flex; flex-direction: column;
}
.tile .thumb {
  height: 84px; border-radius: 12px; background: var(--surface-3);
  display: flex; align-items: center; justify-content: center; font-size: 34px;
  margin-bottom: 10px;
}
.tile .t { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.tile .s { font-size: 11.5px; color: var(--muted); margin-top: 3px; flex: 1; }
.tile .price { margin-top: 9px; font-size: 15px; font-weight: 700; }

.badge {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  background: var(--surface-3); color: var(--muted); text-transform: uppercase;
}
.badge.novice { background: rgba(53, 192, 122, .16); color: #7ee0ab; }
.badge.experienced { background: rgba(224, 82, 106, .16); color: #f2a1ae; }

/* ----------------------------------------------------------------- lists */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--border); cursor: pointer;
}
.row:last-child { border-bottom: none; }
.row .ico {
  width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none;
}
.row .body { flex: 1; min-width: 0; }
.row .body .t { font-size: 14.5px; font-weight: 600; }
.row .body .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row .arrow { color: var(--faint); font-size: 18px; flex: none; }

/* --------------------------------------------------------------- notices */
.notice {
  border-radius: 12px; padding: 12px 13px; font-size: 13px; line-height: 1.45;
  background: rgba(240, 178, 58, .09); border: 1px solid rgba(240, 178, 58, .3); color: #f3d9a4;
}
.notice.safety {
  background: rgba(53, 192, 122, .08); border-color: rgba(53, 192, 122, .28); color: #a9e6c6;
}
.notice.error {
  background: rgba(224, 82, 106, .1); border-color: rgba(224, 82, 106, .35); color: #f3bcc5;
}

/* ---------------------------------------------------------------- inputs */
input[type="text"], textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 12px; padding: 12px; font-size: 14px; font-family: inherit;
}
textarea { resize: vertical; min-height: 68px; }
input:focus, textarea:focus { outline: none; border-color: var(--accent-2); }

.switch { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.switch .body { flex: 1; }
.switch input { width: 44px; height: 26px; accent-color: var(--accent-2); }

/* ---------------------------------------------------------------- tabbar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: rgba(13, 10, 16, .96);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(12px);
}
.tabbar button {
  flex: 1; background: none; border: none; cursor: pointer;
  height: var(--tabbar-h); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: 10.5px; position: relative;
}
.tabbar button .ic { font-size: 19px; line-height: 1; }
.tabbar button.active { color: var(--accent-2); }
.tabbar .dot {
  position: absolute; top: 9px; right: 50%; margin-right: -20px;
  min-width: 17px; height: 17px; border-radius: 999px; background: var(--accent-2);
  color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
  padding: 0 4px;
}

/* ------------------------------------------------------------- sticky bar */
.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 55%, transparent);
}
.sticky-bar .inner { max-width: 528px; margin: 0 auto; }

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 22px); z-index: 40;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  opacity: 0; transition: opacity .2s ease; pointer-events: none; max-width: 88vw;
}
.toast.show { opacity: 1; }

/* ------------------------------------------------------------ guide text */
.guide-body p { font-size: 14.5px; line-height: 1.62; margin-bottom: 13px; color: #e6dff0; }
.guide-body p::first-letter { font-weight: 600; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13.5px; }
.kv + .kv { border-top: 1px solid var(--border); }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; }

.total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
.total .n { font-size: 22px; font-weight: 800; }

/* Discreet mode: strip the visual giveaways someone could catch at a glance. */
body.discreet .tile .thumb,
body.discreet .row .ico,
body.discreet .app-header .mark { filter: grayscale(1) opacity(.75); }
body.discreet .app-header .mark { background: var(--surface-3); box-shadow: none; }
