/* کجا بودیم — the usage guide (guide/*.html). Loaded after site.css and built from its tokens. */

/* On phones the section chips stick under the header too, so anchors land below both. */
.guide { scroll-padding-top: calc(var(--header-h) + 76px); }
@media (min-width: 1024px) {
    .guide { scroll-padding-top: calc(var(--header-h) + 28px); }
}

.nav a[aria-current='page'] { color: var(--gold-300); background: rgba(211, 150, 63, 0.12); }
.js .nav a[aria-current='page'] { color: var(--gold-300); }

.icon {
    width: 1.25em;
    height: 1.25em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ───── Hero ───── */
.g-hero {
    overflow: hidden;
    overflow: clip;
    padding-block: 32px 44px;
    background: var(--forest-900);
    color: var(--cream);
}
.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
    color: rgba(243, 241, 233, 0.55);
}
.crumbs li + li::before { content: '‹'; margin-inline-end: 8px; color: rgba(243, 241, 233, 0.35); }
.crumbs a { text-decoration: none; color: var(--cream-soft); }
.crumbs a:hover { color: var(--gold-300); }
.g-hero .eyebrow { color: var(--gold-300); }
.g-hero .q { margin-bottom: 14px; }
.g-hero .lede { color: var(--cream-soft); }

.roleswitch { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.roleswitch a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid rgba(243, 241, 233, 0.22);
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--cream-soft);
    transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.roleswitch a:hover { border-color: var(--cream); color: var(--cream); }
.roleswitch a[aria-current='page'] { border-color: var(--gold-400); background: var(--gold-400); color: var(--forest-900); }

/* The search box only works with JS, so it only shows with JS. */
.g-search { display: none; position: relative; max-width: 560px; margin-top: 28px; }
.js .g-search { display: block; }
.g-search .icon {
    position: absolute;
    inset-inline-start: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}
.g-search input {
    width: 100%;
    min-height: 54px;
    padding: 0 48px;
    border: 0;
    border-radius: 14px;
    background: var(--white);
    font: inherit;
    font-size: 1.0625rem;
    color: var(--ink);
    box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.6);
    -webkit-appearance: none;
    appearance: none;
}
.g-search input::placeholder { color: var(--muted); }
.g-search input::-webkit-search-cancel-button { display: none; }
.g-search-clear {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    width: 38px;
    height: 38px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink-soft);
    font: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

/* ───── Layout: section list + content ───── */
.g-body { padding-block: 0 88px; }
/* minmax(0, …) so the wide strip of section chips scrolls instead of widening the page. */
.g-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
@media (min-width: 1024px) {
    .g-body { padding-top: 56px; }
    .g-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 64px; align-items: start; }
}

/* Phones and tablets: a swipeable strip of sections stuck under the header. */
.toc {
    position: sticky;
    top: var(--header-h);
    z-index: 20;
    margin-inline: calc(-1 * var(--gutter));
    background: rgba(246, 245, 240, 0.94);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
}
.toc-title,
.toc-group-label { display: none; }
.toc-list {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 10px var(--gutter);
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
}
.toc-list::-webkit-scrollbar { display: none; }
.toc-group { display: contents; }
.toc-group ul { display: contents; list-style: none; }
.toc a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.6;
    text-decoration: none;
    white-space: nowrap;
    color: var(--ink-soft);
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.toc a .icon { width: 1.1em; height: 1.1em; color: var(--forest-600); }
.toc a:hover { border-color: var(--gold-300); color: var(--ink); }
.toc a[aria-current='true'] { border-color: var(--forest-900); background: var(--forest-900); color: var(--cream); }
.toc a[aria-current='true'] .icon { color: var(--gold-300); }
.toc a.is-empty { opacity: 0.4; }

/* Desktop: the same list as a sidebar, grouped like the dashboard's own menu. */
@media (min-width: 1024px) {
    .toc {
        top: calc(var(--header-h) + 28px);
        max-height: calc(100vh - var(--header-h) - 56px);
        margin: 0;
        overflow-y: auto;
        background: none;
        border: 0;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        scrollbar-width: thin;
    }
    .toc-title { display: block; margin: 0 0 12px; font-size: 0.875rem; font-weight: 800; color: var(--muted); }
    .toc-list { display: grid; gap: 18px; padding: 0; overflow: visible; }
    .toc-group { display: block; }
    .toc-group ul { display: grid; gap: 2px; margin: 0; padding: 0; }
    .toc-group-label {
        display: block;
        margin: 0 0 6px;
        padding-inline: 12px;
        font-size: 0.75rem;
        font-weight: 800;
        letter-spacing: 0.02em;
        color: var(--gold-700);
    }
    .toc a { padding: 8px 12px; border: 0; border-radius: 10px; background: none; }
    .toc a:hover { background: var(--white); }
}

