:root {
  --bg: #120e0a;
  --sheet: #1a140f;
  --card: #241b13;
  --gold: #e6c57a;
  --gold-deep: #b8893d;
  --ink: #f7f1e7;
  --muted: #b5a794;
  --line: rgba(230, 197, 122, 0.22);
  --danger: #e08b73;
  --ok: #8fceab;
  --warn: #e0b15a;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Geeza Pro", "Noto Naskh Arabic", Tahoma, sans-serif;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(230, 197, 122, 0.16), transparent 55%),
    var(--bg);
  color: var(--ink);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
#app {
  width: min(430px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--sheet);
  position: relative;
}
.screen { padding: 22px 18px 108px; }
.splash {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.mark { width: 92px; height: 92px; }
.splash h1, .auth h1 { margin: 14px 0 4px; font-size: 32px; letter-spacing: 0; }
.sub { margin: 0 0 18px; color: var(--muted); line-height: 1.8; }
.step { margin: 0 0 6px; color: var(--gold); font-weight: 800; }
.steps { margin: 0 0 8px; padding: 0; list-style: none; }
.steps li { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; line-height: 1.7; }
.steps b {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: #2a1d0b;
  display: grid;
  place-items: center;
}
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 16px; }
.tabs button, .seg button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 6px;
  color: var(--muted);
}
.tabs button.on, .seg button.on { background: var(--gold); color: #2a1d0b; border-color: var(--gold); font-weight: 700; }
label { display: block; margin: 12px 0; }
label span, .lbl { display: block; margin-bottom: 6px; color: var(--muted); font-size: 14px; }
input, select, textarea {
  width: 100%;
  background: #2a2118;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px;
  margin-top: 8px;
  background: linear-gradient(180deg, #f3d7a1, #c59645);
  color: #2a1c09;
  font-weight: 800;
}
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid var(--line); }
.btn.small { width: auto; padding: 8px 12px; margin: 0; }
.hint { margin-top: 18px; color: var(--muted); }
.hint summary { cursor: pointer; }
.hint button {
  display: block;
  width: 100%;
  text-align: right;
  margin-top: 8px;
  background: #2a2118;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.dev, .banner {
  border-radius: 14px;
  padding: 12px 14px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.dev { background: rgba(224, 177, 90, 0.14); color: #f0d7a4; }
.code-box {
  direction: ltr;
  text-align: center;
  font-size: 42px;
  letter-spacing: 0.28em;
  font-weight: 800;
  color: #2a1c09;
  background: linear-gradient(180deg, #f3d7a1, #c59645);
  border-radius: 16px;
  padding: 18px 12px;
  margin: 8px 0 12px;
}
.banner.warn { background: rgba(224, 177, 90, 0.14); color: var(--warn); }
.banner.bad { background: rgba(224, 139, 115, 0.14); color: var(--danger); }
.banner.ok { background: rgba(143, 206, 171, 0.12); color: var(--ok); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px 8px;
  background: rgba(26, 20, 15, 0.92);
}
.topbar strong { font-size: 20px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.7; }
.price-grid, .silver-row { display: grid; gap: 8px; }
.price-grid { grid-template-columns: repeat(3, 1fr); }
.silver-row { grid-template-columns: 1fr; margin-top: 8px; }
.price-card {
  background: linear-gradient(180deg, #322618, #221910);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 6px;
  text-align: center;
}
.price-card .k { color: var(--muted); font-size: 13px; }
.price-card .v { display: block; margin: 6px 0 2px; color: var(--gold); font-size: 20px; font-weight: 800; }
.chart-wrap { margin: 14px 0; }
.chart { width: 100%; height: 86px; }
.chart polyline { fill: none; stroke: #e6c57a; stroke-width: 3; }
.chart circle { fill: #f3d7a1; }
h2 { font-size: 16px; margin: 18px 0 8px; }
.shop-card, .announce {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: right;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
}
.announce { display: block; }
.vip {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: #2a1d0b;
  font-size: 12px;
  font-weight: 800;
}
.avatar, .logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #3c2e1c;
  color: var(--gold);
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
  object-fit: cover;
}
.logo.big { width: 84px; height: 84px; font-size: 28px; }
.grow { flex: 1; }
.rate { color: var(--gold); font-weight: 800; }
.seg { display: flex; gap: 6px; margin: 10px 0; }
.back {
  background: transparent;
  border: 0;
  color: var(--gold);
  padding: 0;
  margin-bottom: 8px;
}
.detail p { line-height: 1.8; }
.call { display: block; text-align: center; text-decoration: none; }
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(430px, 100%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: #140f0b;
  border-top: 1px solid var(--line);
}
.bottom-nav button {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 8px 0;
  font-size: 13px;
}
.rail { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.cats { display: flex; gap: 8px; overflow-x: auto; }
.cat, .product-card {
  background: var(--card);
  border: 1px solid var(--line);
  color: inherit;
  text-align: right;
}
.cat { border-radius: 999px; padding: 8px 14px; white-space: nowrap; }
.cat.on, .seg button.on { background: var(--gold); color: #2a1d0b; border-color: var(--gold); }
.product-card { width: 148px; border-radius: 16px; padding: 8px; flex: 0 0 auto; }
.product-card.wide { width: 100%; display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.shot, .shot-lg {
  background: #3c2e1c;
  color: var(--gold);
  display: grid;
  place-items: center;
  font-weight: 800;
  object-fit: cover;
}
.shot { width: 100%; height: 104px; border-radius: 12px; }
.product-card.wide .shot { width: 72px; height: 72px; flex: 0 0 auto; }
.shot-lg { width: 100%; height: 220px; border-radius: 18px; font-size: 42px; }
.old { color: var(--muted); text-decoration: line-through; font-size: 12px; }
.off { color: #e7b3a4; font-size: 12px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.thumbs span { display: flex; flex-direction: column; gap: 4px; width: 64px; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.thumbs .btn.small { padding: 4px 6px; font-size: 12px; }
.bottom-nav button.on { color: var(--gold); font-weight: 800; }
.role {
  width: 100%;
  text-align: right;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 10px;
}
.role b { display: block; font-size: 18px; margin-bottom: 4px; }
.preview { width: 74px; height: 74px; object-fit: cover; border-radius: 14px; margin-top: 8px; }
.row-actions { display: flex; gap: 8px; }
.design-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.design {
  background: #2a2118;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  text-align: center;
}
.design.on { border-color: var(--gold); }
.design svg { width: 100%; height: auto; display: block; }
.design span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
#toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #f3d7a1;
  color: #2a1c09;
  padding: 10px 14px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  width: min(380px, calc(100% - 32px));
  text-align: center;
}
.thread { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow: auto; margin: 8px 0 12px; }
.msg { align-self: flex-start; max-width: 86%; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.msg.mine { align-self: flex-end; background: #3a2a16; }
.msg p { margin: 0; }
.msg audio { width: 220px; max-width: 100%; }
.msg .muted { display: block; margin-top: 4px; font-size: 12px; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) {
  #toast { transition: none; }
}
