/* ==========================================================================
   HumanProse guides
   Loaded after hp-design.css on the guide pages only. Everything is scoped
   to body.hp-ui.hp-guides and drawn from the --hx-* tokens, so the dark
   theme follows automatically. Logical properties keep Arabic (RTL) right.
   ========================================================================== */

body.hp-ui.hp-guides,
body.hp-ui.hp-guides *,
body.hp-ui.hp-guides *::before,
body.hp-ui.hp-guides *::after { box-sizing: border-box; }
body.hp-ui.hp-guides {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(900px 520px at 0% 0%, color-mix(in srgb, var(--hx-royal) 7%, transparent), transparent 60%),
        radial-gradient(700px 480px at 100% 30%, color-mix(in srgb, var(--hx-quill) 9%, transparent), transparent 60%),
        var(--hx-paper) !important;
    overflow-wrap: break-word;
}
body.hp-ui.hp-guides .hpg-main {
    flex: 1 0 auto;
    width: min(1200px, 100%);
    margin-inline: auto;
    padding: 18px 20px 0;
}

/* ---------- Skip link ---------- */
body.hp-ui.hp-guides .hpg-skip {
    position: absolute; inset-inline-start: 16px; top: -60px; z-index: 100;
    padding: 10px 16px; border-radius: 999px;
    background: var(--hx-royal); color: #fff; font-weight: 700; text-decoration: none;
}
body.hp-ui.hp-guides .hpg-skip:focus { top: 12px; }

/* ---------- Header: the same floating pill as the home page ---------- */
body.hp-ui.hp-guides .hpg-header { position: sticky; top: 0; z-index: 50; padding: 12px 20px 0; }
body.hp-ui.hp-guides .hpg-header-bar {
    width: min(1200px, 100%); margin-inline: auto; height: 64px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding-inline: 18px 8px;
    background: var(--hx-glass);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid var(--hx-line); border-radius: 999px; box-shadow: var(--hx-shadow);
}
body.hp-ui.hp-guides .hpg-brand { display: flex; align-items: center; min-width: 0; flex: 0 1 auto; }
body.hp-ui.hp-guides .hpg-nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
body.hp-ui.hp-guides .hpg-nav-link {
    padding: 10px 14px; border-radius: 999px; text-decoration: none;
    color: var(--hx-ink-2); font-weight: 600; font-size: .9rem; white-space: nowrap;
    transition: background-color .2s ease, color .2s ease;
}
body.hp-ui.hp-guides .hpg-nav-link:hover { color: var(--hx-ink); background: var(--hx-surface-2); }
body.hp-ui.hp-guides .hpg-nav-link[aria-current="page"] { color: var(--hx-royal-ink); background: var(--hx-royal-soft); }
body.hp-ui.hp-guides .hpg-header-cta { padding: 11px 18px; font-size: .88rem; }
html[data-hp-theme="dark"] body.hp-ui.hp-guides :is(.hpg-header, .hpg-footer) .hp-logo { content: var(--hx-logo-light); }

/* ---------- Forest banner: title, reading time and date ---------- */
body.hp-ui.hp-guides .hpg-banner {
    position: relative; isolation: isolate; overflow: hidden;
    margin-top: 10px;
    padding: clamp(30px, 6vw, 72px) clamp(22px, 6vw, 72px) clamp(32px, 5vw, 60px);
    border-radius: 30px;
    background:
        radial-gradient(620px 420px at 18% 0%, rgba(42, 122, 92, .38), transparent 62%),
        radial-gradient(420px 300px at 85% 110%, rgba(184, 137, 74, .16), transparent 60%),
        linear-gradient(165deg, #12503e 0%, #0b392f 42%, #04170f 100%);
    color: var(--hx-on-stage);
    border: 1px solid var(--hx-stage-line);
    box-shadow: var(--hx-shadow-lg);
}
/* The lighter band with its brass seam, as on the sign-in card and the app banners */
body.hp-ui.hp-guides .hpg-banner::after {
    content: ""; position: absolute; z-index: -1; pointer-events: none;
    inset-block: -6%; inset-inline-start: 68%; inset-inline-end: -14%;
    background: linear-gradient(165deg, #155a45 0%, #0d3e31 55%, #062419 100%);
    border-inline-start: 1.5px solid rgba(240, 214, 170, .75);
    box-shadow: -40px 0 70px -40px rgba(0, 0, 0, .65);
    transform-origin: 0 100%; transform: skewX(-9deg);
}
[dir="rtl"] body.hp-ui.hp-guides .hpg-banner::after {
    transform-origin: 100% 100%; transform: skewX(9deg);
    box-shadow: 40px 0 70px -40px rgba(0, 0, 0, .65);
}
body.hp-ui.hp-guides .hpg-banner > * { position: relative; max-width: 62ch; }
body.hp-ui.hp-guides .hpg-banner .hp-kicker { color: var(--hx-cream) !important; margin: 0 0 14px; }
body.hp-ui.hp-guides .hpg-banner-title {
    margin: 0; max-width: 20ch;
    font-size: clamp(2.3rem, 5.4vw, 4.4rem) !important; line-height: 1.04;
    color: var(--hx-on-stage); text-wrap: balance;
}
body.hp-ui.hp-guides .hpg-banner .hp-display em { color: var(--hx-cream); }
body.hp-ui.hp-guides .hpg-banner-lead { margin: 20px 0 0; font-size: 1.08rem; line-height: 1.65; color: var(--hx-on-stage-2); max-width: 58ch; }
body.hp-ui.hp-guides .hpg-banner-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    margin: 26px 0 0; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .14);
    font-size: .88rem; font-weight: 600; color: var(--hx-on-stage-2); font-variant-numeric: tabular-nums;
}
body.hp-ui.hp-guides .hpg-banner-meta time { color: var(--hx-on-stage); }