/* ───── Toolbar (results, open all) ───── */
.g-toolbar {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-top: 28px;
    font-size: 0.9375rem;
    color: var(--muted);
}
.js .g-toolbar { display: flex; }
@media (min-width: 1024px) {
    .g-toolbar { margin-top: 0; }
}
.g-toolbar p { margin: 0; }
.linkbtn {
    padding: 4px 2px;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 800;
    color: var(--forest-600);
    cursor: pointer;
}
.linkbtn:hover { color: var(--forest-900); text-decoration: underline; }

/* ───── Quick start ───── */
.start { margin-top: 28px; }
.start h2 { margin: 0 0 4px; font-size: 1.375rem; font-weight: 800; }
.start > p { margin: 0 0 20px; color: var(--ink-soft); }
.steps-cards { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: card; }
.steps-cards li { counter-increment: card; }
.steps-cards a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 16px;
    height: 100%;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.steps-cards a:hover { border-color: var(--gold-300); box-shadow: 0 18px 36px -26px rgba(13, 42, 38, 0.45); transform: translateY(-2px); }
.steps-cards a::before {
    content: counter(card, persian);
    grid-row: span 2;
    font-family: var(--font-display);
    font-size: 2.25rem;
    line-height: 1.1;
    color: var(--gold-400);
}
.steps-cards b { font-size: 1.0625rem; line-height: 1.6; color: var(--forest-900); }
.steps-cards span { font-size: 0.9375rem; line-height: 1.75; color: var(--muted); }
@media (min-width: 640px) {
    .steps-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
    .steps-cards.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ───── Sections ───── */
.g-sec { padding-top: 56px; }
.g-sec + .g-sec,
.start + .g-sec { margin-top: 56px; border-top: 1px solid var(--line); }
.g-sec-head { margin-bottom: 24px; }
.menu-path {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin: 0 0 10px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--forest-100);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--forest-800);
}
.menu-path span + span::before { content: '‹'; margin-inline-end: 6px; color: var(--forest-600); }
.g-sec h2 {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.875rem, 1.5rem + 1.2vw, 2.5rem);
    line-height: 1.4;
    color: var(--forest-900);
}
.g-sec h2 .icon-tile {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: none;
    border-radius: 14px;
    background: var(--forest-900);
    color: var(--gold-300);
}
.g-sec h2 .icon { width: 24px; height: 24px; }
.g-sec-head p { margin: 0; max-width: 44em; color: var(--ink-soft); }
.g-sec-head p + p { margin-top: 8px; }

.g-sec .plate { margin: 0 0 24px; max-width: 820px; }
.g-sec .plate figcaption { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--white); font-size: 0.875rem; color: var(--muted); }
.g-sec .plate.is-limited img { max-height: 420px; object-fit: cover; object-position: top center; }
.g-phones { display: flex; flex-wrap: wrap; gap: 20px; margin: 0 0 24px; }
.g-phones .phone { width: 196px; }
.g-phones .phone img { cursor: zoom-in; }

/* ───── Tasks ───── */
.tasks { display: grid; gap: 10px; }
.task {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.task[open] { border-color: var(--gold-300); box-shadow: 0 18px 40px -30px rgba(13, 42, 38, 0.5); }
.task summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    font-size: 1.0625rem;
    font-weight: 800;
    line-height: 1.7;
    list-style: none;
    cursor: pointer;
}
.task summary::-webkit-details-marker { display: none; }
.task summary::after {
    content: '';
    flex: none;
    width: 10px;
    height: 10px;
    margin-inline-end: 4px;
    border-inline-start: 2px solid var(--gold-600);
    border-bottom: 2px solid var(--gold-600);
    transform: rotate(-45deg) translateY(-3px);
    transition: transform 0.2s;
}
.task[open] summary::after { transform: rotate(135deg) translate(-3px, 0); }
.task summary:hover { color: var(--forest-700); }
.task-body { padding: 0 20px 20px; color: var(--ink-soft); }
.task-body > :first-child { margin-top: 0; }
.task-body > :last-child { margin-bottom: 0; }
.task-body p { margin: 0 0 12px; }
.task-body ul { display: grid; gap: 6px; margin: 0 0 12px; padding-inline-start: 20px; }
.task-body ul li::marker { color: var(--gold-400); }
.task-tools { display: flex; justify-content: flex-end; margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); }
.task-tools .linkbtn { font-size: 0.875rem; font-weight: 700; color: var(--muted); }
.task-tools .linkbtn:hover { color: var(--forest-700); }

