/* Hallmark · v2 · shape: app screen · theme: custom faravar-ledger (by request: user brand, Persian RTL) · genre: modern-minimal · posture: restrained · nav: sidebar + topbar · footer: none (app) · hero: none (app screen) · signature: bitemporal snapshot (at/known) on the asset dossier */
/* critique: operate surface; one family (Vazirmatn), one accent (water teal), density 7, motion only for state change; labels untracked, sentence case */

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

:root {
  --font: "Vazirmatn", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --canvas: #F6F4EF;
  --surface: #FFFDF9;
  --surface-2: #EFECE5;
  --surface-3: #E7E3DA;
  --ink: #1D2421;
  --ink-soft: #55605B;
  --ink-faint: #6E7873;
  --hairline: #DED9CF;
  --hairline-strong: #C9C2B5;
  --accent: #0F6E6A;
  --accent-deep: #0B5552;
  --accent-tint: #E3F0EE;
  --on-accent: #FFFDF9;
  --ok: #2E6B3A;
  --ok-tint: #E5F2E6;
  --warn: #8A5700;
  --warn-tint: #FBF1DC;
  --error: #B3261E;
  --error-tint: #FBE7E5;
  --info: #2F5D8A;
  --info-tint: #E6EEF7;
  --shadow-1: 0 1px 2px rgba(29, 36, 33, .06), 0 2px 8px rgba(29, 36, 33, .05);
  --shadow-2: 0 8px 28px rgba(29, 36, 33, .14), 0 2px 6px rgba(29, 36, 33, .06);
  --scrim: rgba(18, 22, 20, .38);
  --r-sm: 6px;
  --r-md: 10px;
  --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --fs-xs: .8125rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.1875rem; --fs-xl: 1.4rem; --fs-2xl: 1.75rem;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --sidebar-w: 248px;
  --help-w: 380px;
  --max: 1360px;
  color-scheme: light;
}

[data-theme="dark"] {
  --canvas: #121614;
  --surface: #181D1B;
  --surface-2: #1E2421;
  --surface-3: #262D2A;
  --ink: #E8ECE9;
  --ink-soft: #A8B2AD;
  --ink-faint: #8E9994;
  --hairline: #2E3633;
  --hairline-strong: #3D4743;
  --accent: #4FB3AB;
  --accent-deep: #6CC6BE;
  --accent-tint: #1C3432;
  --on-accent: #0D1211;
  --ok: #7CC58A; --ok-tint: #1E3022;
  --warn: #E2B55C; --warn-tint: #33291A;
  --error: #F08D84; --error-tint: #3A1F1D;
  --info: #8DB4DC; --info-tint: #1D2A38;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, .5);
  --scrim: rgba(0, 0, 0, .55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { overflow-x: clip; }
html { font-size: 100%; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--canvas); color: var(--ink);
  font-family: var(--font); font-size: var(--fs-md); line-height: 1.85; font-variation-settings: normal;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-tint); color: var(--ink); }