/* Breadcrumbs inside the banner */
body.hp-ui.hp-guides .hpg-crumbs { margin-bottom: 26px; }
body.hp-ui.hp-guides .hpg-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .84rem; color: var(--hx-on-stage-2); }
body.hp-ui.hp-guides .hpg-crumbs li { display: inline-flex; gap: 8px; min-width: 0; }
body.hp-ui.hp-guides .hpg-crumbs li + li::before { content: "/"; color: rgba(240, 214, 170, .55); }
body.hp-ui.hp-guides .hpg-crumbs a { color: var(--hx-on-stage); text-decoration: none; border-bottom: 1px solid rgba(240, 214, 170, .35); }
body.hp-ui.hp-guides .hpg-crumbs a:hover { border-bottom-color: var(--hx-cream); }
body.hp-ui.hp-guides .hpg-crumbs [aria-current="page"] { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Article typography ---------- */
body.hp-ui.hp-guides .hpg-article { display: block; }
body.hp-ui.hp-guides .hpg-prose {
    max-width: 68ch; margin: clamp(40px, 6vw, 64px) auto 0;
    font-size: 1.09rem; line-height: 1.75; color: var(--hx-ink);
}
body.hp-ui.hp-guides .hpg-prose > :first-child { margin-top: 0; }
body.hp-ui.hp-guides .hpg-prose p { margin: 0 0 1.1em; }
body.hp-ui.hp-guides .hpg-prose .hpg-lede { font-size: 1.24rem; line-height: 1.65; color: var(--hx-ink); margin-bottom: 1.4em; }
body.hp-ui.hp-guides .hpg-prose h2 {
    margin: 2.2em 0 .55em;
    font-family: var(--hx-f-display) !important; font-weight: 400;
    font-size: clamp(1.75rem, 3.2vw, 2.2rem); line-height: 1.15; letter-spacing: -.005em;
    color: var(--hx-ink); text-wrap: balance;
}
body.hp-ui.hp-guides .hpg-prose h3 { margin: 1.8em 0 .5em; font-size: 1.15rem; font-weight: 700; color: var(--hx-ink); }
body.hp-ui.hp-guides .hpg-prose strong { font-weight: 700; color: var(--hx-ink); }
body.hp-ui.hp-guides .hpg-prose a { color: var(--hx-royal-ink); text-decoration-color: color-mix(in srgb, var(--hx-quill) 60%, transparent); text-underline-offset: 4px; }
body.hp-ui.hp-guides .hpg-prose :is(ul, ol) { margin: 0 0 1.3em; padding-inline-start: 1.4em; }
body.hp-ui.hp-guides .hpg-prose li { margin: 0 0 .5em; padding-inline-start: .2em; }
body.hp-ui.hp-guides .hpg-prose li::marker { color: var(--hx-quill); font-weight: 700; }
body.hp-ui.hp-guides .hpg-prose [lang="en"] { font-family: "HP Sans", "Segoe UI", system-ui, sans-serif; }

/* Before / After: a calm two-row block */
body.hp-ui.hp-guides .hpg-example {
    margin: 1.5em 0 1.8em; overflow: hidden;
    background: var(--hx-surface); border: 1px solid var(--hx-line); border-radius: 18px;
    box-shadow: var(--hx-shadow);
}
body.hp-ui.hp-guides .hpg-example-row {
    display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 4px 18px; align-items: baseline;
    padding: 16px 20px; border-inline-start: 3px solid transparent;
}
body.hp-ui.hp-guides .hpg-example-row + .hpg-example-row { border-top: 1px solid var(--hx-line); }
body.hp-ui.hp-guides .hpg-example-row.is-before { background: var(--hx-surface-2); }
body.hp-ui.hp-guides .hpg-example-row.is-after { border-inline-start: 3px solid var(--hx-quill); }
body.hp-ui.hp-guides .hpg-example-label {
    font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--hx-ink-3);
}
body.hp-ui.hp-guides .is-after .hpg-example-label { color: var(--hx-quill-ink); }
body.hp-ui.hp-guides .hpg-prose .hpg-example-text {
    margin: 0; min-width: 0; text-align: start;
    font-family: var(--hx-f-display); font-size: 1.22rem; line-height: 1.5; color: var(--hx-ink-2);
}
body.hp-ui.hp-guides .hpg-prose .is-after .hpg-example-text { color: var(--hx-ink); }
body.hp-ui.hp-guides .hpg-example-note {
    padding: 12px 20px 14px; border-top: 1px dashed var(--hx-line-2);
    font-size: .92rem; line-height: 1.6; color: var(--hx-ink-2);
}

