/* Product documentation (docs/<product>/): sidebar, article, "On this page". Loaded after site.css, uses its tokens. */

.docs {
    --side: 272px; --toc: 220px;
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 0;
    max-width: 1400px; margin: 0 auto; padding: 0 16px;
}
@media (min-width: 960px) {
    .docs { grid-template-columns: var(--side) minmax(0, 1fr); gap: 40px; padding: 0 24px; }
}
@media (min-width: 1240px) {
    .docs { grid-template-columns: var(--side) minmax(0, 1fr) var(--toc); }
}

/* ---------- Sidebar ---------- */
.doc-side {
    position: sticky; top: 64px; align-self: start;
    height: calc(100vh - 64px); overflow-y: auto; overscroll-behavior: contain;
    padding: 24px 4px 32px 0; border-inline-end: 1px solid var(--border);
}
.doc-side-head { display: grid; gap: 14px; margin-bottom: 18px; padding-inline-end: 16px; }
.doc-product { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.doc-product .product-tile { width: 40px; height: 40px; border-radius: 11px; }
.doc-product b { display: block; font-size: 16px; }
.doc-product small { display: block; font-size: 13px; color: var(--text-3); }

.doc-search { position: relative; }
.doc-search svg { position: absolute; inset-inline-start: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.doc-search input {
    width: 100%; padding: 9px 12px; padding-inline-start: 34px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
.doc-search input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; background: var(--card); }
.doc-results {
    position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 30;
    max-height: 60vh; overflow-y: auto; padding: 6px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.doc-results a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.doc-results a:hover, .doc-results a.active { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.doc-results b { display: block; font-size: 14px; }
.doc-results small { display: block; font-size: 12px; color: var(--text-3); }
.doc-results span { display: block; font-size: 13px; color: var(--text-2); margin-top: 2px; line-height: 1.45; }
.doc-results mark { background: color-mix(in srgb, var(--cyan) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.doc-results p { margin: 0; padding: 10px; font-size: 14px; color: var(--text-3); }

.doc-nav { display: grid; gap: 2px; font-size: 14.5px; }
.doc-nav a { display: block; padding: 6px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; }
.doc-nav a:hover { color: var(--text); background: var(--surface); }
.doc-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.doc-home { font-weight: 600; }
.doc-group summary {
    list-style: none; cursor: pointer; padding: 8px 12px; margin-top: 6px; border-radius: 8px;
    font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3);
    display: flex; align-items: center; justify-content: space-between;
}
html[dir="rtl"] .doc-group summary { letter-spacing: 0; }
.doc-group summary::-webkit-details-marker { display: none; }
.doc-group summary::after { content: ""; width: 7px; height: 7px; border-inline-end: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
html[dir="rtl"] .doc-group summary::after { transform: rotate(45deg); }
.doc-group[open] summary::after { transform: rotate(45deg); }
html[dir="rtl"] .doc-group[open] summary::after { transform: rotate(-45deg); }
.doc-group summary:hover { color: var(--text); }
.doc-group ul { list-style: none; margin: 2px 0 4px; padding: 0; padding-inline-start: 8px; border-inline-start: 1px solid var(--border); margin-inline-start: 12px; }

/* Phones and tablets: the sidebar is a drawer opened by the "Contents" button */
.doc-menu-btn { display: none; }
@media (max-width: 959px) {
    .doc-menu-btn {
        display: inline-flex; align-items: center; gap: 8px; margin: 16px 0 0; padding: 8px 14px;
        border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
    }
    .doc-menu-btn svg { width: 18px; height: 18px; }
    .doc-side {
        position: fixed; top: 64px; inset-inline-start: 0; z-index: 45; width: min(320px, 86vw);
        padding: 20px 16px 32px; background: var(--bg); border-inline-end: 1px solid var(--border);
        box-shadow: var(--shadow); transform: translateX(-105%); transition: transform .2s ease; visibility: hidden;
    }
    html[dir="rtl"] .doc-side { transform: translateX(105%); }
    .doc-side.open { transform: none !important; visibility: visible; }
    .doc-side-head { padding-inline-end: 0; }
}

/* ---------- Article ---------- */
.doc-main { min-width: 0; padding: 28px 0 56px; max-width: 800px; }
.doc-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-3); margin-bottom: 14px; }
.doc-crumbs a { color: var(--text-2); text-decoration: none; }
.doc-crumbs a:hover { color: var(--accent); }
.doc-main h1 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 800; margin-bottom: 12px; }
.doc-lead { font-size: 18px; color: var(--text-2); margin-bottom: 28px; }

.doc-body { color: var(--text-2); }
.doc-body h2 { position: relative; font-size: 23px; color: var(--text); margin: 44px 0 14px; padding-top: 8px; scroll-margin-top: 80px; }
.doc-body h3 { font-size: 18px; color: var(--text); margin: 28px 0 10px; scroll-margin-top: 80px; }
.doc-body strong { color: var(--text); }
.doc-body ul, .doc-body ol { padding-inline-start: 22px; }
.doc-body li { margin: 6px 0; }
.doc-body code, .doc-body kbd { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .88em; }
.doc-body code { padding: 1px 6px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.doc-body kbd { padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border); border-bottom-width: 2px; background: var(--card); color: var(--text); }
.doc-anchor { margin-inline-start: 8px; color: var(--text-3); text-decoration: none; opacity: 0; font-weight: 400; }
.doc-body h2:hover .doc-anchor { opacity: 1; }

/* Names of buttons, menus and fields, as they appear in Fiscal */
.ui { font-weight: 600; color: var(--text); white-space: nowrap; }
.path { font-weight: 600; color: var(--text); }
.path .sep { color: var(--text-3); font-weight: 400; margin: 0 4px; }

/* Numbered steps */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 18px 0 24px; display: grid; gap: 14px; }
ol.steps > li { counter-increment: step; position: relative; padding-inline-start: 44px; margin: 0; min-height: 30px; }
ol.steps > li::before {
    content: counter(step); position: absolute; inset-inline-start: 0; top: -1px;
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: var(--gradient); color: #ffffff; font-size: 14px; font-weight: 700;
}

/* Notes: tip, info, warning */
.note { margin: 20px 0; padding: 14px 16px; padding-inline-start: 48px; position: relative; border-radius: var(--radius-sm); border: 1px solid; font-size: 15px; }
.note::before { position: absolute; inset-inline-start: 16px; top: 13px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #ffffff; }
.note > :last-child { margin-bottom: 0; }
.note b:first-child { color: var(--text); }
.note.tip { background: color-mix(in srgb, #12b76a 8%, transparent); border-color: color-mix(in srgb, #12b76a 35%, transparent); }
.note.tip::before { content: "✓"; background: #12b76a; }
.note.info { background: color-mix(in srgb, var(--accent) 7%, transparent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.note.info::before { content: "i"; background: var(--accent); font-family: Georgia, serif; }
.note.warn { background: color-mix(in srgb, #f79009 9%, transparent); border-color: color-mix(in srgb, #f79009 40%, transparent); }
.note.warn::before { content: "!"; background: #f79009; }

/* Field tables */
.doc-table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 15px; }
.doc-table-wrap { overflow-x: auto; margin: 16px 0 24px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.doc-table-wrap .doc-table { margin: 0; }
.doc-table th, .doc-table td { text-align: start; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.doc-table th { background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 700; }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }
@media (max-width: 600px) { .doc-table td:first-child { white-space: normal; } }

.doc-shot { margin: 20px 0 28px; }
.doc-shot img { width: 100%; }

/* "Related pages" and the guide's home page */
.doc-related { margin-top: 36px; padding: 18px 20px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.doc-related h2 { margin: 0 0 8px !important; padding: 0 !important; font-size: 16px !important; }
.doc-related ul { margin: 0; }
.doc-chapters { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); margin: 28px 0; }
.doc-chapter { position: relative; padding: 22px; }
.doc-chapter-no { font-size: 13px; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.doc-chapter h3 { margin: 4px 0 6px; font-size: 18px; }
.doc-chapter h3 a { color: var(--text); text-decoration: none; }
.doc-chapter h3 a:hover { color: var(--accent); }
.doc-chapter p { font-size: 14.5px; }
.doc-chapter ul { list-style: none; padding: 0; margin: 12px 0 0; font-size: 14.5px; }
.doc-chapter li { margin: 4px 0; }
.doc-chapter li a { text-decoration: none; }
.doc-chapter li a:hover { text-decoration: underline; }
.doc-start { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 8px; }

.doc-help { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 15px; color: var(--text-2); }
.doc-help b { color: var(--text); }

.doc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.doc-pager a { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none; background: var(--card); transition: border-color .15s, transform .15s; }
.doc-pager a:hover { border-color: var(--accent); transform: translateY(-1px); }
.doc-pager span { display: block; font-size: 13px; color: var(--text-3); }
.doc-pager b { display: block; color: var(--text); font-size: 15.5px; }
.doc-pager .next { text-align: end; }
.doc-pager .prev span::before { content: "← "; }
.doc-pager .next span::after { content: " →"; }
html[dir="rtl"] .doc-pager .prev span::before { content: "→ "; }
html[dir="rtl"] .doc-pager .next span::after { content: " ←"; }
@media (max-width: 600px) { .doc-pager { grid-template-columns: 1fr; } }

/* ---------- On this page ---------- */
.doc-toc { display: none; }
@media (min-width: 1240px) {
    .doc-toc { display: block; position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; padding: 32px 0; font-size: 13.5px; }
    .doc-toc p { margin: 0 0 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
    .doc-toc ul { list-style: none; margin: 0; padding: 0; border-inline-start: 1px solid var(--border); }
    .doc-toc a { display: block; padding: 4px 12px; margin-inline-start: -1px; border-inline-start: 2px solid transparent; color: var(--text-2); text-decoration: none; }
    .doc-toc a:hover { color: var(--text); }
    .doc-toc a.active { color: var(--accent); border-inline-start-color: var(--accent); font-weight: 600; }
}

/* ---------- Print: the article only ---------- */
@media print {
    .site-header, .site-footer, .wa-float, .doc-side, .doc-menu-btn, .doc-toc, .doc-pager, .doc-help, .doc-anchor, .skip-link { display: none !important; }
    .docs { display: block; padding: 0; }
    .doc-main { max-width: none; padding: 0; }
    body { background: #ffffff; color: #000000; }
    .doc-body, .doc-lead { color: #222222; }
    a { color: inherit; }
    .note, .doc-table-wrap, .doc-shot { break-inside: avoid; }
}

/* The header and footer span the same width as the docs layout, so the logo lines up with the sidebar */
.site-header .container, .site-footer .container { max-width: 1400px; }