input, textarea, select, button { font: inherit; color: inherit; caret-color: var(--accent); }
a { color: var(--accent-deep); text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1, h2, h3, h4 { line-height: 1.45; margin: 0; font-weight: 700; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); font-weight: 680; }
h3 { font-size: var(--fs-lg); font-weight: 650; }
h4 { font-size: var(--fs-md); font-weight: 650; }
p { margin: 0 0 var(--s3); max-width: 72ch; }
.muted { color: var(--ink-soft); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.num { font-variant-numeric: tabular-nums; }
code, .code {
  font-family: var(--mono); font-size: .8125rem; direction: ltr; unicode-bidi: isolate; background: var(--surface-2);
  border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 0 4px; white-space: nowrap; color: var(--ink);
}
.code-wrap { white-space: normal; word-break: break-all; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 10px; border: 2px solid var(--canvas); }
* { scrollbar-color: var(--hairline-strong) transparent; scrollbar-width: thin; }
svg.i { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }
.mirror { transform: scaleX(-1); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* ─────────── قاب برنامه ─────────── */
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--ink); color: var(--canvas); padding: 8px 16px; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { top: 8px; }
.shell { display: block; min-height: 100dvh; }
.main-col { margin-inline-start: var(--sidebar-w); }
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar-w); z-index: 25; overflow-y: auto; background: var(--surface-2);
  border-inline-end: 1px solid var(--hairline); padding: var(--s4) var(--s3); display: flex; flex-direction: column; gap: var(--s2);
}
.brand { display: flex; align-items: center; gap: var(--s3); padding: var(--s1) var(--s2) var(--s2); text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand b { display: block; font-size: 1.15rem; line-height: 1.2; }
.brand span { font-size: var(--fs-xs); color: var(--ink-soft); }
.nav-group { margin-top: var(--s2); }
.nav-group > p { font-size: var(--fs-xs); color: var(--ink-faint); margin: 0 var(--s3) var(--s1); }
.nav a {
  display: flex; align-items: center; gap: var(--s3); padding: 8px var(--s3); border-radius: var(--r-sm); color: var(--ink-soft);
  text-decoration: none; font-size: .9375rem; min-height: 38px; transition: background-color .15s ease, color .15s ease;
}
@media (hover: hover) and (pointer: fine) { .nav a:hover { background: var(--surface-3); color: var(--ink); } }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
.nav a[aria-current="page"] svg { color: var(--accent); }
.nav .count { font-variant-numeric: tabular-nums; margin-inline-start: auto; font-size: var(--fs-xs); background: var(--accent-tint); color: var(--accent-deep); border-radius: var(--r-pill); padding: 0 8px; line-height: 1.7; }
.sidebar-foot { margin-top: auto; padding: var(--s3) var(--s2) 0; border-top: 1px solid var(--hairline); font-size: var(--fs-xs); color: var(--ink-faint); }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5);
  background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--hairline);
}
.topbar .search { flex: 1; max-width: 560px; position: relative; }
.topbar .search input { width: 100%; padding-inline-start: 38px; }
.topbar .search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.topbar .search kbd { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
kbd { font-family: var(--mono); font-size: .72rem; border: 1px solid var(--hairline-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; color: var(--ink-soft); background: var(--surface); }
.userchip { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); color: var(--ink-soft); }
.main { min-width: 0; }
.page { max-width: var(--max); margin: 0 auto; padding: var(--s5) var(--s5) var(--s7); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3) var(--s4); margin-bottom: var(--s5); }
.page-head .lead { flex: 1 1 420px; }
.page-head p { margin: var(--s1) 0 0; color: var(--ink-soft); }
.page-head .actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.crumbs { font-size: var(--fs-sm); color: var(--ink-faint); margin-bottom: var(--s1); display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }

