/* ==========================================================================
   سامانه توسعه تجارت — design system
   Navy base, gold + rose-gold accents used sparingly. RTL-first, mobile-first.
   ========================================================================== */

@font-face {
  font-family: "Vazirmatn";
  src: url("/assets/fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0A1430;
  --bg-deep: #070E23;
  --surface: #111F42;
  --surface-2: #172952;
  --line: rgba(232, 236, 245, .09);
  --line-strong: rgba(232, 236, 245, .18);
  --ink: #EEF1F7;
  --muted: #9CA7BE;
  --gold: #CBA55D;
  --gold-ink: #0A1430;
  --gold-soft: rgba(203, 165, 93, .13);
  --rose: #DEA897;
  --danger: #F07A6E;
  --ok: #5BC79A;
  --focus: #E7C27A;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, .6);
  --font: "Vazirmatn", "IRANYekanX", Tahoma, system-ui, -apple-system, "Segoe UI", sans-serif;
  --sidebar: 256px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F2F3F7;
  --bg-deep: #E9EBF1;
  --surface: #FFFFFF;
  --surface-2: #F6F7FA;
  --line: #E2E5ED;
  --line-strong: #CBD0DC;
  --ink: #0E1831;
  --muted: #58637D;
  --gold: #9A7631;
  --gold-ink: #FFFFFF;
  --gold-soft: rgba(154, 118, 49, .1);
  --rose: #A9624F;
  --danger: #C4412F;
  --ok: #1E8A5C;
  --focus: #9A7631;
  --shadow: 0 16px 40px -26px rgba(14, 24, 49, .35);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #F2F3F7; --bg-deep: #E9EBF1; --surface: #FFFFFF; --surface-2: #F6F7FA;
    --line: #E2E5ED; --line-strong: #CBD0DC; --ink: #0E1831; --muted: #58637D;
    --gold: #9A7631; --gold-ink: #FFFFFF; --gold-soft: rgba(154, 118, 49, .1); --rose: #A9624F;
    --danger: #C4412F; --ok: #1E8A5C; --focus: #9A7631; --shadow: 0 16px 40px -26px rgba(14, 24, 49, .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.85;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.4; margin: 0; letter-spacing: 0; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -48px; background: var(--gold); color: var(--gold-ink); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 12px; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar);
  background: var(--bg-deep); border-inline-end: 1px solid var(--line);
  display: none; flex-direction: column; padding: 22px 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 4px 8px 22px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  border: 1.5px solid var(--gold); color: var(--gold);
}
.brand-mark .icon { width: 20px; height: 20px; }
.brand-name { font-weight: 800; font-size: 15px; line-height: 1.3; }
.brand-name small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }

.side-nav { display: grid; gap: 2px; }
.side-nav a, .side-nav span {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--muted); font-weight: 500;
}
.side-nav a:hover { background: var(--surface); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--gold-soft); color: var(--ink); }
.side-nav a[aria-current="page"] .icon { color: var(--gold); }
.side-nav span[aria-disabled="true"] { opacity: .45; cursor: default; }
.side-nav .soon { margin-inline-start: auto; font-size: 11px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 8px; line-height: 20px; }
.side-foot { margin-top: auto; display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 14px; }

.main-col { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 12px 18px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 17px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line); cursor: pointer; color: var(--ink);
}
.icon-btn:hover { border-color: var(--line-strong); }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--gold);
  text-decoration: none;
}
.content { padding: 20px 16px 120px; max-width: 1080px; margin: 0 auto; }

/* Mobile bottom navigation */
.bottom-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--bg-deep); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav a, .bottom-nav span {
  display: grid; justify-items: center; gap: 2px; padding: 6px 0; min-height: 52px;
  text-decoration: none; font-size: 11.5px; color: var(--muted);
}
.bottom-nav a[aria-current="page"] { color: var(--gold); }
.bottom-nav span[aria-disabled="true"] { opacity: .4; }

/* Floating action (details/summary: works without JS) */
.fab { position: fixed; inset-inline-end: 18px; bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 40; }
.fab > summary {
  list-style: none; width: 56px; height: 56px; border-radius: 18px; cursor: pointer;
  display: grid; place-items: center; background: var(--gold); color: var(--gold-ink);
  box-shadow: var(--shadow);
}
.fab > summary::-webkit-details-marker { display: none; }
.fab[open] > summary .icon { transform: rotate(45deg); }
.fab .icon { transition: transform .18s ease; width: 24px; height: 24px; }
.fab-sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 41;
  background: var(--surface); border-top: 1px solid var(--line-strong);
  border-radius: 20px 20px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .55);
}
.fab-sheet::before { content: ""; display: block; width: 44px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 0 auto 12px; }
.fab-sheet a, .fab-sheet span { display: flex; align-items: center; gap: 12px; padding: 14px 8px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.fab-sheet a:hover { background: var(--surface-2); }
.fab-sheet span { color: var(--muted); font-weight: 500; }

@media (min-width: 960px) {
  .sidebar { display: flex; }
  .main-col { margin-inline-start: var(--sidebar); }
  .bottom-nav, .topbar .brand-mark { display: none; }
  .content { padding: 28px 32px 64px; }
  .fab { bottom: 28px; inset-inline-end: 28px; }
  .fab-sheet {
    position: absolute; inset-inline: auto 0; bottom: 68px; width: 280px;
    border: 1px solid var(--line-strong); border-radius: 16px; padding: 8px;
  }
  .fab-sheet::before { display: none; }
}

/* ---------- Building blocks ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.panel + .panel, .stack > * + * { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 11px; border: 1px solid transparent;
  font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--gold); color: var(--gold-ink);
}
.btn:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); filter: none; }
.btn-quiet { background: transparent; color: var(--muted); border: 0; padding: 0 10px; font-weight: 600; }
.btn-quiet:hover { color: var(--ink); filter: none; }
.btn-danger { background: transparent; color: var(--danger); border: 0; padding: 0 10px; font-weight: 600; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.inline-form { display: inline; }

/* Forms */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > label, .field > .label { font-size: 13.5px; font-weight: 600; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 11px;
  background: var(--bg); border: 1px solid var(--line-strong); color: var(--ink);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.error { color: var(--danger); font-size: 12.5px; }
.row { display: grid; gap: 12px; }
@media (min-width: 560px) { .row-2 { grid-template-columns: 1fr 1fr; } .row-cc { grid-template-columns: 120px 1fr; } }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 5px; accent-color: var(--gold); flex: none; }
.prefix-input { display: flex; align-items: stretch; direction: ltr; }
.prefix-input span { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-strong); border-inline-end: 0; border-radius: 11px 0 0 11px; color: var(--muted); background: var(--surface-2); font-size: 14px; }
.prefix-input .input { border-radius: 0 11px 11px 0; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.alert { padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); margin-bottom: 16px; font-size: 14px; }
.alert-success { border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.alert-error { border-color: color-mix(in srgb, var(--danger) 55%, transparent); color: var(--ink); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line-strong); color: var(--muted); line-height: 22px; white-space: nowrap; }
.chip-gold { border-color: color-mix(in srgb, var(--gold) 60%, transparent); color: var(--gold); }
.chip-ok { border-color: color-mix(in srgb, var(--ok) 60%, transparent); color: var(--ok); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; font-size: 14px; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--gold); }

.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lang-badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; font-size: 13px; text-transform: uppercase; flex: none; direction: ltr; }

.empty { text-align: center; padding: 36px 16px; }
.empty .icon { width: 36px; height: 36px; color: var(--gold); margin: 0 auto 10px; }
.empty p { color: var(--muted); margin: 6px auto 18px; max-width: 42ch; }

