/* Aram — Jalal's design system: tokens and the panel frame (sidebar + top bar).

   Loaded after admin.css. Everything here is prefixed (`--a-*`, `.a-*`) so it
   never collides with Bootstrap or the older `--jl-*` names. The shared
   components every page uses (cards, tables, chips, buttons, fields,
   Bootstrap's widgets) are drawn in Aram by admin.css, which points the
   `--jl-*` and `--bs-*` variables at these tokens; each page's own
   stylesheet draws its layout with the same tokens.

   The frame keeps the legacy contract other pages build on:
   `--jl-sidebar-w` / `--jl-topbar-h` (sticky offsets, floating panels) and
   `html.jl-collapsed` (sidebar hidden) / `html.jl-header-hidden`.
   Every token has a dark value (html[data-theme="dark"], below the light
   set); the top bar's toggle and ⌘K switch it for every page. */

/* ─── Brand face: Doran ─────────────────────────────────────────────────── */
/* NooshDaroo's own typeface, for names only — the «جلال.» wordmark and
   the login's «ابزارهای هوش مصنوعی». Everything else stays Vazirmatn.
   Doran is licensed per use by fontiran.com: the comment below and the
   FontLicense.txt beside the file must carry the license code, and the
   file may not be modified (no subsetting). */
/*
Doran fonts are considered a proprietary software. To gain information about the laws regarding the
use of these fonts, please visit www.fontiran.com
---------------------------------------------------------------------
This set of fonts are used in this project under the license: (.....)
---------------------------------------------------------------------
*/
@font-face {
  font-family: "Doran";
  src: url("../vendor/doran/doran-vf.woff2") format("woff2");
  font-weight: 100 950;
  font-style: normal;
  font-display: swap;
}

/* ─── Aram tokens ───────────────────────────────────────────────────────── */
:root {
  /* Colour */
  --a-canvas: #F6F6F4;
  --a-surface: #FFFFFF;
  --a-surface-subtle: #FAFAF9;
  --a-hover: #F2F2F0;
  --a-border: #E7E5E4;
  --a-border-strong: #D6D3D1;
  --a-text: #1C1917;
  --a-text-secondary: #57534E;
  --a-text-tertiary: #716A65;
  --a-accent: #0F766E;
  --a-accent-hover: #115E59;
  --a-accent-soft: #E6F4F1;
  --a-on-accent: #FFFFFF;
  --a-danger: #DC2626;
  --a-danger-hover: #B91C1C;
  --a-danger-fg: #B91C1C;   /* danger as text on a tint */
  --a-danger-soft: #FEF0F0;
  --a-on-danger: #FFFFFF;
  --a-focus-ring: var(--a-accent);

  /* Feedback: text colour (each clears 4.5:1 on its own tint) and tint */
  --a-success: #1E7A4A; --a-success-soft: #ECF8F1;
  --a-warning: #8A5A00; --a-warning-soft: #FEF6E4;
  --a-info: #2952CC;    --a-info-soft: #EEF4FF;
  /* The edge of a checkbox, radio or switch: 3.7:1, past the 3:1 a control
     needs to be found. Text-field borders stay --a-border-strong. */
  --a-control-border: #8A8480;

  /* The sidebar sits one tone below the canvas, a step you can see (1.14:1;
     at #EFEEEC it was 1.07:1, and only the hairline told them apart); hover
     steps toward the white of the selected item. */
  --a-sidebar: #E9E7E5;
  --a-sidebar-hover: rgb(255 255 255 / .6);
  --a-sidebar-active: #FFFFFF;

  /* Status */
  --a-st-idea-dot: #7C5CFA;      --a-st-idea-bg: #F3F0FF;      --a-st-idea-fg: #5B3FD0;
  --a-st-draft-dot: #A8A29E;     --a-st-draft-bg: #F2F2F0;     --a-st-draft-fg: #57534E;
  --a-st-review-dot: #E0A100;    --a-st-review-bg: #FEF6E4;    --a-st-review-fg: #8A5A00;
  --a-st-revise-dot: #F06A3F;    --a-st-revise-bg: #FFF0EC;    --a-st-revise-fg: #B43B1E;
  --a-st-approved-dot: #4F7BF7;  --a-st-approved-bg: #EEF4FF;  --a-st-approved-fg: #2952CC;
  --a-st-published-dot: #2FA36B; --a-st-published-bg: #ECF8F1; --a-st-published-fg: #1E7A4A;

  /* Tints for team tiles and avatars */
  --a-tint0-bg: #E6F4F1; --a-tint0-fg: #115E59;
  --a-tint1-bg: #F7EEDF; --a-tint1-fg: #7A4A12;
  --a-tint2-bg: #E8F0FB; --a-tint2-fg: #1D4F91;
  --a-tint3-bg: #FBEAEF; --a-tint3-fg: #9A2B4B;
  --a-tint4-bg: #EDF3E3; --a-tint4-fg: #46601A;
  --a-tint5-bg: #EFEDF8; --a-tint5-fg: #55429A;

  /* Type */
  --a-font: "Vazirmatn", ui-sans-serif, system-ui, sans-serif;
  --a-font-brand: "Doran", "Vazirmatn", ui-sans-serif, system-ui, sans-serif;  /* names only */
  /* Sizes grow with the screen: the first value up to a 1280px-wide window
     (phones and laptops), the last from 2560px (a 27-inch monitor), in a
     straight line between. A wide monitor packs more pixels into each inch,
     so a fixed size reads smaller there. Text grows 1.5–2px; headings keep
     their lead over it. */
  --a-fs-caption: clamp(12px, 10.5px + .1172vw, 13.5px); --a-lh-caption: 1.6;
  --a-fs-meta: clamp(13px, 11.5px + .1172vw, 14.5px);    --a-lh-meta: 1.7;
  --a-fs-ui: clamp(14px, 12px + .1563vw, 16px);          --a-lh-ui: 1.8;
  --a-fs-body: clamp(15px, 13px + .1563vw, 17px);        --a-lh-body: 1.9;
  --a-fs-card: clamp(17px, 15px + .1563vw, 19px);        --a-lh-card: 1.7;
  --a-fs-section: clamp(20px, 18px + .1563vw, 22px);     --a-lh-section: 1.55;
  --a-fs-page: clamp(26px, 24px + .1563vw, 28px);        --a-lh-page: 1.45;
  --a-fs-greet: clamp(32px, 30px + .1563vw, 34px);       --a-lh-greet: 1.35;

  /* Space, shape, depth, motion */
  --a-sp-1: 4px; --a-sp-2: 8px; --a-sp-3: 12px; --a-sp-4: 16px; --a-sp-5: 20px;
  --a-sp-6: 24px; --a-sp-8: 32px; --a-sp-10: 40px; --a-sp-12: 48px; --a-sp-16: 64px;
  --a-r-chip: 6px; --a-r-control: 10px; --a-r-card: 14px; --a-r-dialog: 20px;
  --a-shadow-card-hover: 0 6px 16px -8px rgb(28 25 23 / .12);
  --a-shadow-popover: 0 8px 24px -6px rgb(28 25 23 / .12);
  --a-shadow-dialog: 0 24px 48px -12px rgb(28 25 23 / .18);
  --a-dur-hover: 120ms; --a-dur-expand: 180ms; --a-dur-panel: 240ms;
  --a-ease: cubic-bezier(.2, .8, .2, 1);
  --a-ctl: 40px;
}
@media (pointer: coarse) { :root { --a-ctl: 44px; } }