/* ─────────── سطح و چیدمان ─────────── */
.panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: var(--s5); box-shadow: var(--shadow-1); min-width: 0; }
.panel + .panel { margin-top: var(--s4); }
.panel-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { flex: 1; }
.panel.flush { padding: 0; }
.panel.flush .panel-head { padding: var(--s4) var(--s5) 0; }
.grid { display: grid; gap: var(--s4); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.stack > * + * { margin-top: var(--s3); }
.row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.divider { height: 1px; background: var(--hairline); margin: var(--s4) 0; border: 0; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px var(--s4); font-size: var(--fs-sm); margin: 0; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ─────────── شمارنده‌های کارتابل ─────────── */
.inbox { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hairline); border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; }
.inbox a { background: var(--surface); outline: 1px solid var(--hairline); padding: var(--s4); text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 2px; min-height: 92px; transition: background-color .15s ease; }
@media (hover: hover) and (pointer: fine) { .inbox a:hover { background: var(--accent-tint); } }
.inbox b { font-size: 1.6rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.inbox span { font-size: var(--fs-sm); color: var(--ink-soft); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; }
.stats a { padding: var(--s3) var(--s4); text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 2px; outline: 1px solid var(--hairline); transition: background-color .15s ease; }
@media (hover: hover) and (pointer: fine) { .stats a:hover { background: var(--accent-tint); } }
.stats b { font-size: 1.35rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stats span { font-size: var(--fs-xs); color: var(--ink-soft); }
.split.dash { align-items: stretch; }
.split .col { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.split .col > .panel:last-child { flex: 1; }
.split .col > .panel + .panel { margin-top: 0; }
.value-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s4); }
.value-pair > div + div { border-inline-start: 1px solid var(--hairline); padding-inline-start: var(--s4); }
.value-pair .big { font-size: 1.9rem; font-weight: 750; line-height: 1.2; font-variant-numeric: tabular-nums; }
.value-pair .big.soft { color: var(--ink-soft); }
@media (max-width: 520px) { .value-pair > div + div { border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid var(--hairline); padding-top: var(--s4); } }
.value-strip { display: flex; flex-wrap: wrap; gap: var(--s5); align-items: baseline; }
.value-strip .big { font-size: 2.1rem; font-weight: 750; line-height: 1.2; font-variant-numeric: tabular-nums; }

/* ─────────── دکمه و کنترل ─────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 40px; padding: 0 var(--s4);
  border-radius: var(--r-sm); border: 1px solid var(--hairline-strong); background: var(--surface); color: var(--ink);
  font-weight: 560; font-size: .9375rem; cursor: pointer; text-decoration: none; white-space: nowrap; touch-action: manipulation;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--surface-2); border-color: var(--ink-faint); } }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (hover: hover) and (pointer: fine) { .btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); } }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
@media (hover: hover) and (pointer: fine) { .btn.ghost:hover { background: var(--surface-2); color: var(--ink); } }
.btn.danger { color: var(--error); border-color: color-mix(in srgb, var(--error) 40%, var(--hairline)); }
.btn.sm { min-height: 32px; padding: 0 var(--s3); font-size: var(--fs-sm); }
.btn.icon { padding: 0; width: 40px; }
.btn.sm.icon { width: 32px; }
.btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-faint); border-top-color: transparent; animation: spin .7s linear infinite; }
.btn.primary[aria-busy="true"]::after { border-color: var(--on-accent); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > .label { font-size: var(--fs-sm); font-weight: 560; color: var(--ink); display: flex; gap: var(--s1); align-items: center; }
.req { color: var(--error); font-weight: 700; }
.opt { color: var(--ink-faint); font-weight: 400; font-size: var(--fs-xs); }
.help { font-size: var(--fs-xs); color: var(--ink-soft); line-height: 1.7; margin: 0; }
.err { font-size: var(--fs-xs); color: var(--error); line-height: 1.7; margin: 0; font-weight: 560; }
input[type=text], input[type=search], input[type=password], input[type=number], input[type=email], input[type=tel], input:not([type]), select, textarea {
  width: 100%; min-height: 42px; padding: 8px var(--s3); border: 1px solid var(--hairline-strong); border-radius: var(--r-sm);
  background: var(--surface); transition: border-color .15s ease; line-height: 1.6;
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
[aria-invalid="true"] { border-color: var(--error) !important; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--ink-faint); }
input.ltr, .ltr { direction: ltr; text-align: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s4); }
.form-grid .full { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: var(--s2); }
.check { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); cursor: pointer; min-height: 36px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--hairline-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 4px var(--s3); min-height: 36px; cursor: pointer; color: var(--ink-soft); font-size: var(--fs-sm); transition: background-color .15s ease, color .15s ease; }
.seg button + button { border-inline-start: 1px solid var(--hairline); }
.seg button[aria-pressed="true"] { background: var(--accent-tint); color: var(--accent-deep); font-weight: 600; }
.error-summary { border: 1px solid color-mix(in srgb, var(--error) 45%, var(--hairline)); background: var(--error-tint); border-radius: var(--r-sm); padding: var(--s3) var(--s4); color: var(--error); font-size: var(--fs-sm); }
.error-summary:focus { outline: 2px solid var(--error); }
.error-summary ul { margin: var(--s1) 0 0; padding-inline-start: var(--s5); }
.form-actions { display: flex; gap: var(--s2); justify-content: flex-start; margin-top: var(--s5); flex-wrap: wrap; align-items: center; }

/* ─────────── چیپ، نشان، اعلان ─────────── */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); border-radius: var(--r-pill); padding: 0 12px; line-height: 1.9; border: 1px solid var(--hairline); background: var(--surface-2); color: var(--ink-soft); white-space: nowrap; }
.tag.ok { background: var(--ok-tint); color: var(--ok); border-color: transparent; }
.tag.warn { background: var(--warn-tint); color: var(--warn); border-color: transparent; }
.tag.error { background: var(--error-tint); color: var(--error); border-color: transparent; }
.tag.info { background: var(--info-tint); color: var(--info); border-color: transparent; }
.tag.accent { background: var(--accent-tint); color: var(--accent-deep); border-color: transparent; }
.note { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-sm); background: var(--info-tint); color: var(--ink); font-size: var(--fs-sm); line-height: 1.8; }
.note svg { color: var(--info); margin-top: 4px; }
.note.warn { background: var(--warn-tint); } .note.warn svg { color: var(--warn); }
.note.error { background: var(--error-tint); } .note.error svg { color: var(--error); }
.note.ok { background: var(--ok-tint); } .note.ok svg { color: var(--ok); }
.note.ai { background: var(--accent-tint); } .note.ai svg { color: var(--accent); }
.note p { margin: 0; }

