/* Vazirmatn v33.0.3 (SIL OFL 1.1, see /fonts/OFL.txt) is served from this origin: the panel makes no third-party font request. */
@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-Variable-v33.0.3.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f6f8;
  --surface: #ffffff;
  --surface-2: #f0f0f4;
  --text: #17171c;
  --muted: #6b6b78;
  --border: #e2e2ea;
  --accent: #e5195e;
  --accent-ink: #ffffff;
  --ok: #12805c;
  --ok-bg: #e3f5ee;
  --warn: #9a5b00;
  --warn-bg: #fff2d9;
  --err: #b42318;
  --err-bg: #fde8e6;
  --info: #1d4ed8;
  --info-bg: #e6edff;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 16px rgb(0 0 0 / 4%);
  font-family: Vazirmatn, "IRANSans", Tahoma, "Geeza Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101014;
    --surface: #18181f;
    --surface-2: #22222b;
    --text: #ececf1;
    --muted: #9b9bab;
    --border: #2c2c37;
    --accent: #ff4d86;
    --accent-ink: #1a0610;
    --ok: #4fd1a1;
    --ok-bg: #0f2a22;
    --warn: #f5b84b;
    --warn-bg: #2d2410;
    --err: #ff8a80;
    --err-bg: #341715;
    --info: #8fb0ff;
    --info-bg: #17203a;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
button, input, select, textarea { font: inherit; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.7; font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.logo { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); position: relative; display: inline-block; }
.logo::after { content: ""; position: absolute; inset: 7px 8px 7px 9px; background: var(--accent-ink); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.userbox { display: flex; align-items: center; gap: 10px; font-size: .9rem; min-width: 0; }
.userbox .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); object-fit: cover; flex: none; }

.container { max-width: 960px; margin: 0 auto; padding: 20px 16px 80px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.narrow { max-width: 460px; margin: 10vh auto; }
.hero { text-align: center; padding: 36px 20px; }
.hero p { max-width: 520px; margin: 0 auto 20px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; margin-bottom: 12px; }
.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stack > * + * { margin-top: 14px; }

.btn { appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; padding: 9px 16px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; }
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .short:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--err); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

label.field { display: block; }
.field > .label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }
input[type=text], input[type=number], textarea, select { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
textarea { min-height: 96px; resize: vertical; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { margin-top: 6px; accent-color: var(--accent); }
details.adv { border: 1px dashed var(--border); border-radius: 10px; padding: 10px 14px; }
details.adv summary { cursor: pointer; font-weight: 600; }
.counter { float: left; color: var(--muted); font-size: .8rem; }
.counter.over { color: var(--err); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.err { background: var(--err-bg); color: var(--err); }
.badge.info { background: var(--info-bg); color: var(--info); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.ok .dot { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .badge.ok .dot { animation: none; } }

.banner { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.err { background: var(--err-bg); color: var(--err); }
.banner.info { background: var(--info-bg); color: var(--info); }

.shorts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.short { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; overflow: hidden; text-align: right; cursor: pointer; padding: 0; font: inherit; color: inherit; display: flex; flex-direction: column; }
.short:hover { border-color: var(--accent); }
.short .cover { aspect-ratio: 9 / 16; width: 100%; object-fit: cover; background: var(--surface-2); display: block; }
.short .cover.empty { display: grid; place-items: center; color: var(--muted); }
.short .meta { padding: 8px 10px 10px; font-size: .82rem; }
.short .desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }

.picked { display: flex; gap: 12px; align-items: center; }
.picked img { width: 44px; height: 78px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }

.campaigns { display: grid; gap: 12px; }
.campaign { display: flex; gap: 14px; align-items: center; color: inherit; }
.campaign img { width: 48px; height: 84px; object-fit: cover; border-radius: 8px; background: var(--surface-2); flex: none; }
.campaign .body { flex: 1; min-width: 0; }
.campaign .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font-size: 1.4rem; line-height: 1.2; }
.stat span { color: var(--muted); font-size: .8rem; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td.text { max-width: 260px; overflow-wrap: anywhere; }
.log { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow: auto; font-size: .85rem; }
.log li { padding: 5px 0; border-bottom: 1px dashed var(--border); display: flex; gap: 10px; }
.log .t { color: var(--muted); flex: none; }
.log .warn { color: var(--warn); } .log .error { color: var(--err); }

.match-result { margin-top: 8px; font-size: .9rem; }
.match-result.yes { color: var(--ok); } .match-result.no { color: var(--muted); }

.toasts { position: fixed; bottom: 16px; inset-inline: 16px; display: grid; gap: 8px; justify-items: center; pointer-events: none; z-index: 20; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; max-width: 520px; box-shadow: var(--shadow); pointer-events: auto; }
.toast.err { background: var(--err); color: #fff; }

@media (max-width: 520px) {
  .container { padding: 14px 12px 80px; }
  .card { padding: 14px; }
  .btn { flex: 1 1 auto; }
  .userbox .who { max-width: 28vw; }
}
