@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300..700;1,300..700&family=Geist:wght@100..900&display=swap");

/*
 * Documentazione StrateCo — foglio di stile autonomo.
 *
 * Non importa main.css di proposito: i token della nuova UI sono copiati qui
 * (sorgente: ui/styles/main.css del ramo che introduce il light warm) e la
 * scala tipografica serif e' tenuta piccola e circoscritta alla prosa, mentre
 * nell'app e' globale e monumentale.
 *
 * Regole rispettate: solo var(--*), mai HEX inline; breakpoint 640/768/1024/1280;
 * mobile-first con min-width; tipografia su var(--fs-*).
 */

/* ---------------------------------------------------------------- token --- */
:root {
    --primary-color: #8f00ff;
    --primary-hover: #7700e9;
    --secondary-color: #6f675d;
    --bg-canvas: #f5f3ee;
    --bg-primary: #fffdf8;
    --bg-secondary: #f8f5ef;
    --bg-tertiary: #ede7dc;
    --text-primary: #26221c;
    --text-secondary: #6f675d;
    --border-color: #ded6c9;
    --border-light: #eee8de;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --font-sans-ui: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-serif-display: "Cormorant Garamond", Georgia, serif;

    --fs-xs: 12px;
    --fs-sm: 14px;
    --fs-base: 16px;
    --fs-lg: 18px;
    --fs-xl: 20px;
    --fs-2xl: 24px;
    --fs-3xl: 32px;

    /* Deve corrispondere all'altezza reale della barra: da qui dipendono lo
       stacco della colonna laterale, dell'indice e degli ancoraggi. */
    --docs-topbar-h: 70px;
    --docs-sidebar-w: 268px;
    --docs-toc-w: 232px;
    --docs-prose-w: 54rem;
    --docs-radius: 10px;
    --docs-radius-sm: 7px;
}

[data-theme="dark"] {
    --primary-color: #8c52ff;
    --primary-hover: #653bb8;
    --secondary-color: #9ca3af;
    --bg-canvas: #111827;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --border-color: #374151;
    --border-light: #4b5563;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

@media (max-width: 768px) {
    :root {
        --fs-xs: clamp(12px, 12.98px - 0.13vw, 12.5px);
        --fs-sm: clamp(14px, 15.95px - 0.25vw, 15px);
        --fs-base: clamp(15px, 13.05px + 0.51vw, 16px);
        --fs-lg: clamp(17px, 16.05px + 0.25vw, 18px);
        --fs-xl: clamp(18px, 16.10px + 0.51vw, 20px);
        --fs-2xl: clamp(21px, 18.14px + 0.76vw, 24px);
        --fs-3xl: clamp(26px, 20.27px + 1.53vw, 32px);
    }
}

/* ----------------------------------------------------------------- base --- */
*, *::before, *::after { box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-secondary) 35%, transparent) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-secondary) 30%, transparent); border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--docs-topbar-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    font-family: var(--font-sans-ui);
    font-size: var(--fs-base);
    line-height: 1.6;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    background: var(--bg-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color 0.2s ease, color 0.2s ease;
}

img { max-width: 100%; height: auto; }
a { color: var(--primary-color); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; border-radius: 4px; }

.docs-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 10px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--docs-radius-sm);
}
.docs-skip:focus { left: 12px; top: 12px; }

/* --------------------------------------------------------------- topbar --- */
.docs-topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--docs-topbar-h);
    padding: 8px 12px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.docs-topbar__start { display: flex; align-items: center; gap: 8px; min-width: 0; }

.docs-brand { display: flex; align-items: center; gap: 8px; color: var(--text-primary); }
.docs-brand:hover { text-decoration: none; }
/* Sotto i 640px c'e' spazio per il marchio o per il logo esteso, non per
   entrambi accanto a una ricerca usabile: come nella barra laterale dell'app,
   sotto quella soglia resta il solo marchio. */
.docs-brand__mark {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
}
.docs-brand__logo {
    display: none;
    height: auto;
    width: auto;
    max-width: 186px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 1;
    transform: translateX(0);
}
/* Sotto i 640px la barra ha spazio per il logo o per l'etichetta, non per
   entrambi: vince il campo di ricerca. */
