.gallery-window {
  left: clamp(126px, 14vw, 300px);
  top: clamp(72px, 10vh, 136px);
  width: min(1050px, 78vw);
  height: min(710px, calc(100vh - var(--taskbar-h) - 70px));
  min-width: 760px;
  min-height: 520px;
  z-index: 9;
}

.gallery-window.is-active {
  z-index: 12;
}

.gallery-body {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) 23px;
  min-height: 0;
  height: 100%;
  color: #1b2836;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .74), rgba(226, 238, 249, .9) 58px, #f6f8fb 59px),
    #f6f8fb;
  border-top: 1px solid rgba(255, 255, 255, .65);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 12px;
}

.gallery-commandbar {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 32px;
  padding: 3px 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(218, 232, 246, .72)),
    #dfeaf5;
  border-bottom: 1px solid #b5c8dc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95);
}

.gallery-commandbar button,
.gallery-history button {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  padding: 3px 9px;
  color: #17324b;
  font: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
}

.gallery-command-button {
  position: relative;
}

.gallery-command-button--split {
  padding-right: 20px;
}

.gallery-command-button--split::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid #35566f;
  transform: translateY(-35%);
}

.gallery-commandbar button:hover,
.gallery-history button:hover {
  border-color: #8fb8d6;
  background: linear-gradient(#ffffff, #dceffa 48%, #c3e1f2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .74);
}

.gallery-commandbar-spacer {
  flex: 1 1 auto;
}

.gallery-icon-button {
  width: 28px;
  padding: 0;
}

.gallery-icon-button img,
.gallery-history img,
.gallery-search img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.gallery-view-glyph {
  width: 15px;
  height: 13px;
  background:
    linear-gradient(#5d91bf, #2f6fa7) 0 0 / 6px 5px no-repeat,
    linear-gradient(#5d91bf, #2f6fa7) 9px 0 / 6px 5px no-repeat,
    linear-gradient(#5d91bf, #2f6fa7) 0 8px / 6px 5px no-repeat,
    linear-gradient(#5d91bf, #2f6fa7) 9px 8px / 6px 5px no-repeat;
  border: 1px solid rgba(37, 80, 119, .24);
}

.gallery-addressbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(180px, 260px);
  gap: 7px;
  align-items: center;
  min-height: 38px;
  padding: 6px 8px;
  background: linear-gradient(#f7fbff, #e8f1fa);
  border-bottom: 1px solid #c3d2df;
}

.gallery-history {
  display: flex;
  gap: 2px;
}

.gallery-history button {
  width: 26px;
  height: 25px;
  min-height: 25px;
  padding: 0;
  background: linear-gradient(#fdfefe, #d7e7f4);
  border-color: #9eb8ce;
  border-radius: 50%;
}

.gallery-breadcrumbs,
.gallery-search {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 25px;
  border: 1px solid #9fb8ce;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(40, 70, 100, .14);
}

.gallery-breadcrumbs {
  gap: 0;
  overflow: hidden;
}

.gallery-breadcrumbs span,
.gallery-breadcrumbs strong {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 21px 0 10px;
  white-space: nowrap;
  font-weight: 400;
}

.gallery-breadcrumbs span::after,
.gallery-breadcrumbs strong::after {
  content: "";
  position: absolute;
  right: 5px;
  width: 7px;
  height: 7px;
  border-top: 1px solid #6b879f;
  border-right: 1px solid #6b879f;
  transform: rotate(45deg);
}

.gallery-breadcrumbs strong {
  color: #102d4a;
}

.gallery-search {
  gap: 6px;
  padding: 0 7px;
}

.gallery-search input {
  min-width: 0;
  width: 100%;
  height: 21px;
  color: #23374a;
  font: inherit;
  border: 0;
  outline: 0;
  background: transparent;
}

.gallery-search input::placeholder {
  color: #63798c;
}

.gallery-choice {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.gallery-shell {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr) 252px;
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, .82);
}

.gallery-nav {
  min-width: 0;
  overflow: auto;
  padding: 10px 8px 12px;
  background: linear-gradient(90deg, #edf4fb, #f8fbfe);
  border-right: 1px solid #c2d2e1;
}

.gallery-nav section + section {
  margin-top: 13px;
}

.gallery-nav h2 {
  margin: 0 0 5px;
  padding: 0 7px;
  color: #4c6c86;
  font-size: 12px;
  font-weight: 600;
}

.gallery-nav a {
  display: block;
  min-width: 0;
  overflow: hidden;
  padding: 4px 8px 5px 18px;
  color: #193953;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 3px;
}

.gallery-nav a:hover,
.gallery-nav a.is-selected {
  border-color: #b7d3ea;
  background: linear-gradient(#fafdff, #dceefa);
}

.gallery-main {
  display: grid;
  grid-template-rows: auto minmax(230px, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.gallery-folder-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #d8e2ec;
  background:
    radial-gradient(circle at 88% 26%, rgba(121, 170, 214, .22), transparent 30%),
    linear-gradient(#ffffff, #f6fbff);
}

.gallery-folder-head h1 {
  margin: 0;
  color: #183b5c;
  font-size: 21px;
  font-weight: 400;
  line-height: 1.2;
}

.gallery-folder-head p {
  margin: 3px 0 0;
  color: #5f7488;
  font-size: 12px;
}

.gallery-folder-head dl {
  display: flex;
  gap: 14px;
  margin: 0;
  color: #5f7488;
}

.gallery-folder-head dt,
.gallery-folder-head dd {
  margin: 0;
}

.gallery-folder-head dt {
  font-size: 11px;
}

.gallery-folder-head dd {
  color: #1a3550;
  font-size: 13px;
}

.gallery-grid-pane {
  min-height: 0;
  overflow: auto;
  padding: 10px 14px 14px;
}

.gallery-group-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  color: #426681;
  font-size: 12px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 10px;
  align-items: start;
}

.gallery-tile {
  position: relative;
  display: grid;
  grid-template-rows: 86px auto auto auto;
  gap: 4px;
  min-width: 0;
  padding: 7px;
  color: #1c3347;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: default;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.gallery-tile:hover {
  border-color: #b8d6ee;
  background: #eef7ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .78);
}

.gallery-thumb {
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  padding: 4px;
  background:
    linear-gradient(135deg, #ffffff, #edf3f8),
    #fff;
  border: 1px solid #c9d7e3;
  box-shadow: 0 1px 2px rgba(45, 76, 105, .22);
}

.gallery-thumb img {
  display: block;
  width: 100%;
  height: 76px;
  object-fit: cover;
}

.gallery-open-affordance {
  justify-self: center;
  max-width: 100%;
  min-height: 17px;
  padding: 1px 7px 2px;
  overflow: hidden;
  color: #245879;
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #b6d1e5;
  border-radius: 2px;
  background: linear-gradient(#ffffff, #e3f2fb);
  opacity: .82;
}

.gallery-tile:hover .gallery-open-affordance {
  color: #123a58;
  border-color: #6aa6cf;
  opacity: 1;
}

.gallery-name,
.gallery-meta {
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-name {
  font-size: 12px;
}

.gallery-meta {
  color: #6a7f91;
  font-size: 11px;
}

.gallery-list-pane {
  min-height: 116px;
  overflow: auto;
  border-top: 1px solid #d7e1ec;
  background: #fbfdff;
}

.gallery-list-head,
.gallery-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.6fr) minmax(88px, .8fr) minmax(86px, .8fr) 70px;
  align-items: center;
}

.gallery-list-head {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 24px;
  color: #435d73;
  background: linear-gradient(#ffffff, #e8f0f8);
  border-bottom: 1px solid #c8d7e5;
}

.gallery-list-head span,
.gallery-row span {
  min-width: 0;
  overflow: hidden;
  padding: 4px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-right: 1px solid #e4edf5;
}

.gallery-row {
  min-height: 25px;
  color: #20394e;
  border-bottom: 1px solid #edf3f8;
  cursor: default;
}

.gallery-row:nth-child(odd) {
  background: #f7fbff;
}

.gallery-row:hover {
  background: #eaf6ff;
}

.gallery-preview {
  min-width: 0;
  overflow: auto;
  padding: 13px 12px;
  background:
    linear-gradient(180deg, #f6fbff, #e7f0f8),
    #edf5fb;
  border-left: 1px solid #c2d2e1;
}

.gallery-detail {
  display: none;
  gap: 9px;
}

.gallery-detail img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #fff;
  border: 1px solid #aebfd0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .9),
    0 2px 8px rgba(47, 76, 104, .24);
}

.gallery-detail h2 {
  margin: 2px 0 0;
  color: #183b5c;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.gallery-detail p {
  margin: 0;
  color: #4e6579;
  font-size: 12px;
  line-height: 1.45;
}

.gallery-detail dl {
  display: grid;
  gap: 5px;
  margin: 4px 0 0;
  padding-top: 8px;
  border-top: 1px solid #c9d8e5;
}

.gallery-detail dl div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 7px;
}

.gallery-detail dt,
.gallery-detail dd {
  min-width: 0;
  margin: 0;
}

.gallery-detail dt {
  color: #63798c;
}

.gallery-detail dd {
  color: #1d3449;
  overflow-wrap: anywhere;
}

.gallery-detail-open {
  justify-self: stretch;
  min-height: 28px;
  margin-top: 2px;
  color: #183e5b;
  font: inherit;
  border: 1px solid #8eb5d2;
  border-radius: 3px;
  background:
    linear-gradient(#ffffff, #e3f4fd 48%, #b9daf0),
    #d9edf8;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .75),
    0 1px 1px rgba(36, 66, 92, .16);
}

.gallery-detail-open:hover,
.gallery-detail-open:focus-visible {
  color: #092b46;
  border-color: #4f98c6;
  background: linear-gradient(#ffffff, #e8f8ff 48%, #85c8eb);
  outline: 0;
}

.gallery-detail-open:active {
  background: linear-gradient(#73b7dd, #a8d8ef 52%, #effbff);
}

.gallery-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 9px;
  color: #344e65;
  background: linear-gradient(#f6fbff, #dce9f5);
  border-top: 1px solid #b9ccdd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86);
}

#gallery-photo-sol:checked ~ .gallery-shell [for="gallery-photo-sol"],
#gallery-photo-naturaleza:checked ~ .gallery-shell [for="gallery-photo-naturaleza"],
#gallery-photo-sky:checked ~ .gallery-shell [for="gallery-photo-sky"],
#gallery-photo-cuadros:checked ~ .gallery-shell [for="gallery-photo-cuadros"],
#gallery-photo-feed:checked ~ .gallery-shell [for="gallery-photo-feed"],
#gallery-photo-herbalism:checked ~ .gallery-shell [for="gallery-photo-herbalism"],
#gallery-photo-self:checked ~ .gallery-shell [for="gallery-photo-self"],
#gallery-photo-field:checked ~ .gallery-shell [for="gallery-photo-field"] {
  color: #082c4b;
  border-color: #6da9d8;
  background: linear-gradient(#dff2ff, #b7def7);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72);
}

#gallery-photo-sol:checked ~ .gallery-shell [for="gallery-photo-sol"] .gallery-open-affordance,
#gallery-photo-naturaleza:checked ~ .gallery-shell [for="gallery-photo-naturaleza"] .gallery-open-affordance,
#gallery-photo-sky:checked ~ .gallery-shell [for="gallery-photo-sky"] .gallery-open-affordance,
#gallery-photo-cuadros:checked ~ .gallery-shell [for="gallery-photo-cuadros"] .gallery-open-affordance,
#gallery-photo-feed:checked ~ .gallery-shell [for="gallery-photo-feed"] .gallery-open-affordance,
#gallery-photo-herbalism:checked ~ .gallery-shell [for="gallery-photo-herbalism"] .gallery-open-affordance,
#gallery-photo-self:checked ~ .gallery-shell [for="gallery-photo-self"] .gallery-open-affordance,
#gallery-photo-field:checked ~ .gallery-shell [for="gallery-photo-field"] .gallery-open-affordance {
  color: #0f4365;
  border-color: #5b9dcc;
  background: linear-gradient(#ffffff, #d6efff);
  opacity: 1;
}

#gallery-photo-sol:checked ~ .gallery-shell .gallery-detail-sol,
#gallery-photo-naturaleza:checked ~ .gallery-shell .gallery-detail-naturaleza,
#gallery-photo-sky:checked ~ .gallery-shell .gallery-detail-sky,
#gallery-photo-cuadros:checked ~ .gallery-shell .gallery-detail-cuadros,
#gallery-photo-feed:checked ~ .gallery-shell .gallery-detail-feed,
#gallery-photo-herbalism:checked ~ .gallery-shell .gallery-detail-herbalism,
#gallery-photo-self:checked ~ .gallery-shell .gallery-detail-self,
#gallery-photo-field:checked ~ .gallery-shell .gallery-detail-field {
  display: grid;
}

#gallery-photo-sol:focus-visible ~ .gallery-shell [for="gallery-photo-sol"],
#gallery-photo-naturaleza:focus-visible ~ .gallery-shell [for="gallery-photo-naturaleza"],
#gallery-photo-sky:focus-visible ~ .gallery-shell [for="gallery-photo-sky"],
#gallery-photo-cuadros:focus-visible ~ .gallery-shell [for="gallery-photo-cuadros"],
#gallery-photo-feed:focus-visible ~ .gallery-shell [for="gallery-photo-feed"],
#gallery-photo-herbalism:focus-visible ~ .gallery-shell [for="gallery-photo-herbalism"],
#gallery-photo-self:focus-visible ~ .gallery-shell [for="gallery-photo-self"],
#gallery-photo-field:focus-visible ~ .gallery-shell [for="gallery-photo-field"] {
  outline: 2px solid #1a74b7;
  outline-offset: 1px;
}

@media (max-width: 899px), (max-height: 690px) {
  .gallery-window {
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: calc(100vw - 16px);
    min-width: 0;
    height: min(84vh, 760px);
  }

  .gallery-body {
    min-height: 620px;
  }

  .gallery-addressbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .gallery-search {
    grid-column: 1 / -1;
  }

  .gallery-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .gallery-nav {
    display: none;
  }

  .gallery-main {
    min-height: 0;
  }

  .gallery-preview {
    max-height: 240px;
    border-top: 1px solid #c2d2e1;
    border-left: 0;
  }

  .gallery-list-head,
  .gallery-row {
    grid-template-columns: minmax(150px, 1fr) 84px 74px;
  }

  .gallery-list-head span:nth-child(4),
  .gallery-row span:nth-child(4) {
    display: none;
  }
}

@media (max-width: 620px) {
  .gallery-commandbar {
    overflow-x: auto;
  }

  .gallery-folder-head {
    display: block;
  }

  .gallery-folder-head dl {
    margin-top: 8px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  }

  .gallery-list-pane {
    display: none;
  }
}
