.gdfv-wrap {
  --gdfv-accent: #2271b1;
  --gdfv-border: #e1e5ea;
  --gdfv-muted: #68727d;
  --gdfv-bg: #fff;
  font-family: inherit;
  max-width: 1200px;
  margin: 20px auto;
}

.gdfv-head {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.gdfv-title { margin: 0; }

.gdfv-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gdfv-controls input,
.gdfv-controls select {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #ccd2d9;
  border-radius: 6px;
  background: var(--gdfv-bg);
  font-size: 14px;
}

.gdfv-view-toggle { display: inline-flex; border: 1px solid #ccd2d9; border-radius: 6px; overflow: hidden; }
.gdfv-view-btn {
  border: 0; background: var(--gdfv-bg); cursor: pointer;
  padding: 8px 12px; font-size: 15px; line-height: 1; color: var(--gdfv-muted);
}
.gdfv-view-btn + .gdfv-view-btn { border-left: 1px solid #ccd2d9; }
.gdfv-view-btn[aria-pressed="true"] { background: var(--gdfv-accent); color: #fff; }

.gdfv-breadcrumbs { margin: 0 0 12px; font-size: 13px; color: var(--gdfv-muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.gdfv-breadcrumbs:empty { display: none; }
.gdfv-crumb { background: none; border: 0; padding: 2px 4px; cursor: pointer; color: var(--gdfv-accent); font-size: 13px; text-decoration: underline; }
.gdfv-crumb.is-current { color: var(--gdfv-muted); text-decoration: none; cursor: default; }
.gdfv-crumb-sep { color: #b7bec5; }

.gdfv-status { padding: 10px 0; color: var(--gdfv-muted); font-size: 14px; }
.gdfv-status.gdfv-error, .gdfv-error { color: #b32d2e; }

/* Grid layout */
.gdfv-grid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.gdfv-grid-grid .gdfv-card {
  border: 1px solid var(--gdfv-border);
  border-radius: 10px;
  background: var(--gdfv-bg);
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
  display: flex;
  flex-direction: column;
  min-height: 170px;
  transition: box-shadow .15s ease, transform .15s ease;
}
.gdfv-grid-grid .gdfv-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .09); }
.gdfv-grid-grid .gdfv-card.is-clickable { cursor: pointer; }
.gdfv-grid-grid .gdfv-media { margin-bottom: 10px; }

/* List layout */
.gdfv-grid-list { display: flex; flex-direction: column; gap: 8px; }
.gdfv-grid-list .gdfv-card {
  border: 1px solid var(--gdfv-border);
  border-radius: 8px;
  background: var(--gdfv-bg);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
}
.gdfv-grid-list .gdfv-card.is-clickable { cursor: pointer; }
.gdfv-grid-list .gdfv-media { margin: 0; }
.gdfv-grid-list .gdfv-name { grid-column: 2; }
.gdfv-grid-list .gdfv-meta { grid-column: 2; margin-top: 2px; }
.gdfv-grid-list .gdfv-actions { grid-column: 3; grid-row: 1 / span 2; margin: 0; padding: 0; }
.gdfv-grid-list .gdfv-icon,
.gdfv-grid-list .gdfv-thumb-wrap { width: 36px; height: 36px; font-size: 18px; }

/* Shared card bits */
.gdfv-icon {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 30px;
}
.gdfv-grid-list .gdfv-icon { border-radius: 6px; aspect-ratio: auto; }
.gdfv-icon-folder { background: #fff6da; }
.gdfv-icon-chip { color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.gdfv-grid-list .gdfv-icon-chip { font-size: 11px; }

.gdfv-thumb-wrap { width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #f0f2f5; }
.gdfv-grid-list .gdfv-thumb-wrap { border-radius: 6px; }
.gdfv-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }

.gdfv-name { font-weight: 600; line-height: 1.35; word-break: break-word; }
.gdfv-meta { font-size: 12px; color: var(--gdfv-muted); margin-top: 4px; }

.gdfv-actions { margin-top: auto; padding-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.gdfv-actions button,
.gdfv-actions a {
  cursor: pointer; border: 0; border-radius: 6px; padding: 7px 10px;
  text-decoration: none; background: #f0f2f5; color: #1d2327; font-size: 12.5px;
}
.gdfv-actions .gdfv-open { background: var(--gdfv-accent); color: #fff; }
.gdfv-actions button:focus-visible,
.gdfv-actions a:focus-visible,
.gdfv-view-btn:focus-visible,
.gdfv-crumb:focus-visible,
.gdfv-page:focus-visible { outline: 2px solid var(--gdfv-accent); outline-offset: 2px; }

.gdfv-pagination { display: flex; gap: 6px; justify-content: center; margin: 22px 0; flex-wrap: wrap; }
.gdfv-page { border: 1px solid #ccd2d9; background: var(--gdfv-bg); padding: 7px 11px; border-radius: 5px; cursor: pointer; }
.gdfv-page.active { background: var(--gdfv-accent); color: #fff; border-color: var(--gdfv-accent); }

.gdfv-empty { grid-column: 1 / -1; padding: 40px 20px; text-align: center; border: 1px dashed #ccd2d9; border-radius: 8px; color: var(--gdfv-muted); }

.gdfv-modal { display: none; position: fixed; inset: 0; z-index: 999999; }
.gdfv-modal.is-open { display: block; }
.gdfv-modal-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .78); }
.gdfv-modal-box { position: absolute; inset: 4vh 4vw; background: #fff; border-radius: 8px; overflow: hidden; }
.gdfv-close {
  position: absolute; right: 8px; top: 6px; z-index: 2; width: 38px; height: 38px;
  border: 0; border-radius: 50%; background: #fff; font-size: 25px; cursor: pointer;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .25);
}
.gdfv-viewer { width: 100%; height: 100%; }
.gdfv-viewer iframe { width: 100%; height: 100%; border: 0; }

@media (max-width: 700px) {
  .gdfv-modal-box { inset: 2vh 2vw; }
  .gdfv-grid-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .gdfv-grid-list .gdfv-card { grid-template-columns: 34px 1fr; }
  .gdfv-grid-list .gdfv-actions { grid-column: 1 / -1; grid-row: 3; }
  .gdfv-head { align-items: stretch; }
  .gdfv-controls { width: 100%; }
  .gdfv-controls > * { flex: 1; min-width: 130px; }
}

@media (prefers-color-scheme: dark) {
  .gdfv-wrap { --gdfv-bg: #1e2125; --gdfv-border: #33383e; --gdfv-muted: #9aa3ab; color: #e6e8ea; }
  .gdfv-controls input, .gdfv-controls select, .gdfv-view-btn, .gdfv-page { color: inherit; border-color: #3a4046; }
  .gdfv-actions button, .gdfv-actions a { background: #2a2f35; color: #e6e8ea; }
  .gdfv-icon-folder { background: #3a3620; }
  .gdfv-close { background: #2a2f35; color: #e6e8ea; }
}