/* ─────────── جدول ─────────── */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
th { text-align: start; font-weight: 600; color: var(--ink-soft); font-size: var(--fs-xs); padding: var(--s2) var(--s3); border-bottom: 1px solid var(--hairline-strong); white-space: nowrap; background: var(--surface); }
td { padding: 12px var(--s3); border-bottom: 1px solid var(--hairline); vertical-align: top; }
tbody tr { transition: background-color .12s ease; }
@media (hover: hover) and (pointer: fine) { tbody tr.clickable:hover { background: var(--surface-2); cursor: pointer; } }
tbody tr:last-child td { border-bottom: 0; }
td.wrap { min-width: 220px; }
.empty { text-align: center; padding: var(--s7) var(--s4); color: var(--ink-soft); }
.empty svg { width: 34px; height: 34px; color: var(--ink-faint); margin-bottom: var(--s2); }
.empty h3 { color: var(--ink); margin-bottom: var(--s1); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: var(--r-sm); height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ─────────── زبانه‌ها ─────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hairline); margin-bottom: var(--s4); overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; padding: var(--s2) var(--s4); min-height: 42px; color: var(--ink-soft); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: .9375rem; transition: color .15s ease, border-color .15s ease; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .tabs button:hover { color: var(--ink); } }

/* ─────────── گام‌شمار و چرخه ─────────── */
.steps { list-style: none; margin: 0 0 var(--s5); padding: 0; display: flex; gap: var(--s2); flex-wrap: wrap; counter-reset: st; }
.steps li { counter-increment: st; display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); color: var(--ink-faint); padding: 4px var(--s3) 4px var(--s2); border-radius: var(--r-pill); background: var(--surface-2); }
.steps li::before { content: counter(st, persian); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--hairline-strong); font-size: var(--fs-xs); }
.steps li[aria-current="step"] { color: var(--ink); background: var(--accent-tint); font-weight: 600; }
.steps li[aria-current="step"]::before { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.steps li.done { color: var(--ink-soft); }
.steps li.done::before { background: var(--ok-tint); color: var(--ok); border-color: transparent; }
.cycle { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; }
.cycle > div { background: var(--surface); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.cycle .n { font-size: var(--fs-xs); color: var(--accent-deep); font-weight: 700; }
.cycle h3 { font-size: var(--fs-md); }
.cycle p { font-size: var(--fs-sm); color: var(--ink-soft); margin: 0; }
.cycle a { font-size: var(--fs-sm); margin-top: auto; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--hairline); }
.timeline li { position: relative; padding-inline-start: 28px; padding-bottom: var(--s4); font-size: var(--fs-sm); }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 2px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline .when { color: var(--ink-faint); font-size: var(--fs-xs); }

/* ─────────── برش زمانی ─────────── */
.timebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: var(--s3); align-items: end; padding: var(--s4); background: var(--surface-2); border-radius: var(--r-md); border: 1px solid var(--hairline); margin-bottom: var(--s4); }
.datein { display: flex; gap: var(--s1); }
.datein input { flex: 1; direction: ltr; text-align: end; }
.date-hint { font-size: var(--fs-xs); color: var(--ink-faint); }

