/* GIFTTTNEO panel — RTL, Vazirmatn, dark/light */
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Black.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --bg: #f4f5fb;
  --bg2: #eceef8;
  --card: #ffffff;
  --card2: #f8f9fd;
  --line: #e3e6f2;
  --text: #171a2c;
  --muted: #6b7190;
  --accent: #6d4aff;
  --accent2: #00b3d6;
  --accent-soft: rgba(109, 74, 255, .10);
  --ok: #12a870; --ok-soft: rgba(18, 168, 112, .12);
  --warn: #d98a00; --warn-soft: rgba(217, 138, 0, .13);
  --bad: #e5484d; --bad-soft: rgba(229, 72, 77, .12);
  --shadow: 0 1px 2px rgba(20, 24, 60, .05), 0 8px 24px rgba(20, 24, 60, .06);
  --radius: 16px;
  --grad: linear-gradient(135deg, var(--accent), var(--accent2));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e1a; --bg2: #11142380; --card: #151a2e; --card2: #1a2037; --line: #262c47;
    --text: #e9ebf8; --muted: #8e95b8; --accent: #8c6bff; --accent2: #22c7e8;
    --accent-soft: rgba(140, 107, 255, .16);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  --bg: #0c0e1a; --bg2: #11142380; --card: #151a2e; --card2: #1a2037; --line: #262c47;
  --text: #e9ebf8; --muted: #8e95b8; --accent: #8c6bff; --accent2: #22c7e8;
  --accent-soft: rgba(140, 107, 255, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Vazirmatn", Tahoma, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; direction: ltr; unicode-bidi: embed; font-size: .88em; }
h1, h2, h3 { margin: 0; line-height: 1.4; }
h1 { font-size: 1.45rem; font-weight: 900; }
h2 { font-size: 1.08rem; font-weight: 700; }
h3 { font-size: .98rem; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ltr { direction: ltr; unicode-bidi: embed; }
.nowrap { white-space: nowrap; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 250px; flex: 0 0 250px; padding: 22px 16px;
  background: var(--card); border-inline-start: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 12px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 1.15rem;
  box-shadow: 0 6px 18px rgba(109, 74, 255, .35);
}
.brand b { font-size: 1.15rem; font-weight: 900; letter-spacing: -.3px; }
.brand small { display: block; color: var(--muted); font-size: .72rem; margin-top: -4px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px;
  color: var(--muted); font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--card2); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav svg { width: 19px; height: 19px; flex: none; }
.side .foot { margin-top: auto; display: flex; gap: 8px; align-items: center; padding: 10px; border-top: 1px solid var(--line); }
.side .foot .who { flex: 1; font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar .sub { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.btn.menu-btn { display: none; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card + .card { margin-top: 18px; }
.grid > .card, .grid > .card + .card { margin-top: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.stack > * + * { margin-top: 18px; }

.kpi { position: relative; overflow: hidden; }
.kpi .v { font-size: 1.75rem; font-weight: 900; margin-top: 4px; letter-spacing: -.5px; }
.kpi .l { color: var(--muted); font-size: .88rem; font-weight: 500; }
.kpi .ic {
  position: absolute; inset-inline-end: 16px; top: 16px; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.kpi .ic svg { width: 22px; height: 22px; }
.kpi.ok .ic { background: var(--ok-soft); color: var(--ok); }
.kpi.warn .ic { background: var(--warn-soft); color: var(--warn); }
.kpi.bad .ic { background: var(--bad-soft); color: var(--bad); }
.kpi.hero { background: var(--grad); color: #fff; border: 0; }
.kpi.hero .l { color: rgba(255, 255, 255, .85); }
.kpi.hero .ic { background: rgba(255, 255, 255, .2); color: #fff; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; background: var(--card2); color: var(--muted); white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.badge.ok .dot { animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(18, 168, 112, .55); } 70% { box-shadow: 0 0 0 7px rgba(18, 168, 112, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 168, 112, 0); } }

/* ---------- buttons & forms ---------- */
.btn {
  font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; border: 1px solid var(--line);
  background: var(--card); color: var(--text); padding: 8px 16px; border-radius: 11px;
  display: inline-flex; align-items: center; gap: 7px; transition: transform .08s, background .15s, border-color .15s;
  text-decoration: none !important; white-space: nowrap;
}
.btn:hover { background: var(--card2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 6px 16px rgba(109, 74, 255, .28); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 5px 11px; font-size: .82rem; border-radius: 9px; }
.btn.icon { padding: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

label { display: block; font-weight: 500; font-size: .88rem; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field .hint { color: var(--muted); font-size: .8rem; margin-top: 5px; }
input[type=text], input[type=password], input[type=number], input[type=search], textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--card2);
  border: 1px solid var(--line); border-radius: 11px; padding: 9px 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea { min-height: 90px; resize: vertical; }
input.ltr, textarea.ltr { text-align: left; direction: ltr; }
input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.plans { display: flex; gap: 10px; flex-wrap: wrap; }
.plan {
  border: 1.5px solid var(--line); border-radius: 13px; padding: 10px 16px; cursor: pointer;
  background: var(--card2); min-width: 120px; transition: border-color .15s, background .15s;
}
.plan b { display: block; }
.plan span { color: var(--muted); font-size: .82rem; }
.plan.on { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: .82rem; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--card2); }
.bot-cell { display: flex; align-items: center; gap: 11px; min-width: 200px; }
.avatar {
  width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center;
  font-weight: 900; color: #fff; background: var(--grad);
}
.bot-cell b { display: block; line-height: 1.35; }
.bot-cell small { color: var(--muted); direction: ltr; display: inline-block; }

.bar { height: 7px; background: var(--card2); border-radius: 99px; overflow: hidden; min-width: 90px; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }

.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; opacity: .5; margin-bottom: 8px; }

/* ---------- chart ---------- */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .b { width: 100%; max-width: 42px; border-radius: 9px 9px 4px 4px; background: var(--grad); min-height: 3px; position: relative; transition: filter .15s; }
.chart .b:hover { filter: brightness(1.15); }
.chart .b[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); font-size: .75rem; padding: 3px 8px; border-radius: 7px; white-space: nowrap;
}
.chart .lbl { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.chart.empty-chart .b { background: var(--line); }

/* ---------- misc ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.list li:last-child { border-bottom: 0; }
.list .when { color: var(--muted); font-size: .78rem; white-space: nowrap; margin-inline-start: auto; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.copy { display: inline-flex; align-items: center; gap: 6px; background: var(--card2); border: 1px solid var(--line); border-radius: 9px; padding: 3px 4px 3px 10px; max-width: 100%; }
.copy code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 4px; background: var(--card2); padding: 4px; border-radius: 12px; border: 1px solid var(--line); flex-wrap: wrap; }
.tabs button, .tabs a { font: inherit; border: 0; background: transparent; color: var(--muted); padding: 6px 14px; border-radius: 9px; cursor: pointer; font-weight: 500; font-size: .88rem; }
.tabs .on { background: var(--card); color: var(--text); box-shadow: var(--shadow); font-weight: 700; }
.tabs a:hover { text-decoration: none; }
.pane { display: none; }
.pane.on { display: block; }
.logbox {
  background: #0a0c16; color: #cfd6ff; border-radius: 12px; padding: 14px; height: 420px; overflow: auto;
  direction: ltr; text-align: left; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; line-height: 1.6;
  white-space: pre-wrap; word-break: break-all; border: 1px solid #1d2240;
}
.logbox .e { color: #ff8a8f; }
.logbox .w { color: #ffcf66; }
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; display: flex; gap: 10px; align-items: center; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert a { color: inherit; text-decoration: underline; }
.countdown { display: flex; gap: 10px; direction: rtl; }
.countdown div { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; min-width: 70px; text-align: center; }
.countdown b { display: block; font-size: 1.5rem; font-weight: 900; }
.countdown span { font-size: .75rem; color: var(--muted); }
.search { display: flex; gap: 10px; flex-wrap: wrap; }
.search input { max-width: 300px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a { padding: 5px 13px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: .85rem; font-weight: 500; }
.chips a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chips a:hover { text-decoration: none; }
.token-preview { margin-top: 8px; font-size: .88rem; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 12px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); z-index: 100; transition: all .25s; max-width: calc(100% - 32px);
  display: flex; gap: 10px; align-items: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--ok); color: #fff; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }

/* modal */
dialog { border: 0; border-radius: 18px; padding: 0; background: var(--card); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); width: min(460px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(10, 12, 26, .55); backdrop-filter: blur(3px); }
dialog .dh { padding: 18px 20px 0; }
dialog .db { padding: 14px 20px; }
dialog .df { padding: 0 20px 18px; display: flex; gap: 8px; justify-content: flex-start; }

/* login / portal */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(900px 500px at 85% -10%, rgba(109, 74, 255, .25), transparent 60%),
  radial-gradient(700px 500px at -10% 110%, rgba(0, 179, 214, .22), transparent 60%), var(--bg); }
.auth { width: min(400px, 100%); }
.auth .brand { justify-content: center; padding-bottom: 24px; }
.portal { max-width: 860px; margin: 0 auto; padding: 30px 16px 60px; }
.hero-card { background: var(--grad); color: #fff; border: 0; }
.hero-card .muted { color: rgba(255, 255, 255, .8); }
.hero-card .countdown div { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .2); }
.hero-card .countdown span { color: rgba(255, 255, 255, .8); }

/* ---------- shared bits (v2) ---------- */
h1 svg, h2 svg, h3 svg, .alert > svg { width: 18px; height: 18px; vertical-align: -3px; flex: none; }
.center { text-align: center; }
.btn.block { width: 100%; justify-content: center; padding: 11px; }
.btn.lg { padding: 11px 22px; font-size: 1rem; }
.bad-t { color: var(--bad); font-weight: 700; }
.warn-t { color: var(--warn); font-weight: 700; }
.danger-t { color: var(--bad) !important; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.avatar.sm { width: 30px; height: 30px; font-size: .8rem; border-radius: 9px; }
.avatar.lg { width: 46px; height: 46px; font-size: 1.2rem; }
.avatar.xl { width: 72px; height: 72px; font-size: 1.8rem; border-radius: 20px; margin: 0 auto; }
.badge svg { width: 13px; height: 13px; }
.badge.glass { background: rgba(255, 255, 255, .2); color: #fff; }
.side .brand { color: inherit; text-decoration: none; }
.credit { display: flex; gap: 8px; align-items: center; margin: 12px 4px 0; padding: 10px 12px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); font-size: .78rem; line-height: 1.5; text-decoration: none !important; }
.credit svg { width: 16px; height: 16px; flex: none; }
.side .foot { margin-top: 10px; }
.side .nav { flex: 1; }
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.crumbs span { opacity: .5; }
.hbadges { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: .78rem;
  background: var(--card2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; direction: ltr; unicode-bidi: plaintext; }
.chip.is-main { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.chip svg { width: 13px; height: 13px; }
a.chip:hover { text-decoration: none; filter: brightness(1.05); }
.tabs.full { display: flex; }
.tabs.full > * { flex: 1; justify-content: center; display: inline-flex; gap: 6px; align-items: center; }
.tabs svg { width: 16px; height: 16px; vertical-align: -3px; }
.tabs.links { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.tabs.links a { white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs.links small { background: var(--line); color: var(--muted); border-radius: 99px; padding: 0 7px; font-size: .72rem; }
.tabs.links small.hot { background: var(--warn); color: #fff; }
.grid.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpis .kpi { padding: 14px 16px; }
.kpis .kpi .v { font-size: 1.45rem; }
.grid.mini .kpi { background: var(--card2); border-radius: 12px; padding: 12px 14px; }

/* challenge list */
.ch-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.ch-card { color: inherit; text-decoration: none !important; display: flex; flex-direction: column; gap: 10px; transition: transform .15s, box-shadow .15s; }
.ch-card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(20, 24, 60, .12); }
.ch-card.closed { opacity: .72; }
.ch-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ch-card h3 { font-size: 1.1rem; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: var(--card2); border-radius: 12px; padding: 10px 6px; }
.mini-stats div { text-align: center; }
.mini-stats b { display: block; font-size: 1.05rem; }
.mini-stats span { font-size: .72rem; color: var(--muted); }
.ch-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.empty.big { padding: 50px 20px; }
.empty.big svg { width: 64px; height: 64px; color: var(--accent); opacity: .8; }
.empty.big h2 { margin: 6px 0; }

/* wizard */
.step-h { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.step-n { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 900; font-size: .9rem; flex: none; }
.radio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.radio-cards.compact { gap: 8px; margin-top: 6px; }
.rcard { cursor: pointer; margin: 0; }
.rcard input { position: absolute; opacity: 0; pointer-events: none; }
.rc-body { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card2); transition: border-color .15s, background .15s, box-shadow .15s; }
.rc-body svg { width: 26px; height: 26px; color: var(--accent); margin-bottom: 4px; }
.rc-body small { color: var(--muted); font-weight: 400; line-height: 1.6; }
.compact .rc-body { padding: 10px 12px; }
.rcard input:checked + .rc-body { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-soft); }
.rcard input:focus-visible + .rc-body { outline: 2px solid var(--accent); }
.only-multi { display: none; }
form.is-multi .only-multi { display: block; }
.picker { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.picker label { margin: 0; }
.pick-row { display: flex; gap: 8px; }
.pick-row input { flex: 1; }
.pick-status { font-size: .84rem; min-height: 1.4em; display: flex; flex-direction: column; gap: 4px; }
.pick-status .badge { white-space: normal; line-height: 1.6; padding: 4px 10px; justify-content: flex-start; }
.switches { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 4px; }
.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-weight: 500; margin: 0; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch > span { flex: none; width: 42px; height: 24px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s; margin-top: 1px; }
.switch > span::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(-18px); }
.switch input:disabled + span { opacity: .5; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.stars-fields { display: none !important; }
form.stars-on .stars-fields { display: flex !important; }
.drop { display: grid; place-items: center; min-height: 170px; border: 2px dashed var(--line); border-radius: 14px; background: var(--card2); cursor: pointer; overflow: hidden; position: relative; text-align: center; padding: 10px; margin: 0; font-weight: 500; }
.drop.small { min-height: 120px; }
.drop:hover { border-color: var(--accent); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-empty { color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .86rem; }
.drop-empty svg { width: 30px; height: 30px; }
.drop img { max-width: 100%; max-height: 260px; border-radius: 10px; }
.drop.has-img .drop-empty { display: none; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; margin-top: 18px; padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); box-shadow: var(--shadow); }

/* dropdown */
.dropdown { position: relative; }
.dropdown .menu { display: none; position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 20; min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.dropdown.open .menu { display: block; }
.dropdown .menu a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); font-size: .88rem; }
.dropdown .menu a:hover { background: var(--card2); text-decoration: none; }

/* job progress */
.job { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 14px; padding: 12px 16px; margin-bottom: 18px; }
.job-h { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.job .bar { background: var(--card); }
.job.done { background: var(--ok-soft); border-color: transparent; }
.job.failed { background: var(--bad-soft); border-color: transparent; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.job.done .spinner, .job.failed .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ranking */
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rank li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; }
.rank li:hover { background: var(--card2); }
.rk { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; font-weight: 900; font-size: .85rem; background: var(--card2); color: var(--muted); flex: none; }
.rk.g { background: linear-gradient(135deg, #ffd66b, #f5a524); color: #5a3b00; }
.rk.s { background: linear-gradient(135deg, #e8ecf5, #b9c1d6); color: #394257; }
.rk.b { background: linear-gradient(135deg, #f3c7a4, #cf8a55); color: #4d2a10; }
.rk-body { flex: 1; min-width: 0; }
.rk-body a { color: var(--text); }
.rk-num { text-align: end; line-height: 1.3; }
.rk-num b { font-size: 1.05rem; display: block; }
.rk-num small { font-size: .72rem; }
.bar.thin { height: 5px; margin-top: 4px; min-width: 0; border: 0; }
.thumb { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; background: var(--card2); flex: none; border: 1px solid var(--line); }
.thumb.lg { width: 52px; height: 52px; cursor: zoom-in; }
.hero-img { width: 100%; max-width: 260px; aspect-ratio: 4/5; object-fit: cover; border-radius: 16px; background: var(--card2); cursor: zoom-in; }
.chart.sm { height: 120px; gap: 3px; }
.chart.sm .b { max-width: 22px; border-radius: 5px 5px 2px 2px; }
.chart.sm .lbl { font-size: .62rem; }
.hbar { display: grid; grid-template-columns: minmax(80px, 1fr) 2fr auto; gap: 10px; align-items: center; margin-bottom: 8px; font-size: .86rem; }
.hbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: end; }

/* tables & filters */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 16px 0 12px; }
.filters input[type=search], .filters input[type=text] { max-width: 280px; }
.filters select { max-width: 230px; }
.inline-fake { background: var(--card2); border-radius: 12px; padding: 10px 12px; margin-top: 0; }
.row-fake td { background: color-mix(in srgb, var(--bad-soft) 60%, transparent); }
.voter a { color: var(--text); }
.copyable { cursor: copy; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 14px; }
table.parts td { padding-top: 8px; padding-bottom: 8px; }
.add-box { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; margin-top: 16px; }
.add-box summary { cursor: pointer; padding: 12px 16px; font-weight: 700; display: flex; gap: 8px; align-items: center; list-style: none; }
.add-box summary svg { width: 18px; height: 18px; color: var(--accent); }
.add-form { display: flex; gap: 16px; padding: 0 16px 16px; align-items: flex-start; flex-wrap: wrap; }
.add-form .drop { width: 170px; }
.grow { flex: 1; min-width: 220px; }

/* requests */
.req-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-top: 6px; }
.req { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card2); display: flex; flex-direction: column; }
.req.approved { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.req.rejected { opacity: .7; }
.req-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--line); cursor: zoom-in; display: block; }
.req-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.req-body a { color: var(--text); }
.req-top { display: flex; justify-content: space-between; align-items: center; }
.req-actions { margin-top: auto; padding-top: 10px; }

/* timeline */
.timeline { margin-top: 16px; display: flex; flex-direction: column; }
.tl { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px dashed var(--line); }
.tl:last-child { border-bottom: 0; }
.tl > div { flex: 1; min-width: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 8px; flex: none; }
.tl-dot.vote { background: var(--ok); } .tl-dot.fake { background: var(--bad); } .tl-dot.request { background: var(--warn); }
.tl-dot.challenge { background: var(--accent2); } .tl-dot.participant { background: #b16cff; } .tl-dot.member { background: var(--muted); }
.tl-data { overflow-wrap: anywhere; }

/* dialogs */
dialog.wide { width: min(760px, calc(100% - 32px)); }
.card-preview { background: var(--card2); border-radius: 12px; min-height: 200px; display: grid; place-items: center; padding: 10px; }
.card-preview img { max-width: 100%; border-radius: 10px; }
dialog.zoom { background: transparent; box-shadow: none; width: auto; max-width: 94vw; }
dialog.zoom img { max-width: 94vw; max-height: 88vh; border-radius: 14px; display: block; }
.zoom-x { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.5) !important; color: #fff; }
.danger-zone { border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-soft); border-radius: 14px; padding: 14px 16px; }

/* responsive */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .radio-cards { grid-template-columns: minmax(0, 1fr); } .grid.g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hbar { grid-template-columns: 1fr 1.4fr auto; } }
@media (max-width: 860px) {
  .side { position: fixed; inset-inline-start: 0; z-index: 50; transform: translateX(100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .main { padding: 18px 16px 50px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .hide-sm { display: none; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; } .kpi .v { font-size: 1.35rem; } .kpi .ic { display: none; } .row { flex-direction: column; } }