/* Numbered steps, in Persian digits. */
.steps { display: grid; gap: 12px; margin: 0 0 14px; padding: 0; list-style: none; counter-reset: step; }
.steps > li { position: relative; padding-inline-start: 42px; counter-increment: step; }
.steps > li::before {
    content: counter(step, persian);
    position: absolute;
    inset-inline-start: 0;
    top: 0.1em;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--forest-900);
    color: var(--gold-300);
    font-size: 0.875rem;
    font-weight: 800;
    line-height: 1;
}
.steps > li > ul { margin: 8px 0 0; }

/* A button or field label as it appears in the dashboard. */
.ui {
    display: inline-block;
    padding: 0 0.5em;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--paper);
    box-shadow: 0 1px 0 var(--line);
    font-size: 0.92em;
    font-weight: 700;
    line-height: 1.7;
    white-space: nowrap;
    color: var(--forest-800);
}
.ui-gold { border-color: var(--gold-300); background: var(--gold-100); color: var(--gold-700); }

.chip {
    display: inline-block;
    padding: 0 0.6em;
    border-radius: 999px;
    font-size: 0.875em;
    font-weight: 700;
    line-height: 1.8;
    white-space: nowrap;
    background: var(--paper);
    color: var(--ink-soft);
}
.chip-green { background: var(--forest-100); color: var(--forest-800); }
.chip-gold { background: var(--gold-100); color: var(--gold-700); }
.chip-red { background: #F6DEDA; color: #8A2F22; }
.chip-blue { background: #DEE7F3; color: #24476F; }

.note {
    margin: 14px 0 0;
    padding: 12px 16px;
    border-inline-start: 3px solid var(--gold-400);
    border-radius: 10px;
    background: var(--gold-50);
    font-size: 0.96875rem;
    color: var(--ink-soft);
}
.note b:first-child { color: var(--gold-700); }
.note-info { border-color: var(--forest-600); background: #EDF4F0; }
.note-info b:first-child { color: var(--forest-700); }
.note + .note { margin-top: 8px; }

.perm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    padding: 2px 10px;
    border-radius: 8px;
    background: var(--gold-50);
    border: 1px dashed var(--gold-300);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--gold-700);
}

/* Reference tables (permissions, statuses). Scroll sideways on phones instead of squeezing. */
.table-wrap { margin: 4px 0 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.g-table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.75; }
.g-table th,
.g-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.g-table thead th { background: var(--paper); font-size: 0.8125rem; font-weight: 800; color: var(--muted); }
.g-table tbody tr:last-child > * { border-bottom: 0; }
.g-table td:first-child { font-weight: 700; color: var(--ink); }

/* Search */
.task mark { padding: 0 2px; border-radius: 4px; background: var(--gold-100); color: inherit; }
.g-empty {
    margin-top: 32px;
    padding: 36px 24px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    text-align: center;
    color: var(--muted);
}
.g-empty b { display: block; margin-bottom: 4px; font-size: 1.125rem; color: var(--ink); }

/* ───── Help card ───── */
.g-help {
    display: grid;
    gap: 20px;
    margin-top: 72px;
    padding: 28px;
    border-radius: var(--radius);
    background: var(--forest-900);
    color: var(--cream);
}
.g-help h2 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 400; font-size: 1.875rem; line-height: 1.45; }
.g-help p { margin: 0; color: var(--cream-soft); }
.g-help .contact { align-content: start; }
.g-help .contact-line { padding: 14px 20px; }
.g-help .contact-value { font-size: 1.1875rem; }
@media (min-width: 900px) {
    .g-help { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: 40px; padding: 36px 40px; }
}

.g-next { display: grid; gap: 12px; margin-top: 20px; }
@media (min-width: 640px) {
    .g-next { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.g-next .role { padding: 20px 24px; }
.g-next .role-q { font-size: 1.5rem; }

/* ───── Hub page ───── */
.hub-roles { padding-block: 56px 24px; }
.hub-roles .role ul { display: grid; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 0.9375rem; color: var(--muted); }
.hub-roles .role li::before { content: '•'; margin-inline-end: 8px; color: var(--gold-400); }
.hub-roles .role-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 8px;
    border-radius: 16px;
    background: var(--forest-900);
    color: var(--gold-300);
}
.hub-roles .role-icon .icon { width: 26px; height: 26px; }
.hub-basics { padding-block: 48px 88px; }
.hub-basics h2 { margin: 0 0 6px; font-size: 1.5rem; font-weight: 800; }
.hub-basics > .wrap > p { margin: 0 0 24px; color: var(--ink-soft); }
.hub-basics .tasks { max-width: 880px; }

/* ───── Print: every answer open, no chrome ───── */
@media print {
    .site-header, .toc, .g-toolbar, .g-search, .roleswitch, .g-help, .g-next, .site-footer, .task-tools { display: none !important; }
    .g-hero { padding: 0; background: none; color: var(--ink); }
    .g-hero .q, .g-hero .lede { color: var(--ink); }
    .g-layout { display: block; }
    .task { break-inside: avoid; box-shadow: none; }
}