.docs-brand__label {
    display: none;
    font-size: var(--fs-lg);
    font-weight: 500;
    color: var(--text-secondary);
    padding-left: 10px;
    border-left: 1px solid var(--border-color);
}

.docs-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: var(--docs-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.docs-iconbtn:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.docs-searchbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: 7px 10px;
    font: inherit;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--docs-radius-sm);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.docs-searchbar:hover { border-color: var(--primary-color); }
.docs-searchbar__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-searchbar__kbd { display: none; }

kbd {
    display: inline-block;
    padding: 1px 5px;
    font-family: var(--font-sans-ui);
    font-size: var(--fs-xs);
    line-height: 1.5;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.docs-topbar__actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }

.docs-appcta {
    display: none;
    padding: 7px 12px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--bg-primary);
    background: var(--primary-color);
    border-radius: var(--docs-radius-sm);
    white-space: nowrap;
}
.docs-appcta:hover { background: var(--primary-hover); text-decoration: none; }
[data-theme="dark"] .docs-appcta { color: #fff; }

.docs-lang { position: relative; }
.docs-lang__button { width: auto; padding: 0 8px; }
.docs-lang__current { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em; }
.docs-lang__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    min-width: 148px;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--docs-radius);
    box-shadow: var(--shadow-lg);
}
.docs-lang__option {
    display: block;
    padding: 7px 10px;
    font-size: var(--fs-sm);
    color: var(--text-primary);
    border-radius: var(--docs-radius-sm);
}
.docs-lang__option:hover { background: var(--bg-secondary); text-decoration: none; }
.docs-lang__option.is-current {
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    color: var(--text-primary);
    font-weight: 500;
}

/* ---------------------------------------------------------------- shell --- */
.docs-shell {
    display: grid;
    grid-template-columns: 1fr;
    padding-top: var(--docs-topbar-h);
}

.docs-sidebar {
    position: fixed;
    top: var(--docs-topbar-h);
    bottom: 0;
    left: 0;
    z-index: 35;
    width: var(--docs-sidebar-w);
    max-width: 88vw;
    padding: 16px 8px 40px 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    transform: translateX(-100%);
    transition: transform 0.24s ease;
}
.docs-sidebar.is-open { transform: translateX(0); }

.docs-sidebar__scrim {
    position: fixed;
    inset: var(--docs-topbar-h) 0 0 0;
    z-index: 34;
    background: rgb(0 0 0 / 0.45);
    backdrop-filter: blur(2px);
}

/* ------------------------------------------------------------------ nav --- */
.docs-nav__list { margin: 0; padding: 0; list-style: none; }
.docs-nav__list--depth-1 { margin-left: 10px; padding-left: 8px; border-left: 1px solid var(--border-color); }
.docs-nav__list--depth-2 { margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--border-color); }

.docs-nav__link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: var(--fs-sm);
    line-height: 1.4;
    color: var(--text-secondary);
    border: 1px solid transparent;
    border-radius: var(--docs-radius-sm);
    transition: background-color 0.15s ease, color 0.15s ease;
}
.docs-nav__link:hover { background: var(--bg-tertiary); color: var(--text-primary); text-decoration: none; }
.docs-nav__link.is-current {
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    border-color: color-mix(in srgb, var(--primary-color) 44%, transparent);
    color: var(--text-primary);
    font-weight: 500;
}

.docs-nav__summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-primary);
    border-radius: var(--docs-radius-sm);
    cursor: pointer;
    list-style: none;
}
.docs-nav__summary::-webkit-details-marker { display: none; }
.docs-nav__summary:hover { background: var(--bg-tertiary); }
.docs-nav__summary-label { flex: 1; min-width: 0; }
.docs-nav__chevron { display: inline-flex; color: var(--text-secondary); transition: transform 0.2s ease; }
.docs-nav__group[open] > .docs-nav__summary .docs-nav__chevron { transform: rotate(90deg); }
.docs-nav__self { margin-left: 10px; padding-left: 8px; border-left: 1px solid var(--border-color); }