/* Dashboard */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font-size: 26px; font-weight: 800; line-height: 1.3; }
.stat span { font-size: 12.5px; color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.steps a { display: flex; align-items: center; gap: 12px; padding: 10px 4px; text-decoration: none; border-radius: 10px; }
.steps a:hover { background: var(--surface-2); }
.steps .dot { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.steps .done .dot { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.steps .done span:last-child { color: var(--muted); text-decoration: line-through; }
.steps .dot .icon { width: 14px; height: 14px; stroke-width: 2.4; }

/* Image pickers */
.image-pick { display: flex; gap: 14px; align-items: center; }
.image-pick img, .image-pick .ph { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); flex: none; display: grid; place-items: center; color: var(--muted); }
.image-pick.cover img, .image-pick.cover .ph { width: 160px; height: 60px; border-radius: 10px; }
.image-pick input[type=file] { font-size: 13px; max-width: 100%; }

/* ---------- Guest (auth) layout ---------- */
.guest { min-height: 100vh; display: grid; }
@media (min-width: 960px) { .guest { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.guest-aside {
  display: none; position: relative; overflow: hidden; padding: 56px;
  background: var(--bg-deep); border-inline-end: 1px solid var(--line);
}
@media (min-width: 960px) { .guest-aside { display: flex; flex-direction: column; justify-content: space-between; } }
.guest-aside .routes { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none; }
.guest-aside .routes path { fill: none; stroke: var(--gold); stroke-width: 1; stroke-dasharray: 2 7; }
.guest-aside .routes circle { fill: var(--rose); }
.guest-aside blockquote { position: relative; margin: 0; font-size: 26px; font-weight: 800; line-height: 1.6; max-width: 17ch; }
.guest-aside p { position: relative; color: var(--muted); max-width: 40ch; margin-top: 14px; }
.guest-main { display: grid; place-items: center; padding: 28px 16px 48px; }
.guest-card { width: 100%; max-width: 460px; }
.guest-card .brand { padding-inline: 0; }
.guest-card h1 { font-size: 26px; margin: 10px 0 6px; }
.guest-card .lead { color: var(--muted); margin-bottom: 24px; }
.guest-card .switch { margin-top: 22px; text-align: center; color: var(--muted); font-size: 14px; }
.guest-card .switch a { color: var(--gold); font-weight: 700; text-decoration: none; }

/* ---------- Public business page ---------- */
.pub-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--bg-deep); }
.pub-top .brand { padding: 0; }
.pub { max-width: 920px; margin: 0 auto; padding: 0 0 72px; }
.pub-cover { aspect-ratio: 8 / 3; background: linear-gradient(135deg, var(--surface-2), var(--bg-deep)); border-bottom: 1px solid var(--gold); }
.pub-cover img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 960px) { .pub-cover { border-radius: 0 0 22px 22px; } }
.pub-card { padding: 0 18px; margin-top: -56px; position: relative; }
.pub-avatar {
  width: 112px; height: 112px; border-radius: 28px; padding: 3px;
  background: linear-gradient(135deg, var(--gold), var(--rose));
}
.pub-avatar img, .pub-avatar div { width: 100%; height: 100%; border-radius: 25px; object-fit: cover; background: var(--surface); display: grid; place-items: center; font-size: 34px; font-weight: 800; color: var(--gold); }
.pub-name { margin-top: 16px; font-size: clamp(26px, 5vw, 38px); font-weight: 800; line-height: 1.35; }
.pub-title { color: var(--muted); font-size: 16px; margin-top: 2px; }
.pub-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pub-meta .flag { font-size: 16px; line-height: 1; }
.pub-teaser { font-size: 17px; line-height: 2; margin-top: 20px; max-width: 64ch; }
.pub-langs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.pub-langs a { text-decoration: none; }
.pub-langs a[aria-current="true"] { border-color: var(--gold); color: var(--gold); }
.pub-body { padding: 8px 18px 0; display: grid; gap: 14px; margin-top: 24px; }
@media (min-width: 760px) { .pub-body { grid-template-columns: 1.4fr 1fr; align-items: start; } .pub-body .span { grid-column: 1 / -1; } }
.pub-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.pub-section h2 { font-size: 15px; color: var(--gold); margin-bottom: 10px; }
.pub-section .prose { line-height: 2; }
.pub-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pub-list li { padding: 5px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.pub-contacts { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pub-contacts li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.pub-contacts li:last-child { border-bottom: 0; padding-bottom: 0; }
.pub-contacts span { color: var(--muted); }
.pub-contacts a, .pub-contacts b { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.pub-locked { text-align: center; padding: 32px 20px; border-style: dashed; border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.pub-locked .icon { width: 30px; height: 30px; margin: 0 auto 8px; color: var(--gold); }
.pub-locked p { color: var(--muted); margin: 6px auto 18px; max-width: 44ch; }
.pub-foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 40px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.btn-start { justify-content: flex-start; padding-inline: 12px; min-height: 42px; }
.prefix-input .cc-input { max-width: 84px; border-radius: 0; border-inline-end: 0; text-align: center; }
.form-actions-center { justify-content: center; }
.upload-hint { margin-top: 2px; }
.image-pick .stack > * + * { margin-top: 6px; }
.pub-price-note { font-size: 12.5px; margin-top: 14px !important; }
.pub-alert { margin: 12px 18px 0; }

/* Wallet */
.wallet-hero { display: grid; gap: 8px; background: linear-gradient(135deg, var(--surface), var(--surface-2)); border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); }
.wallet-balance { font-size: 36px; font-weight: 800; line-height: 1.4; }
.wallet-balance small { font-size: 15px; color: var(--muted); font-weight: 600; }
.packages { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .packages { grid-template-columns: repeat(5, 1fr); } }
.package { position: relative; cursor: pointer; }
.package input { position: absolute; opacity: 0; top: 0; right: 0; bottom: 0; left: 0; }
.package-body { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 14px 8px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--bg); min-height: 110px; align-content: center; }
.package-body b { font-size: 20px; font-weight: 800; }
.package-body small { font-size: 12px; color: var(--muted); }
.package input:checked + .package-body { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.package input:focus-visible + .package-body { outline: 2px solid var(--focus); outline-offset: 2px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.amount { font-size: 15px; }
.amount.plus { color: var(--ok); }
.amount.minus { color: var(--ink); }

/* Payment result */
.result { text-align: center; max-width: 560px; margin: 0 auto; }
.result-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 4px auto 12px; font-size: 28px; font-weight: 800; background: var(--surface-2); }
.result-ok .result-icon { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.result-fail .result-icon { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.result p { color: var(--muted); margin: 8px auto 16px; max-width: 46ch; }
.result-meta { display: grid; gap: 8px; margin: 0 0 18px; text-align: start; }
.result-meta div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 8px; font-size: 14px; }
.result-meta dt { color: var(--muted); }
.result-meta dd { margin: 0; font-weight: 600; }
@media (min-width: 960px) { .topbar .wallet-btn { display: none; } }
.wallet-strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; padding: 14px 20px; }
.wallet-strip:hover { border-color: var(--line-strong); }

/* ---------- Proposals ---------- */
.feed-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.segmented a { padding: 6px 14px; border-radius: 9px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); }
.segmented a[aria-selected="true"] { background: var(--gold-soft); color: var(--ink); }
.filters > summary { list-style: none; }
.filters > summary::-webkit-details-marker { display: none; }
.filters-form { display: grid; gap: 10px; margin-top: 10px; min-width: min(100%, 320px); }
.filters[open] { flex-basis: 100%; }
@media (min-width: 720px) { .filters-form { grid-template-columns: repeat(3, 1fr) auto; align-items: end; } }
.hint-strip { display: block; text-decoration: none; margin-bottom: 16px; padding: 14px 18px; border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); color: var(--gold); font-weight: 600; }

.feed { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .feed { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .feed { grid-template-columns: repeat(3, 1fr); } }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.pcard-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--surface-2); }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; }
.pcard-ph { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; color: var(--gold); }
.pcard-ph .icon { width: 36px; height: 36px; }
.pcard-type { position: absolute; top: 12px; inset-inline-start: 12px; background: color-mix(in srgb, var(--bg-deep) 82%, transparent); color: var(--ink); backdrop-filter: blur(6px); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.pcard-body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.pcard-body h3 { font-size: 16px; line-height: 1.6; }
.pcard-body h3 a { text-decoration: none; }
.pcard-body h3 a:hover { color: var(--gold); }
.pcard-owner { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.pcard-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pcard-tags span { font-size: 12px; color: var(--gold); }
.feed-foot { display: grid; justify-items: center; gap: 12px; padding: 24px 0; }
.skeleton-row { display: none; }
.js .skeleton-row { display: flex; gap: 10px; }
.js [data-feed-next] { display: none; }
.skeleton-row span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); animation: pulse 1.2s infinite ease-in-out; }
.skeleton-row span:nth-child(2) { animation-delay: .15s; } .skeleton-row span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

