.csg { min-width:0; scroll-margin-top:5rem; }
.csg [hidden], .csg .csg-dialog:not([open]) { display:none !important; }
.csg-heading {display:flex;justify-content:space-between;align-items:end;gap:1.25rem 2rem;flex-wrap:wrap}
.csg .csg-heading h2 {margin:0 0 .35rem}
.csg .csg-intro {color:var(--sub);max-width:64ch;margin:0;line-height:1.65;font-size:15px}
.csg-search {display:grid;gap:.25rem;flex:1 1 14rem;max-width:21rem}
.csg-search label,.csg-mobile-filter {color:var(--ink);font-size:.83rem;font-weight:650;line-height:1.4;margin:0}
.csg input[type="search"],.csg-mobile-filter select {
    display:block;width:100%;min-height:44px;background:var(--paper);padding:.6rem .85rem;
    border:1px solid var(--line);border-radius:var(--radius-sm);font:inherit;font-weight:400;color:var(--ink);
}
.csg-tools {margin-block:18px 12px;display:grid;gap:.8rem}
.csg-categories,.csg-actions {display:flex;flex-wrap:wrap;align-items:center;gap:.4rem}
.csg-category,.csg-empty button,.csg-dialog-head button,.csg .csg-show-all {
    min-height:44px;min-width:44px;padding:.48rem .78rem;border-radius:var(--radius-sm);border:1px solid var(--line);
    background:var(--paper);color:var(--ink);font:inherit;font-size:.875rem;line-height:1.3;cursor:pointer;
}
.csg .csg-category {font-weight:600}
.csg-category[aria-pressed="true"] {background:var(--blue);border-color:var(--blue);color:#fff}
.csg-category:hover:not([aria-pressed="true"]),.csg-empty button:hover,.csg-dialog-head button:hover,.csg .csg-show-all:hover {background:var(--soft);border-color:var(--blue-line)}
.csg-mobile-filter {display:none}
.csg .csg-count {margin:0;font-size:.85rem;color:var(--sub)}
#csg-results {scroll-margin-block-start:5rem}
.csg-group {margin-block:1.05rem 1.8rem}
.csg .csg-group h3 {margin:0 0 .75rem;color:var(--ink);font-size:1.18rem;scroll-margin-block-start:5rem}
.csg-grid,#csg-results.csg-featured {display:grid;gap:clamp(.65rem,1.6vw,1.15rem);grid-template-columns:repeat(3,minmax(0,1fr))}
.csg-featured .csg-group:not([hidden]), .csg-featured .csg-grid {display:contents}
.csg .csg-industry-copy {margin:0 0 1rem;max-width:82ch;line-height:1.55;color:var(--sub)}
.csg-featured .csg-group h3, .csg-featured .csg-industry-copy {display:none}
.csg-card {
    display:flex;flex-direction:column;min-width:0;padding:12px;overflow-wrap:anywhere;
    border:1px solid var(--line);border-radius:15px;background:var(--paper);box-shadow:var(--shadow);scroll-margin-block-start:5rem;
}
.csg-card:focus-within {border-color:var(--blue)}
.csg-sample {padding:14px 16px;border:1px solid #e3e8f5;border-radius:10px;background:linear-gradient(135deg,#f8faff,#eef3ff);color:var(--ink)}
.csg-industry {display:block;color:var(--sub);font-size:.81rem;line-height:1.4;font-weight:600}
.csg-sample-row,.csg-sample-total {display:flex;align-items:baseline;justify-content:space-between;gap:.55rem;line-height:1.25}
.csg-sample-row {margin-top:.65rem;padding-bottom:.42rem;font-size:.8rem;border-bottom:1px solid var(--line)}
.csg-money {display:inline-block;white-space:nowrap;overflow-wrap:normal;word-break:normal}
.csg-sample-row > strong {text-align:right;font-weight:650}
.csg-sample-total {margin-top:.4rem;font-size:.8rem}
.csg-sample-total b {font-size:clamp(1.08rem,2vw,1.38rem);color:var(--blue-dark);font-weight:700;white-space:nowrap;letter-spacing:-.035em;font-variant-numeric:tabular-nums}
.csg .csg-card h4 {margin:.85rem .35rem .36rem;font-size:19px;font-weight:700;line-height:1.25;color:var(--ink);text-wrap:balance}
.csg .csg-card p {flex:1;color:var(--sub);font-size:.93rem;line-height:1.45;margin:0 .35rem .5rem}
.csg-actions {gap:.28rem .7rem}
.csg-card .csg-actions {padding-inline:.35rem}
.csg-actions a {display:inline-flex;gap:.3rem;align-items:center;min-height:44px;line-height:1.3;font-size:.875rem}
.csg .csg-choose {padding:.4rem .8rem;border:1px solid var(--blue-line);border-radius:10px;background:var(--soft);color:var(--blue-dark);font-weight:700;text-decoration:none}
.csg .csg-choose:hover {background:var(--blue);color:white}
.csg .csg-view {color:var(--blue-dark);text-underline-offset:.2em}
.csg .csg-show-all {display:block;margin:18px auto 0;padding:9px 16px;color:var(--blue-dark);font-weight:700}
.csg-empty {padding:1rem;background:var(--page);border-radius:var(--radius-sm)}
.csg-dialog {
    padding:0; margin:auto; width:min(42rem,calc(100% - 2rem)); max-width:100%; max-height:85vh; max-height:85dvh;
    color:var(--ink); background:var(--paper); border:1px solid var(--line); border-radius:var(--radius);
    overflow:auto; overscroll-behavior:contain; box-shadow:0 1rem 4rem rgb(14 36 64 / .25);
}
.csg-dialog::backdrop { background:rgb(11 31 57 / .55); }
body:has(.csg-dialog[open]) { overflow:hidden; }
.csg-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:1rem; }
.csg-dialog-head h3 { margin:0; overflow-wrap:anywhere; }
.csg-dialog-head button { flex:0 0 auto; }
.csg-dialog-body { padding:0 1rem; }
.csg-dialog-footer { padding:.75rem 1rem 1rem; }

@media (max-width:900px) {
    .csg-grid,#csg-results.csg-featured {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:650px) {
    .csg-heading {gap:.9rem}
    .csg-search {max-width:none;flex-basis:100%}
    .csg-categories {display:none}
    .csg-mobile-filter {display:grid;gap:.25rem}
    .csg-tools {margin:.55rem 0 .75rem;gap:.65rem}
    .csg-grid,#csg-results.csg-featured {grid-template-columns:minmax(0,1fr);gap:.7rem}
    .csg .csg-card h4 {margin-top:.7rem}
    .csg-sample {padding:.58rem .75rem}
    .csg-dialog {width:calc(100% - 1rem);max-height:94vh;max-height:94dvh}
    .csg-dialog-body {padding:0 .5rem}
}