.docs-nav__count {
    flex-shrink: 0;
    padding: 0 6px;
    font-size: var(--fs-xs);
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-radius: 999px;
}

/* ----------------------------------------------------------------- main --- */
.docs-main {
    min-width: 0;
    padding: 24px 16px 64px;
}
.docs-article { max-width: var(--docs-prose-w); }

.docs-breadcrumb { margin-bottom: 16px; }
.docs-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--fs-xs);
    color: var(--text-secondary);
}
.docs-breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--border-light); }
.docs-breadcrumb a { color: var(--text-secondary); }
.docs-breadcrumb a:hover { color: var(--text-primary); }

/* ------------------------------------------------------------ tipografia --- */
.docs-article h1,
.docs-article h2 {
    font-family: var(--font-serif-display);
    font-optical-sizing: auto;
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.docs-article h1 {
    margin: 0 0 12px;
    font-size: clamp(34px, 5vw, 48px);
    line-height: 1.05;
}
.docs-article h2 {
    margin: 44px 0 12px;
    padding-top: 20px;
    font-size: clamp(26px, 3.2vw, 34px);
    line-height: 1.15;
    border-top: 1px solid var(--border-light);
}
.docs-article h3,
.docs-article h4 {
    margin: 28px 0 8px;
    font-family: var(--font-sans-ui);
    font-style: normal;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--text-primary);
}
.docs-article h3 { font-size: var(--fs-xl); }
.docs-article h4 { font-size: var(--fs-lg); }

.docs-article p { margin: 0 0 16px; font-size: var(--fs-base); line-height: 1.7; }
.docs-article strong { font-weight: 600; color: var(--text-primary); }

.docs-anchor {
    margin-left: 8px;
    font-family: var(--font-sans-ui);
    font-style: normal;
    font-size: var(--fs-sm);
    color: var(--border-light);
    opacity: 0;
    transition: opacity 0.15s ease;
}
.docs-article :is(h1, h2, h3, h4):hover .docs-anchor { opacity: 1; }
.docs-anchor:hover { color: var(--primary-color); text-decoration: none; }

.docs-lede {
    margin: 0 0 24px;
    font-size: var(--fs-lg);
    line-height: 1.6;
    color: var(--text-secondary);
}

.docs-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary-color);
}

.docs-list { margin: 0 0 16px; padding-left: 22px; }
.docs-list li { margin-bottom: 6px; line-height: 1.65; }
.docs-list--nested { margin: 6px 0 0; }
.docs-list li::marker { color: var(--text-secondary); }

.docs-quote {
    margin: 0 0 20px;
    padding: 2px 0 2px 18px;
    color: var(--text-secondary);
    border-left: 3px solid var(--border-color);
}
.docs-quote p:last-child { margin-bottom: 0; }

code {
    padding: 2px 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-radius: 5px;
}
.docs-code {
    margin: 0 0 20px;
    padding: 14px 16px;
    overflow-x: auto;
    font-size: var(--fs-sm);
    line-height: 1.6;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--docs-radius);
}
.docs-code code { padding: 0; background: none; }

.docs-table-wrap { margin: 0 0 20px; overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--docs-radius); }
.docs-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.docs-table th, .docs-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border-light); }
.docs-table th { font-weight: 600; background: var(--bg-secondary); }
.docs-table tr:last-child td { border-bottom: 0; }

hr { margin: 32px 0; border: 0; border-top: 1px solid var(--border-light); }