.pdetail { max-width: 820px; margin: 0 auto; }
.pdetail-cover { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-2); margin-bottom: 18px; }
.pdetail-cover img { width: 100%; height: 100%; object-fit: cover; }
.pdetail-main { display: grid; gap: 14px; }
.pdetail-title { font-size: clamp(22px, 4vw, 30px); font-weight: 800; }
.pdetail-summary { font-size: 16px; color: var(--muted); line-height: 2; }
.owner-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; background: var(--surface); }
.owner-row .grow { display: grid; line-height: 1.6; min-width: 0; }
.owner-row .muted { font-size: 13px; }
.specs { margin: 0; display: grid; gap: 8px; }
.specs div { display: grid; grid-template-columns: minmax(84px, 120px) 1fr; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; font-size: 14px; }
.specs div:last-child { border-bottom: 0; padding-bottom: 0; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; text-align: start; line-height: 1.9; }
.gallery { columns: 2; column-gap: 10px; }
.gallery a { display: block; break-inside: avoid; margin-bottom: 10px; }
.gallery img { border-radius: 12px; width: 100%; height: auto; }
@media (max-width: 480px) { .gallery { columns: 1; } }
.pdetail-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 0 24px; }
.inline-icon { display: inline-block; vertical-align: -4px; width: 16px; height: 16px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img { height: 64px; width: auto; border-radius: 8px; }
.thumb-sm { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; }
.list-row .title { text-decoration: none; display: block; }
.list-row.unread .title::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-inline-start: 8px; vertical-align: middle; }
.list-note { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.chip-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-pick { position: relative; cursor: pointer; }
.chip-pick input { position: absolute; opacity: 0; top: 0; right: 0; bottom: 0; left: 0; }
.chip-pick span { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 14px; }
.chip-pick input:checked + span { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); font-weight: 600; }
.chip-pick input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.input.narrow { max-width: 140px; }
.pub-cta { margin-top: 14px; }

/* ---------- Searchable select (combobox) ---------- */
.ss { position: relative; }
.ss-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ss-trigger { text-align: start; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ss-trigger::after { content: ""; width: 8px; height: 8px; border-inline-end: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg) translateY(-2px); flex: none; }
.ss-trigger.ss-placeholder { color: var(--muted); }
.ss.is-open .ss-trigger { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.ss-panel {
  position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 45;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; min-width: 240px;
}
.ss-search { padding: 10px; border-bottom: 1px solid var(--line); }
.ss-search .input { min-height: 40px; }
.ss-list { list-style: none; margin: 0; padding: 6px; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
.ss-list li { padding: 9px 12px; border-radius: 9px; cursor: pointer; font-size: 14.5px; line-height: 1.7; }
.ss-list li:hover, .ss-list li.is-active { background: var(--surface-2); }
.ss-list li[aria-selected="true"] { color: var(--gold); font-weight: 700; }
.ss-list li[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.ss-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 14px; }
@media (max-width: 640px) {
  .ss.is-open::before { content: ""; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0, 0, 0, .45); z-index: 44; }
  .ss-panel {
    position: fixed; inset-inline: 0; top: auto; bottom: 0; border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom); max-height: 75vh; display: flex; flex-direction: column;
  }
  .ss-list { max-height: none; flex: 1; }
}

/* Badges */
.badge { margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-size: 11.5px; font-weight: 800; font-style: normal; display: inline-grid; place-items: center; line-height: 1; }
.icon-btn.bell { position: relative; }
.icon-btn.bell .badge { position: absolute; top: -6px; inset-inline-end: -6px; margin: 0; }
.bn-icon { position: relative; display: inline-block; }
.dot-badge { position: absolute; top: -2px; inset-inline-end: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); border: 2px solid var(--bg-deep); }

/* ---------- Letters (Gmail-like compact list) ---------- */
.tabs-flat { margin-bottom: 0; border-bottom: 0; }
.mail { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.mail-row + .mail-row { border-top: 1px solid var(--line); }
.mail-row a { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; text-decoration: none; }
.mail-row a:hover { background: var(--surface-2); }
.mail-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.mail-top { display: flex; justify-content: space-between; gap: 10px; }
.mail-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mail-subject { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-subject .chip { font-size: 11px; line-height: 18px; padding: 0 8px; }
.mail-preview { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row.unread .mail-name, .mail-row.unread .mail-subject { font-weight: 800; color: var(--ink); }
.mail-row .badge { margin-top: 10px; }

.thread { max-width: 820px; margin: 0 auto; display: grid; gap: 14px; }
.thread-head { display: flex; gap: 14px; align-items: flex-start; }
.thread-head h2 { margin: 6px 0 2px; }
.messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; max-width: 88%; margin-inline-start: auto; border-end-start-radius: 4px; }
.msg.mine { margin-inline-start: 0; margin-inline-end: auto; border-end-start-radius: 16px; border-end-end-radius: 4px; background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 30%, var(--line)); }
.msg-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.msg-meta b { color: var(--ink); }
.msg-body { line-height: 2; overflow-wrap: anywhere; }
.reply label { font-weight: 600; font-size: 14px; }

.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--rose)); }
.progress-0 { width: 0%; }
.progress-5 { width: 5%; }
.progress-10 { width: 10%; }
.progress-15 { width: 15%; }
.progress-20 { width: 20%; }
.progress-25 { width: 25%; }
.progress-30 { width: 30%; }
.progress-35 { width: 35%; }
.progress-40 { width: 40%; }
.progress-45 { width: 45%; }
.progress-50 { width: 50%; }
.progress-55 { width: 55%; }
.progress-60 { width: 60%; }
.progress-65 { width: 65%; }
.progress-70 { width: 70%; }
.progress-75 { width: 75%; }
.progress-80 { width: 80%; }
.progress-85 { width: 85%; }
.progress-90 { width: 90%; }
.progress-95 { width: 95%; }
.progress-100 { width: 100%; }
.stat { text-decoration: none; } a.stat:hover { border-color: var(--line-strong); }
.settings-grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; } }
.sticky-actions { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 90%, transparent); padding: 10px 0; z-index: 5; }
@media (min-width: 960px) { .sticky-actions { bottom: 0; } }

/* ---------- Mailbox (Gmail-like) ---------- */
.mailbox { display: grid; gap: 16px; }
@media (min-width: 900px) { .mailbox { grid-template-columns: 220px minmax(0, 1fr); align-items: start; } }
.mail-nav { display: grid; gap: 12px; }
@media (min-width: 900px) { .mail-nav { position: sticky; top: 76px; } }
.mail-compose { justify-content: flex-start; padding-inline: 18px; min-height: 48px; border-radius: 16px; }
.mail-folders { display: flex; gap: 6px; overflow-x: auto; }
@media (min-width: 900px) { .mail-folders { flex-direction: column; overflow: visible; } }
.mail-folders a { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.mail-folders a:hover { background: var(--surface); color: var(--ink); }
.mail-folders a[aria-current="page"] { background: var(--gold-soft); color: var(--ink); }
.mail-folders a[aria-current="page"] .icon { color: var(--gold); }
.mail-cats { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.mail-cats a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.mail-cats a[aria-current="page"] { color: var(--ink); border-color: var(--gold); }
.mail-cats .badge { margin: 0; }
.mail-official { margin-bottom: 12px; border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); }
.org-avatar { background: var(--gold-soft); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.org-avatar .icon { width: 20px; height: 20px; }

/* Send wizard */
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); font-size: 13px; font-weight: 800; margin-inline-end: 6px; vertical-align: 2px; }
.kind-cards { display: grid; gap: 10px; }
@media (min-width: 720px) { .kind-cards { grid-template-columns: repeat(3, 1fr); } }
.kind-card { position: relative; cursor: pointer; }
.kind-card input { position: absolute; opacity: 0; top: 0; right: 0; bottom: 0; left: 0; }
.kind-body { display: grid; gap: 6px; padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--bg); height: 100%; }
.kind-body .muted { font-size: 13px; line-height: 1.8; }
.kind-price { font-size: 12.5px; color: var(--gold); font-weight: 600; }
.kind-card input:checked + .kind-body { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.kind-card input:focus-visible + .kind-body { outline: 2px solid var(--focus); outline-offset: 2px; }
.js [data-send-form] [hidden] { display: none !important; }
.log { background: var(--bg-deep); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 12.5px; line-height: 1.8; overflow-x: auto; white-space: pre-wrap; text-align: left; }
.steps-list { margin: 0; padding-inline-start: 20px; line-height: 2; font-size: 14px; }
.input.narrow-wide { max-width: 320px; }
.release.is-hidden { opacity: .6; }
.release .chip { margin-inline-end: 6px; }
.proposal-picks { display: grid; gap: 8px; max-height: 360px; overflow-y: auto; padding: 2px; }
.proposal-pick { position: relative; cursor: pointer; }
.proposal-pick input { position: absolute; opacity: 0; top: 0; right: 0; bottom: 0; left: 0; }
.proposal-pick-body { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--bg); }
.proposal-pick-body img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; flex: none; }
.proposal-pick-body .grow { display: grid; min-width: 0; }
.proposal-pick-body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proposal-pick-body .muted { font-size: 12.5px; }
.proposal-pick input:checked + .proposal-pick-body { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.proposal-pick input:focus-visible + .proposal-pick-body { outline: 2px solid var(--focus); outline-offset: 2px; }
.plain-fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }

