:root {
  --bg: #06101f;
  --card: #122a4e;
  --card2: #18345c;
  --line: rgba(180, 210, 255, .12);
  --gold: #f0c45c;
  --gold2: #c9922a;
  --cyan: #5ec8ff;
  --text: #f6f3ec;
  --mute: #93a9c4;
  --ok: #3dd68c;
  --warn: #ffc14d;
  --bad: #ff6b7a;
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: Vazirmatn, Tahoma, sans-serif;
  --dock-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}
button, input, select, textarea { font: inherit; max-width: 100%; }
img, video { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

.ico {
  width: 22px;
  height: 22px;
  display: block;
  flex: 0 0 auto;
  overflow: visible;
}
.ico.lg { width: 30px; height: 30px; }

.pc-auth {
  min-height: 100dvh;
  display: block;
  padding: calc(20px + var(--safe-t)) 16px calc(24px + var(--safe-b));
}
.auth-bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(700px 280px at 100% 0%, rgba(94, 200, 255, .16), transparent 55%),
    linear-gradient(165deg, #0c1e3a, #06101f 58%);
}
.auth-card {
  position: relative; z-index: 1;
  width: 100%;
  max-width: 420px;
  min-width: 0;
  margin-inline: auto;
  background: linear-gradient(180deg, rgba(24, 52, 92, .94), rgba(8, 20, 40, .96));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px 16px;
}
.auth-mark {
  width: 52px; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #1a1404; display: grid; place-items: center; margin-bottom: 12px;
}
.auth-card h1 { margin: 0; font-size: 1.25rem; line-height: 1.4; }
.auth-sub { color: var(--mute); margin: 6px 0 0; font-size: 12px; }
.auth-form { display: grid; gap: 12px; margin-top: 16px; }
.auth-form label { display: grid; gap: 6px; font-size: 13px; color: var(--mute); }
.auth-form input {
  background: #06101f; border: 1px solid var(--line); border-radius: 14px;
  color: var(--text); padding: 12px 14px; min-height: 48px; width: 100%;
}
.captcha-row { display: flex; gap: 8px; align-items: center; }
.captcha-row img { border-radius: 12px; background: #fff; width: min(160px, 62%); height: 48px; object-fit: cover; }

.gold, .ghost, .icon-btn, .card-btn, .menu-row {
  min-height: 44px; border: 0; border-radius: 14px; cursor: pointer;
}
.gold {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #1a1404; font-weight: 800; width: 100%;
}
.gold.compact, .ghost.compact { width: auto; min-width: 72px; padding: 0 12px; }
.ghost { background: transparent; color: var(--gold); border: 1px solid var(--line); }
.err { color: var(--bad); font-size: 13px; }

.pc-app {
  width: 100%;
  padding-bottom: calc(var(--dock-h) + var(--safe-b));
  background: var(--bg);
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  min-width: 0;
  padding: calc(8px + var(--safe-t)) 10px 8px;
  background: rgba(6, 16, 31, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-brand {
  display: flex; align-items: center; gap: 8px;
  min-width: 0; flex: 1; overflow: hidden;
}
.topbar-brand > div { min-width: 0; overflow: hidden; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #1a1404; display: grid; place-items: center; flex: 0 0 auto;
}
.brand-mark .ico { width: 20px; height: 20px; }
.topbar strong {
  display: block; font-size: 13px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.muted { color: var(--mute); font-size: 11px; }
.icon-btn {
  width: 42px; height: 42px; min-height: 42px; flex: 0 0 auto;
  background: var(--card); color: var(--text);
  position: relative; border: 1px solid var(--line);
  display: grid; place-items: center; padding: 0;
}
.icon-btn.sm { width: 38px; height: 38px; min-height: 38px; }
.icon-btn.goldish {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #1a1404; border: 0; width: 44px; height: 44px;
}
.badge {
  position: absolute; top: 3px; left: 3px; background: var(--bad); color: #fff;
  border-radius: 99px; font-size: 10px; min-width: 16px; padding: 1px 4px;
}

.page-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.05rem; }
.view {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 12px 16px;
  display: grid;
  gap: 12px;
}
.toolbar { display: flex; gap: 8px; align-items: center; width: 100%; }
.search {
  flex: 1; min-width: 0; width: auto;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 14px; padding: 11px 12px; min-height: 44px;
}
.cards { display: grid; gap: 10px; width: 100%; }
.card {
  background: linear-gradient(165deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  overflow: hidden;
}
.card h3 { margin: 0 0 6px; font-size: 15px; line-height: 1.45; word-break: break-word; }
.empty { color: var(--mute); text-align: center; padding: 24px 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip {
  display: inline-flex; align-items: center; padding: 4px 8px; min-height: 26px;
  border: 0; border-radius: 10px;
  background: rgba(240, 196, 92, .12); color: var(--gold); font-size: 11px; font-weight: 700;
}
.st-searching { color: var(--warn); }
.st-dealing { color: var(--cyan); }
.st-done { color: var(--ok); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.card-btn {
  background: #06101f; color: var(--text); border: 1px solid var(--line);
  padding: 0 12px; flex: 1 1 auto;
}
.card-btn.danger { color: var(--bad); }

.tabbar {
  position: fixed;
  right: 0; left: 0; bottom: 0;
  z-index: 30;
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  height: calc(var(--dock-h) + var(--safe-b));
  padding: 4px 0 var(--safe-b);
  background: rgba(8, 18, 36, .96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar button {
  flex: 1 1 0;
  min-width: 0 !important;
  width: 0;
  min-height: 0;
  height: var(--dock-h);
  background: transparent;
  color: var(--mute);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  border: 0;
  border-radius: 10px;
  padding: 4px 0 !important;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
}
.tabbar button span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tabbar button .ico { width: 20px; height: 20px; }
.tabbar button.on {
  color: var(--gold);
  background: rgba(240, 196, 92, .14);
  box-shadow: none;
}

.sheet {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  width: 100%;
  background: linear-gradient(180deg, #16325c, #0c1e3a);
  border-top: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 16px 14px calc(20px + var(--safe-b));
  max-height: 88dvh; overflow: auto;
}
.sheet-lg { inset: 8vh 0 0; border-radius: 22px 22px 0 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sheet-head h3 { margin: 0; font-size: 16px; }
.menu-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  padding: 0 14px; margin-bottom: 8px; text-align: right; font-weight: 700;
}
.menu-row.danger { color: var(--bad); }
.form { display: grid; gap: 10px; }
.form input, .form select, .form textarea {
  width: 100%; background: #06101f; color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px; min-height: 44px;
}
.pick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 10px;
  font-weight: 800;
  text-align: center;
}
.pick-btn .file-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  opacity: 0;
  font-size: 48px;
  cursor: pointer;
  padding: 0;
  border: 0;
  background: transparent;
}
.file-native { color: transparent; }
.stack { display: grid; gap: 8px; }
.media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.media-grid img, .media-grid video { height: 84px; object-fit: cover; border-radius: 10px; width: 100%; }
.toast {
  position: fixed; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #1a1404; padding: 10px 16px; border-radius: 999px;
  z-index: 80; font-weight: 800; font-size: 13px; max-width: calc(100vw - 24px);
}
.pwa-bar {
  position: fixed; z-index: 25;
  right: 10px; left: 10px;
  bottom: calc(var(--dock-h) + var(--safe-b) + 8px);
  background: #14325c;
  border: 1px solid rgba(240, 196, 92, .45);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex; gap: 8px; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
}
.pc-auth .pwa-bar {
  bottom: calc(12px + var(--safe-b));
  top: auto;
}
.pwa-bar strong { font-size: 13px; }
.pwa-bar .muted { margin: 4px 0 0; }
.site-card .thumb {
  width: 100%; height: 150px; object-fit: cover; border-radius: 12px; margin-bottom: 10px;
  background: #06101f; display: block;
}
.chip.price { background: rgba(61, 214, 140, .16); color: var(--ok); }
a.gold-link {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #1a1404 !important; font-weight: 800; min-height: 44px; padding: 0 12px; border-radius: 14px;
}

@media (max-width: 380px) {
  .tabbar button { font-size: 9px; }
  .auth-card { padding: 18px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