/* -------------------------------------------------------------- callout --- */
.docs-callout {
    display: flex;
    gap: 12px;
    margin: 0 0 20px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--docs-radius);
}
.docs-callout__icon { flex-shrink: 0; display: inline-flex; color: var(--text-secondary); }
.docs-callout__body > :last-child { margin-bottom: 0; }
.docs-callout__title { font-weight: 600; margin-bottom: 4px !important; }
.docs-callout--tip { background: color-mix(in srgb, var(--primary-color) 7%, var(--bg-secondary)); border-color: color-mix(in srgb, var(--primary-color) 30%, var(--border-color)); }
.docs-callout--tip .docs-callout__icon { color: var(--primary-color); }
.docs-callout--warning { background: color-mix(in srgb, #d97706 8%, var(--bg-secondary)); border-color: color-mix(in srgb, #d97706 32%, var(--border-color)); }
.docs-callout--warning .docs-callout__icon { color: #d97706; }
.docs-callout--important { border-color: color-mix(in srgb, var(--primary-color) 44%, var(--border-color)); }

/* ------------------------------------------------------------- immagini --- */
.docs-figure { margin: 0 0 24px; }
.docs-figure img {
    display: block;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--docs-radius);
    background: var(--bg-secondary);
}
.docs-figure figcaption { margin-top: 8px; font-size: var(--fs-sm); color: var(--text-secondary); }

.docs-shot { margin: 0 0 24px; }
.docs-shot__frame { position: relative; }
.docs-shot img { display: block; width: 100%; border: 1px solid var(--border-color); border-radius: var(--docs-radius); }
.docs-shot img[hidden] { display: none; }
.docs-shot__legend { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.docs-shot__legend li { display: flex; gap: 10px; align-items: baseline; font-size: var(--fs-sm); color: var(--text-secondary); }
.docs-shot__num {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: var(--fs-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--bg-primary);
    background: var(--primary-color);
    border-radius: 999px;
}
[data-theme="dark"] .docs-shot__num { color: #fff; }
.docs-shot__missing {
    padding: 24px;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    text-align: center;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: var(--docs-radius);
}

/* ---------------------------------------------------------- blocchi doc --- */
.docs-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 24px;
}
.docs-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 999px;
}
.docs-chip--accent {
    color: var(--text-primary);
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    border-color: color-mix(in srgb, var(--primary-color) 44%, transparent);
}

.docs-defs { margin: 0 0 24px; display: grid; gap: 16px; }
.docs-def {
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--docs-radius);
}
.docs-def__label {
    margin: 0 0 6px;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.docs-def p:last-child { margin-bottom: 0; }

.docs-cards { display: grid; gap: 12px; margin: 0 0 28px; }
.docs-card {
    display: block;
    padding: 16px;
    color: inherit;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--docs-radius);
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.docs-card:hover { border-color: var(--primary-color); text-decoration: none; transform: translateY(-1px); }
.docs-card__icon { display: inline-flex; margin-bottom: 10px; color: var(--primary-color); }
.docs-card__title { margin: 0 0 4px; font-size: var(--fs-base); font-weight: 600; color: var(--text-primary); }
.docs-card__body { margin: 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--text-secondary); }

.docs-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--bg-primary);
    background: var(--primary-color);
    border-radius: var(--docs-radius-sm);
}
.docs-cta:hover { background: var(--primary-hover); text-decoration: none; }
[data-theme="dark"] .docs-cta { color: #fff; }
.docs-cta--ghost {
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--border-color);
}
.docs-cta--ghost:hover { background: var(--bg-secondary); border-color: var(--primary-color); }
[data-theme="dark"] .docs-cta--ghost { color: var(--text-primary); }


/* Testata della scheda agente: avatar e identita' affiancati. */
.docs-agenthead { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.docs-agenthead__avatar {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    border-radius: 999px;
    object-fit: cover;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}
/* Gli avatar sono <picture> (webp con fallback jpg): senza questo il figlio
   della flex e' il contenitore e non l'immagine, e il suo flex-shrink: 0
   smette di difenderla dalla compressione. */
.docs-agenthead picture, .docs-agentcard picture { display: contents; }
.docs-agenthead__text { min-width: 0; }
.docs-agenthead h1 { margin-bottom: 4px; }
.docs-agenthead__role {
    margin: 0 0 12px;
    font-size: var(--fs-lg);
    line-height: 1.4;
    color: var(--primary-color);
}
.docs-agenthead .docs-meta { margin-bottom: 0; }

@media (max-width: 640px) {
    .docs-agenthead { gap: 14px; }
    .docs-agenthead__avatar { width: 64px; height: 64px; }
}

/* ------------------------------------------------------------------ toc --- */
.docs-toc { display: none; }

/* ----------------------------------------------------- fondo pagina/nav --- */
.docs-pagination {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: var(--docs-prose-w);
    margin: 48px 0 0;
}
.docs-pagination__link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--docs-radius);
}
.docs-pagination__link:hover { border-color: var(--primary-color); text-decoration: none; }
.docs-pagination__link--next { text-align: right; }
.docs-pagination__dir { font-size: var(--fs-xs); color: var(--text-secondary); }
.docs-pagination__label { font-size: var(--fs-sm); font-weight: 500; }

