/* Academy Entekhab design system — tokens from entekhab-iomad/design (canvas 1, artboard 01·b) */
@font-face { font-family: "IRANYekanX"; src: url("/dashboard/assets/fonts/IRANYekanX-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "IRANYekanX"; src: url("/dashboard/assets/fonts/IRANYekanX-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IRANYekanX"; src: url("/dashboard/assets/fonts/IRANYekanX-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --brand-100: #c9daf6; --brand-200: #9fc3e8; --brand-500: #1a52c4; --brand-600: #1446aa; --brand-700: #0d3585; --brand-800: #003974;
  --accent-500: #0091d0; --accent-700: #00679a;
  --ink-50: #f5f7fb; --ink-100: #eef2f8; --ink-150: #ebf0f7; --ink-200: #dfe6f0; --ink-300: #c6d2e4; --ink-400: #a6b3c8;
  --ink-500: #62728a; --ink-600: #5a6982; --ink-800: #3c4a61; --ink-950: #0e1b33;
  --warn-400: #dcb446; --warn-800: #886b1d; --danger-500: #d53f3f; --danger-700: #b03030;
  --soft-brand: #e3ecfa; --soft-brand-hover: #d6e4fa; --soft-accent: #e6f4fb; --soft-warn: #faf3df; --soft-danger: #fbebeb;
  --btn-body: #0c2f76; --btn-body-danger: #7a1d1d; --btn-body-ghost: #c6d2e4; --btn-ring: #9cc0ff;

  /* semantic */
  --page: var(--ink-100);
  --surface: #ffffff;
  --surface-2: var(--ink-50);
  --surface-3: var(--ink-100);
  --line-subtle: var(--ink-150);
  --line: var(--ink-200);
  --line-strong: var(--ink-300);
  --fg: var(--ink-950);
  --fg-2: var(--ink-600);
  --fg-3: var(--ink-500);
  --brand: var(--brand-600);
  --brand-fg: var(--brand-600);
  --brand-surface: var(--soft-brand);
  --accent-fg: var(--accent-700);
  --accent-surface: var(--soft-accent);
  --warn: var(--warn-800);
  --warn-surface: var(--soft-warn);
  --danger: var(--danger-700);
  --danger-surface: var(--soft-danger);
  --neutral-surface: var(--ink-100);
  --row-selected: #f5f9ff;

  /* charts: one series hue (brand) and a single-hue sequential ramp */
  --series: var(--brand-600);
  --series-dim: var(--brand-200);
  --seq-0: var(--ink-100); --seq-1: #e3ecfa; --seq-2: #c9daf6; --seq-3: #9fc3e8; --seq-4: #5da9dd; --seq-5: #1a52c4; --seq-6: #003974;

  --elev-1: 0 1px 2px rgba(10, 25, 60, .06), 0 12px 32px -16px rgba(10, 25, 60, .18);
  --elev-3: 0 4px 8px rgba(10, 25, 60, .10), 0 40px 80px -28px rgba(10, 25, 60, .45);
  --hero: linear-gradient(135deg, #1a52c4, #003974);

  --r-chip: 8px; --r-btn: 12px; --r-input: 14px; --r-panel: 16px; --r-card: 18px; --r-card-lg: 20px; --r-pill: 100px;
  --t-instant: 120ms; --t-fast: 180ms; --t-base: 260ms; --e: cubic-bezier(.2, .8, .3, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --page: #0a1d42;
  --surface: #10285c;
  --surface-2: #1b3868;
  --surface-3: #1b3868;
  --line-subtle: #1b3868;
  --line: #2a4a85;
  --line-strong: #2a4a85;
  --fg: #e7edf7;
  --fg-2: #a8bedd;
  --fg-3: #92a8cc;
  --brand: #2e63d6;
  --brand-fg: #b9d0fa;
  --brand-surface: #1b3a75;
  --accent-fg: #9fdcf7;
  --accent-surface: #1b3a75;
  --warn: #dcb446;
  --warn-surface: color-mix(in srgb, #dcb446 18%, transparent);
  --danger: #f0a0a0;
  --danger-surface: color-mix(in srgb, #d53f3f 20%, transparent);
  --neutral-surface: #1b3a75;
  --row-selected: #1b3a75;
  --btn-body-ghost: #2a4a85;
  --series: #4c82e6;
  --series-dim: #2a4a85;
  --seq-0: #1b3868; --seq-1: #1b3a75; --seq-2: #224a8f; --seq-3: #2e63d6; --seq-4: #4c82e6; --seq-5: #7fa8f0; --seq-6: #b9d0fa;
  --elev-1: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--fg); }
body { font: 400 13.5px/1.9 "IRANYekanX", system-ui, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--brand-fg); text-decoration: none; }
a:hover { color: var(--accent-500); }
p { text-wrap: pretty; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ltr { direction: ltr; unicode-bidi: isolate; font-family: "JetBrains Mono", ui-monospace, "IRANYekanX", monospace; font-size: .92em; }

/* ---- gate (login header: one of the three places a gradient is allowed) ---- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; overflow: hidden; box-shadow: var(--elev-3); }
.gate-head { background: linear-gradient(120deg, #1446aa, #0091d0); color: #fff; padding: 28px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.gate-head .mark { width: 44px; height: 44px; border-radius: 13px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); backdrop-filter: blur(14px); display: grid; place-items: center; font-weight: 700; }
.gate-head h1 { margin: 0; font-size: 19px; line-height: 1.6; }
.gate-head small { color: var(--brand-100); font-size: 12px; }
.gate-body { padding: 20px 22px 24px; color: var(--fg-2); font-size: 13px; }

/* ---- shell ---- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line-subtle); }
.brandmark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-600); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.title-stack { display: flex; flex-direction: column; line-height: 1.45; min-width: 0; }
.title-stack strong { font-size: 13px; }
.title-stack small { font-size: 11px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg-2); display: grid; place-items: center; cursor: pointer; flex: none; transition: background var(--t-fast); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.96); }
.topbar .end { margin-inline-start: auto; display: flex; gap: 8px; }
.view { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 16px 16px 96px; display: flex; flex-direction: column; gap: 12px; }

.tabs { position: fixed; bottom: 0; inset-inline: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px) saturate(140%); border-top: 1px solid var(--line-subtle); }
.tabs button { position: relative; border: 0; background: none; height: 52px; border-radius: var(--r-btn); color: var(--fg-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.tabs button svg.i { width: 20px; height: 20px; }
.tabs button.active { color: var(--brand-fg); font-weight: 700; background: var(--brand-surface); }
.tabs .count { position: absolute; top: 4px; inset-inline-end: calc(50% - 22px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-pill); background: var(--warn-400); color: #10285c; font-size: 9px; font-weight: 700; display: grid; place-items: center; line-height: 1; }

/* ---- type ---- */
.h-page { font-size: 16px; font-weight: 700; line-height: 1.8; margin: 2px 0 0; }
.h-section { font-size: 15px; font-weight: 700; margin: 0; line-height: 1.8; }
.label { font-size: 11.5px; font-weight: 700; color: var(--fg-2); }
.help { font-size: 12px; color: var(--fg-2); line-height: 2; margin: 0; }
.muted { color: var(--fg-2); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---- surfaces ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.raised { box-shadow: var(--elev-1); }
.card.selected { background: var(--row-selected); border: 1.5px solid var(--brand); }
.section-head { display: flex; align-items: center; gap: 10px; }
.section-head .chip-icon { width: 30px; height: 30px; border-radius: 10px; background: var(--brand-surface); color: var(--brand-fg); display: grid; place-items: center; flex: none; }
.section-head .chip-icon svg.i { width: 16px; height: 16px; }
.divider { border: 0; border-top: 1px solid var(--line-subtle); margin: 2px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 12px; border-top: 1px solid var(--line-subtle); padding-top: 10px; }
.kv dt { color: var(--fg-2); }
.kv dd { margin: 0; min-width: 0; }

/* hero (one per screen) */
.hero { background: var(--hero); color: #fff; border-radius: var(--r-card-lg); padding: 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 14px 28px -12px rgba(20, 70, 170, .6); }
.hero .eyebrow { font-size: 11px; font-weight: 700; color: var(--brand-200); }
.hero .title { font-size: 16px; font-weight: 700; line-height: 1.75; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hero .meta { font-size: 11.5px; color: var(--brand-100); }
.hero .hero-btn { margin-top: 12px; height: 46px; border: 0; border-radius: var(--r-btn); background: #fff; color: var(--brand-600); font-size: 13.5px; font-weight: 700; cursor: pointer; transition: transform var(--t-instant) var(--e); }
.hero .hero-btn:active { transform: translateY(2px); }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats.two { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px; text-align: center; cursor: default; }
button.stat { cursor: pointer; font: inherit; color: inherit; }
.stat strong { display: block; font-size: 17px; font-weight: 700; line-height: 1.5; }
.stat span { font-size: 10.5px; color: var(--fg-2); }
.stat.warn { background: var(--warn-surface); border: 1.5px solid var(--warn-400); }
.stat.warn strong, .stat.warn span { color: var(--warn); }
.stat.danger { background: var(--danger-surface); border: 1.5px solid var(--danger-500); }
.stat.danger strong, .stat.danger span { color: var(--danger); }
.stat.big { text-align: start; padding: 14px 16px; border-radius: var(--r-card-lg); }
.stat.big span { font-size: 11px; font-weight: 700; color: var(--fg-3); display: block; }
.stat.big strong { font-size: 22px; line-height: 1.3; margin-top: 6px; }
.stat.big small { display: block; font-size: 11px; color: var(--accent-fg); margin-top: 4px; }

/* status pill — shape carries meaning, not colour alone */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; border-radius: var(--r-pill); padding: 3px 10px; white-space: nowrap; flex: none; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 100px; background: currentColor; flex: none; }
.pill.progress { color: var(--brand-fg); background: var(--brand-surface); }
.pill.pending { color: var(--warn); background: var(--warn-surface); }
.pill.pending::before { background: transparent; border: 1.5px solid currentColor; width: 8px; height: 8px; }
.pill.complete { color: var(--accent-fg); background: var(--accent-surface); }
.pill.complete::before { width: 9px; height: 5px; border-radius: 0; background: none; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translateY(-1px); }
.pill.danger { color: var(--danger); background: var(--danger-surface); }
.pill.danger::before { border-radius: 0; transform: rotate(45deg); width: 6px; height: 6px; }
.pill.neutral { color: var(--fg-2); background: var(--neutral-surface); }
.pill.neutral::before { border-radius: 1px; }
.pill.live::before { animation: pulse 1.4s ease-in-out infinite; }
.pill.plain::before { display: none; }
@keyframes pulse { 50% { opacity: .3; } }

/* tabs (mobile-scroll variant) */
.seg { display: flex; gap: 6px; overflow-x: auto; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-input); background: var(--surface); scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; border: 0; padding: 6px 14px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--fg-2); font-size: 12px; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.seg button.active { background: var(--brand); color: #fff; font-weight: 700; }
.seg button .n { margin-inline-start: 4px; opacity: .75; }

/* buttons — 3D body from canvas 3 §03 */
.btn { --body-h: 4px; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-btn); font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; background: var(--surface); color: var(--fg); box-shadow: 0 var(--body-h) 0 0 var(--btn-body-ghost), 0 8px 14px -6px rgba(12, 47, 118, .18); transition: transform var(--t-instant) var(--e), box-shadow var(--t-instant) var(--e), filter 150ms; margin-bottom: var(--body-h); }
.btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn:active { transform: translateY(var(--body-h)); box-shadow: 0 0 0 0 var(--btn-body-ghost); }
.btn:focus-visible { outline: 3px solid var(--btn-ring); outline-offset: 3px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg.i { width: 16px; height: 16px; }
.btn.primary { background: var(--brand-600); color: #fff; box-shadow: 0 var(--body-h) 0 0 var(--btn-body), 0 8px 14px -6px rgba(12, 47, 118, .5); }
.btn.primary:active { box-shadow: 0 0 0 0 var(--btn-body); }
.btn.danger { background: var(--danger-500); color: #fff; box-shadow: 0 var(--body-h) 0 0 var(--btn-body-danger), 0 8px 14px -6px rgba(12, 47, 118, .35); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 12px; --body-h: 3px; }
.btn.block { width: 100%; min-height: 46px; font-size: 13.5px; }
.btn.flat { box-shadow: none; margin-bottom: 0; border: 1px solid var(--line-strong); }
.btn.flat:active { transform: scale(.98); }
.btn.link { background: none; box-shadow: none; margin: 0; padding: 0 6px; color: var(--brand-fg); min-height: 32px; }
.btn.link.danger-text { color: var(--danger); }

/* fields */
.field { display: flex; flex-direction: column; gap: 6px; }
textarea, input[type=text], input[type=number], input[type=datetime-local] {
  width: 100%; border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: var(--r-input); padding: 9px 12px; outline: none; font-size: 13px; transition: border-color var(--t-fast); }
textarea { min-height: 104px; resize: vertical; line-height: 1.9; }
textarea:focus, input:focus { border-color: var(--brand); }
textarea::placeholder, input::placeholder { color: var(--fg-3); }
input[type=color] { width: 46px; height: 40px; border: 1.5px solid var(--line-strong); border-radius: var(--r-btn); background: var(--surface); padding: 3px; }
.dropzone { border: 1.5px dashed var(--line-strong); border-radius: var(--r-panel); background: var(--surface-2); padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--fg-2); font-size: 12px; cursor: pointer; }
.dropzone svg.i { width: 26px; height: 26px; color: var(--brand-200); }
.dropzone input { display: none; }

.switch { position: relative; width: 40px; height: 24px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 100px; transition: background var(--t-instant); cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(10, 25, 60, .3); transition: inset-inline-start var(--t-instant) var(--e); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { inset-inline-start: 19px; }
.switch input:disabled + span { opacity: .45; cursor: not-allowed; }
.switch input:focus-visible + span { outline: 3px solid var(--btn-ring); outline-offset: 2px; }

.choice { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: var(--r-btn); max-width: 100%; align-self: flex-start; }
.choice.wrap { flex-wrap: wrap; }
.choice button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 12px; min-height: 34px; border-radius: 9px; font-size: 12.5px; color: var(--fg-2); cursor: pointer; white-space: nowrap; transition: background var(--t-fast), color var(--t-fast); }
.choice button svg.i { width: 15px; height: 15px; }
.choice button:hover { color: var(--fg); }
.choice button.on { background: var(--surface); color: var(--brand-fg); font-weight: 700; box-shadow: 0 1px 2px rgba(10, 25, 60, .12), 0 0 0 1px var(--line); }
.choice button:focus-visible { outline: 3px solid var(--btn-ring); outline-offset: 1px; }

/* drafts */
.draft-card { text-align: start; cursor: pointer; font: inherit; color: inherit; transition: border-color var(--t-fast), background var(--t-fast); }
.draft-card:hover { border-color: var(--line-strong); }
.draft-card .head { display: flex; align-items: flex-start; gap: 10px; }
.draft-card .thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface-3); flex: none; }
.draft-card .ttl { font-size: 13px; font-weight: 700; line-height: 1.7; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.draft-card .sub { font-size: 11px; color: var(--fg-2); }
.platforms { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--fg-2); background: var(--surface-3); border-radius: var(--r-chip); padding: 1px 8px; }

.variant-head { display: flex; align-items: center; gap: 10px; }
.variant-head .pf { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-surface); color: var(--brand-fg); flex: none; }
.variant-head .pf svg.i { width: 17px; height: 17px; }
.variant-head .name { display: flex; flex-direction: column; line-height: 1.5; min-width: 0; flex: 1; }
.variant-head .name strong { font-size: 13px; }
.variant-head .name small { font-size: 11px; color: var(--fg-2); }
.preview { background: var(--surface-2); border: 1px solid var(--line-subtle); border-radius: var(--r-input); padding: 12px 14px; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.95; }
.preview blockquote { margin: 4px 0; padding-inline-start: 10px; border-inline-start: 3px solid var(--brand); }
.preview code { background: var(--surface-3); padding: 0 4px; border-radius: 4px; }
.preview.headline { font-weight: 700; font-size: 14px; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; }
.thumbs img, .thumbs video { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; background: var(--surface-3); flex: none; border: 1px solid var(--line-subtle); }
.card-img { width: 100%; max-width: 220px; border-radius: 14px; display: block; border: 1px solid var(--line-subtle); }
.note { display: flex; gap: 10px; align-items: flex-start; background: var(--brand-surface); color: var(--brand-fg); border-radius: var(--r-panel); padding: 10px 12px; font-size: 12.5px; line-height: 1.9; }
.note svg.i { width: 16px; height: 16px; margin-top: 4px; }
.note.danger { background: var(--danger-surface); color: var(--danger); }
.note.warn { background: var(--warn-surface); color: var(--warn); }
details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--fg-2); }
details > summary::-webkit-details-marker { display: none; }
details > summary svg.i { width: 15px; height: 15px; transition: transform var(--t-fast); }
details[open] > summary svg.i { transform: rotate(180deg); }

.chat { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.bubble { padding: 8px 12px; border-radius: 14px; font-size: 12.5px; max-width: 88%; line-height: 1.9; }
.bubble.human { background: var(--brand-surface); color: var(--fg); align-self: flex-start; border-start-start-radius: 4px; }
.bubble.agent { background: var(--surface-2); border: 1px solid var(--line-subtle); align-self: flex-end; border-start-end-radius: 4px; }
.bubble small { display: block; color: var(--fg-3); font-size: 10.5px; }

.action-bar { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 3; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card-lg); padding: 10px 10px 6px; box-shadow: var(--elev-3); display: flex; flex-direction: column; gap: 6px; }
.action-bar .row { flex-wrap: nowrap; }
.action-bar .row .btn { flex: 1; }

/* instagram */
.entity { display: flex; align-items: center; gap: 12px; }
.avatar { width: 46px; height: 46px; border-radius: 100px; background: var(--brand-surface); color: var(--brand-fg); display: grid; place-items: center; font-size: 17px; font-weight: 700; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: var(--surface-2); text-align: center; }
.slot.top { background: var(--brand-surface); border-color: transparent; }
.slot strong { display: block; font-size: 17px; line-height: 1.5; }
.slot small { color: var(--fg-2); font-size: 10.5px; }
.chart { width: 100%; max-width: 640px; height: auto; display: block; margin-inline: auto; overflow: visible; font-family: "IRANYekanX", system-ui; }
.chart .grid { stroke: var(--line-subtle); stroke-width: 1; }
.chart .axis { fill: var(--fg-3); font-size: 9.5px; }
.chart .bar { fill: var(--series); }
.chart .bar.dim { fill: var(--series-dim); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .mark { fill: var(--fg-2); font-size: 9px; font-weight: 700; }
.chart .cell { stroke: var(--surface); stroke-width: 2px; }
.legend-scale { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--fg-2); flex-wrap: wrap; }
.legend-scale i { width: 16px; height: 10px; border-radius: 3px; display: inline-block; }
table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th { text-align: start; color: var(--fg-2); font-size: 10.5px; font-weight: 700; padding: 8px 6px; background: var(--surface-2); white-space: nowrap; }
table.data th:first-child { border-start-start-radius: 10px; border-end-start-radius: 10px; }
table.data th:last-child { border-start-end-radius: 10px; border-end-end-radius: 10px; }
table.data td { padding: 9px 6px; border-bottom: 1px solid var(--line-subtle); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.post-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-subtle); }
.post-row:last-child { border-bottom: 0; padding-bottom: 0; }
.post-row img, .post-row .ph { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--surface-3); flex: none; }
.post-row p { margin: 0; font-size: 12.5px; line-height: 1.8; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.metrics { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--fg-2); margin-top: 2px; }
.metrics b { color: var(--fg); font-weight: 700; }
.list { margin: 0; padding-inline-start: 18px; font-size: 13px; line-height: 2; }
.steps { margin: 0; padding-inline-start: 20px; font-size: 12.5px; line-height: 2.05; color: var(--fg); }
code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; direction: ltr; unicode-bidi: isolate; }
.conn { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-subtle); font-size: 13px; }
.conn:last-child { border-bottom: 0; }
.conn .grow small { display: block; font-size: 11px; color: var(--fg-2); line-height: 1.6; }
.dest { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-subtle); }
.dest:last-of-type { border-bottom: 0; }

