/* RusChat Air compact gallery block - no fixed dark/light palette */
.rcgl-widget{--rcgl-line:var(--border-color,var(--line,rgba(128,128,128,.23)));--rcgl-muted:var(--muted-color,var(--text-muted,#9696a4));--rcgl-accent:var(--accent-color,var(--accent,var(--primary-color,currentColor)));color:var(--text-color,var(--text,inherit));background:var(--card-bg,var(--surface,var(--bg-card,transparent)));font:inherit;border:1px solid var(--rcgl-line);border-radius:10px;overflow:hidden;min-width:0}
.rcgl-widget,.rcgl-widget *{box-sizing:border-box}.rcgl-widget a{text-decoration:none!important}.rcgl-widget .fa{width:17px;height:17px;flex:none}
.rcgl-head{padding:13px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--rcgl-line)}
.rcgl-heading{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:750}.rcgl-heading .fa{color:var(--rcgl-accent)}
.rcgl-head>a,.rcgl-subhead>a{color:var(--rcgl-accent)!important;font-size:13px;white-space:nowrap}
.rcgl-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:12px 14px;border-bottom:1px solid var(--rcgl-line)}
.rcgl-stat{min-width:0;display:flex;align-items:center;justify-content:center;gap:7px;padding:8px 6px;border:1px solid var(--rcgl-line);border-radius:8px;white-space:nowrap}
.rcgl-stat .fa{color:var(--rcgl-accent);width:16px;height:16px}.rcgl-stat-num{font-size:15px;font-weight:750}.rcgl-stat-label{font-size:13px;color:var(--rcgl-muted)}
.rcgl-subhead{padding:12px 15px 10px;display:flex;align-items:center;justify-content:space-between;gap:10px}.rcgl-subhead strong{font-size:15px}
.rcgl-photo-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;padding:0 14px 12px}
.rcgl-photo{min-width:0;color:inherit!important;display:block}.rcgl-photo-img{display:block;aspect-ratio:4/3;background:rgba(128,128,128,.10);overflow:hidden;border-radius:7px;border:1px solid var(--rcgl-line)}
.rcgl-photo-img img{width:100%;height:100%;display:block;object-fit:cover;transition:transform .2s}.rcgl-photo:hover img{transform:scale(1.045)}
.rcgl-photo-title{display:block;margin-top:5px;font-size:13px;font-weight:600;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rcgl-photo:hover .rcgl-photo-title{color:var(--rcgl-accent)}
.rcgl-album-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 14px 13px}
.rcgl-album{border:1px solid var(--rcgl-line);border-radius:8px;display:flex;align-items:center;gap:9px;padding:7px;min-width:0;color:inherit!important}
.rcgl-album:hover{background:rgba(128,128,128,.07)}.rcgl-album-cover{width:50px;height:43px;flex:none;display:grid;place-items:center;border-radius:5px;overflow:hidden;background:rgba(128,128,128,.1)}
.rcgl-album-cover img{width:100%;height:100%;object-fit:cover}.rcgl-album-cover .fa{color:var(--rcgl-accent);width:22px;height:22px}
.rcgl-album-info{min-width:0;display:flex;flex-direction:column;gap:4px}.rcgl-album-info strong{font-size:14px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rcgl-album-info small{font-size:12px;color:var(--rcgl-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rcgl-footer{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;border-top:1px solid var(--rcgl-line);padding:11px 14px}
.rcgl-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid var(--rcgl-line);background:transparent;color:inherit!important;padding:9px 12px;border-radius:7px;font-size:13px;font-weight:700;min-height:37px}
.rcgl-btn:hover{background:rgba(128,128,128,.09)}.rcgl-primary{background:var(--rcgl-accent);border-color:var(--rcgl-accent);color:var(--rcgl-accent-contrast,#fff)!important}.rcgl-primary:hover{filter:brightness(.92);background:var(--rcgl-accent)}
.rcgl-empty{padding:15px 14px;color:var(--rcgl-muted);font-size:14px}
@media(max-width:760px){.rcgl-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.rcgl-photo-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:520px){.rcgl-head{padding:12px}.rcgl-stats{padding:10px;gap:6px}.rcgl-stat{gap:5px;padding:7px 4px}.rcgl-stat-label{font-size:12px}.rcgl-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 11px 11px}.rcgl-subhead{padding:11px}.rcgl-album-list{grid-template-columns:1fr;padding:0 11px 11px}.rcgl-footer{padding:10px;justify-content:stretch}.rcgl-btn{flex:1;white-space:nowrap;padding:8px 9px}}

/* v1.0.2: true thumbnail-size cards, with RusChat Air readable typography. */
.rcgl-widget{font-family:inherit;font-size:14px;line-height:1.45}
.rcgl-photo-grid{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:flex-start;gap:11px;padding:0 14px 14px}
.rcgl-photo{display:block;flex:0 0 112px;width:112px;max-width:112px;min-width:0}
.rcgl-photo-img{width:112px;height:84px;aspect-ratio:auto;border-radius:7px}
.rcgl-photo-img img{width:100%;height:100%;object-fit:cover}
.rcgl-photo-title{font-size:14px;line-height:1.4;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:5px}
.rcgl-album-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.rcgl-album{min-height:64px;padding:7px 9px;gap:10px}
.rcgl-album-cover{width:52px;height:45px}
.rcgl-album-info strong{font-size:14px}.rcgl-album-info small{font-size:13px}
.rcgl-stat-num{font-size:15px}.rcgl-stat-label{font-size:14px}
.rcgl-subhead strong{font-size:16px}.rcgl-head>a,.rcgl-subhead>a{font-size:14px}
.rcgl-btn{font-size:14px}.rcgl-empty{font-size:14px}
@media(max-width:760px){.rcgl-photo-grid{display:flex;flex-wrap:wrap;gap:9px}}
@media(max-width:520px){
 .rcgl-photo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;padding:0 11px 12px}
 .rcgl-photo{width:100%;max-width:100%;min-width:0;flex:none}
 .rcgl-photo-img{width:100%;height:auto;aspect-ratio:4/3}
 .rcgl-photo-title{font-size:13px}
 .rcgl-album-list{grid-template-columns:1fr}
 .rcgl-stat-label{font-size:13px}
}
@media(max-width:340px){.rcgl-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* v1.1.2: match the header height, title and top-right link of other RusChat Air widgets.
   Strictly header-scoped; photo and album grid layouts remain unchanged. */
.rcgl-widget .rcgl-head {
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  min-height:48px!important;
  padding:10px 14px!important;
  margin:0!important;
  flex-wrap:nowrap;
}
.rcgl-widget .rcgl-head .rcgl-heading {
  display:inline-flex!important;
  align-items:center!important;
  min-width:0;
  margin:0!important;
  padding:0!important;
  font:inherit!important;
  font-size:16px!important;
  font-weight:700!important;
  line-height:1.4!important;
}
.rcgl-widget .rcgl-head>a {
  display:inline-flex!important;
  flex:none;
  align-items:center!important;
  justify-content:flex-end!important;
  min-height:28px!important;
  width:auto!important;
  margin:0!important;
  padding:2px 0!important;
  font:inherit!important;
  font-size:.88em!important;
  font-weight:400!important;
  line-height:1.35!important;
  white-space:nowrap!important;
}
@media(max-width:520px) {
  .rcgl-widget .rcgl-head {min-height:44px!important;padding:9px 11px!important}
}

/* v1.1.4: header typography correction, scoped only to the gallery title and link.
   No changes to photo/album column layouts. */
.rcgl-widget .rcgl-head .rcgl-heading {
  font-size:18px!important;
  font-weight:700!important;
  line-height:1.4!important;
}
.rcgl-widget .rcgl-head>a {
  font-size:15px!important;
  font-weight:400!important;
  line-height:1.35!important;
}

/* v1.1.5: Upload button contrast follows RusChat Air light/dark theme.
   The rule is restricted to the upload button; gallery layouts are unchanged. */
.rcgl-widget .rcgl-footer .rcgl-btn.rcgl-primary {color:#fff!important;}
html[data-theme="dark"] .rcgl-widget .rcgl-footer .rcgl-btn.rcgl-primary,
body[data-theme="dark"] .rcgl-widget .rcgl-footer .rcgl-btn.rcgl-primary,
html.theme-dark .rcgl-widget .rcgl-footer .rcgl-btn.rcgl-primary,
body.theme-dark .rcgl-widget .rcgl-footer .rcgl-btn.rcgl-primary,
html.dark .rcgl-widget .rcgl-footer .rcgl-btn.rcgl-primary,
body.dark .rcgl-widget .rcgl-footer .rcgl-btn.rcgl-primary {color:#111!important;}

/* Font Awesome icons replace inline SVG in this widget. */
.rcgl-widget .fa{display:inline-block;vertical-align:middle;line-height:1;}


/* v1.1.8: precisely aligned Font Awesome icons in statistics/buttons.
   Keep the existing photo and album column definitions unchanged. */
.rcgl-widget .rcgl-stats .rcgl-stat {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:38px;
  padding:8px 10px;
  line-height:1.3;
}
.rcgl-widget .rcgl-stats .rcgl-stat > .fa {
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  flex:0 0 18px;
  width:18px!important;
  height:18px!important;
  margin:0!important;
  padding:0!important;
  font-family:FontAwesome!important;
  font-size:16px!important;
  font-weight:normal!important;
  font-style:normal!important;
  line-height:1!important;
  text-align:center!important;
  vertical-align:middle!important;
  color:var(--rcgl-accent);
}
.rcgl-widget .rcgl-stats .rcgl-stat-num,
.rcgl-widget .rcgl-stats .rcgl-stat-label {
  display:inline-block;
  margin:0;
  line-height:18px;
  vertical-align:middle;
}
.rcgl-widget .rcgl-footer .rcgl-btn > .fa {
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  flex:0 0 16px;
  width:16px!important;
  height:16px!important;
  padding:0!important;
  margin:0!important;
  font-family:FontAwesome!important;
  font-size:14px!important;
  font-weight:normal!important;
  font-style:normal!important;
  line-height:1!important;
  text-align:center!important;
}
.rcgl-widget .rcgl-footer .rcgl-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  line-height:1.3;
}
.rcgl-widget .rcgl-album-cover > .fa {
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  width:22px!important;
  height:22px!important;
  font-family:FontAwesome!important;
  font-size:20px!important;
  font-weight:normal!important;
  font-style:normal!important;
  line-height:1!important;
}
@media (max-width:520px) {
  .rcgl-widget .rcgl-stats .rcgl-stat {gap:5px;padding:7px 5px}
  .rcgl-widget .rcgl-stats .rcgl-stat > .fa {flex-basis:16px;width:16px!important;height:16px!important;font-size:14px!important}
}

/* v1.1.9 - the four statistics use ordinary RusChat Air body typography.
   Only stats typography is affected; icons and photo/album layouts stay intact. */
.rcgl-widget .rcgl-stats .rcgl-stat {
  font-family:inherit!important;
  font-size:inherit!important;
  font-weight:400!important;
  font-style:normal!important;
}
.rcgl-widget .rcgl-stats .rcgl-stat-num,
.rcgl-widget .rcgl-stats .rcgl-stat-label {
  font-family:inherit!important;
  font-size:inherit!important;
  font-weight:400!important;
  font-style:normal!important;
  letter-spacing:normal!important;
  line-height:1.45!important;
}

/* v1.2.0: fluid, full-width photo grid.
   A minimum usable width protects small screens; photos grow/shrink with their container.
   Album columns, statistics, header, and buttons are intentionally untouched. */
.rcgl-widget .rcgl-photo-grid {
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,112px),1fr))!important;
  justify-content:stretch!important;
  align-items:start!important;
  gap:10px!important;
  width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
.rcgl-widget .rcgl-photo-grid > .rcgl-photo {
  display:block!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  flex:none!important;
  margin:0!important;
}
.rcgl-widget .rcgl-photo-grid .rcgl-photo-img {
  display:block!important;
  width:100%!important;
  height:auto!important;
  aspect-ratio:4 / 3!important;
  overflow:hidden;
  box-sizing:border-box;
}
.rcgl-widget .rcgl-photo-grid .rcgl-photo-img img {
  display:block!important;
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
}
@media(max-width:520px) {
  .rcgl-widget .rcgl-photo-grid {
    grid-template-columns:repeat(auto-fit,minmax(min(100%,96px),1fr))!important;
    gap:8px!important;
  }
}

/* v1.2.1: unified RusChat button style */
.rcgl-widget .rcgl-btn,
.rcgl-widget button.rcgl-btn,
.rcgl-widget a.rcgl-btn {
  border-radius:6px!important;
  font-weight:600!important;
}