.docs-footer {
    max-width: var(--docs-prose-w);
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}
.docs-footer__build { margin: 8px 0 0; font-size: var(--fs-xs); color: var(--text-secondary); opacity: 0.75; }

/* -------------------------------------------------------------- ricerca --- */
.docs-search { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; }
.docs-search[hidden] { display: none; }
.docs-search__backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / 0.6); backdrop-filter: blur(4px); }
.docs-search__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(640px, 94vw);
    max-height: min(70vh, 620px);
    margin-top: 8vh;
    overflow: hidden;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}
.docs-search__field { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-color); }
.docs-search__icon { display: inline-flex; color: var(--text-secondary); }
.docs-search__input {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: var(--fs-base);
    color: var(--text-primary);
    background: transparent;
    border: 0;
    outline: none;
}
.docs-search__input::-webkit-search-cancel-button { display: none; }
.docs-search__close { display: inline-flex; padding: 4px; color: var(--text-secondary); background: transparent; border: 0; border-radius: 5px; cursor: pointer; }
.docs-search__close:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.docs-search__results { flex: 1; overflow-y: auto; padding: 8px; }
.docs-search__group { margin: 8px 6px 4px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.docs-search__hit {
    display: block;
    padding: 10px 12px;
    color: inherit;
    border: 1px solid transparent;
    border-radius: var(--docs-radius-sm);
}
.docs-search__hit:hover, .docs-search__hit.is-active {
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    border-color: color-mix(in srgb, var(--primary-color) 44%, transparent);
    text-decoration: none;
}
.docs-search__hit-title { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--text-primary); }
.docs-search__hit-path { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--text-secondary); }
.docs-search__hit-snippet { display: block; margin-top: 4px; font-size: var(--fs-xs); line-height: 1.5; color: var(--text-secondary); }
.docs-search__hit mark { padding: 0 1px; color: var(--text-primary); background: color-mix(in srgb, var(--primary-color) 26%, transparent); border-radius: 3px; }
.docs-search__empty { padding: 28px 16px; text-align: center; font-size: var(--fs-sm); color: var(--text-secondary); }
.docs-search__footer {
    display: flex;
    gap: 16px;
    padding: 8px 16px;
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}
.docs-search__footer kbd { margin-right: 3px; }

/* ----------------------------------------------------------------- home --- */
.docs-hero { max-width: var(--docs-prose-w); margin-bottom: 40px; }
.docs-hero h1 {
    margin: 0 0 12px;
    font-family: var(--font-serif-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(40px, 7vw, 72px);
    line-height: 1;
    letter-spacing: -0.03em;
}
.docs-hero p { margin: 0 0 20px; font-size: var(--fs-lg); line-height: 1.6; color: var(--text-secondary); }
.docs-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.docs-section-title {
    margin: 40px 0 14px;
    font-family: var(--font-serif-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(24px, 3vw, 30px);
    line-height: 1.2;
    color: var(--text-primary);
}

.docs-agentgrid { display: grid; gap: 12px; margin-bottom: 28px; }
.docs-agentcard {
    display: flex;
    gap: 12px;
    padding: 16px;
    color: inherit;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--docs-radius);
    transition: border-color 0.2s ease;
}
.docs-agentcard:hover { border-color: var(--primary-color); text-decoration: none; }
.docs-agentcard__avatar { flex-shrink: 0; width: 44px; height: 44px; border-radius: 999px; object-fit: cover; background: var(--bg-tertiary); }
.docs-agentcard__text { min-width: 0; }
.docs-agentcard__name { display: block; font-size: var(--fs-base); font-weight: 600; line-height: 1.3; color: var(--text-primary); }
.docs-agentcard__role { display: block; margin-bottom: 4px; font-size: var(--fs-xs); color: var(--primary-color); }
.docs-agentcard__body { display: block; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-secondary); }

