:root {
    --cm-ink: #f7fbfc;
    --cm-muted: #b9d8da;
    --cm-line: rgba(218, 246, 247, .16);
    --cm-surface: #123f4d;
    --cm-surface-deep: #0b303d;
    --cm-bg: #176f78;
    --cm-blue: #ffd43b;
    --cm-blue-dark: #e8ad1d;
    --cm-gold: #ffd43b;
    --cm-green: #319657;
    --cm-green-dark: #247541;
    --cm-teal: #2ba4a7;
    --cm-radius: 18px;
}

body:has(.cm-bases-page),
body:has(.cm-single-page) {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 8%, rgba(95, 220, 214, .25), transparent 30rem),
        linear-gradient(145deg, #2ba4a7 0%, #187681 48%, #0c4f62 100%);
}

body:has(.cm-bases-page) #page,
body:has(.cm-single-page) #page { background: transparent; }
body:has(.cm-bases-page) #header,
body:has(.cm-single-page) #header {
    padding: 20px max(20px, calc((100% - 1180px) / 2));
    border-bottom: 1px solid rgba(218, 246, 247, .2);
    background: rgba(6, 47, 58, .34);
    backdrop-filter: blur(10px);
}
body:has(.cm-bases-page) #header h1,
body:has(.cm-single-page) #header h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); }
body:has(.cm-bases-page) #header h1 a,
body:has(.cm-single-page) #header h1 a {
    color: var(--cm-ink);
    text-decoration: none;
    text-shadow: 0 2px 14px rgba(2, 28, 36, .24);
}
body:has(.cm-bases-page) #page > hr,
body:has(.cm-single-page) #page > hr { display: none; }