/* ─────────── نگاره ─────────── */
.graph-box { position: relative; height: 560px; border: 1px solid var(--hairline); border-radius: var(--r-md); background:
  radial-gradient(circle, var(--hairline) 1px, transparent 1.2px) 0 0 / 22px 22px, var(--surface); overflow: hidden; touch-action: none; }
.graph-box svg.g { width: 100%; height: 100%; cursor: grab; user-select: none; }
.graph-box svg.g:active { cursor: grabbing; }
.graph-tools { position: absolute; top: var(--s3); inset-inline-end: var(--s3); display: flex; gap: var(--s1); }
.graph-legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: var(--fs-xs); color: var(--ink-soft); margin-top: var(--s3); }
.graph-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.gnode rect { stroke-width: 1.2; }
.gnode text { font-family: var(--font); font-size: 12px; fill: var(--ink); }
.gnode .kind { font-family: var(--mono); font-size: 10px; fill: var(--ink-soft); }
.gnode.gap rect { stroke: var(--warn); stroke-width: 2.2; stroke-dasharray: 5 3; }
.gnode.root rect { stroke: var(--accent); stroke-width: 2.4; }
.gnode { cursor: pointer; }
.gedge { fill: none; stroke: var(--hairline-strong); stroke-width: 1.3; }
.gedge-label { font-size: 10px; fill: var(--ink-faint); font-family: var(--font); }