.docs-actionlist { display: grid; gap: 10px; margin: 0 0 28px; padding: 0; list-style: none; }
.docs-actionlist__link {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    color: inherit;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--docs-radius);
    transition: border-color 0.2s ease;
}
.docs-actionlist__link:hover { border-color: var(--primary-color); text-decoration: none; }
.docs-actionlist__icon { flex-shrink: 0; display: inline-flex; margin-top: 2px; color: var(--primary-color); }
.docs-actionlist__title { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); }
.docs-actionlist__body { display: block; margin-top: 2px; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-secondary); }

/* --------------------------------------------------------- breakpoint --- */
@media (min-width: 640px) {
    .docs-main { padding: 32px 24px 72px; }
    .docs-brand__mark { display: none; }
    .docs-brand__logo { display: block; }
    .docs-searchbar__kbd { display: inline-block; margin-left: auto; }
    .docs-appcta { display: inline-block; }
    .docs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .docs-agentgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .docs-defs { gap: 12px; }
}

@media (min-width: 768px) {
    .docs-topbar { padding: 8px 20px; gap: 16px; }
    .docs-main { padding: 36px 32px 80px; }
}

@media (min-width: 1024px) {
    /* Le due colonne laterali sono larghe quanto quello che contengono (marchio
       a sinistra, lingua/tema/CTA a destra): tutto il resto va alla ricerca,
       che cosi' respira invece di restare un riquadro stretto in mezzo. Sotto i
       1024 non ci starebbe senza schiacciare logo o comandi, quindi li' resta
       il flusso semplice. */
    .docs-topbar { display: grid; grid-template-columns: 360px minmax(0, 100%) 200px; }
    .docs-searchbar { flex: none; }
    .docs-menu-toggle { display: none; }
    .docs-sidebar__scrim { display: none !important; }
    .docs-shell {
        grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr);
        /* La colonna laterale e' sticky e piu' corta della pagina: il fondo lo
           dipinge la griglia, altrimenti sotto la nav ricompare il canvas. */
        background: linear-gradient(to right, var(--bg-secondary) 0 var(--docs-sidebar-w), var(--bg-canvas) var(--docs-sidebar-w));
    }
    .docs-sidebar { position: sticky; top: var(--docs-topbar-h); height: calc(100vh - var(--docs-topbar-h)); transform: none; }
    .docs-main { padding: 40px 40px 96px; }
    .docs-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .docs-agentgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
    .docs-brand__label { display: inline; }
    .docs-shell { grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr) var(--docs-toc-w); }
    .docs-toc {
        display: block;
        position: sticky;
        top: var(--docs-topbar-h);
        align-self: start;
        max-height: calc(100vh - var(--docs-topbar-h));
        padding: 40px 24px 40px 8px;
        overflow-y: auto;
    }
    .docs-toc__title {
        margin: 0 0 10px;
        font-size: var(--fs-xs);
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--text-secondary);
    }
    .docs-toc__list { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--border-color); }
    .docs-toc__item a {
        display: block;
        padding: 5px 12px;
        margin-left: -1px;
        font-size: var(--fs-sm);
        line-height: 1.4;
        color: var(--text-secondary);
        border-left: 1px solid transparent;
    }
    .docs-toc__item a:hover { color: var(--text-primary); text-decoration: none; }
    .docs-toc__item.is-active a { color: var(--primary-color); border-left-color: var(--primary-color); }
    .docs-toc__item--h3 a { padding-left: 24px; font-size: var(--fs-xs); }
}

@media print {
    .docs-topbar, .docs-sidebar, .docs-toc, .docs-search, .docs-pagination { display: none !important; }
    .docs-shell { padding-top: 0; }
    body { background: #fff; color: #000; }
}