/* Tip */
body.hp-ui.hp-guides .hpg-tip {
    margin: 2em 0; padding: 18px 22px; border-radius: 16px;
    background: var(--hx-quill-soft); color: var(--hx-quill-ink);
    border-inline-start: 3px solid var(--hx-quill);
}
body.hp-ui.hp-guides .hpg-prose .hpg-tip p { margin: 0; font-size: .98rem; line-height: 1.65; }
body.hp-ui.hp-guides .hpg-prose .hpg-tip strong { color: inherit; }

/* ---------- Call to action ---------- */
body.hp-ui.hp-guides .hpg-cta {
    position: relative; overflow: hidden;
    max-width: 68ch; margin: 56px auto 0; padding: 30px clamp(22px, 4vw, 36px) 32px;
    font-size: 1.09rem; /* same as the prose, so 68ch lines up with the article column */
    background: var(--hx-surface); border: 1px solid var(--hx-line); border-radius: 26px;
    border-inline-start: 3px solid var(--hx-quill);
    box-shadow: var(--hx-shadow);
}
body.hp-ui.hp-guides .hpg-cta.is-wide { max-width: none; margin-top: 64px; }
body.hp-ui.hp-guides .hpg-cta .hp-kicker { margin: 0 0 10px; }
body.hp-ui.hp-guides .hpg-cta h2 { margin: 0; font-size: clamp(1.9rem, 3.6vw, 2.6rem) !important; color: var(--hx-ink); text-wrap: balance; }
body.hp-ui.hp-guides .hpg-cta p:not(.hp-kicker) { margin: 12px 0 22px; font-size: 1rem; color: var(--hx-ink-2); line-height: 1.65; max-width: 58ch; }
body.hp-ui.hp-guides .hpg-cta .hp-btn { white-space: normal; text-align: center; }