/* ─────────── کشوها، گفت‌وگو، پیام ─────────── */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(var(--help-w), calc(100% - 24px)); background: var(--surface); z-index: 50;
  border-inline-start: 1px solid var(--hairline); box-shadow: var(--shadow-2); display: flex; flex-direction: column;
  transform: translateX(-104%); transition: transform .28s var(--ease-drawer); visibility: hidden;
}
.drawer.open { transform: translateX(0); visibility: visible; }
.drawer.wide { width: min(640px, calc(100% - 24px)); }
.drawer header { display: flex; align-items: center; gap: var(--s2); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--hairline); }
.drawer header h2 { flex: 1; font-size: var(--fs-lg); }
.drawer .body { padding: var(--s5); overflow-y: auto; flex: 1; }
.drawer .foot { padding: var(--s4) var(--s5); border-top: 1px solid var(--hairline); }
.help-body h3 { margin-top: var(--s5); margin-bottom: var(--s2); font-size: var(--fs-md); }
.help-body h3:first-child { margin-top: 0; }
.help-body ol, .help-body ul { padding-inline-start: var(--s5); margin: 0 0 var(--s3); font-size: var(--fs-sm); }
.help-body li { margin-bottom: 4px; }
.help-body p { font-size: var(--fs-sm); }
.ax { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px var(--s3); font-size: var(--fs-sm); }
.chat { display: flex; flex-direction: column; gap: var(--s3); }
.bubble { padding: var(--s3) var(--s4); border-radius: var(--r-md); font-size: var(--fs-sm); line-height: 1.85; white-space: pre-wrap; }
.bubble.me { background: var(--surface-2); align-self: flex-start; max-width: 90%; }
.bubble.bot { background: var(--accent-tint); max-width: 100%; }
dialog { border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); width: min(560px, calc(100% - 32px)); }
dialog::backdrop { background: var(--scrim); }
dialog .body { padding: var(--s5); }
dialog header { padding: var(--s4) var(--s5); border-bottom: 1px solid var(--hairline); display: flex; align-items: center; }
dialog header h2 { flex: 1; font-size: var(--fs-lg); }
.toasts { position: fixed; bottom: var(--s5); inset-inline-start: var(--s5); z-index: 80; display: flex; flex-direction: column; gap: var(--s2); max-width: min(420px, calc(100% - 32px)); }
.toast { display: flex; gap: var(--s3); align-items: flex-start; background: var(--ink); color: var(--canvas); border-radius: var(--r-md); padding: var(--s3) var(--s4); box-shadow: var(--shadow-2); font-size: var(--fs-sm); line-height: 1.75;
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out); }
@starting-style { .toast { opacity: 0; transform: translateY(8px); } }
.toast.error { background: var(--error); color: var(--surface); }
.toast .t-close { margin-inline-start: auto; background: none; border: 0; color: inherit; cursor: pointer; opacity: .8; min-width: 28px; min-height: 28px; }
.picker { position: relative; }
.picker-list { position: absolute; inset-inline: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: var(--r-sm); box-shadow: var(--shadow-2); z-index: 30; max-height: 280px; overflow-y: auto; padding: 4px; }
.picker-list button { display: flex; width: 100%; gap: var(--s2); align-items: center; text-align: start; border: 0; background: none; padding: 8px var(--s3); border-radius: 4px; cursor: pointer; font-size: var(--fs-sm); min-height: 40px; }
.picker-list button:hover, .picker-list button[aria-selected="true"] { background: var(--accent-tint); }
.picker-list .k { font-family: var(--mono); font-size: .72rem; color: var(--ink-soft); direction: ltr; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chips .tag button { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; display: inline-flex; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s3); }
.choice { text-align: start; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); padding: var(--s4); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 108px; transition: border-color .15s ease, background-color .15s ease; }
.choice b { font-size: var(--fs-md); }
.choice span { font-size: var(--fs-xs); color: var(--ink-soft); line-height: 1.7; }
.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
@media (hover: hover) and (pointer: fine) { .choice:hover { border-color: var(--ink-faint); } }
.crit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2) var(--s4); align-items: center; padding: var(--s3) 0; border-bottom: 1px solid var(--hairline); }
.crit:last-child { border-bottom: 0; }
.crit .t b { font-size: var(--fs-sm); display: block; }
.crit .t span { font-size: var(--fs-xs); color: var(--ink-soft); }
.bar { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 8px; }
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-art { background: var(--ink); color: var(--canvas); padding: var(--s7); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h1 { font-size: 2.4rem; line-height: 1.35; max-width: 16ch; }
.login-art p { color: color-mix(in srgb, var(--canvas) 72%, transparent); max-width: 46ch; }
.login-art svg.ledger { position: absolute; inset-inline-end: -40px; bottom: -40px; width: 70%; opacity: .16; color: var(--canvas); }
.login-form { display: grid; place-items: center; padding: var(--s6); }
.login-form form { width: min(400px, 100%); }
.demo-users { font-size: var(--fs-xs); color: var(--ink-soft); margin-top: var(--s5); line-height: 1.9; }
.ai-badge { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--accent-deep); background: var(--accent-tint); border-radius: var(--r-pill); padding: 0 8px; }

/* ─────────── پاسخ‌گرا ─────────── */
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .cycle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .main-col { margin-inline-start: 0; }
  .sidebar { position: static; width: auto; height: auto; }
  .js .sidebar { position: fixed; width: min(300px, 86%); z-index: 60; transform: translateX(104%); transition: transform .28s var(--ease-drawer); visibility: hidden; box-shadow: var(--shadow-2); }
  .js .sidebar.open { transform: translateX(0); visibility: visible; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: var(--s2) var(--s3); }
  .topbar .search kbd, .topbar .uname, .userchip > svg.i { display: none; }
  .topbar { gap: 2px; }
  .topbar .search { min-width: 0; }
  .page { padding: var(--s4) var(--s3) var(--s7); }
  .g2, .g3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .timebar { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { padding: var(--s5); min-height: 240px; }
  .login-art h1 { font-size: 1.7rem; }
  .graph-box { height: 440px; }
  h1 { font-size: 1.45rem; }
}
@media (max-width: 520px) {
  .cycle { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: var(--s4); }
  .inbox { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .skeleton { animation: none; }
}
@media print {
  .sidebar, .topbar, .drawer, .toasts, .btn { display: none !important; }
  .shell { display: block; }
  .panel { box-shadow: none; break-inside: avoid; }
}
code.copyable { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; cursor: copy; }