/* ---------- Admin ---------- */
.stats-admin { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .stats-admin { grid-template-columns: repeat(4, 1fr); } }
.chart { margin: 0; }
.chart figcaption { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-weight: 700; }
.chart figcaption b { color: var(--gold); }
.chart svg { width: 100%; height: 160px; }
.chart rect { fill: var(--gold); opacity: .85; }
.chart rect:hover { opacity: 1; fill: var(--rose); }
.chart-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.chart-empty { padding: 20px 0; }
.admin-search { display: grid; gap: 10px; }
@media (min-width: 720px) { .admin-search { grid-template-columns: 2fr 1fr 1fr auto; align-items: center; } }
.admin-wallet { display: grid; gap: 10px; }
@media (min-width: 720px) { .admin-wallet { grid-template-columns: 1fr 1fr 2fr 1.5fr auto; align-items: center; } }
.admin-user-head { flex-wrap: wrap; }
.avatar-lg { width: 64px; height: 64px; font-size: 20px; }
.impersonation-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
select[multiple].select { min-height: 160px; }
/* On/off switch */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 46px; height: 26px; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; transition: background .15s ease; }
.switch-track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: inset-inline-start .15s ease; }
.switch input:checked + .switch-track { background: var(--gold); }
.switch input:checked + .switch-track::after { inset-inline-start: 23px; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* =====================================================================
   Visual system v2 — "Lacquer & Champagne"
   Midnight-navy lacquer surfaces, champagne-gold foil reserved for primary
   actions, the brand mark and active states. Everything else stays quiet.
   ===================================================================== */
:root {
  --bg: #0A1230; --bg-deep: #060B1D; --surface: #0F1A3A; --surface-2: #15214A; --surface-3: #1B2A5A;
  --line: rgba(226, 232, 245, .075); --line-strong: rgba(226, 232, 245, .16);
  --ink: #F3F5F9; --muted: #8F99B0;
  --gold: #D4B06A; --gold-2: #B98F45; --rose: #DCA593; --gold-ink: #0A1230; --gold-soft: rgba(212, 176, 106, .12);
  --foil: linear-gradient(135deg, #F1D79A 0%, #D4B06A 38%, #B98F45 62%, #DCA593 100%);
  --edge: linear-gradient(90deg, transparent, rgba(212, 176, 106, .75), rgba(220, 165, 147, .6), transparent);
  --lift: inset 0 1px 0 rgba(255, 255, 255, .04);
  --float: 0 24px 60px -18px rgba(2, 6, 20, .75), 0 2px 8px rgba(2, 6, 20, .35);
  --radius-xl: 24px; --radius-lg: 20px; --radius: 14px; --radius-sm: 11px;
  --font: "Vazirmatn", system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="light"] {
  --bg: #F4F5F9; --bg-deep: #ECEEF4; --surface: #FFFFFF; --surface-2: #F6F7FB; --surface-3: #EEF0F6;
  --line: #E3E6EF; --line-strong: #CDD2DE; --ink: #0C1634; --muted: #5B667F;
  --gold: #9C7A38; --gold-2: #7F622A; --rose: #A9634F; --gold-ink: #FFFFFF; --gold-soft: rgba(156, 122, 56, .1);
  --foil: linear-gradient(135deg, #B8954F 0%, #9C7A38 45%, #7F622A 70%, #A9634F 100%);
  --edge: linear-gradient(90deg, transparent, rgba(156, 122, 56, .55), rgba(169, 99, 79, .45), transparent);
  --lift: inset 0 1px 0 rgba(255, 255, 255, .9);
  --float: 0 22px 50px -20px rgba(12, 22, 52, .35), 0 2px 6px rgba(12, 22, 52, .08);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F4F5F9; --bg-deep: #ECEEF4; --surface: #FFFFFF; --surface-2: #F6F7FB; --surface-3: #EEF0F6;
    --line: #E3E6EF; --line-strong: #CDD2DE; --ink: #0C1634; --muted: #5B667F;
    --gold: #9C7A38; --gold-2: #7F622A; --rose: #A9634F; --gold-ink: #FFFFFF; --gold-soft: rgba(156, 122, 56, .1);
    --foil: linear-gradient(135deg, #B8954F 0%, #9C7A38 45%, #7F622A 70%, #A9634F 100%);
    --edge: linear-gradient(90deg, transparent, rgba(156, 122, 56, .55), rgba(169, 99, 79, .45), transparent);
    --lift: inset 0 1px 0 rgba(255, 255, 255, .9);
    --float: 0 22px 50px -20px rgba(12, 22, 52, .35), 0 2px 6px rgba(12, 22, 52, .08);
  }
}

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body { font-size: 15.5px; line-height: 1.9; text-rendering: optimizeLegibility; }
body::before { /* faint vignette on the lacquer, fixed and cheap */
  content: ""; position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(1200px 600px at 100% -10%, rgba(212, 176, 106, .07), transparent 60%),
              radial-gradient(900px 500px at -10% 110%, rgba(220, 165, 147, .05), transparent 60%);
}
a, button, input, select, textarea, summary, label { touch-action: manipulation; }
h1, h2, h3 { letter-spacing: -.005em; }
h2 { font-size: 19px; font-weight: 800; }
::selection { background: rgba(212, 176, 106, .3); }

/* Smooth page-to-page navigation (Chrome/Edge/Safari support; ignored elsewhere) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; animation-timing-function: var(--ease); }

/* ---------- Buttons: champagne foil only for the primary action ---------- */
.btn {
  background: var(--foil); color: var(--gold-ink); border: 0; min-height: 46px; border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 22px -12px rgba(212, 176, 106, .7);
  transition: transform .12s var(--ease), box-shadow .2s var(--ease), filter .2s var(--ease);
}
.btn:hover { filter: brightness(1.05) saturate(1.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 12px 28px -12px rgba(212, 176, 106, .85); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--gold); filter: none; }
.btn-quiet, .btn-danger { background: transparent; box-shadow: none; }
.btn-quiet:hover, .btn-danger:hover { background: var(--surface-2); box-shadow: none; filter: none; }
.btn-sm { min-height: 38px; border-radius: 11px; }
.btn:disabled { opacity: .6; cursor: progress; }
.icon-btn { border-radius: 12px; border-color: var(--line); background: var(--surface); box-shadow: var(--lift); transition: border-color .2s var(--ease), transform .12s var(--ease); }
.icon-btn:hover { border-color: var(--gold); }
.icon-btn:active { transform: scale(.96); }

/* ---------- Surfaces: hierarchy by radius and depth, not identical cards ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 22px; box-shadow: var(--lift); }
.gilded { position: relative; overflow: hidden; }
.gilded::before { content: ""; position: absolute; inset-inline: 18px; top: 0; height: 1px; background: var(--edge); }
.stat { border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--lift); position: relative; overflow: hidden; padding: 16px 18px; transition: border-color .2s var(--ease); }
.stat b { font-size: 28px; font-weight: 900; letter-spacing: -.01em; }
.stat::after { content: ""; position: absolute; inset-inline-start: 0; top: 16px; bottom: 16px; width: 2px; border-radius: 2px; background: var(--foil); opacity: .8; }
.list-row { padding: 14px 4px; }
.list-row + .list-row { border-top-color: var(--line); }
.chip { border-color: var(--line-strong); background: transparent; }
.chip-gold { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 55%, transparent); background: var(--gold-soft); }
.avatar { background: var(--surface-3); color: var(--gold); box-shadow: 0 0 0 1px var(--line-strong); }
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }

/* ---------- Forms ---------- */
.input, .select, .textarea { min-height: 50px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { background: var(--surface); border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.field > label, .field > .label { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.alert { border-radius: var(--radius); background: var(--surface); box-shadow: var(--lift); }
.alert-success { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.alert-error { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.fee-note { color: var(--gold); font-size: 13.5px; font-weight: 600; }

/* ---------- App shell ---------- */
.sidebar { width: var(--sidebar); background: var(--bg-deep); border-inline-end: 1px solid var(--line); padding: 22px 14px 16px; }
.brand-mark { border: 0; background: var(--foil); color: var(--gold-ink); box-shadow: 0 8px 20px -10px rgba(212, 176, 106, .8), inset 0 1px 0 rgba(255, 255, 255, .4); }
.brand-name { font-weight: 900; }
.side-nav a, .side-nav span { position: relative; border-radius: 12px; padding: 10px 14px; transition: background .15s var(--ease), color .15s var(--ease); }
.side-nav a[aria-current="page"] { background: linear-gradient(90deg, var(--gold-soft), transparent); color: var(--ink); }
.side-nav a[aria-current="page"]::before { content: ""; position: absolute; inset-inline-start: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--foil); }
.side-user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 10px; border-radius: 16px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); margin-bottom: 10px; }
.side-user:hover { border-color: var(--line-strong); }
.side-user-text { display: grid; line-height: 1.5; min-width: 0; }
.side-user-text b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-text small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot { margin-top: 0; }
.topbar { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); border-bottom-color: var(--line); padding: 12px 20px; }
.topbar h1 { font-size: 18px; font-weight: 800; }
.content { max-width: 1160px; padding: 24px 16px 140px; }
@media (min-width: 960px) { .content { padding: 32px 36px 72px; } }
main.content > * { animation: rise .32s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Mobile: floating glass dock instead of a flat bar */
.bottom-nav {
  inset-inline: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); border-radius: 22px; padding: 6px;
  background: color-mix(in srgb, var(--bg-deep) 82%, transparent); backdrop-filter: saturate(170%) blur(18px); -webkit-backdrop-filter: saturate(170%) blur(18px);
  border: 1px solid var(--line-strong); box-shadow: var(--float);
}
.bottom-nav a, .bottom-nav span { border-radius: 16px; min-height: 54px; font-size: 11px; font-weight: 600; transition: background .15s var(--ease), color .15s var(--ease); }
.bottom-nav a[aria-current="page"] { background: var(--gold-soft); color: var(--gold); }
.bottom-nav .icon { width: 22px; height: 22px; }
.fab { bottom: calc(92px + env(safe-area-inset-bottom)); }
.fab > summary { width: 58px; height: 58px; border-radius: 20px; background: var(--foil); box-shadow: var(--float), inset 0 1px 0 rgba(255, 255, 255, .4); transition: transform .15s var(--ease); }
.fab > summary:active { transform: scale(.95); }
.fab-sheet { border-radius: 26px 26px 0 0; background: var(--surface); box-shadow: var(--float); animation: sheet .26s var(--ease) both; }
.fab-sheet a { border-radius: 14px; }
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 960px) {
  .fab { bottom: 28px; }
  .fab-sheet { border-radius: 18px; animation-name: pop; }
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.ss-panel { animation: pop .18s var(--ease) both; border-radius: 18px; box-shadow: var(--float); }
@media (max-width: 640px) { .ss-panel { animation-name: sheet; border-radius: 26px 26px 0 0; } }

/* ---------- Dashboard ---------- */
.welcome { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 26px 24px;
  background: radial-gradient(600px 220px at 100% 0%, rgba(212, 176, 106, .12), transparent 70%), var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--lift); }
.welcome h2 { font-size: clamp(22px, 3.2vw, 28px); font-weight: 900; }
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.wallet-hero { background: radial-gradient(600px 220px at 100% 0%, rgba(212, 176, 106, .14), transparent 70%), var(--surface); }
.wallet-balance { font-size: clamp(32px, 6vw, 44px); font-weight: 900; }

/* ---------- Feed: post-style cards ---------- */
.feed { gap: 18px; }
.pcard { border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--lift); content-visibility: auto; contain-intrinsic-size: 420px; transition: border-color .2s var(--ease), transform .2s var(--ease); }
@media (hover: hover) { .pcard:hover { border-color: var(--line-strong); transform: translateY(-2px); } }
.pcard-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.pcard-who { display: grid; line-height: 1.45; min-width: 0; }
.pcard-who b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-who small { font-size: 12px; color: var(--muted); }
.pcard-media { margin: 0 10px; border-radius: 16px; overflow: hidden; }
.pcard-type { top: 10px; inset-inline-start: 10px; font-weight: 700; }
.pcard-body { padding: 14px 16px 18px; }
.pcard-body h3 { font-size: 16.5px; font-weight: 800; }
.segmented { border-radius: 14px; padding: 4px; background: var(--surface); box-shadow: var(--lift); }
.segmented a { border-radius: 10px; transition: background .15s var(--ease), color .15s var(--ease); }
.segmented a[aria-selected="true"] { background: var(--foil); color: var(--gold-ink); }

/* ---------- Mailbox & tabs ---------- */
.mail { border-radius: var(--radius-xl); box-shadow: var(--lift); }
.mail-row a { padding: 14px 18px; transition: background .12s var(--ease); }
.mail-row.unread { background: linear-gradient(90deg, var(--gold-soft), transparent 40%); }
.mail-compose { background: var(--foil); }
.mail-folders a { border-radius: 14px; }
.mail-folders a[aria-current="page"] { background: linear-gradient(90deg, var(--gold-soft), transparent); }
.mail-cats a[aria-current="page"], .tabs a[aria-current="page"] { border-color: var(--gold); }
.msg { border-radius: 20px; box-shadow: var(--lift); }
.msg.mine { background: linear-gradient(135deg, rgba(212, 176, 106, .16), rgba(220, 165, 147, .1)); }
.badge { background: var(--foil); color: var(--gold-ink); }

/* ---------- Public business page ---------- */
.pub-cover { position: relative; }
.pub-cover::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--bg) 75%, transparent)); pointer-events: none; }
.pub-cover { border-bottom: 0; }
.pub-avatar { background: var(--foil); box-shadow: var(--float); }
.pub-name { font-weight: 900; letter-spacing: -.01em; }
.pub-section { border-radius: var(--radius-xl); box-shadow: var(--lift); }
.pub-section h2 { font-size: 14px; letter-spacing: 0; }
.pub-locked { background: radial-gradient(500px 200px at 50% 0%, rgba(212, 176, 106, .1), transparent 70%), var(--surface); }