.member { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line-subtle); }
.member:first-of-type { padding-top: 4px; }
.member-head { display: flex; align-items: center; gap: 10px; }
.member-head .avatar { width: 40px; height: 40px; font-size: 15px; }
.member .kv dd { display: flex; flex-wrap: wrap; gap: 4px; }
.activity { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; font-size: 12px; align-items: baseline; }
.activity small { color: var(--fg-3); font-size: 11px; }

/* empty, skeleton, toast, tooltip */
.empty { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-card-lg); padding: 28px 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.empty .ring { width: 48px; height: 48px; border-radius: 100px; background: var(--surface-3); color: var(--fg-3); display: grid; place-items: center; }
.empty .ring svg.i { width: 22px; height: 22px; }
.empty strong { font-size: 13.5px; }
.empty span { font-size: 12px; color: var(--fg-2); line-height: 1.9; max-width: 300px; }
.skel { border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.skel i { display: block; height: 11px; border-radius: 100px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: calc(84px + env(safe-area-inset-bottom)); inset-inline: 16px; margin: 0 auto; max-width: 420px; z-index: 20; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px 14px; display: flex; gap: 12px; align-items: center; box-shadow: var(--elev-3); overflow: hidden; font-size: 12.5px; font-weight: 700; line-height: 1.8; animation: slide-in var(--t-base) var(--e); }
.toast .ic { width: 30px; height: 30px; border-radius: 100px; background: var(--brand-surface); color: var(--brand-fg); display: grid; place-items: center; flex: none; }
.toast.error { border-color: var(--soft-danger); }
.toast.error .ic { background: var(--danger-surface); color: var(--danger); }
.toast .bar { position: absolute; bottom: 0; inset-inline: 0; height: 3px; background: var(--brand); transform-origin: right; animation: drain linear forwards; }
.toast.error .bar { background: var(--danger-500); }
@keyframes slide-in { from { transform: translateY(12px); opacity: 0; } }
@keyframes drain { to { transform: scaleX(0); } }
.tip { position: fixed; z-index: 30; pointer-events: none; background: var(--ink-950); color: #fff; font-size: 11.5px; padding: 5px 9px; border-radius: 9px; white-space: nowrap; box-shadow: var(--elev-3); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; } }
@media (min-width: 600px) { .view { padding-inline: 24px; } .stats.two { grid-template-columns: repeat(3, 1fr); } }