/* The one page that is dark today (idea-hunter articles, via data-theme)
   gets the frame in Aram's dark values. Full dark mode comes later. */
html[data-theme="dark"] {
  --a-canvas: #151413; --a-surface: #1C1B1A; --a-surface-subtle: #181716; --a-hover: #2A2826;
  --a-border: #2E2C2A; --a-border-strong: #3A3734;
  --a-text: #F5F5F4; --a-text-secondary: #A8A29E; --a-text-tertiary: #8A8480;
  --a-accent: #2BB3A3; --a-accent-hover: #4CC9BA; --a-accent-soft: rgb(43 179 163 / .14); --a-on-accent: #062B27;
  --a-danger: #F87171; --a-danger-hover: #FCA5A5; --a-danger-fg: #FCA5A5; --a-danger-soft: rgb(248 113 113 / .14); --a-on-danger: #2A0A0A;
  --a-success: #7FD8A8; --a-success-soft: rgb(47 163 107 / .16);
  --a-warning: #F5C451; --a-warning-soft: rgb(224 161 0 / .16);
  --a-info: #A9C1FF;    --a-info-soft: rgb(79 123 247 / .16);
  --a-sidebar: #0D0C0B; --a-sidebar-hover: #181716; --a-sidebar-active: #1C1B1A;
  --a-st-review-bg: rgb(224 161 0 / .16); --a-st-review-fg: #F5C451;
  --a-tint0-bg: rgb(43 179 163 / .16); --a-tint0-fg: #7FDCD0;
  --a-tint1-bg: rgb(214 160 80 / .16); --a-tint1-fg: #E8C48E;
  --a-tint2-bg: rgb(96 150 230 / .16); --a-tint2-fg: #A8C8F5;
  --a-tint3-bg: rgb(230 110 145 / .16); --a-tint3-fg: #F2A9BE;
  --a-tint4-bg: rgb(140 180 80 / .16); --a-tint4-fg: #BFD99A;
  --a-tint5-bg: rgb(150 130 230 / .16); --a-tint5-fg: #C6B9F2;
  --a-shadow-popover: none; --a-shadow-dialog: none;
}

/* On the sidebar's tone (and the login column that wears it) the canvas's
   hairline would vanish and its caption grey would fall to 4.3:1, so both
   step down a notch there (captions 4.7:1). The dark tone needs neither. */
html:not([data-theme="dark"]) :is(.a-sidebar, .jl-login__side) {
  --a-border: #DDDAD7;
  --a-text-tertiary: #6B645F;
}

/* ─── Icons ─────────────────────────────────────────────────────────────── */
.a-ic {
  inline-size: 18px; block-size: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.a-ic--mirror { transform: scaleX(-1); }  /* directional icons point the RTL way */
/* An icon inside running text or a control that sizes by font: it follows
   the font size, as the icon font it replaced did. */
.a-ic--em { inline-size: 1.15em; block-size: 1.15em; vertical-align: -.2em; }
.a-ic--fill { fill: currentColor; }        /* status dots */
.a-ic--spin { animation: a-spin .9s linear infinite; }
@keyframes a-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .a-ic--spin { animation: none; } }

/* ─── Frame: layout ─────────────────────────────────────────────────────── */
body { background: var(--a-canvas); }