/* ---------- Guest (auth) ---------- */
.guest-aside { background: radial-gradient(800px 500px at 0% 100%, rgba(212, 176, 106, .1), transparent 60%), var(--bg-deep); }
.guest-aside blockquote { font-size: 30px; font-weight: 900; }
.guest-card h1 { font-size: 28px; font-weight: 900; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  main.content > *, .fab-sheet, .ss-panel { animation: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
.bn-icon { display: block; line-height: 0; }
.bottom-nav a, .bottom-nav span { align-content: center; }
.fab { bottom: calc(100px + env(safe-area-inset-bottom)); }
@media (min-width: 960px) { .fab { bottom: 28px; } }
.side-nav a[aria-current="page"]::before { inset-inline-start: 0; border-radius: 3px; }
.bottom-nav a, .bottom-nav span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.bottom-nav .bn-icon { height: 22px; width: 22px; }
.bottom-nav .bn-icon .icon { display: block; }
.bottom-nav .bn-icon { display: block; min-height: 0; padding: 0; border-radius: 0; background: none; gap: 0; }
/* Text buttons keep readable colours in both themes */
.btn.btn-quiet { color: var(--muted); }
.btn.btn-quiet:hover { color: var(--ink); }
.btn.btn-danger { color: var(--danger); }
.btn.btn-ghost { color: var(--ink); }

/* ---------- Discover & search ---------- */
.search-bar { position: relative; display: flex; gap: 10px; align-items: center; }
.search-bar > .icon { position: absolute; inset-inline-start: 16px; color: var(--muted); pointer-events: none; }
.search-bar .input { padding-inline-start: 46px; min-height: 54px; border-radius: 16px; }
.search-bar-lg { flex-wrap: wrap; }
.search-bar-lg .input { flex: 1 1 260px; }
.search-bar-lg .ss, .search-bar-lg > .select { flex: 0 1 220px; }
.disc { display: grid; gap: 12px; }
.disc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 170px); gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.rail > * { scroll-snap-align: start; }
.trader-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.trader { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 18px 12px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--lift); text-decoration: none; transition: border-color .2s var(--ease), transform .2s var(--ease); }
@media (hover: hover) { .trader:hover { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); transform: translateY(-2px); } }
.trader-avatar { width: 64px; height: 64px; font-size: 22px; margin-bottom: 6px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px color-mix(in srgb, var(--gold) 60%, transparent); }
.trader b { font-size: 14px; line-height: 1.6; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.trader small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.verified { color: var(--gold); }
.feed-compact { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.country-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.country-tile { display: grid; justify-items: center; gap: 2px; padding: 14px 8px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: border-color .2s var(--ease); }
.country-tile:hover { border-color: var(--gold); }
.country-flag { font-size: 28px; line-height: 1.2; }
.country-tile small { color: var(--muted); font-size: 12px; }
.topbar-search { display: none; flex: 0 1 340px; }
.topbar-search .input { min-height: 42px; border-radius: 13px; }
@media (min-width: 960px) { .topbar-search { display: flex; } }

/* Brand logo (1.14.0): the image carries its own tile, so the mark drops the gold foil background. */
.brand-mark.has-logo, .org-avatar.has-logo { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0; overflow: visible; }
.brand-mark.has-logo > img, .org-avatar.has-logo > img { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }

/* 1.15: phones and tablets never zoom into a field on focus (iOS zooms below 16px). Applies to every form on the site. */
@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea { font-size: 16px !important; }
}

/* 1.15: searchable selects open as a dropdown anchored to the field on every screen (no bottom sheet), as wide as
   their longest option, and flip above the field when the space below is short (class set by app.js). */
.ss.ss-up .ss-panel { top: auto; bottom: calc(100% + 6px); }
@media (max-width: 640px) {
  .ss.is-open::before { content: none; }
  .ss-panel, .panel-ui .ss-panel {
    position: absolute; top: calc(100% + 6px); bottom: auto; inset-inline-start: 0; inset-inline-end: auto;
    width: max-content; min-width: min(220px, 100%); max-width: min(340px, calc(100vw - 32px)); max-height: none;
    border-radius: 16px; padding-bottom: 0; display: block; animation-name: pop;
  }
  .ss.ss-up .ss-panel { top: auto; bottom: calc(100% + 6px); }
  .ss-list { max-height: 300px; }
  .ss-list li { white-space: nowrap; }
}

/* 1.15: proposal photos are shown in place only (no link, no new tab). */
.gallery .gallery-item { display: block; break-inside: avoid; margin-bottom: 10px; }
.gallery img { pointer-events: none; -webkit-user-drag: none; user-select: none; }

/* 1.15.5: business page text is justified (both edges aligned); short labels and chips are left as they are. */
.pub .pub-teaser, .pub .prose, .pub .prose p, .pub .pub-section > p, .pub .pub-locked p, .pub .pub-reach p {
  text-align: justify; text-justify: inter-word; hyphens: auto;
}

/* 1.15.6: small "install the app" popup on phones (built by app.js; never on the installed app itself). */
.pwa-pop { position: fixed; z-index: 9999; inset-inline: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); max-width: 380px; margin-inline: auto; padding: 16px 16px 14px; border-radius: 20px; direction: rtl; text-align: start;
  background: linear-gradient(180deg, rgba(12, 30, 56, .98), rgba(6, 17, 34, .98)); color: #EAF1FA; border: 1px solid rgba(243, 198, 91, .45);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .04) inset, 0 0 30px rgba(243, 198, 91, .12);
  font-size: 13px; line-height: 1.85; opacity: 0; transform: translateY(24px) scale(.97); transition: opacity .35s ease, transform .35s cubic-bezier(.2, .7, .2, 1); }
