.refg {
  --refg-blue: #087dff;
  --refg-text: #181b20;
  --refg-muted: #68727e;
  --refg-line: #e2e6eb;
  color: var(--refg-text);
  font-size: 1rem;
  line-height: 1.6;
}
.refg *, .refg *::before, .refg *::after {box-sizing: border-box;}
.refg [hidden] {display: none !important;}
.refg button, .refg a {font: inherit;}
.refg button {cursor: pointer;}
.refg button:focus-visible, .refg a:focus-visible, .refg-stage:focus-visible {
  outline: 3px solid var(--refg-blue);
  outline-offset: 3px;
}
.refg-header, .refg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.refg-title {margin: 0; font-size: 1.25rem; font-weight: 600; line-height: 1.4;}
.refg-summary {margin: .35rem 0 0; color: var(--refg-muted); font-size: .875rem;}
.refg-source {flex: 0 0 auto; color: #1765b7; font-size: .875rem; text-underline-offset: 4px;}
.refg-categories {display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 1rem;}
.refg-category {
  min-height: 2.5rem;
  padding: .45rem .85rem;
  border: 1px solid var(--refg-line);
  border-radius: 999px;
  background: #fff;
  color: #46515f;
  font-size: .875rem !important;
  white-space: nowrap;
}
.refg-category:hover {border-color: #9ba9b9;}
.refg-category[aria-pressed="true"] {border-color: var(--refg-blue); background: #edf5ff; color: #085ebd;}
.refg-figure {margin: 0; overflow: hidden; border: 1px solid var(--refg-line); border-radius: 12px;}
.refg-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(240px, 44vh, 420px);
  min-width: 0;
  background: #f1f3f5;
}
.refg-image {display: block; width: 100%; height: 100%; object-fit: contain;}
.refg-unavailable {max-width: 25rem; margin: 1.5rem; color: var(--refg-muted); text-align: center;}
.refg-caption {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  background: #fff;
}
.refg-description {margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: .9375rem;}
.refg-counter {flex: 0 0 auto; color: var(--refg-muted); font-size: .875rem; font-variant-numeric: tabular-nums;}
.refg-navigation {display: flex; justify-content: flex-end; gap: .5rem; margin: .75rem 0;}
.refg-nav-button {
  min-height: 2.5rem;
  padding: .4rem .9rem;
  border: 1px solid var(--refg-line);
  border-radius: 6px;
  background: #fff;
  color: #384452;
  font-size: .875rem !important;
}
.refg-nav-button:hover:not(:disabled) {background: #f2f6fa; border-color: #acb7c4;}
.refg-nav-button:disabled {cursor: default; color: #9aa2ad; background: #f7f8f9;}
.refg-thumbnails {display: flex; gap: .65rem; overflow-x: auto; padding: 4px 3px 10px; scrollbar-width: thin;}
.refg-thumb {
  display: flex;
  flex: 0 0 112px;
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #f3f5f7;
  color: #475363;
}
.refg-thumb:hover {background: #eaf0f6;}
.refg-thumb[aria-pressed="true"] {border-color: var(--refg-blue); background: #edf5ff; color: #0759b2;}
.refg-thumb-image {display: block; width: 100%; height: 66px; object-fit: cover; border-radius: 4px; background: #e4e8ed;}
.refg-thumb-label {padding: 0 .15rem .15rem; font-size: .875rem; line-height: 1.4; text-align: left; overflow-wrap: anywhere;}
.refg-footer {margin-top: .65rem; padding-top: 1rem; border-top: 1px solid var(--refg-line);}
.refg-note {color: var(--refg-muted); font-size: .875rem;}
.refg-note p {margin: 0;}
.refg-date {margin-top: .25rem !important; font-size: .8125rem;}
.refg-model-button {
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: .55rem 1rem;
  border: 1px solid #191d23;
  border-radius: 6px;
  background: #191d23;
  color: #fff;
  font-size: .9375rem !important;
}
.refg-model-button:hover {background: #303843;}
.refg-empty {margin-top: 1.25rem; padding: 2rem 1.25rem; border: 1px dashed #ccd4de; border-radius: 12px; background: #f7f9fb; text-align: center;}
.refg-empty h4 {margin: 0 0 .5rem; font-size: 1.125rem;}
.refg-empty p {max-width: 34rem; margin: 0 auto; color: var(--refg-muted);}
@media (max-width: 600px) {
  .refg-header, .refg-footer {align-items: flex-start; flex-direction: column; gap: .7rem;}
  .refg-title {font-size: 1.125rem;}
  .refg-categories {gap: .4rem; margin-top: 1rem;}
  .refg-category {min-height: 2.75rem; padding: .45rem .7rem;}
  .refg-stage {height: clamp(220px, 37vh, 330px);}
  .refg-caption {flex-direction: column; gap: .25rem; padding: .75rem;}
  .refg-navigation {justify-content: stretch;}
  .refg-nav-button {flex: 1; min-height: 2.75rem;}
  .refg-thumb {flex-basis: 100px;}
  .refg-thumb-image {height: 60px;}
  .refg-model-button {width: 100%;}
}