.jl-layout { display: flex; min-height: 100vh; }
.jl-main {
  flex: 1 1 auto;
  margin-inline-start: var(--jl-sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.jl-layout--no-sidebar .jl-main { margin-inline-start: 0; }

/* ─── Frame: sidebar ────────────────────────────────────────────────────── */
.a-sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 1030;
  inline-size: var(--jl-sidebar-w);
  display: flex;
  flex-direction: column;
  padding: var(--a-sp-4) var(--a-sp-3) var(--a-sp-3);
  background: var(--a-sidebar);
  border-inline-end: 1px solid var(--a-border);
  color: var(--a-text-secondary);
  font-family: var(--a-font);
  font-size: var(--a-fs-ui);
  line-height: var(--a-lh-ui);
  transition: transform var(--a-dur-panel) var(--a-ease);
}
.a-sidebar :focus-visible { outline: 2px solid var(--a-focus-ring); outline-offset: 2px; }

.a-sb-top { display: flex; align-items: center; min-block-size: 40px; margin-block-end: var(--a-sp-3); padding-inline: var(--a-sp-3); }
.a-wordmark {
  display: inline-flex; align-items: center; gap: 2px;
  color: var(--a-text); font-family: var(--a-font-brand); font-size: 24px; font-weight: 600; line-height: 1.4;
  border-radius: var(--a-r-chip); text-decoration: none;
}
.a-wordmark:hover { color: var(--a-text); }
/* Sits on the baseline at any size: the offset is in em, not px. */
.a-wordmark__dot { inline-size: .25em; block-size: .25em; border-radius: 50%; background: var(--a-accent); align-self: flex-end; margin-block-end: .4em; }

/* The middle scrolls on its own; the foot (settings, account) stays put.
   The 4px inline padding gives focus rings room inside the scroll box. */
.a-sb-body {
  flex: 1 1 auto;
  min-block-size: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin-inline: -4px;
  padding: 2px 4px var(--a-sp-4);
  scrollbar-width: thin;
  scrollbar-color: var(--a-border-strong) transparent;
}
.a-sb-foot {
  display: flex; flex-direction: column; gap: 2px;
  padding-block-start: var(--a-sp-3);
  border-block-start: 1px solid var(--a-border);
}

/* Nav items */
.a-nav { display: flex; flex-direction: column; gap: 2px; }
.a-nav-item {
  position: relative;
  display: flex; align-items: center; gap: var(--a-sp-3);
  min-block-size: 40px;
  padding-inline: var(--a-sp-3);
  border-radius: var(--a-r-control);
  color: var(--a-text-secondary);
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--a-dur-hover) var(--a-ease), color var(--a-dur-hover) var(--a-ease);
}
.a-nav-item:hover { background: var(--a-sidebar-hover); color: var(--a-text); }
.a-nav-item.active {
  background: var(--a-sidebar-active);
  color: var(--a-text);
  box-shadow: inset 0 0 0 1px var(--a-border);
}
.a-nav-item.active .a-ic { color: var(--a-accent); }
.a-nav-item.is-child { padding-inline-start: 42px; font-size: var(--a-fs-meta); }
.a-nav-item.is-child .a-ic { inline-size: 16px; block-size: 16px; }
.a-nav-label { flex: 1; min-inline-size: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* How much waits behind an item (nav.badge): a count at the row's far end, in the accent
   the pages use for "this asks for you". */
.a-nav-badge {
  flex: none;
  min-inline-size: 1.5rem;
  padding: 0 .4rem;
  border-radius: var(--a-r-chip);
  background: var(--a-accent-soft);
  color: var(--a-accent);
  font-size: var(--a-fs-caption);
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
}
.a-nav-back { color: var(--a-text-secondary); margin-block-end: var(--a-sp-2); }

/* Sections: «ابزارهای تیم», «محتوای سایت», settings groups */
.a-sec { margin-block-start: var(--a-sp-3); }
.a-sec-head { display: flex; align-items: center; gap: 2px; min-block-size: 32px; }
.a-sec-toggle {
  flex: 1; min-inline-size: 0;
  display: flex; align-items: center; gap: 6px;
  min-block-size: 32px; padding-inline: var(--a-sp-3) var(--a-sp-2);
  border: 0; border-radius: var(--a-r-chip); background: none;
  color: var(--a-text-tertiary);
  font: inherit; font-size: var(--a-fs-caption); line-height: var(--a-lh-caption); font-weight: 600;
  text-align: start;
  transition: color var(--a-dur-hover) var(--a-ease);
}
.a-sec-toggle:hover { color: var(--a-text-secondary); }
.a-sec-toggle .a-ic { inline-size: 14px; block-size: 14px; transition: transform var(--a-dur-expand) var(--a-ease); }
.a-sec-toggle[aria-expanded="false"] .a-ic { transform: rotate(90deg); }
.a-sec-caption { margin-inline-start: auto; font-weight: 400; color: var(--a-text-tertiary); unicode-bidi: isolate; }
.a-sec-label { padding: var(--a-sp-4) var(--a-sp-3) var(--a-sp-1); margin: 0; font-size: var(--a-fs-caption); line-height: var(--a-lh-caption); font-weight: 600; color: var(--a-text-tertiary); }
/* Folded sections: the pre-paint script in base.html sets data-sb-closed. */
html[data-sb-closed~="tools"] [data-sec="tools"] .a-sec-items,
html[data-sb-closed~="content"] [data-sec="content"] .a-sec-items { display: none; }
html[data-sb-closed~="tools"] [data-sec="tools"] .a-sec-toggle .a-ic,
html[data-sb-closed~="content"] [data-sec="content"] .a-sec-toggle .a-ic { transform: rotate(90deg); }

/* A quiet icon button (section settings shortcut, sign out, view controls) */
.a-icon-btn {
  position: relative;
  display: inline-grid; place-items: center; flex: none;
  inline-size: var(--a-ctl); block-size: var(--a-ctl);
  padding: 0; border: 0; border-radius: var(--a-r-control);
  background: transparent; color: var(--a-text-secondary);
  transition: background-color var(--a-dur-hover) var(--a-ease), color var(--a-dur-hover) var(--a-ease);
}
.a-icon-btn:hover { background: var(--a-hover); color: var(--a-text); }
.a-icon-btn:focus-visible { outline: 2px solid var(--a-focus-ring); outline-offset: 2px; }
.a-icon-btn--sm { inline-size: 32px; block-size: 32px; }
.a-icon-btn--sm::after { content: ""; position: absolute; inset: -4px; }  /* 40px target */
.a-sidebar .a-icon-btn:hover { background: var(--a-sidebar-hover); }
.a-sec-gear { opacity: 0; transition: opacity var(--a-dur-hover) var(--a-ease); }
.a-sec-gear .a-ic { inline-size: 16px; block-size: 16px; }
.a-sec-head:hover .a-sec-gear, .a-sec-gear:focus-visible { opacity: 1; }
@media (hover: none) { .a-sec-gear { opacity: 1; } }

/* Team switcher */
.a-team { margin-block-end: var(--a-sp-2); }
.a-team-btn {
  display: flex; align-items: center; gap: var(--a-sp-3);
  inline-size: 100%; min-block-size: 52px;
  padding: var(--a-sp-2) var(--a-sp-3);
  border: 1px solid var(--a-border); border-radius: var(--a-r-control);
  background: var(--a-sidebar-active); color: var(--a-text);
  font: inherit; text-align: start;
  transition: border-color var(--a-dur-hover) var(--a-ease);
}
button.a-team-btn:hover, .a-team-btn[aria-expanded="true"] { border-color: var(--a-border-strong); }
.a-team-tile {
  --s: 28px;
  inline-size: var(--s); block-size: var(--s); flex: none;
  display: inline-grid; place-items: center;
  border-radius: calc(var(--s) * .3);
  background: var(--tint-bg, var(--a-tint0-bg)); color: var(--tint-fg, var(--a-tint0-fg));
  font-size: calc(var(--s) * .5); font-weight: 700; line-height: 1;
}
.a-team-meta { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; line-height: 1.6; }
.a-team-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.a-team-role { font-size: var(--a-fs-caption); color: var(--a-text-tertiary); }
.a-team-chev { inline-size: 16px; block-size: 16px; color: var(--a-text-tertiary); }
[data-tint="0"] { --tint-bg: var(--a-tint0-bg); --tint-fg: var(--a-tint0-fg); }
[data-tint="1"] { --tint-bg: var(--a-tint1-bg); --tint-fg: var(--a-tint1-fg); }
[data-tint="2"] { --tint-bg: var(--a-tint2-bg); --tint-fg: var(--a-tint2-fg); }
[data-tint="3"] { --tint-bg: var(--a-tint3-bg); --tint-fg: var(--a-tint3-fg); }
[data-tint="4"] { --tint-bg: var(--a-tint4-bg); --tint-fg: var(--a-tint4-fg); }
[data-tint="5"] { --tint-bg: var(--a-tint5-bg); --tint-fg: var(--a-tint5-fg); }

/* Popover menu (team switcher). Bootstrap's dropdown does the behaviour. */
.a-menu.dropdown-menu {
  min-inline-size: 240px;
  padding: 6px;
  border: 1px solid var(--a-border);
  border-radius: 12px;
  background: var(--a-surface);
  box-shadow: var(--a-shadow-popover);
  font-family: var(--a-font);
  font-size: var(--a-fs-ui);
  text-align: start;
}
.a-menu-head { margin: 0; padding: 6px 10px 2px; font-size: var(--a-fs-caption); font-weight: 600; color: var(--a-text-tertiary); }
.a-menu .dropdown-item {
  display: flex; align-items: center; gap: 10px;
  min-block-size: 40px; padding: 6px 10px;
  border-radius: 8px;
  color: var(--a-text); white-space: normal; text-align: start;
}
.a-menu .dropdown-item:hover, .a-menu .dropdown-item:focus { background: var(--a-hover); color: var(--a-text); }
.a-menu .dropdown-item:focus-visible { outline: 2px solid var(--a-focus-ring); outline-offset: -2px; }
.a-menu .dropdown-item .a-ic { color: var(--a-text-secondary); }
.a-menu-body { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; line-height: 1.6; }
.a-menu-sub { font-size: var(--a-fs-caption); color: var(--a-text-tertiary); }
.a-menu-check { color: var(--a-accent) !important; }
.a-menu .dropdown-divider { margin: 6px 4px; border-color: var(--a-border); opacity: 1; }

/* Settings filter */
.a-sb-filter { position: relative; margin-block-end: var(--a-sp-1); }
.a-sb-filter .a-ic { position: absolute; inset-inline-start: 12px; inset-block-start: 50%; transform: translateY(-50%); inline-size: 16px; block-size: 16px; color: var(--a-text-tertiary); pointer-events: none; }
.a-sb-filter input {
  inline-size: 100%; block-size: 36px;
  padding-inline: 36px 12px;
  border: 1px solid var(--a-border-strong); border-radius: var(--a-r-control);
  background: var(--a-surface); color: var(--a-text);
  font: inherit; font-size: var(--a-fs-meta);
}
.a-sb-filter input::placeholder { color: var(--a-text-tertiary); }
.a-sb-filter input:focus-visible { outline: 2px solid var(--a-focus-ring); outline-offset: 2px; border-color: var(--a-accent); }
.a-sb-empty { margin: var(--a-sp-3); font-size: var(--a-fs-caption); color: var(--a-text-tertiary); }

/* Account */
.a-user { display: flex; align-items: center; gap: var(--a-sp-3); min-block-size: 52px; padding-inline: var(--a-sp-2) 0; }
.a-avatar {
  --s: 32px;
  inline-size: var(--s); block-size: var(--s); flex: none;
  display: inline-grid; place-items: center; border-radius: 50%;
  background: var(--tint-bg, var(--a-tint0-bg)); color: var(--tint-fg, var(--a-tint0-fg));
  font-size: 14px; font-weight: 600; line-height: 1;
}
.a-user-meta { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; line-height: 1.6; }
.a-user-name { color: var(--a-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-user-sub { font-size: var(--a-fs-caption); color: var(--a-text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-user form { margin: 0; }

/* Rail tooltips (admin.js positions them; the scrolling body would clip CSS ones). */
.a-tip {
  position: fixed; z-index: 1090;
  padding: 4px 10px; border-radius: var(--a-r-chip);
  background: var(--a-text); color: var(--a-canvas);
  font-family: var(--a-font); font-size: var(--a-fs-caption); line-height: 1.6; font-weight: 500;
  white-space: nowrap; pointer-events: none;
  transform: translateY(-50%);
}

/* ─── Frame: top bar ────────────────────────────────────────────────────── */
.a-topbar {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: var(--a-sp-3);
  block-size: var(--jl-topbar-h);
  padding-inline: var(--a-sp-6);
  background: var(--a-canvas);
  border-block-end: 1px solid var(--a-border);
  font-family: var(--a-font);
  transition: block-size .25s ease;
}
/* Where the page sits, then its name — each said once. The path is quiet and
   uses the sidebar's own words; the name is the one strong word in the bar.
   A page with a title of its own docks its name here only while that title
   is scrolled under the bar (html.jl-title-docked, set by admin.js). The
   head starts 6px early so the first word lines up with the content edge
   while its hover pill still has room. */
.a-topbar-head { display: flex; align-items: center; gap: 2px; min-inline-size: 0; margin-inline-start: -6px; }
.a-trail { min-inline-size: 0; }
.a-trail ol { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; min-inline-size: 0; }
.a-trail li { display: flex; align-items: center; gap: 2px; min-inline-size: 0; }
.a-trail :is(a, span) {
  padding: 2px 6px; border-radius: var(--a-r-chip);
  font-size: var(--a-fs-ui); line-height: max(20px, 1.3em); font-weight: 500; color: var(--a-text-tertiary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.a-trail a {
  color: var(--a-text-secondary); text-decoration: none;
  transition: background-color var(--a-dur-hover) var(--a-ease), color var(--a-dur-hover) var(--a-ease);
}
.a-trail a:hover { color: var(--a-text); background: var(--a-hover); }
.a-trail a:focus-visible { outline: 2px solid var(--a-focus-ring); outline-offset: 2px; }
.a-trail__sep { flex: none; inline-size: 14px; block-size: 14px; color: var(--a-text-tertiary); }
.a-topbar-name { display: flex; align-items: center; gap: 2px; margin: 0; min-inline-size: 0; }
.a-topbar-title {
  min-inline-size: 0; padding-inline: 6px;
  font-size: var(--a-fs-body); line-height: max(20px, 1.3em); font-weight: 600; color: var(--a-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.a-topbar-name--dock { display: none; }
html.jl-title-docked .a-topbar-name--dock { display: flex; animation: a-name-in var(--a-dur-expand) var(--a-ease); }
@keyframes a-name-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
  html.jl-title-docked .a-topbar-name--dock { animation: none; }
}
/* A phone's bar holds one item: the nearest step up at rest, the name once
   it shows (a workspace's always, a page's while docked). */
@media (max-width: 767.98px) {
  .a-trail li:not(:last-child), .a-trail__sep { display: none; }
  .a-topbar-head--titled .a-trail, html.jl-title-docked .a-trail { display: none; }
}
.a-topbar .jl-topbar__spacer { flex: 1 1 auto; }
/* Not production: say so on every page (was an orange bar). */
.a-env {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  block-size: 24px; padding-inline: 8px; border-radius: var(--a-r-chip);
  background: var(--a-st-review-bg); color: var(--a-st-review-fg);
  font-size: var(--a-fs-caption); line-height: 1.6; font-weight: 600;
}
.a-env::before { content: ""; inline-size: 6px; block-size: 6px; border-radius: 50%; background: var(--a-st-review-dot); }
/* A phone's top bar keeps room for the page title: the chip drops its word,
   the spacer's two gaps become one auto margin, and the trailing icon
   buttons sit flush (each is already a 44px target). */
@media (max-width: 575.98px) {
  .a-env__label { display: none; }
  .a-topbar { gap: var(--a-sp-2); }
  .a-topbar .jl-topbar__spacer { display: none; }
  .a-topbar .a-search { margin-inline-start: auto; }
  .a-topbar .a-search ~ .a-icon-btn { margin-inline-start: calc(-1 * var(--a-sp-2)); }
}
.a-topbar .a-user { min-block-size: 40px; }
/* A board without a sidebar signs out from the top bar; on a phone that
   bar has no room for the name, so the avatar stands for it. */
@media (max-width: 767.98px) {
  .a-topbar .a-user { gap: var(--a-sp-1); padding-inline: 0; }
  .a-topbar .a-user-meta { display: none; }
}

/* Hide the header for a content-focused view. What is left of it is a tab
   hanging from the top edge, under the spot where the hide button was, its
   chevron where that button's chevron was. The page keeps a strip for the
   tab (--jl-restore-h plus a gap) so it never covers the page's own
   buttons, and sticky parts stop under it (see the hidden-state offsets of
   .a-toc, .ims and .qs). A hover pulls the tab down a few pixels. */
:root { --jl-restore-h: 26px; }
@media (pointer: coarse) { :root { --jl-restore-h: 36px; } }
html.jl-header-hidden .a-topbar { block-size: 0; border-block-end-width: 0; overflow: hidden; visibility: hidden; }
html.jl-header-hidden .jl-content { padding-block-start: calc(var(--jl-restore-h) + var(--a-sp-3)); }
.jl-header-restore {
  position: fixed; top: 0; inset-inline-end: var(--a-sp-6); z-index: 1040;
  display: none; align-items: center; gap: var(--a-sp-1);
  box-sizing: content-box; block-size: var(--jl-restore-h);
  padding-block: 0; padding-inline: var(--a-sp-3);
  border: 1px solid var(--a-border-strong); border-block-start: 0;
  border-end-start-radius: var(--a-r-control); border-end-end-radius: var(--a-r-control);
  background: var(--a-canvas); color: var(--a-text-secondary);
  font-family: var(--a-font); font-size: var(--a-fs-caption); font-weight: 500;
  transition: padding-block-start var(--a-dur-hover) var(--a-ease),
              background-color var(--a-dur-hover) var(--a-ease), color var(--a-dur-hover) var(--a-ease);
}
.jl-header-restore .a-ic { order: 1; inline-size: 16px; block-size: 16px; }
.jl-header-restore:hover { padding-block-start: var(--a-sp-1); background: var(--a-hover); color: var(--a-text); }
.jl-header-restore:focus-visible { outline: 2px solid var(--a-focus-ring); outline-offset: -2px; }
html.jl-header-hidden .jl-header-restore { display: inline-flex; }
@media (max-width: 991.98px) { .jl-header-restore { inset-inline-end: var(--a-sp-4); } }
/* Only on the press that hid the bar (admin.js), not on every page load. */
@media (prefers-reduced-motion: no-preference) {
  .jl-header-restore.is-arriving { animation: jl-restore-drop var(--a-dur-panel) var(--a-ease) 80ms backwards; }
}
@keyframes jl-restore-drop { from { transform: translateY(-100%); } }

/* Fold / unfold the sidebar. The icon follows the state; on phones it closes
   the drawer, so it always shows «fold». */
.a-sb-top { justify-content: space-between; }
.a-sb-toggle__unfold { display: none; }
@media (min-width: 992px) {
  html.jl-collapsed .a-sb-toggle__fold { display: none; }
  html.jl-collapsed .a-sb-toggle__unfold { display: block; }
}

/* ─── Frame: light / dark toggle ────────────────────────────────────────── */
/* The icon names the mode a press switches to. */
.a-theme-toggle__to-light { display: none; }
html[data-theme="dark"] .a-theme-toggle__to-light { display: block; }
html[data-theme="dark"] .a-theme-toggle__to-dark { display: none; }
/* A switch happens in one frame; nothing fades at its own pace. */
.a-theme-switching, .a-theme-switching * { transition: none !important; }

/* ─── Frame: search (⌘K) ────────────────────────────────────────────────── */
.a-search {
  display: inline-flex; align-items: center; gap: var(--a-sp-2); flex: none;
  block-size: var(--a-ctl); min-inline-size: 240px;
  padding-inline: var(--a-sp-3) var(--a-sp-2);
  border: 1px solid var(--a-border); border-radius: var(--a-r-control);
  background: var(--a-surface); color: var(--a-text-tertiary);
  font-family: var(--a-font); font-size: var(--a-fs-ui);
  transition: border-color var(--a-dur-hover) var(--a-ease), color var(--a-dur-hover) var(--a-ease);
}
.a-search:hover { border-color: var(--a-border-strong); color: var(--a-text-secondary); }
.a-search:focus-visible { outline: 2px solid var(--a-focus-ring); outline-offset: 2px; }
.a-search__text { flex: 1; text-align: start; }
.a-kbd {
  padding: 0 6px; border: 1px solid var(--a-border); border-radius: var(--a-r-chip);
  background: var(--a-surface-subtle); color: var(--a-text-tertiary);
  font-family: var(--a-font); font-size: var(--a-fs-caption); line-height: 1.6;
  unicode-bidi: isolate; white-space: nowrap;
}
@media (max-width: 767.98px) {
  .a-search { min-inline-size: 0; inline-size: var(--a-ctl); justify-content: center; padding: 0; border-color: transparent; background: none; color: var(--a-text-secondary); }
  .a-search__text, .a-search .a-kbd { display: none; }
}

.a-palette-dlg {
  margin-block-start: 12vh; padding: 0; border: 0;
  background: transparent; color: var(--a-text);
  max-inline-size: calc(100vw - 32px); overflow: visible;
}
.a-palette-dlg::backdrop { background: rgb(28 25 23 / .28); }
.a-palette-dlg:focus { outline: none; }
.a-palette {
  inline-size: min(600px, calc(100vw - 32px)); overflow: hidden;
  background: var(--a-surface); border: 1px solid var(--a-border); border-radius: var(--a-r-dialog);
  box-shadow: var(--a-shadow-dialog);
  font-family: var(--a-font); font-size: var(--a-fs-ui); line-height: var(--a-lh-ui);
}
.a-pal-search { display: flex; align-items: center; gap: var(--a-sp-3); block-size: 56px; padding-inline: var(--a-sp-4); border-block-end: 1px solid var(--a-border); color: var(--a-text-tertiary); }
.a-pal-search input { flex: 1; min-inline-size: 0; block-size: 100%; border: 0; background: transparent; color: var(--a-text); font: inherit; font-size: var(--a-fs-body); outline: none; }
.a-pal-search input::placeholder { color: var(--a-text-tertiary); }
.a-pal-list { max-block-size: min(420px, 55vh); overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.a-pal-group { margin: 0; padding: 8px 10px 4px; font-size: var(--a-fs-caption); line-height: var(--a-lh-caption); font-weight: 600; color: var(--a-text-tertiary); }
.a-pal-opt { display: flex; align-items: center; gap: 10px; min-block-size: 40px; padding: 6px 10px; border-radius: 8px; color: var(--a-text); cursor: pointer; }
.a-pal-opt .a-ic { color: var(--a-text-secondary); }
.a-pal-opt[aria-selected="true"] { background: var(--a-accent-soft); }
.a-pal-opt[aria-selected="true"] .a-ic { color: var(--a-accent); }
.a-pal-label { flex: 1; min-inline-size: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-pal-hint { font-size: var(--a-fs-caption); color: var(--a-text-tertiary); white-space: nowrap; unicode-bidi: plaintext; }
.a-pal-empty { margin: 0; padding: var(--a-sp-6) var(--a-sp-4); text-align: center; color: var(--a-text-tertiary); }
.a-pal-foot { display: flex; flex-wrap: wrap; gap: var(--a-sp-4); padding: 10px var(--a-sp-4); border-block-start: 1px solid var(--a-border); font-size: var(--a-fs-caption); line-height: var(--a-lh-caption); color: var(--a-text-tertiary); }
@media (prefers-reduced-motion: no-preference) {
  .a-palette-dlg[open] { animation: a-pop var(--a-dur-panel) var(--a-ease); }
}
@keyframes a-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ─── «تازه‌های جلال»: the version and its changelog ───────────────────── */
/* The version: a quiet caption at the foot of the sidebar. In the rail
   only the number stays. */
.a-version {
  display: inline-flex; align-items: center; gap: var(--a-sp-1); align-self: flex-start;
  min-block-size: 32px; padding-inline: var(--a-sp-2);
  border: 0; border-radius: var(--a-r-chip);
  background: none; color: var(--a-text-tertiary);
  /* inherit, not just the family: a button's own font drops the body's
     "ss01", and the number would show in Latin digits. */
  font: inherit; font-size: var(--a-fs-caption); line-height: var(--a-lh-caption);
  white-space: nowrap; cursor: pointer;
  transition: background-color var(--a-dur-hover) var(--a-ease), color var(--a-dur-hover) var(--a-ease);
}
.a-version:hover { background: var(--a-sidebar-hover); color: var(--a-text-secondary); }
.a-version:focus-visible { outline: 2px solid var(--a-focus-ring); outline-offset: 2px; }
/* No entry for this viewer: the number alone, nothing to press. */
.a-version--plain { cursor: default; }
.a-version--plain:hover { background: none; color: var(--a-text-tertiary); }
html.jl-rail .a-version { align-self: center; padding-inline: var(--a-sp-1); }
html.jl-rail .a-version__label {
  position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.a-changelog-dlg {
  padding: 0; border: 0;
  background: transparent; color: var(--a-text);
  max-inline-size: calc(100vw - 32px); max-block-size: calc(100dvh - 32px); overflow: visible;
}
.a-changelog-dlg::backdrop { background: rgb(28 25 23 / .28); }
html[data-theme="dark"] .a-changelog-dlg::backdrop { background: rgb(0 0 0 / .55); }
.a-changelog-dlg:focus { outline: none; }
.a-changelog {
  display: flex; flex-direction: column;
  inline-size: min(520px, calc(100vw - 32px)); max-block-size: calc(100dvh - 32px);
  background: var(--a-surface); border: 1px solid var(--a-border); border-radius: var(--a-r-dialog);
  box-shadow: var(--a-shadow-dialog);
  font-family: var(--a-font); font-size: var(--a-fs-ui); line-height: var(--a-lh-ui);
}
.a-changelog__head { display: flex; align-items: center; gap: var(--a-sp-3); padding: var(--a-sp-5) var(--a-sp-6) var(--a-sp-3); }
.a-changelog__title { flex: 1; margin: 0; font-size: var(--a-fs-card); line-height: var(--a-lh-card); font-weight: 600; color: var(--a-text); }
.a-changelog__list {
  flex: 1 1 auto; min-block-size: 0; overflow-y: auto;
  margin: 0; padding: 0 var(--a-sp-6); list-style: none; scrollbar-width: thin;
}
.a-changelog__entry + .a-changelog__entry { margin-block-start: var(--a-sp-4); padding-block-start: var(--a-sp-4); border-block-start: 1px solid var(--a-border); }
.a-changelog__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--a-sp-2);
  margin: 0 0 var(--a-sp-2);
  font-size: var(--a-fs-meta); line-height: var(--a-lh-meta); color: var(--a-text-tertiary);
}
.a-changelog__version {
  padding-inline: var(--a-sp-2); border-radius: var(--a-r-chip);
  background: var(--a-hover); color: var(--a-text-secondary); font-weight: 600;
}
.a-changelog__text { margin: 0 0 var(--a-sp-2); font-size: var(--a-fs-body); line-height: var(--a-lh-body); color: var(--a-text-secondary); }
/* An entry's video: wider popup, the clip on top, its pause / play under it.
   The clip is drawn on Aram's light canvas, so it keeps a border in dark. */
.a-changelog-dlg.a-changelog--media .a-changelog { inline-size: min(640px, calc(100vw - 32px)); }
.a-changelog__video {
  display: block; inline-size: 100%; block-size: auto; aspect-ratio: 1200 / 750;
  margin-block-end: var(--a-sp-3);
  border: 1px solid var(--a-border); border-radius: var(--a-r-card);
  background: var(--a-sidebar); object-fit: contain; cursor: pointer;
}
/* Full screen: the whole clip, letterboxed on black — a phone held upright
   would otherwise crop it to a middle slice. Two rules: an unknown prefixed
   selector in one list would void the other. */
.a-changelog__video:fullscreen { border: 0; border-radius: 0; background: #000; object-fit: contain; cursor: auto; }
.a-changelog__video:-webkit-full-screen { border: 0; border-radius: 0; background: #000; object-fit: contain; cursor: auto; }
.a-changelog__play {
  display: inline-flex; align-items: center; gap: var(--a-sp-1);
  margin-inline-start: auto; min-block-size: 32px; padding-inline: var(--a-sp-2);
  border: 0; border-radius: var(--a-r-chip); background: none;
  color: var(--a-text-secondary); font: inherit; cursor: pointer;
  transition: background-color var(--a-dur-hover) var(--a-ease), color var(--a-dur-hover) var(--a-ease);
}
.a-changelog__play:hover { background: var(--a-hover); color: var(--a-text); }
.a-changelog__play:focus-visible { outline: 2px solid var(--a-focus-ring); outline-offset: 2px; }
.a-changelog__play .a-ic { inline-size: 16px; block-size: 16px; }
.a-changelog__play-pause,
.a-changelog__entry[data-playing] .a-changelog__play-play { display: none; }
.a-changelog__entry[data-playing] .a-changelog__play-pause { display: block; }
.a-changelog__foot { display: flex; justify-content: flex-end; padding: var(--a-sp-4) var(--a-sp-6) var(--a-sp-5); }
@media (max-width: 575.98px) {
  .a-changelog__head { padding: var(--a-sp-4) var(--a-sp-4) var(--a-sp-2); }
  .a-changelog__list { padding-inline: var(--a-sp-4); }
  .a-changelog__foot { padding: var(--a-sp-3) var(--a-sp-4) var(--a-sp-4); }
  .a-changelog__foot .btn { inline-size: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .a-changelog-dlg[open] { animation: a-pop var(--a-dur-panel) var(--a-ease); }
}

/* ─── Frame: responsive ─────────────────────────────────────────────────── */
/* Mobile: the sidebar is an off-canvas drawer (admin.js opens it). */
.jl-backdrop {
  position: fixed; inset: 0; z-index: 1025;
  background: rgb(28 25 23 / .28);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.jl-backdrop.is-visible { opacity: 1; visibility: visible; }

@media (max-width: 991.98px) {
  .a-sidebar { transform: translateX(100%); box-shadow: var(--a-shadow-dialog); }
  [dir="ltr"] .a-sidebar { transform: translateX(-100%); }
  .a-sidebar.is-open { transform: translateX(0); }
  .jl-main { margin-inline-start: 0; }
  .a-topbar { padding-inline: var(--a-sp-4); gap: var(--a-sp-2); }
}

@media (min-width: 992px) {
  .jl-main { transition: margin-inline-start .25s ease; }
  .jl-backdrop { display: none; }
  .a-sb-open { display: none; }
}

/* The 72px icon rail: what «جمع کردن نوار کناری» folds the sidebar to on a
   wide screen, and the sidebar's only form at laptop widths. html.jl-rail is
   set before first paint (base.html) and kept in sync by admin.js. Labels
   stay in the DOM, visually hidden, so every link keeps its name; admin.js
   shows them as tooltips. Pages that position against the sidebar read
   --jl-sidebar-w. */
html.jl-rail { --jl-sidebar-w: 72px; }
html.jl-rail .a-sidebar { padding-inline: var(--a-sp-3); }
html.jl-rail .a-sb-top { justify-content: center; padding-inline: 0; }
html.jl-rail .a-wordmark { font-size: 18px; }
html.jl-rail.jl-collapsed .a-wordmark { display: none; }  /* the unfold button takes the top */
html.jl-rail .a-nav-item,
html.jl-rail .a-nav-item.is-child { justify-content: center; padding-inline: 0; }
/* On the rail the count sits on the icon's corner, solid so it reads at that size. */
html.jl-rail .a-nav-badge {
  position: absolute;
  inset-block-start: 2px;
  inset-inline-end: 6px;
  min-inline-size: 1.125rem;
  padding: 0 .25rem;
  background: var(--a-accent);
  color: var(--a-on-accent);
  font-size: 10px;
  line-height: 1.6;
}
html.jl-rail .a-nav-label,
html.jl-rail .a-team-meta,
html.jl-rail .a-team-chev,
html.jl-rail .a-user-meta {
  position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
html.jl-rail .a-team-btn { justify-content: center; padding: 0; min-block-size: 44px; border-color: transparent; background: none; }
html.jl-rail .a-sec-head,
html.jl-rail .a-sb-filter,
html.jl-rail .a-sec-label,
html.jl-rail .a-sb-empty { display: none; }
html.jl-rail .a-sec { margin-block-start: var(--a-sp-2); padding-block-start: var(--a-sp-2); border-block-start: 1px solid var(--a-border); }
html.jl-rail[data-sb-closed] [data-sec] .a-sec-items { display: flex; }
html.jl-rail .a-user { flex-direction: column; gap: var(--a-sp-1); padding: var(--a-sp-1) 0 0; }

/* Laptop widths are always a rail, so there is nothing to unfold to. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .a-sb-toggle { display: none; }
  html.jl-rail.jl-collapsed .a-wordmark { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  .a-sidebar, .jl-main, .a-topbar, .jl-backdrop, .a-sec-toggle .a-ic { transition: none; }
}

/* ─── Section index (.a-toc) ────────────────────────────────────────────── */
/* A long page's index of its own sections: one column beside the page's
   body, on the inline-end side so it never stands next to the sidebar, kept
   in view while the body scrolls. Its items look and behave like the
   sidebar's: the section in view (aria-current, set by admin.js) is the
   same white card the sidebar marks its page with. A page whose sections
   are steps in order numbers them (.a-toc--steps); a line joins the steps.
   Under 1200px the index is one row above the body, titles only.

   <div class="a-toc-layout">
     <nav class="a-toc" data-a-toc aria-label="…">
       <p class="a-toc__head">بخش‌ها</p>
       <ol class="a-toc__list"><li><a class="a-toc__item" href="#s1">
         <span class="a-toc__text"><span class="a-toc__title">…</span>
           <span class="a-toc__meta">…</span></span></a></li></ol>
     </nav>
     <div class="a-toc-layout__body"> …<section class="a-toc-target" id="s1">… </div>
   </div>
   The index comes first, as it shows on a narrow screen. */
.a-toc-layout {
  --a-toc-w: 236px;
  --a-toc-top: calc(var(--jl-topbar-h) + var(--a-sp-4));
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--a-toc-w);
  grid-template-areas: "body toc";
  gap: var(--a-sp-8);
  align-items: start;
}
html.jl-header-hidden .a-toc-layout { --a-toc-top: calc(var(--jl-restore-h) + var(--a-sp-4)); }
.a-toc-layout__body { grid-area: body; min-width: 0; }
.a-toc-target { scroll-margin-top: calc(var(--jl-topbar-h) + var(--a-sp-4)); }
html.jl-header-hidden .a-toc-target { scroll-margin-top: calc(var(--jl-restore-h) + var(--a-sp-4)); }

.a-toc {
  grid-area: toc;
  position: sticky;
  top: var(--a-toc-top);
  max-block-size: calc(100vh - var(--a-toc-top) - var(--a-sp-4));
  overflow-y: auto;
  padding: 2px; /* room for the focus ring inside the scroller */
}
.a-toc__head {
  margin: 0;
  padding: 0 var(--a-sp-3) var(--a-sp-2);
  font-size: var(--a-fs-caption);
  line-height: var(--a-lh-caption);
  font-weight: 600;
  color: var(--a-text-tertiary);
}
.a-toc__list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.a-toc__list > li { position: relative; }
.a-toc__item {
  display: flex;
  align-items: flex-start;
  gap: var(--a-sp-3);
  padding: var(--a-sp-2) var(--a-sp-3);
  border-radius: var(--a-r-control);
  color: var(--a-text-secondary);
  text-decoration: none;
  transition: background-color var(--a-dur-hover) var(--a-ease), color var(--a-dur-hover) var(--a-ease);
}
.a-toc__item:hover { background: var(--a-hover); color: var(--a-text); }
.a-toc__item:focus-visible { outline: 2px solid var(--a-focus-ring); outline-offset: -2px; }
.a-toc__item[aria-current] {
  background: var(--a-surface);
  color: var(--a-text);
  box-shadow: inset 0 0 0 1px var(--a-border);
}
.a-toc__text { display: grid; gap: 2px; min-width: 0; }
.a-toc__title { font-size: var(--a-fs-ui); line-height: var(--a-lh-meta); font-weight: 500; }
.a-toc__meta {
  justify-self: start;
  max-width: 100%;
  overflow: hidden;
  color: var(--a-text-tertiary);
  font-size: var(--a-fs-caption);
  line-height: var(--a-lh-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A section with changes not yet saved. */
.a-toc__flag { color: var(--a-warning); font-size: var(--a-fs-caption); line-height: var(--a-lh-caption); font-weight: 600; }

/* Steps: the number, the line between steps, and the step in view. */
.a-toc__num {
  position: relative;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  inline-size: 28px;
  block-size: 28px;
  border-radius: 50%;
  background: var(--a-surface);
  box-shadow: inset 0 0 0 1px var(--a-border-strong);
  color: var(--a-text-secondary);
  font-size: var(--a-fs-meta);
  font-weight: 600;
  line-height: 1;
}
.a-toc--steps .a-toc__item { padding-block: 10px; }
.a-toc--steps .a-toc__text { padding-top: 2px; }
.a-toc--steps .a-toc__list > li:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-inline-start: calc(var(--a-sp-3) + 14px);
  top: 40px;
  bottom: -10px;
  width: 1px;
  background: var(--a-border-strong);
}
.a-toc__item[aria-current] .a-toc__num { background: var(--a-accent); box-shadow: none; color: var(--a-on-accent); }
.a-toc__item.is-dirty .a-toc__num::after {
  content: "";
  position: absolute;
  top: -3px;
  inset-inline-end: -3px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--a-canvas);
  border-radius: 50%;
  background: var(--a-st-review-dot);
}

@media (prefers-reduced-motion: no-preference) {
  html:has([data-a-toc]) { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  .a-toc__item { transition: none; }
}

/* Under 1200px: one row above the body, scrolling sideways if it must. */
@media (max-width: 1199.98px) {
  .a-toc-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "toc" "body";
    gap: var(--a-sp-6);
  }
  .a-toc { position: static; max-block-size: none; overflow: visible; padding: 0; }
  .a-toc__head { display: none; }
  .a-toc__list {
    flex-direction: row;
    gap: var(--a-sp-2);
    overflow-x: auto;
    padding: 2px;
    margin: -2px;
    scrollbar-width: thin;
  }
  .a-toc__list > li { flex: 0 0 auto; }
  .a-toc--steps .a-toc__list > li:not(:last-child)::after { display: none; }
  .a-toc__item,
  .a-toc--steps .a-toc__item {
    align-items: center;
    gap: var(--a-sp-2);
    padding: var(--a-sp-2) var(--a-sp-3);
    background: var(--a-surface);
    box-shadow: inset 0 0 0 1px var(--a-border);
    white-space: nowrap;
  }
  .a-toc__item[aria-current] { box-shadow: inset 0 0 0 1px var(--a-border-strong); }
  .a-toc--steps .a-toc__text { padding-top: 0; }
  .a-toc__meta, .a-toc__flag { display: none; }
  .a-toc__num { inline-size: 24px; block-size: 24px; font-size: var(--a-fs-caption); }
}