.pwa-pop.is-in { opacity: 1; transform: none; }
.pwa-pop::before { content: ""; position: absolute; top: 0; right: 18px; bottom: auto; left: 18px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #F3C65B, #25C7FF, transparent); }
.pwa-x { position: absolute; top: 8px; inset-inline-end: 10px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); color: #C9D6E6; font-size: 18px; line-height: 1; cursor: pointer; }
.pwa-head { display: flex; align-items: center; gap: 12px; padding-inline-end: 30px; }
.pwa-head img { width: 44px; height: 44px; border-radius: 12px; flex: none; box-shadow: 0 6px 16px rgba(0, 0, 0, .4); }
.pwa-head b { display: block; font-size: 14.5px; font-weight: 900; color: #fff; }
.pwa-head small { display: block; color: #9DB1C7; font-size: 11.5px; }
.pwa-text { margin: 10px 0 0; color: #C9D6E6; }
.pwa-steps { margin: 10px 0 0; padding: 0 18px 0 0; color: #C9D6E6; }
.pwa-steps li { margin: 2px 0; }
.pwa-steps b, .pwa-text b { color: #FFD978; font-weight: 800; direction: ltr; unicode-bidi: isolate; }
.pwa-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; margin: 0 2px; vertical-align: -6px; border-radius: 7px; background: rgba(37, 199, 255, .14); color: #25C7FF; }
.pwa-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pwa-ic svg circle { fill: currentColor; stroke: none; }
.pwa-actions { display: flex; gap: 8px; margin-top: 12px; }
.pwa-btn { flex: 1; min-height: 40px; border: 0; border-radius: 12px; background: linear-gradient(180deg, #FFE39A, #F3C65B 45%, #E7B84B); color: #102039; font: inherit; font-weight: 900; cursor: pointer; box-shadow: 0 8px 20px -8px rgba(243, 198, 91, .7); }
.pwa-later { min-height: 40px; padding: 0 16px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; background: transparent; color: #C9D6E6; font: inherit; cursor: pointer; }
@media (min-width: 900px) { .pwa-pop { bottom: 24px; inset-inline: auto 24px; } }
/* …and every box below it: products, services, markets, locked/contact notes. Long list items wrap inside their chip. */
.pub .pub-section p, .pub .pub-section li, .pub .pub-section .prose, .pub .pub-section .muted, .pub .pub-body p {
  text-align: justify; text-justify: inter-word;
}
.pub .pub-list li { max-width: 100%; }

/* 1.15.7: "not enough Stars" notice next to a disabled send button */
.stars-short { display: flex; align-items: flex-start; gap: 12px; margin: 12px 0; padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(243, 198, 91, .5); background: linear-gradient(180deg, rgba(243, 198, 91, .14), rgba(243, 198, 91, .06)); color: var(--ink, #EAF1FA); text-align: start; line-height: 1.9; }
.stars-short-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 12px; background: rgba(243, 198, 91, .2); font-size: 18px; }
.stars-short b { display: block; font-size: 14px; font-weight: 900; }
.stars-short span { display: block; font-size: 13px; opacity: .9; }
.stars-short .btn { margin-top: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.35); box-shadow: none; }

/* ---------- 1.16 Trust & Safety + API ---------- */
.report-pop { position: relative; display: inline-block; }
.report-trigger { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; list-style: none; }
.report-trigger::-webkit-details-marker { display: none; }
.report-trigger .icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.report-trigger:hover, .report-pop[open] > .report-trigger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.report-pop.is-compact .report-trigger { padding: 3px; border-color: transparent; }
.report-form { position: absolute; z-index: 40; inset-inline-end: 0; top: calc(100% + 8px); width: min(340px, calc(100vw - 32px)); display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-align: start; color: var(--ink); font-size: 13.5px; white-space: normal; }
.report-form p { margin: 0; font-size: 12.5px; }
.report-title { font-size: 15px; }
.report-reasons { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.report-reason { cursor: pointer; }
.report-reason input { position: absolute; opacity: 0; pointer-events: none; }
.report-reason span { display: inline-block; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12.5px; color: var(--muted); }
.report-reason input:checked + span { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.report-reason input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.report-block { font-size: 12.5px; color: var(--muted); }
.report-form .form-actions { margin: 0; }
.pub-safety { display: flex; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pub-safety form { margin: 0; }
.pdetail-actions .report-pop { margin-inline-start: auto; }
.msg-meta { align-items: center; }
.msg-meta .report-pop { margin-inline-start: auto; }
.msg-hidden { color: var(--muted); font-style: italic; }
.reply-closed { text-align: center; color: var(--muted); }
.trust-reason { margin: 0 0 8px; padding: 8px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--danger) 9%, transparent); font-size: 13px; }
.trust-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.trust-status .select, .trust-status .input { width: auto; flex: 1 1 160px; }
.trust-reason-input { flex: 2 1 240px !important; }
.chip-danger { border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.seg-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); width: fit-content; max-width: 100%; overflow-x: auto; margin-top: 4px; }
.seg-tabs a { padding: 6px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.seg-tabs a b { font-weight: 700; margin-inline-start: 4px; }
.seg-tabs a[aria-current] { background: var(--gold); color: var(--gold-ink); }
.chip-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip-tabs .chip { text-decoration: none; }
.chip-tabs .chip.is-on { border-color: var(--gold); color: var(--gold); }
.trust-filter { margin: 0; }
.trust-empty { text-align: center; padding: 18px 0; margin: 0; }
.trust-card { display: grid; gap: 12px; }
.trust-card-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.trust-card-head .grow { flex: 1; }
.trust-who { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.trust-who > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.trust-who small, .trust-details small { display: block; width: 100%; color: var(--muted); font-size: 11.5px; }
.trust-content { position: relative; margin: 0; padding: 12px 14px; border-inline-start: 3px solid var(--danger); border-radius: var(--radius-sm); background: var(--surface-2); display: grid; gap: 6px; font-size: 13.5px; line-height: 1.9; text-align: justify; }
.trust-content.is-hidden { opacity: .7; border-inline-start-color: var(--muted); }
.trust-open { font-size: 12.5px; width: fit-content; }
.trust-details { margin: 0; font-size: 13.5px; }
.trust-done { margin: 0; font-size: 13.5px; }
.trust-decide > summary { list-style: none; width: fit-content; }
.trust-decide > summary::-webkit-details-marker { display: none; }
.trust-form { margin-top: 12px; display: grid; gap: 12px; }
.trust-actions { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.trust-actions legend { width: 100%; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.trust-actions label { cursor: pointer; }
.trust-actions input { position: absolute; opacity: 0; pointer-events: none; }
.trust-actions span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; }
.trust-actions input:checked + span { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); }
.trust-actions input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.wa-ledger .wa-tx { flex-wrap: wrap; }
.wa-refund { flex-basis: 100%; }
.wa-refund > summary { list-style: none; width: fit-content; margin-inline-start: auto; }
.wa-refund > summary::-webkit-details-marker { display: none; }
.wa-refund .form { margin-top: 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.tx-refunded { color: var(--ok); }
.api-sample { margin: 12px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-deep); overflow-x: auto; font-size: 12.5px; text-align: left; }
.api-state { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; }
.safety .list-row form { margin: 0; }
@media (max-width: 640px) {
  .report-form { position: fixed; inset-inline: 16px; top: auto; bottom: 16px; width: auto; }
  .trust-status .select, .trust-status .input { flex-basis: 100%; }
}

/* 1.16.1: proposal content takes its direction from its text (dir="auto"): fa/ar right-aligned, Latin left-aligned */
.pdetail [dir="auto"] { text-align: start; unicode-bidi: plaintext; }
.pdetail .prose[dir="auto"], .pdetail .pdetail-summary[dir="auto"] { text-align: justify; text-align-last: start; }
.pdetail .prose[dir="auto"] > * { unicode-bidi: plaintext; text-align: inherit; }
@media (max-width: 520px) { .specs div { grid-template-columns: 1fr; gap: 2px; } }

/* 1.16.4: «صفحه‌ها» list — the switch shows the status; actions sit on their own line on phones */
.page-row { flex-wrap: wrap; row-gap: 12px; }
.page-row-main { display: flex; align-items: center; gap: 12px; flex: 1 1 260px; min-width: 0; }
.page-row-main .grow { min-width: 0; }
.page-row-main .title { overflow-wrap: anywhere; }
.page-row-actions { display: flex; align-items: center; gap: 10px; flex: 0 1 auto; flex-wrap: wrap; }
.page-row-end { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 190px; }
.page-row-actions .inline-form { margin: 0; }
@media (max-width: 640px) {
  .page-row-actions { flex-basis: 100%; justify-content: space-between; padding-top: 10px; border-top: 1px dashed var(--line); }
  .page-row-end { min-width: 0; }
}

/* 1.17: finance — gifts, audience breakdown, delete; tables become cards on phones */
.fin-period { padding-block: 12px; }
.fin-period .seg-tabs { margin: 0; }
.stat-gift b { color: var(--gold); }
.fin-gift { color: var(--gold); font-weight: 700; white-space: nowrap; }
.fin-share { display: inline-block; width: 64px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; vertical-align: middle; }
.fin-share i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: inherit; }
.fin-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fin-filter .select { width: auto; min-width: 150px; }
.fin-actions { white-space: nowrap; }
.fin-del > summary { list-style: none; }
.fin-del > summary::-webkit-details-marker { display: none; }
.fin-del .form { margin-top: 8px; display: grid; gap: 8px; min-width: 240px; white-space: normal; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.fin-del .form p { margin: 0; font-size: 12.5px; }
.btn.btn-danger-fill, .panel-ui .btn.btn-danger-fill { background: var(--danger); color: #fff; box-shadow: none; border-color: transparent; }
@media (max-width: 640px) {
  .fin-table thead { display: none; }
  .fin-table, .fin-table tbody, .fin-table tr, .fin-table td { display: block; width: 100%; }
  .fin-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .fin-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; text-align: start; }
  .fin-table td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 500; }
  .fin-table td.fin-actions { display: block; }
  .fin-table td.fin-actions::before { content: none; }
  .fin-del > summary { margin-inline-start: auto; width: fit-content; }
  .fin-del .form { min-width: 0; }
  .fin-filter, .fin-filter .select { width: 100%; }
}

/* 1.18 */
.api-sub { font-size: 14px; margin: 14px 0 8px; color: var(--muted); }

/* ===== Language switcher (partials/lang_switch.php) ===== */
.lang-pick { position: relative; }
.lang-pick > summary { list-style: none; cursor: pointer; -webkit-user-select: none; user-select: none; }
.lang-pick > summary::-webkit-details-marker { display: none; }
.lang-menu { position: absolute; top: calc(100% + 8px); z-index: 80; min-width: 196px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-strong, var(--line)); box-shadow: var(--float, 0 24px 60px -18px rgba(2, 6, 20, .75)); }
[dir="rtl"] .lang-menu { left: 0; }
[dir="ltr"] .lang-menu { right: 0; }
.lang-menu-h { display: block; padding: 6px 10px 8px; font-size: 12px; color: var(--muted); font-weight: 700; }
.lang-menu a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 12px; border-radius: 11px; color: var(--ink); font-size: 14px; text-decoration: none; }
.lang-menu a:hover, .lang-menu a:focus-visible { background: rgba(127, 140, 170, .12); }
.lang-menu a[aria-checked="true"] { color: var(--gold); font-weight: 700; }
.lang-menu a small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.lang-menu a[lang="ru"] { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.lang-btn { position: relative; }
.lang-btn .lang-code { position: absolute; bottom: 3px; right: 2px; font-style: normal; font-size: 8.5px; font-weight: 800; line-height: 1; color: var(--gold); letter-spacing: .02em; }
.lang-pill { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; color: #FFD978; font-size: 13.5px; font-weight: 700; background: rgba(10, 20, 48, .55); border: 1px solid rgba(243, 198, 91, .35); }
.lang-pill .icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.th-lang { cursor: pointer; border-radius: 999px; }
.th-lang:hover { color: #F3C65B; }
.th .lang-menu, .auth .lang-menu { background: rgba(9, 18, 44, .97); border-color: rgba(243, 198, 91, .22); }
.th .lang-menu a, .auth .lang-menu a { color: #EEF1F7; }
.th .lang-menu a[aria-checked="true"], .auth .lang-menu a[aria-checked="true"] { color: #F3C65B; }
.th-menu-langs { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 4px 4px; border-top: 1px solid rgba(255, 255, 255, .08); }
.th-menu-langs a { padding: 6px 12px; border-radius: 999px; font-size: 13px; color: #C9D2E6; border: 1px solid rgba(255, 255, 255, .12); text-decoration: none; }
.th-menu-langs a[aria-current="true"] { color: #F3C65B; border-color: rgba(243, 198, 91, .5); }

/* Russian: Vazirmatn has no Cyrillic, so the interface uses the system font. */
html[lang="ru"] { --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
html[lang="ru"] body, html[lang="ru"] .th { font-family: var(--font); }

/* Other languages: Vazirmatn's ss01 turns Latin digits into Persian ones — only Persian pages keep it. */
html:not([lang="fa"]) body, html:not([lang="fa"]) .th, html:not([lang="fa"]) input, html:not([lang="fa"]) textarea,
html:not([lang="fa"]) select, html:not([lang="fa"]) button { font-feature-settings: normal; }
/* Other languages: the browser's own "Choose file / No file chosen" text is wider than Persian, so the picker
   wraps under the preview on narrow phones instead of widening the page. */
html:not([lang="fa"]) .image-pick { flex-wrap: wrap; min-width: 0; }
html:not([lang="fa"]) .image-pick > *, html:not([lang="fa"]) .field, html:not([lang="fa"]) .form .row > * { min-width: 0; }
html:not([lang="fa"]) input[type=file] { max-width: 100%; min-width: 0; }
@media (max-width: 480px) { html:not([lang="fa"]) .image-pick > .stack, html:not([lang="fa"]) .image-pick > input[type=file] { flex: 1 1 100%; } }

/* Public business page (/p/…): dark petrol-blue accent in place of champagne gold — buttons, frames, links,
   section titles and the verified seal. The site logo in the top bar keeps its colours. */
.pub-teal {
  --gold: #5AAFC4; --gold-2: #2F8BA3; --rose: #3E97AE; --gold-ink: #FFFFFF; --gold-soft: rgba(90, 175, 196, .12);
  --foil: linear-gradient(135deg, #2C86A0 0%, #1D6C83 42%, #155A6E 72%, #104958 100%);
  --edge: linear-gradient(90deg, transparent, rgba(90, 175, 196, .7), rgba(29, 108, 131, .55), transparent);
  --petrol-glow: rgba(29, 108, 131, .75); --petrol-tint: rgba(29, 108, 131, .14); --seal: #2C86A0;
}
:root[data-theme="light"] .pub-teal {
  --gold: #155A6E; --gold-2: #104958; --rose: #1D6C83; --gold-soft: rgba(21, 90, 110, .08);
  --foil: linear-gradient(135deg, #1F7088 0%, #175F75 42%, #114D5F 72%, #0C3D4B 100%);
  --edge: linear-gradient(90deg, transparent, rgba(21, 90, 110, .5), rgba(16, 73, 88, .4), transparent);
  --petrol-glow: rgba(16, 73, 88, .55); --petrol-tint: rgba(21, 90, 110, .08); --seal: #175F75;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .pub-teal {
    --gold: #155A6E; --gold-2: #104958; --rose: #1D6C83; --gold-soft: rgba(21, 90, 110, .08);
    --foil: linear-gradient(135deg, #1F7088 0%, #175F75 42%, #114D5F 72%, #0C3D4B 100%);
    --edge: linear-gradient(90deg, transparent, rgba(21, 90, 110, .5), rgba(16, 73, 88, .4), transparent);
    --petrol-glow: rgba(16, 73, 88, .55); --petrol-tint: rgba(21, 90, 110, .08); --seal: #175F75;
  }
}
.pub-teal::before { background: radial-gradient(1200px 600px at 100% -10%, var(--petrol-tint), transparent 60%); }
.pub-teal ::selection { background: var(--petrol-tint); }
.pub-teal .btn { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 8px 22px -12px var(--petrol-glow); }
.pub-teal .btn:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 12px 28px -12px var(--petrol-glow); }
.pub-teal .btn-ghost { box-shadow: inset 0 1px 0 0 transparent, inset 0 0 0 1px var(--line-strong); }
.pub-teal .btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--gold); }
.pub-teal .pub-locked { background: radial-gradient(500px 200px at 50% 0%, var(--petrol-tint), transparent 70%), var(--surface); }
.verified-seal { display: inline-block; width: .72em; height: .72em; margin-inline-start: .28em; vertical-align: .02em; }
.verified-seal svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 6px var(--petrol-glow, rgba(0, 0, 0, .3))); }
.verified-seal .vs-bg { fill: var(--seal, var(--gold-2)); }
.verified-seal .vs-tick { fill: none; stroke: #fff; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- System update page (compact: everything above the fold) ---------- */
.su-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.su-title { margin: 0; font-size: 22px; }
.su-version bdi { font-weight: 800; direction: ltr; }
.su-panel { padding: 16px 18px; margin-bottom: 12px; }
.su-form { display: grid; gap: 12px; }
.su-row { display: grid; gap: 10px; align-items: start; }
@media (min-width: 900px) {
  .su-row { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; }
  .su-export .su-row { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; align-items: center; }
}
.su-row .field { gap: 4px; }
.su-go { min-height: 52px; padding: 0 26px; }
.su-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.su-drop { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 14px; cursor: pointer; border: 2px dashed var(--line-strong); border-radius: 11px; background: var(--bg); transition: border-color .15s ease, background .15s ease; }
.su-drop:hover, .field:has(.su-file:focus-visible) .su-drop { border-color: var(--gold); background: var(--gold-soft); }
.su-drop-icon { font-size: 24px; color: var(--gold); line-height: 1; flex: none; }
.su-drop-body { display: grid; min-width: 0; line-height: 1.5; }
.su-drop-text { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-drop-hint { font-size: 12px; }
.field.has-error .su-drop { border-color: var(--danger); }
.su-field-pass .input { min-height: 52px; }
.su-options { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; padding: 10px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); font-size: 14px; }
.su-options .check input { margin-top: 0; }
.su-options .check { align-items: center; }
.su-note { margin: 0; font-size: 12.5px; line-height: 1.8; }
.su-export-text { display: grid; gap: 2px; font-size: 14px; }
.su-export-text .muted { font-size: 12.5px; }
/* Reports: per-day (week, month, year) figures under the bar chart, newest first. */
.chart-table { margin-top: 16px; max-height: 440px; overflow: auto; }
.chart-table td:last-child, .chart-table th:last-child { text-align: end; }
.chart-table tr.muted td { color: var(--muted); }

.reject-box { display: inline-block; vertical-align: top; }
.reject-box > summary { list-style: none; cursor: pointer; }
.reject-box > summary::-webkit-details-marker { display: none; }
.reject-box[open] { display: block; width: 100%; margin-top: 8px; }
.reject-box textarea { display: block; width: 100%; margin-bottom: 6px; }

.role-group-title { margin: 18px 0 10px; font-size: 14px; color: var(--muted); font-weight: 600; }
.role-group-title:first-of-type { margin-top: 4px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.role-card { position: relative; display: block; cursor: pointer; }
.role-card input { position: absolute; opacity: 0; inset: 0; }
.role-card-body { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface-2); transition: border-color .15s, background .15s, transform .15s; }
.role-card:hover .role-card-body { border-color: var(--gold); transform: translateY(-1px); }
.role-card input:checked + .role-card-body { border-color: var(--gold); background: var(--gold-soft); }
.role-card input:focus-visible + .role-card-body { outline: 2px solid var(--focus); outline-offset: 2px; }
.role-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; }
.role-tick { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); font-style: normal; font-size: 12px; color: transparent; }
.role-card input:checked + .role-card-body .role-tick { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.role-card-about { font-size: 13px; line-height: 1.7; color: var(--muted); }
.role-card-count { margin-top: auto; align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: var(--line); font-size: 12px; color: var(--muted); }
.country-picks { max-height: 180px; overflow-y: auto; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.country-picks .chip-pick span { padding: 5px 12px; font-size: 13px; }