/* ---------- Cards (index and "more guides") ---------- */
body.hp-ui.hp-guides .hpg-list { margin-top: 28px; }
body.hp-ui.hp-guides .hpg-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
body.hp-ui.hp-guides .hpg-cards.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.hp-ui.hp-guides .hpg-card {
    position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0;
    padding: 28px 26px 24px;
    background: var(--hx-surface); border: 1px solid var(--hx-line); border-radius: 24px;
    transition: border-color .2s ease, transform .25s var(--hx-ease), box-shadow .25s ease;
}
body.hp-ui.hp-guides .hpg-card:hover { border-color: color-mix(in srgb, var(--hx-quill) 70%, transparent); transform: translateY(-2px); box-shadow: var(--hx-shadow); }
body.hp-ui.hp-guides .hpg-card:focus-within { border-color: var(--hx-quill); }
body.hp-ui.hp-guides .hpg-card-n { margin: 0; font-family: var(--hx-f-display); font-size: 2.6rem; line-height: 1; color: var(--hx-royal-ink); }
body.hp-ui.hp-guides .hpg-card-title { margin: 0; font-size: clamp(1.45rem, 2.2vw, 1.7rem) !important; line-height: 1.15 !important; color: var(--hx-ink); }
body.hp-ui.hp-guides .hpg-card-title a { color: inherit; text-decoration: none; }
body.hp-ui.hp-guides .hpg-card-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
body.hp-ui.hp-guides .hpg-card-title a:focus-visible { outline: none !important; }
body.hp-ui.hp-guides .hpg-card:has(a:focus-visible) { outline: 2px solid var(--hx-quill); outline-offset: 3px; }
body.hp-ui.hp-guides .hpg-card-copy { margin: 0; flex: 1; color: var(--hx-ink-2); font-size: .95rem; line-height: 1.6; }
body.hp-ui.hp-guides .hpg-card-meta {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 14px;
    margin: 6px 0 0; padding-top: 14px; border-top: 1px dashed var(--hx-line-2);
    font-size: .84rem; font-weight: 600; color: var(--hx-ink-3); font-variant-numeric: tabular-nums;
}
body.hp-ui.hp-guides .hpg-card-more { display: inline-flex; align-items: center; gap: 6px; color: var(--hx-royal-ink); }
body.hp-ui.hp-guides .hpg-card-more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--hx-ease); }
body.hp-ui.hp-guides .hpg-card:hover .hpg-card-more svg { transform: translateX(3px); }
[dir="rtl"] body.hp-ui.hp-guides .hpg-card-more svg { transform: scaleX(-1); }
[dir="rtl"] body.hp-ui.hp-guides .hpg-card:hover .hpg-card-more svg { transform: scaleX(-1) translateX(3px); }

body.hp-ui.hp-guides .hpg-related { margin-top: 80px; }
body.hp-ui.hp-guides .hpg-related > h2 { margin: 0 0 22px; font-size: clamp(2rem, 4vw, 2.8rem) !important; color: var(--hx-ink); }

/* ---------- Footer ---------- */
body.hp-ui.hp-guides .hpg-footer { margin-top: 96px; background: var(--hx-surface); border-top: 1px solid var(--hx-line); }
body.hp-ui.hp-guides .hpg-footer-inner {
    width: min(1200px, 100%); margin-inline: auto; padding: 34px 20px 30px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: start;
}
body.hp-ui.hp-guides .hpg-footer-brand .hp-logo { height: 30px !important; }
body.hp-ui.hp-guides .hpg-footer-brand p { margin: 12px 0 0; max-width: 46ch; color: var(--hx-ink-2); font-size: .92rem; line-height: 1.6; }
body.hp-ui.hp-guides .hpg-footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .92rem; font-weight: 600; }
body.hp-ui.hp-guides .hpg-footer-links a { color: var(--hx-ink-2); text-decoration: none; }
body.hp-ui.hp-guides .hpg-footer-links a:hover { color: var(--hx-ink); }
body.hp-ui.hp-guides .hpg-footer-copy { grid-column: 1 / -1; margin: 0; padding-top: 16px; border-top: 1px solid var(--hx-line); color: var(--hx-ink-3); font-size: .82rem; }

