.fluxmath-public-guide {
    border: 1px solid var(--border);
    border-top: 2px solid var(--accent);
    padding: 1.2rem;
    background: var(--surface-raised);
}

.fluxmath-public-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 25rem);
    gap: .35rem 1.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.fluxmath-public-heading h3 { margin: 0; }
.fluxmath-public-heading p {
    grid-column: 1;
    margin: 0;
    color: var(--secondary);
}

.fluxmath-public-heading input {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 100%;
    min-height: 2.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: .55rem .7rem;
    color: var(--text);
    background: var(--surface);
}

.fluxmath-public-layout {
    display: grid;
    grid-template-columns: minmax(10rem, 15rem) minmax(0, 1fr);
    gap: 1.25rem;
    min-width: 0;
}

.fluxmath-public-toc {
    position: sticky;
    top: 6rem;
    align-self: start;
    max-height: 70vh;
    overflow: auto;
    border-right: 1px solid var(--border);
    padding-right: .9rem;
}

.fluxmath-public-toc h4 { margin: 0 0 .45rem; }
.fluxmath-public-toc button {
    display: block;
    width: 100%;
    min-height: 2.75rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: .45rem .6rem;
    color: var(--secondary);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.fluxmath-public-toc button:hover,
.fluxmath-public-toc button:focus-visible {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--surface-muted);
}

.fluxmath-public-content {
    min-width: 0;
    max-height: 70vh;
    overflow: auto;
    padding-right: .65rem;
    overscroll-behavior: contain;
}

.fluxmath-public-doc-section {
    scroll-margin-top: 6rem;
    margin-bottom: 2rem;
}

.fluxmath-public-doc-section h3 { margin-top: 0; }
.fluxmath-public-doc-section p,
.fluxmath-public-doc-section li { color: var(--secondary); }
.fluxmath-public-summary,
.fluxmath-public-caption { font-size: .9rem; }

.fluxmath-public-code {
    margin: .8rem 0 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .7rem;
    background: var(--surface);
}

.fluxmath-public-code-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.fluxmath-public-code-actions button {
    min-height: 2.5rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: .35rem .65rem;
    color: var(--text);
    background: var(--surface-muted);
    cursor: pointer;
}

.fluxmath-public-code pre {
    max-height: 18rem;
    margin: .6rem 0 0;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.fluxmath-public-callout {
    margin: 1rem 0;
    border-left: 3px solid var(--accent);
    padding: .7rem .9rem;
    background: var(--surface-muted);
}

.fluxmath-public-callout[data-tone="warning"] { border-left-color: var(--warning); }
.fluxmath-public-callout p { margin: .15rem 0 0; }

.fluxmath-public-screenshot {
    margin: 1rem 0;
    border: 1px solid var(--border);
    padding: .7rem;
    background: var(--surface);
}

.fluxmath-public-screenshot-slot {
    display: grid;
    min-height: 8rem;
    place-items: center;
    border: 1px dashed var(--border-strong);
    color: var(--muted);
    text-align: center;
}

.fluxmath-public-screenshot img { display: block; width: 100%; height: auto; }
.fluxmath-public-screenshot figcaption { margin-top: .55rem; color: var(--secondary); font-size: .88rem; }

.fluxmath-public-operation {
    margin: .55rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .55rem .75rem;
    background: var(--surface);
}

.fluxmath-public-operation summary {
    min-height: 2.75rem;
    padding: .55rem 0;
    cursor: pointer;
    font-weight: 700;
}

.fluxmath-public-operation dl {
    display: grid;
    grid-template-columns: minmax(6rem, 18%) minmax(0, 1fr);
    gap: .3rem .7rem;
}

.fluxmath-public-operation dt { color: var(--secondary); font-weight: 700; }
.fluxmath-public-operation dd { margin: 0; color: var(--secondary); }

@media (max-width: 720px) {
    .fluxmath-public-heading { grid-template-columns: 1fr; }
    .fluxmath-public-heading input {
        grid-column: 1;
        grid-row: auto;
    }
    .fluxmath-public-layout { grid-template-columns: 1fr; }
    .fluxmath-public-toc {
        position: static;
        max-height: 12rem;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        padding: 0 0 .75rem;
    }
    .fluxmath-public-content { max-height: none; padding-right: 0; }
    .fluxmath-public-operation dl { grid-template-columns: 1fr; gap: .1rem; }
    .fluxmath-public-operation dd { margin-bottom: .35rem; }
}
