.zp-site .cg-catalog-hero,
.zp-site .cg-detail-hero {
    background: var(--lilac, #eee5fc);
    color: var(--ink, #211b2d);
}
.zp-site .cg-detail-hero { background: var(--paper, #fcfaff); border-bottom: 1px solid var(--line, #e4dce6); }
.zp-site .cg-product .cg-detail-hero { background: var(--mint, #e6f4ef); }
.zp-site .cg-catalog-inner,
.zp-site .cg-detail-inner {
    width: min(calc(100% - 48px), 1152px);
    margin-inline: auto;
    padding-block: clamp(42px, 8vw, 102px);
}
.zp-site .cg-detail-inner { width: min(calc(100% - 48px), 1040px); padding-block: clamp(34px, 6vw, 76px); }
.zp-site .cg-catalog-hero h1,
.zp-site .cg-detail-hero h1 {
    width: 100%;
    max-width: 25ch;
    margin: 0;
    font-size: clamp(2.2rem, 5.2vw, 4.7rem);
    line-height: 1.06;
    letter-spacing: -.04em;
    overflow-wrap: anywhere;
    color: inherit;
}
.zp-site .cg-detail-hero h1 {
    max-width: 28ch;
    font-size: clamp(2.05rem, 4.05vw, 3.95rem);
    margin: .45em 0 .27em;
}
.zp-site .cg-catalog-hero p,
.zp-site .cg-detail-hero .cg-lede { max-width: 68ch; color: var(--muted, #594f64); font-size: clamp(1rem, 2.15vw, 1.22rem); line-height: 1.6; }
.zp-site .cg-catalog-hero p { margin: 1rem 0 1.65rem; }
.zp-site .cg-detail-hero .cg-lede { margin: 0; }
.zp-site .cg-detail-hero nav { display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items:center; line-height: 1.4; }
.zp-site .cg-detail-hero nav a { text-decoration: underline; text-underline-offset: .18em; color: var(--accent-strong, #831741); font-weight: 650; }
.zp-site .cg-catalog-hero .cg-filter {
    width: min(100%, 810px);
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(130px, 1fr) auto;
    gap: .6rem;
    margin: 0;
    border: 1px solid var(--line, #e4dce6);
    border-radius: 14px;
    background: #fff;
    padding: .55rem;
    box-shadow: 0 9px 25px #211b2d10;
}
.zp-site .cg-catalog-hero .cg-filter > * { margin:0; min-width:0; min-height: 46px; }
.zp-site .cg-wrap.cg-results,
.zp-site .cg-wrap.cg-related { padding-block: clamp(34px, 6vw, 72px); width: min(calc(100% - 48px), 1152px); }
.zp-site .cg-results .cg-grid,
.zp-site .cg-related .cg-grid { gap: clamp(.85rem, 2vw, 1.5rem); }
.zp-site .cg-results .cg-card,
.zp-site .cg-related .cg-card { background: #fff; }
.zp-site .cg-results .cg-card p { line-height: 1.58; }
.zp-site .cg-empty { min-height: 10rem; padding: 1.5rem; background: var(--paper, #fcfaff); border: 1px solid var(--line, #e4dce6); border-radius: 12px; }
.zp-site .cg-article.cg-detail { max-width: none; width: 100%; padding: 0; margin: 0; }
.zp-site .cg-detail-content { width:min(calc(100% - 48px), 1040px); margin: 0 auto; padding-block: clamp(25px, 5vw, 62px); min-width: 0; }
.zp-site .cg-detail-content > .cg-cover { display:block; max-width: 100%; width: 100%; height:auto; max-height: 535px; aspect-ratio: 1.9; object-fit: cover; background: var(--paper, #fcfaff); border:1px solid var(--line, #e4dce6); border-radius: 16px; margin: 0 0 clamp(24px, 5vw, 46px); }
.zp-site .cg-product .cg-detail-content > .cg-cover { max-height: 445px; object-fit:contain; }
.zp-site .cg-detail .cg-spec { display: grid; gap: .35rem 1.25rem; grid-template-columns: repeat(auto-fit,minmax(min(100%, 230px),1fr)); padding: 1.25rem; border-radius: 14px; margin-bottom: 2.1rem; background: var(--mint, #e6f4ef); }
.zp-site .cg-reading-layout {
    display: grid;
    grid-template-columns: minmax(168px, 220px) minmax(0, 1fr);
    gap: clamp(22px, 5.2vw, 64px);
    align-items: start;
}
.zp-site .cg-detail .cg-body { min-width: 0; max-width: 76ch; margin-inline: auto; overflow-wrap: anywhere; font-size: clamp(1rem, .91rem + .38vw, 1.19rem); line-height: 1.75; }
.zp-site .cg-detail .cg-body h2,
.zp-site .cg-detail .cg-body h3,
.zp-site .cg-detail .cg-body h4 { margin: 1.75em 0 .45em; line-height: 1.2; color: var(--ink, #211b2d); scroll-margin-top: 7rem; }
.zp-site .cg-detail .cg-body h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -.025em; }
.zp-site .cg-detail .cg-body h3 { font-size: clamp(1.23rem, 2.3vw, 1.55rem); }
.zp-site .cg-detail .cg-body h4 { font-size: 1.12em; }
.zp-site .cg-detail .cg-body p { margin: 0 0 1.2em; }
.zp-site .cg-detail .cg-body ul,
.zp-site .cg-detail .cg-body ol { padding-inline-start: 1.4em; }
.zp-site .cg-detail .cg-body li { margin-bottom: .43em; }
.zp-site .cg-detail .cg-body blockquote { margin:1.35em 0; padding: .7em 1.2em; background:var(--lilac, #eee5fc); border-inline-start: 3px solid var(--accent, #a21f55); }
.zp-site .cg-detail .cg-source-text { margin-block-start: 1.4em; padding-block-start: 1.4em; border-top: 1px solid var(--line, #e4dce6); }
.zp-site .cg-detail .cg-table-scroll,
.zp-site .cg-detail .cg-body pre { max-width: 100%; overflow-x: auto; }
.zp-site .cg-detail .cg-body .cg-table-scroll { margin-block: 1.3em; border: 1px solid var(--line, #e4dce6); border-radius: 12px; }
.zp-site .cg-detail .cg-body table { width: 100%; height: auto; margin: 0; border-collapse: collapse; font-size: .9em; }
.zp-site .cg-detail .cg-body td,
.zp-site .cg-detail .cg-body th { text-align: start; padding: .65em .85em; vertical-align: top; border-bottom: 1px solid var(--line, #e4dce6); }
.zp-site .cg-detail .cg-body th { background: var(--lilac,#eee5fc); }
.zp-site .cg-outline {
    position: sticky;
    top: 6rem;
    border: 1px solid var(--line, #e4dce6);
    border-radius: 13px;
    background: var(--paper, #fcfaff);
    color: var(--ink, #211b2d);
}
.zp-site .cg-outline summary { padding: .85rem 1rem; cursor: pointer; font-weight: 700; }
.zp-site .cg-outline nav { padding: 0 1rem .8rem; max-height: 52vh; overflow:auto; }
.zp-site .cg-outline ol { list-style: none; margin: 0; padding: 0; }
.zp-site .cg-outline li { padding: 0.15rem 0; }
.zp-site .cg-outline a { display:block; padding: .22rem 0; line-height: 1.34; font-size: .9rem; overflow-wrap:anywhere; }
.zp-site .cg-outline a:hover { color: var(--accent-strong, #831741); text-decoration: underline; }
@media(max-width: 740px) {
    .zp-site .cg-reading-layout { grid-template-columns: minmax(0,1fr); gap: 1.2rem; }
    .zp-site .cg-outline { position:static; width: 100%; }
    .zp-site .cg-outline nav { max-height: 35vh; }
}
@media(max-width: 540px) {
    .zp-site .cg-catalog-inner,
    .zp-site .cg-detail-inner,
    .zp-site .cg-detail-content,
    .zp-site .cg-wrap.cg-results,
    .zp-site .cg-wrap.cg-related { width: calc(100% - 32px); }
    .zp-site .cg-catalog-hero .cg-filter { grid-template-columns: minmax(0, 1fr) auto; }
    .zp-site .cg-catalog-hero .cg-filter input { grid-column: 1/-1; }
    .zp-site .cg-detail-content > .cg-cover { border-radius: 10px; }
}

.zp-site .cg-catalog-hero .cg-filter.cg-search-only { grid-template-columns: minmax(0,1fr) auto; }
.zp-site .cg-catalog-hero .cg-filter.cg-search-only input { grid-column: auto; }
