.cg-gallery {
  --cg-scroll-thumb: color-mix(in srgb, var(--brand-bright) 36%, var(--brand-border));
  --cg-hover-border: color-mix(in srgb, var(--brand-bright) 30%, var(--brand-border));
  width: 100%;
  min-width: 0;
  color: var(--brand-ink);
  font-family: inherit;
}
.cg-gallery *, .cg-gallery *::before, .cg-gallery *::after { box-sizing: border-box; }
.cg-gallery button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cg-gallery button:focus-visible, .cg-viewport:focus-visible, .cg-viewer:focus-visible { outline: 2px solid var(--brand-focus); outline-offset: 4px; }
.cg-viewer:focus-visible { outline-offset: -3px; }
.cg-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 30px; }
.cg-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.cg-filter { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 10px 15px; border: 1px solid transparent; border-radius: 50px; background: transparent; color: var(--brand-body); font-size: 13px !important; line-height: 1.4; white-space: nowrap; transition: background .2s, color .2s, border-color .2s; }
.cg-filter:hover { background: var(--brand-tint); color: var(--brand-strong); }
.cg-filter[aria-pressed="true"] { color: #fff; background: var(--brand-gradient); box-shadow: 0 4px 10px -6px var(--brand-shadow); }
.cg-filter[aria-pressed="true"]:hover { background: var(--brand-gradient-hover); }
.cg-filter-count { font-size: 10px; font-variant-numeric: tabular-nums; }
.cg-shelf-controls, .cg-dialog-navigation, .cg-zoom-controls { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.cg-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; background: var(--brand-soft-gradient); color: var(--brand-color); border: 1px solid var(--brand-border); border-radius: 50%; font-size: 23px !important; font-weight: 400; line-height: 1; transition: background .2s, border-color .2s, color .2s; }
.cg-icon-button:hover:not(:disabled) { background: var(--brand-tint); border-color: var(--cg-hover-border); color: var(--brand-strong); }
.cg-icon-button:disabled { opacity: .3; cursor: default; }
.cg-viewport { --cg-shelf-inset: 5px; container-type: inline-size; width: 100%; min-width: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--cg-scroll-thumb) transparent; scroll-padding-inline: var(--cg-shelf-inset); }
.cg-viewport::-webkit-scrollbar { height: 4px; }
.cg-viewport::-webkit-scrollbar-thumb { background: var(--cg-scroll-thumb); border-radius: 20px; }
.cg-track { --cg-visible-cards: 3; --cg-gap: 24px; display: flex; align-items: stretch; gap: var(--cg-gap); width: max-content; min-width: 100%; padding: 5px var(--cg-shelf-inset) 24px; }
.cg-card {
  flex: 0 0 auto;
  width: calc((100cqw - 2 * var(--cg-shelf-inset) - (var(--cg-visible-cards) - 1) * var(--cg-gap)) / var(--cg-visible-cards));
  scroll-snap-align: start;
}
@container (max-width: 1000px) {
  .cg-track { --cg-visible-cards: 2; }
}
@container (max-width: 620px) {
  .cg-track { --cg-visible-cards: 1; }
}
.cg-open { display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; text-align: left; border: 0; background: transparent; color: inherit; }
.cg-frame { position: relative; display: flex; align-items: center; justify-content: center; height: 296px; width: 100%; padding: 16px; border-radius: 13px; border: 1px solid var(--brand-border); background: var(--brand-soft-gradient); box-shadow: inset 0 1px 0 #fff, 0 10px 23px -19px var(--brand-shadow); backdrop-filter: blur(12px); transition: border-color .25s, box-shadow .25s; }
.cg-open:hover .cg-frame { border-color: var(--cg-hover-border); box-shadow: inset 0 1px 0 #fff, 0 13px 24px -17px var(--brand-shadow); }
.cg-thumbnail { display: block; flex: none; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; object-position: center; box-shadow: 0 3px 12px color-mix(in srgb, var(--brand-ink) 9%, transparent); }
.cg-enlarge { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; justify-content: center; width: 29px; height: 29px; color: var(--brand-color); border: 1px solid var(--brand-border); border-radius: 50%; background: var(--brand-wash); font-size: 16px; }
.cg-open:hover .cg-enlarge { background: var(--brand-tint); border-color: var(--cg-hover-border); color: var(--brand-strong); }
.cg-card-meta { display: flex; flex: 1; flex-direction: column; padding: 19px 2px 0; }
.cg-type { font-size: 10px; line-height: 1.4; letter-spacing: .06em; color: var(--brand-color); }
.cg-card-title { display: block; min-height: 44px; margin-top: 7px; color: var(--brand-ink); font-size: 14px; line-height: 1.6; font-weight: 500; overflow-wrap: anywhere; }
.cg-card-date { margin-top: 10px; font-size: 11px; line-height: 1.5; color: var(--brand-muted); font-variant-numeric: tabular-nums; }
.cg-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.cg-count, .cg-hint { margin: 0; color: var(--brand-muted); font-size: 11px; line-height: 1.6; letter-spacing: .02em; }
.cg-hint span { margin-left: 6px; color: var(--brand-color); }
.cg-disclosure { max-width: 100%; margin: 15px 0 0; color: var(--brand-muted); font-size: 10px; line-height: 1.7; }
.cg-dialog { position: fixed; inset: 0; width: min(1080px, calc(100vw - 48px)); height: min(940px, calc(100dvh - 48px)); max-width: none; max-height: none; margin: auto; padding: 0; overflow: hidden; color: var(--brand-ink); background: var(--brand-wash); border: 1px solid var(--brand-border); border-radius: 18px; box-shadow: 0 25px 100px color-mix(in srgb, var(--brand-ink) 20%, transparent); }
.cg-dialog[open] { display: flex; flex-direction: column; }
.cg-dialog::backdrop { background: color-mix(in srgb, var(--brand-ink) 48%, transparent); backdrop-filter: blur(9px); }
.cg-dialog-header { display: flex; flex: 0 0 auto; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 24px; background: var(--brand-wash); border-bottom: 1px solid var(--brand-border); }
.cg-dialog-heading { min-width: 0; }
.cg-dialog-kicker { margin: 0 0 5px; color: var(--brand-color); font-size: 10px; letter-spacing: .08em; line-height: 1.5; }
.cg-dialog-title { margin: 0; font-family: inherit; font-size: 17px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.cg-close { flex: 0 0 auto; }
.cg-viewer { flex: 1; min-height: 120px; width: 100%; overflow: auto; overscroll-behavior: contain; background: radial-gradient(ellipse at center, var(--brand-wash), var(--brand-tint)); scrollbar-width: thin; scrollbar-color: var(--cg-scroll-thumb) transparent; }
.cg-image-stage { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; padding: 20px; }
.cg-full-image { display: block; flex: 0 0 auto; max-width: none; max-height: none; object-fit: contain; box-shadow: 0 5px 24px color-mix(in srgb, var(--brand-ink) 13%, transparent); user-select: none; }
.cg-dialog-controls { display: flex; flex: 0 0 auto; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 24px; background: var(--brand-wash); border-top: 1px solid var(--brand-border); }
.cg-position { min-width: 60px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--brand-muted); }
.cg-zoom-reset { min-width: 60px; padding: 8px; border: 0; background: transparent; color: var(--brand-color); font-size: 12px !important; font-variant-numeric: tabular-nums; border-radius: 8px; }
.cg-zoom-reset:hover { background: var(--brand-tint); color: var(--brand-strong); }
.cg-dialog-details { flex: 0 0 auto; padding: 0 24px 18px; background: var(--brand-wash); }
.cg-dialog-details p { margin: 3px 0; color: var(--brand-muted); font-size: 11px; line-height: 1.6; }
.cg-dialog-details .cg-holder { color: var(--brand-body); }
.cg-dialog-details p[hidden] { display: none; }
@media (max-width: 700px) {
  .cg-toolbar { gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
  .cg-filters { flex: 1 1 100%; gap: 4px; }
  .cg-filter { padding: 8px 10px; gap: 5px; font-size: 12px !important; }
  .cg-shelf-controls { margin-left: auto; }
  .cg-shelf-controls .cg-icon-button { width: 34px; height: 34px; }
  .cg-track { --cg-gap: 16px; }
  .cg-frame { height: 270px; padding: 14px; }
  .cg-card-meta { padding-top: 15px; }
  .cg-card-title { font-size: 13px; }
  .cg-dialog { width: calc(100vw - 20px); height: calc(100dvh - 24px); border-radius: 13px; }
  .cg-dialog-header { padding: 16px; gap: 12px; }
  .cg-dialog-title { font-size: 14px; }
  .cg-dialog-controls { padding: 12px; gap: 6px; }
  .cg-dialog-navigation, .cg-zoom-controls { gap: 4px; }
  .cg-dialog-controls .cg-icon-button { width: 36px; height: 36px; }
  .cg-position, .cg-zoom-reset { min-width: 48px; }
  .cg-dialog-details { padding: 0 16px 14px; }
  .cg-dialog-details p { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .cg-filter, .cg-icon-button, .cg-frame { transition: none; }
}

