/* Styling for the HTML rendered from User Guide Markdown files (Content/UserGuide/**).
   This content is injected via @Html.Raw in Pages/Guide/Index.cshtml, so it is never
   part of that page's own markup — Razor's CSS isolation (Index.cshtml.css) can only
   scope literal tags written in the .cshtml file itself, and has no way to tag elements
   that arrive as a raw HTML string at render time. These rules must therefore live in a
   normal, unscoped stylesheet instead of the page's scoped CSS file. */

.guide__section img {
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.guide__section pre {
    background-color: var(--color-bg-subtle);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.guide__section table {
    border-collapse: collapse;
    width: 100%;
}

.guide__section th,
.guide__section td {
    border: 1px solid var(--color-border);
    padding: var(--space-2) var(--space-3);
    text-align: left;
}

.guide__section hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin-block: var(--space-6);
}

.guide__section .last-updated {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-6);
}

.guide__section .callout {
    border-left: 4px solid var(--color-border);
    background-color: var(--color-bg-subtle);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    margin-block: var(--space-4);
}

.guide__section .callout p:last-child,
.guide__section .callout span:last-child {
    margin-bottom: 0;
}

.guide__section .callout::before {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: var(--space-1);
}

.guide__section .callout.info {
    border-left-color: var(--color-accent);
    background-color: rgb(0 113 193 / 0.08);
}

.guide__section .callout.info::before {
    content: "Note";
    color: var(--color-accent);
}

.guide__section .callout.tip {
    border-left-color: #1a7f37;
    background-color: rgb(26 127 55 / 0.08);
}

.guide__section .callout.tip::before {
    content: "Tip";
    color: #1a7f37;
}

.guide__section .callout.warn {
    border-left-color: #b35900;
    background-color: rgb(179 89 0 / 0.08);
}

.guide__section .callout.warn::before {
    content: "Warning";
    color: #b35900;
}

.guide__section .setting-block {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-block: var(--space-4);
    background-color: var(--color-surface);
}

.guide__section .setting-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.guide__section .setting-name {
    font-weight: 700;
}

.guide__section .setting-badge,
.guide__section .badge {
    display: inline-block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background-color: var(--color-bg-subtle);
    color: var(--color-text-muted);
}

.guide__section .badge {
    margin-left: var(--space-2);
    vertical-align: middle;
}

.guide__section .setting-badge.badge-toggle {
    background-color: rgb(0 113 193 / 0.12);
    color: var(--color-accent);
}

.guide__section .setting-badge.badge-select {
    background-color: rgb(124 58 237 / 0.12);
    color: #6d28d9;
}

.guide__section .setting-badge.badge-input {
    background-color: rgb(13 148 136 / 0.12);
    color: #0d9488;
}

.guide__section .badge.optional {
    background-color: rgb(0 113 193 / 0.12);
    color: var(--color-accent);
}

.guide__section .badge.req {
    background-color: rgb(220 38 38 / 0.12);
    color: #dc2626;
}

.guide__section .setting-body p:last-child {
    margin-bottom: 0;
}

.guide__section .tbl-wrap {
    overflow-x: auto;
    margin-block: var(--space-4);
}

.guide__section .tbl-wrap table {
    margin: 0;
}

.guide__section .val {
    text-align: center;
    font-weight: 700;
    color: #1a7f37;
}

.guide__section .val-muted {
    text-align: center;
    color: var(--color-text-muted);
}

.guide__section .example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: var(--space-4);
    margin-block: var(--space-4);
}

.guide__section .example-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    background-color: var(--color-bg-subtle);
}

.guide__section .example-card .card-head,
.guide__section .example-card .card-title,
.guide__section .example-card > strong {
    display: block;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.guide__section .example-card .card-num {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-1);
}

.guide__section .example-card .card-note,
.guide__section .example-card .card-body {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
}

.guide__section .example-card pre {
    margin: 0;
    background-color: var(--color-surface);
}

.guide__section ul.bp-list {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-block: var(--space-4);
}

.guide__section ul.bp-list > li {
    position: relative;
    padding-left: var(--space-6);
}

.guide__section ul.bp-list > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--color-accent);
}

.guide__section ol.flow {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    counter-reset: flow;
    margin-block: var(--space-4);
}

.guide__section ol.flow > li {
    position: relative;
    padding-left: var(--space-8);
    counter-increment: flow;
}

.guide__section ol.flow > li::before {
    content: counter(flow);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background-color: var(--color-accent);
    color: var(--color-accent-contrast);
    font-weight: 700;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide__section .step-row {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    margin-bottom: var(--space-3);
}

.guide__section .step-num {
    flex: 0 0 1.6rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background-color: var(--color-accent);
    color: var(--color-accent-contrast);
    font-weight: 700;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide__section .step-content {
    flex: 1;
    padding-top: 0.1rem;
}

.guide__section .two-col-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    margin-block: var(--space-4);
}

@media (min-width: 40rem) {
    .guide__section .two-col-steps {
        grid-template-columns: 1fr 1fr;
    }
}

.guide__section pre .kw {
    color: var(--color-accent);
    font-weight: 600;
}

.guide__section pre .s {
    color: #1a7f37;
}

.guide__section pre .c {
    color: var(--color-text-muted);
    font-style: italic;
}