.cm-bases-page,
.cm-single-page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 64px 0 80px;
    color: var(--cm-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cm-bases-page *,
.cm-single-page * { box-sizing: border-box; }

.cm-bases-hero {
    max-width: 720px;
    margin-bottom: 32px;
}

.cm-eyebrow {
    margin: 0 0 8px;
    color: var(--cm-blue);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.cm-bases-hero h1,
.cm-single-header h1 {
    margin: 0;
    color: var(--cm-ink);
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.03;
    letter-spacing: -.035em;
}

.cm-bases-hero > p:last-child,
.cm-single-header p {
    color: var(--cm-muted);
    font-size: 18px;
    line-height: 1.65;
}

.cm-filter-bar {
    display: flex;
    align-items: end;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-radius);
    background: rgba(10, 54, 66, .84);
    box-shadow: 0 16px 38px rgba(4, 34, 43, .22);
    backdrop-filter: blur(12px);
}

.cm-filter-bar label { flex: 1 1 220px; }
.cm-filter-bar label span { display: block; margin: 0 0 7px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.cm-filter-bar select { width: 100%; min-height: 46px; padding: 0 38px 0 13px; border: 1px solid var(--cm-line); border-radius: 11px; background-color: #174e5c; color: var(--cm-ink); }
.cm-filter-bar button,
.cm-primary-action { min-height: 46px; padding: 12px 22px; border: 0; border-radius: 11px; font-weight: 800; text-decoration: none; cursor: pointer; }
.cm-filter-bar button { background: var(--cm-gold); color: #18333d; }
.cm-filter-bar button:hover { background: #ffe16e; color: #18333d; }
.cm-primary-action { background: var(--cm-green); color: #fff; font-size: 15px; font-weight: 500; }
.cm-primary-action:hover { background: var(--cm-green-dark); color: #fff; }
.cm-clear-filter { align-self: center; color: var(--cm-muted); font-weight: 700; }
.cm-results-line { margin: 28px 0 14px; color: var(--cm-muted); font-size: 14px; font-weight: 700; }

.cm-base-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.cm-base-card { overflow: hidden; border: 1px solid var(--cm-line); border-radius: var(--cm-radius); background: linear-gradient(180deg, #164b59, var(--cm-surface-deep)); box-shadow: 0 12px 32px rgba(2, 28, 36, .2); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.cm-base-card:hover { transform: translateY(-4px); border-color: rgba(255, 212, 59, .42); box-shadow: 0 20px 46px rgba(2, 27, 36, .34); }
.cm-card-image { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #092d39; }
.cm-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.cm-base-card:hover .cm-card-image img { transform: scale(1.025); }
.cm-image-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: var(--cm-muted); }
.cm-card-content { padding: 18px; }
.cm-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.cm-badges span,
.cm-badges a { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: rgba(69, 205, 203, .18); color: #bff9f5; font-size: 12px; font-weight: 800; text-decoration: none; }
.cm-badges .cm-badge-type { background: rgba(255, 212, 59, .17); color: #ffe276; }
.cm-card-content h2 { margin: 13px 0 10px; font-size: 20px; line-height: 1.25; }
.cm-card-content h2 a { color: var(--cm-ink); text-decoration: none; }
.cm-card-meta { display: flex; gap: 16px; color: var(--cm-muted); font-size: 13px; }
.cm-card-link { display: inline-flex; gap: 6px; margin-top: 18px; color: var(--cm-blue); font-weight: 800; text-decoration: none; }

.cm-pagination { margin-top: 36px; }
.cm-pagination .page-numbers { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.cm-pagination a,
.cm-pagination span { display: grid; min-width: 42px; min-height: 42px; padding: 8px; place-items: center; border: 1px solid var(--cm-line); border-radius: 10px; background: var(--cm-surface); color: var(--cm-ink); text-decoration: none; }
.cm-pagination .current { border-color: var(--cm-gold); background: var(--cm-gold); color: #18333d; }
.cm-empty-state { padding: 70px 20px; border: 1px dashed var(--cm-line); border-radius: var(--cm-radius); text-align: center; }
.cm-landing-guide { max-width: 880px; margin: 52px auto 0; padding: clamp(24px, 4vw, 38px); border: 1px solid var(--cm-line); border-radius: var(--cm-radius); background: rgba(9, 54, 66, .72); color: var(--cm-muted); line-height: 1.7; }
.cm-landing-guide h2 { margin: 0 0 18px; color: var(--cm-ink); font-size: clamp(25px, 3vw, 34px); }
.cm-landing-guide p { margin: 0 0 16px; }
.cm-landing-guide p:last-child { margin-bottom: 0; }
.cm-landing-guide a { color: var(--cm-blue); font-weight: 700; }
.cm-landing-related { padding-top: 4px; color: var(--cm-ink); }

.cm-breadcrumb { display: flex; gap: 9px; margin-bottom: 22px; scroll-margin-top: 16px; color: var(--cm-muted); font-size: 14px; }
.cm-breadcrumb a { color: var(--cm-blue); }
.cm-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    margin-bottom: 18px;
    padding: 9px 15px;
    border: 1px solid var(--cm-line);
    border-radius: 11px;
    background: rgba(10, 54, 66, .72);
    color: var(--cm-ink);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}
.cm-back-button:hover { border-color: rgba(255, 212, 59, .55); color: var(--cm-gold); }
.cm-single-card { padding: clamp(20px, 4vw, 46px); border: 1px solid var(--cm-line); border-radius: 24px; background: linear-gradient(160deg, rgba(20, 75, 87, .96), rgba(8, 43, 55, .97)); box-shadow: 0 20px 55px rgba(2, 28, 36, .28); }
.cm-single-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.cm-single-header h1 { margin-top: 14px; font-size: clamp(34px, 5vw, 56px); }
.cm-single-header p { margin-bottom: 0; }
.cm-stat-pills { display: flex; flex: 0 0 auto; gap: 8px; }
.cm-stat-pills span { padding: 10px 13px; border: 1px solid var(--cm-line); border-radius: 11px; background: rgba(45, 164, 167, .16); color: var(--cm-muted); font-size: 13px; }
.cm-main-layout { position: relative; overflow: hidden; margin: 0; border-radius: 18px; background: #111722; cursor: pointer; touch-action: pan-y; user-select: none; }
.cm-main-layout.is-interactive { cursor: grab; touch-action: none; }
.cm-main-layout.is-interactive:active { cursor: grabbing; }
.cm-main-layout img { display: block; width: 100%; height: auto; transform-origin: center; transition: transform .08s linear; will-change: transform; }
.cm-image-viewer-hint { position: absolute; z-index: 2; bottom: 16px; left: 16px; display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 10px 13px; border-radius: 13px; background: rgba(7, 49, 61, .88); color: #fff; font-size: 15px; font-weight: 700; line-height: 1.2; pointer-events: none; }
.cm-image-viewer-hint > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cm-image-viewer-hint svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cm-main-layout.is-interactive .cm-image-viewer-hint { opacity: 0; }
.cm-image-viewer-controls { position: absolute; z-index: 2; right: 14px; bottom: 14px; display: flex; gap: 6px; padding: 6px; border-radius: 13px; background: rgba(7, 49, 61, .86); }
.cm-image-viewer-controls button { min-width: 46px; min-height: 42px; padding: 7px 13px; border: 1px solid rgba(255,255,255,.25); border-radius: 9px; background: rgba(255,255,255,.08); color: #fff; font-weight: 800; cursor: pointer; }
.cm-image-viewer-controls button:disabled { opacity: .35; cursor: default; }
.cm-base-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}
.cm-base-navigation a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 11px 17px;
    border: 1px solid var(--cm-line);
    border-radius: 11px;
    background: rgba(10, 54, 66, .72);
    color: var(--cm-ink);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}
.cm-base-navigation a:hover { border-color: rgba(255, 212, 59, .55); color: var(--cm-gold); }
.cm-base-navigation-previous { justify-self: start; }
.cm-base-navigation-next { justify-self: end; justify-content: flex-end; }
.cm-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; }
.cm-copy-action { min-height: 46px; padding: 11px 20px; border: 1px solid rgba(255, 212, 59, .48); border-radius: 11px; background: rgba(255, 212, 59, .1); color: #ffe276; font-weight: 800; cursor: pointer; }
.cm-copy-action:hover { background: rgba(255, 212, 59, .2); }
.cm-unavailable { padding: 12px 15px; border-radius: 10px; background: #fff6df; color: #785000; }
.cm-variants,
.cm-description { margin-top: 42px; }
.cm-variants h2,
.cm-description h2,
.cm-related h2 { margin: 0 0 18px; font-size: 26px; }
.cm-variant-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.cm-variant-grid figure { overflow: hidden; margin: 0; border: 1px solid var(--cm-line); border-radius: 14px; background: var(--cm-surface-deep); }
.cm-variant-grid img { display: block; width: 100%; }
.cm-variant-grid figcaption { padding: 12px; font-weight: 800; }
.cm-related { margin-top: 54px; }
.cm-section-heading { display: flex; align-items: center; justify-content: space-between; }
.cm-related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cm-related-card { overflow: hidden; border: 1px solid var(--cm-line); border-radius: 14px; background: var(--cm-surface-deep); color: var(--cm-ink); text-decoration: none; }
.cm-related-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.cm-related-card span { display: block; padding: 13px; font-weight: 800; }

@media (max-width: 900px) {
    .cm-base-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cm-related-grid { grid-template-columns: repeat(2, 1fr); }
    .cm-single-header { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
    .cm-bases-page,
    .cm-single-page { width: min(100% - 20px, 1180px); padding-top: 34px; }
    .cm-filter-bar { align-items: stretch; flex-direction: column; }
    .cm-filter-bar label { flex-basis: auto; }
    .cm-base-grid { grid-template-columns: 1fr; }
    .cm-related-grid,
    .cm-variant-grid { grid-template-columns: 1fr; }
    .cm-stat-pills { flex-wrap: wrap; }
    .cm-primary-action,
    .cm-copy-action { width: 100%; text-align: center; }
    .cm-image-viewer-hint { top: 12px; bottom: auto; left: 12px; max-width: calc(100% - 24px); border-radius: 10px; line-height: 1.25; }
    .cm-image-viewer-hint > span { flex-wrap: wrap; white-space: normal; }
}