/* ---------- Arabic ---------- */
html[lang="ar"] body.hp-ui.hp-guides .hpg-prose { line-height: 1.95; }
html[lang="ar"] body.hp-ui.hp-guides .hpg-prose .hpg-lede { line-height: 1.85; }
html[lang="ar"] body.hp-ui.hp-guides .hpg-prose h2 { font-weight: 700; line-height: 1.4; letter-spacing: 0; }
html[lang="ar"] body.hp-ui.hp-guides .hpg-banner-title { line-height: 1.3 !important; max-width: 22ch; }
html[lang="ar"] body.hp-ui.hp-guides :is(.hpg-card-title, .hpg-cta h2, .hpg-related > h2) { line-height: 1.35 !important; }
html[lang="ar"] body.hp-ui.hp-guides .hpg-example-label { letter-spacing: 0; font-size: .82rem; }
html[lang="ar"] body.hp-ui.hp-guides .hpg-prose .hpg-example-text {
    font-family: "HP Display", "Iowan Old Style", Georgia, serif; text-align: left; line-height: 1.5;
}
html[lang="ar"] body.hp-ui.hp-guides .hpg-prose [lang="en"] { unicode-bidi: isolate; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    body.hp-ui.hp-guides .hpg-cards, body.hp-ui.hp-guides .hpg-cards.is-two { grid-template-columns: 1fr; }
    body.hp-ui.hp-guides .hpg-banner::after { inset-inline-start: 82%; }
}
@media (max-width: 640px) {
    body.hp-ui.hp-guides .hpg-header { padding: 10px 12px 0; }
    body.hp-ui.hp-guides .hpg-header-bar { height: 58px; padding-inline: 14px 6px; gap: 8px; }
    body.hp-ui.hp-guides .hpg-header .hp-logo { height: 28px !important; }
    body.hp-ui.hp-guides .hpg-header-cta { display: none; }
    body.hp-ui.hp-guides .hpg-nav { gap: 4px; }
    body.hp-ui.hp-guides .hpg-nav-link { padding: 9px 10px; }
    body.hp-ui.hp-guides .hpg-main { padding-inline: 12px; }
    body.hp-ui.hp-guides .hpg-banner { border-radius: 24px; }
    body.hp-ui.hp-guides .hpg-banner::after { display: none; }
    body.hp-ui.hp-guides .hpg-banner-lead { font-size: 1rem; }
    body.hp-ui.hp-guides .hpg-prose { font-size: 1.03rem; padding-inline: 4px; }
    body.hp-ui.hp-guides .hpg-prose .hpg-lede { font-size: 1.12rem; }
    body.hp-ui.hp-guides .hpg-example-row { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
    body.hp-ui.hp-guides .hpg-prose .hpg-example-text { font-size: 1.12rem; }
    body.hp-ui.hp-guides .hpg-example-note { padding-inline: 16px; }
    body.hp-ui.hp-guides .hpg-card { padding: 22px 20px 20px; }
    body.hp-ui.hp-guides .hpg-cta .hp-btn { width: 100%; }
    body.hp-ui.hp-guides .hpg-footer-inner { grid-template-columns: minmax(0, 1fr); padding-inline: 16px; }
}
/* Phones: logo, two links and the language/theme switches must fit inside the pill (they ran ~7px past it at 390px). */
@media (max-width: 420px) {
    body.hp-ui.hp-guides .hpg-header-bar { padding-inline: 12px 6px; gap: 6px; }
    body.hp-ui.hp-guides .hpg-header .hp-logo { height: 22px !important; }
    body.hp-ui.hp-guides .hpg-nav { gap: 2px; }
    body.hp-ui.hp-guides .hpg-nav-link { padding-inline: 6px; font-size: .86rem; }
}
@media (max-width: 360px) {
    body.hp-ui.hp-guides .hpg-header-bar { padding-inline: 10px 4px; }
    body.hp-ui.hp-guides .hpg-header .hp-logo { height: 20px !important; }
    body.hp-ui.hp-guides .hpg-nav-link { padding-inline: 5px; font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
    body.hp-ui.hp-guides :is(.hpg-card, .hpg-card-more svg, .hpg-nav-link) { transition: none !important; }
    body.hp-ui.hp-guides .hpg-card:hover { transform: none; }
}

@media print {
    body.hp-ui.hp-guides :is(.hpg-header, .hpg-footer, .hpg-related, .hpg-cta, .hp-help) { display: none !important; }
    body.hp-ui.hp-guides .hpg-banner { background: none; color: #000; box-shadow: none; border: 0; padding: 0; }
    body.hp-ui.hp-guides .hpg-banner::after { display: none; }
}

/* ==========================================================================
   Guides written in the admin (Markdown)
   The renderer emits plain elements; these give them the same reading
   rhythm as the hand-written guides.
   ========================================================================== */
body.hp-ui.hp-guides .hpg-prose h4 { margin: 1.6em 0 .4em; font-size: 1.02rem; font-weight: 700; color: var(--hx-ink); }
body.hp-ui.hp-guides .hpg-prose :is(h2, h3) { scroll-margin-top: 100px; }
body.hp-ui.hp-guides .hpg-prose blockquote {
    margin: 1.8em 0; padding: 16px 22px; border-radius: 16px;
    background: var(--hx-quill-soft); color: var(--hx-quill-ink);
    border-inline-start: 3px solid var(--hx-quill);
}
body.hp-ui.hp-guides .hpg-prose blockquote > :last-child { margin-bottom: 0; }
body.hp-ui.hp-guides .hpg-prose blockquote :is(p, strong, em) { color: inherit; }
body.hp-ui.hp-guides .hpg-prose :not(pre) > code {
    padding: .1em .4em; border-radius: 6px; background: var(--hx-surface-2); border: 1px solid var(--hx-line);
    font-family: var(--hx-f-mono); font-size: .88em; direction: ltr; unicode-bidi: isolate;
}
body.hp-ui.hp-guides .hpg-prose pre {
    margin: 1.5em 0; padding: 16px 20px; overflow-x: auto; border-radius: 16px;
    background: var(--hx-surface); border: 1px solid var(--hx-line); direction: ltr; text-align: left;
    font-family: var(--hx-f-mono); font-size: .9rem; line-height: 1.6;
}
body.hp-ui.hp-guides .hpg-prose img { display: block; max-width: 100%; height: auto; margin: 1.6em auto; border-radius: 16px; border: 1px solid var(--hx-line); }
body.hp-ui.hp-guides .hpg-prose hr { margin: 2.4em auto; width: 96px; border: 0; border-top: 1px solid var(--hx-quill); }
body.hp-ui.hp-guides .hpg-prose .hpg-table { margin: 1.5em 0 1.8em; overflow-x: auto; border-radius: 16px; border: 1px solid var(--hx-line); background: var(--hx-surface); }
body.hp-ui.hp-guides .hpg-prose table { width: 100%; border-collapse: collapse; font-size: .96rem; line-height: 1.55; }
body.hp-ui.hp-guides .hpg-prose :is(th, td) { padding: 11px 16px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--hx-line); }
body.hp-ui.hp-guides .hpg-prose th { background: var(--hx-surface-2); font-weight: 700; color: var(--hx-ink); }
body.hp-ui.hp-guides .hpg-prose tr:last-child td { border-bottom: 0; }
body.hp-ui.hp-guides .hpg-prose del { color: var(--hx-ink-3); }
body.hp-ui.hp-guides .hpg-prose input[type="checkbox"] { accent-color: var(--hx-royal); margin-inline-end: 6px; }

/* Table of contents, above the article */
body.hp-ui.hp-guides .hpg-toc {
    max-width: 68ch; margin: clamp(32px, 5vw, 48px) auto 0; padding: 20px 24px 18px;
    font-size: 1.09rem; /* so 68ch matches the prose column */
    background: var(--hx-surface); border: 1px solid var(--hx-line); border-radius: 20px;
}
body.hp-ui.hp-guides .hpg-toc-title { margin: 0 0 10px; font-size: .74rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--hx-quill-ink); }
body.hp-ui.hp-guides .hpg-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: hpg-toc; display: grid; gap: 4px; }
body.hp-ui.hp-guides .hpg-toc li { counter-increment: hpg-toc; display: flex; gap: 12px; font-size: .95rem; line-height: 1.5; }
body.hp-ui.hp-guides .hpg-toc li::before { content: counter(hpg-toc, decimal-leading-zero); flex: none; min-width: 1.8em; font-family: var(--hx-f-display); color: var(--hx-royal-ink); }
body.hp-ui.hp-guides .hpg-toc li.is-sub { counter-increment: none; padding-inline-start: 2.6em; font-size: .9rem; }
body.hp-ui.hp-guides .hpg-toc li.is-sub::before { content: "–"; min-width: auto; color: var(--hx-ink-3); }
body.hp-ui.hp-guides .hpg-toc a { color: var(--hx-ink-2); text-decoration: none; border-bottom: 1px solid transparent; }
body.hp-ui.hp-guides .hpg-toc a:hover { color: var(--hx-ink); border-bottom-color: var(--hx-quill); }
body.hp-ui.hp-guides .hpg-toc + .hpg-prose { margin-top: 36px; }
html[lang="ar"] body.hp-ui.hp-guides .hpg-toc-title { letter-spacing: 0; font-size: .86rem; }

/* Category on cards; the Arabic note on English-only guides */
body.hp-ui.hp-guides .hpg-card-category { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--hx-quill-ink); }
html[lang="ar"] body.hp-ui.hp-guides .hpg-card-category { letter-spacing: 0; font-size: .82rem; }
body.hp-ui.hp-guides .hpg-lang-note { display: none; }
html[lang="ar"] body.hp-ui.hp-guides .hpg-lang-note {
    display: block; max-width: 68ch; margin: 28px auto 0; padding: 12px 18px; border-radius: 14px;
    font-size: 1.09rem; background: var(--hx-quill-soft); color: var(--hx-quill-ink); text-align: right;
}
@media (max-width: 640px) {
    body.hp-ui.hp-guides .hpg-toc { padding: 16px 18px; font-size: 1.03rem; }
}
