:root {
  color-scheme: dark;
  --bg: #141210;
  --bg-2: #1c1915;
  --card: #221e19;
  --line: #3a332b;
  --text: #f6f1e7;
  --muted: #a89b8c;
  --amber: #f0a202;
  --amber-2: #c4840a;
  --ink: #1a1408;
  --green: #2f9e73;
  --green-bg: #16352b;
  --red: #e15b45;
  --red-bg: #3a201c;
  --blue: #7eb6d9;
  --shadow: 0 16px 40px rgba(0, 0, 0, .35);
  --nav: calc(68px + env(safe-area-inset-bottom));
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: #070605; color: var(--text); }
body { min-height: 100dvh; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--amber); }

.shell {
  width: min(480px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background:
    radial-gradient(1200px 420px at 50% -10%, rgba(240, 162, 2, .16), transparent 55%),
    var(--bg);
  position: relative;
  padding-bottom: var(--nav);
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(20, 18, 16, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.mark {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--amber); color: var(--ink);
  display: grid; place-items: center; font-weight: 800;
}
.brand h1 { margin: 0; font-size: 17px; letter-spacing: .01em; }
.brand p { margin: 0; color: var(--muted); font-size: 12px; }
.icon-btn, .text-btn {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  border-radius: 999px; min-height: 36px;
}
.icon-btn { width: 36px; }
.text-btn { padding: 0 12px; }

.page { padding: 14px 14px 24px; }
.banner {
  background: #3a2a12; color: #ffd89a; border-radius: 14px; padding: 12px 14px;
  margin-bottom: 12px; font-size: 14px;
}
.banner.bad { background: var(--red-bg); color: #ffc7be; }
.banner.ok { background: var(--green-bg); color: #b7f0d8; }
.banner .text-btn { margin-top: 8px; }
.signin-stage {
  width: 100%; background: #000; border-radius: 12px; overflow: hidden;
  touch-action: none; margin: 8px 0 12px;
}
.signin-stage img {
  width: 100%; height: auto; display: block; touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 4px 0 12px; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 7px 12px; white-space: nowrap; font-size: 13px;
}
.chip.on { background: var(--text); color: var(--ink); border-color: var(--text); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 4px; font-size: 16px; }
.meta { color: var(--muted); font-size: 13px; line-height: 1.45; }
.id { color: var(--amber); font-weight: 700; font-size: 13px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pill {
  font-size: 12px; border-radius: 999px; padding: 3px 8px; background: #2c271f; color: var(--text);
}
.pill.warn { background: #3a2a12; color: #ffd89a; }
.pill.good { background: var(--green-bg); color: #b7f0d8; }
.pill.bad { background: var(--red-bg); color: #ffc7be; }
.pill.quiet { color: var(--muted); }

.price-line { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 14px; }
.price-line strong { font-size: 15px; }

.btn, .btn-ghost, .btn-danger, .btn-ok {
  border: 0; border-radius: 12px; min-height: 44px; padding: 0 14px; font-weight: 700;
}
.btn { background: var(--amber); color: var(--ink); width: 100%; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: var(--red); color: white; width: 100%; }
.btn-ok { background: var(--green); color: #062117; width: 100%; }
.btn:disabled, .btn-danger:disabled, .btn-ok:disabled { opacity: .5; }
.stack { display: grid; gap: 8px; }
.stack.two { grid-template-columns: 1fr 1fr; }

label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); margin: 8px 0; }
input, textarea, select {
  width: 100%; background: #12100e; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; font-size: 16px;
}
textarea { min-height: 96px; resize: vertical; }

.nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: min(480px, 100%);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(20, 18, 16, .96); border-top: 1px solid var(--line);
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
  z-index: 6;
}
.nav button {
  background: transparent; border: 0; color: var(--muted); border-radius: 12px; padding: 8px 0 6px;
  font-size: 11px; font-weight: 700;
}
.nav button.on { color: var(--amber); }
.nav .dot { display: block; width: 6px; height: 6px; border-radius: 99px; background: var(--red); margin: 0 auto 4px; }

.login {
  min-height: 100dvh; display: grid; align-content: center; padding: 28px 20px 40px;
}
.login h1 { font-size: 34px; margin: 12px 0 6px; }
.kicker { color: var(--amber); font-weight: 800; letter-spacing: .14em; font-size: 12px; }

.bubble { border-radius: 16px; padding: 10px 12px; margin: 8px 0; max-width: 92%; }
.bubble .who { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.bubble .when { color: var(--muted); font-weight: 500; }
.bubble.partner { background: #2a2418; margin-right: auto; }
.bubble.dealer { background: #1b2830; margin-right: auto; }
.bubble.self { background: #3a2e16; margin-left: auto; }
.bubble.system { background: transparent; border: 1px dashed var(--line); margin: 10px auto; text-align: center; color: var(--muted); font-size: 13px; }
.amount { font-weight: 800; color: var(--amber); }

.shots { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.shots button { border: 0; padding: 0; background: transparent; }
.shots img { width: 112px; height: 78px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

.sheet {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 8;
  display: grid; align-items: end; justify-items: center;
}
.sheet .panel {
  width: min(480px, 100%); background: var(--bg-2); border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); max-height: 88dvh; overflow: auto;
}
.lightbox {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .88); z-index: 9;
  display: grid; place-items: center; padding: 16px;
}
.lightbox img { max-width: 100%; max-height: 88dvh; border-radius: 12px; }

.stat { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.stat span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; }
.toggle p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.switch { width: 48px; height: 28px; border-radius: 99px; border: 0; background: #3a332b; position: relative; flex: none; }
.switch.on { background: var(--green); }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 99px; background: white; transition: left .15s; }
.switch.on i { left: 23px; }
.empty { color: var(--muted); text-align: center; padding: 28px 10px; }
.back { background: transparent; border: 0; color: var(--amber); font-weight: 700; padding: 0; }
h3 { margin: 16px 0 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.line { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.note { color: var(--muted); font-size: 13px; }
