/* Gallery viewing layer: a discovery-style mobile masonry feed and a paced desktop wall. */

.role-gallery .vote-topbar {
  min-height: 148px;
  padding-top: 48px;
  padding-bottom: 18px;
}

.role-gallery .brand {
  max-width: min(760px, calc(100vw - 150px));
  gap: 12px;
}

.role-gallery .brand-text h1 {
  font-size: clamp(30px, 3.4vw, 42px);
  letter-spacing: -.06em;
}

.role-gallery .brand-text p { display: none; }

.role-gallery .progress-pill {
  min-width: 108px;
  border-color: rgba(247, 247, 251, .3);
  background: rgba(4, 5, 10, .58);
}

.role-gallery .progress-pill::before {
  content: "ON VIEW";
  color: rgba(247, 247, 251, .58);
}

.role-gallery .vote-shell {
  width: min(1440px, calc(100vw - 64px));
  padding-top: 14px;
  gap: 18px;
}

.role-gallery .demo-mode-note {
  justify-self: start;
  padding: 7px 11px;
  border-color: rgba(255, 67, 56, .24);
  background: transparent;
  font-size: 11px;
}

html[data-theme="light"] .demo-mode-note {
  border-color: rgba(201, 47, 40, .2);
  background: #fff7f6;
  color: #69717d;
}

html[data-theme="light"] .demo-mode-note b { color: #c92f28; }

/* The controls read as a gallery rail, not a dashboard card. */
.role-gallery .gal-controls {
  position: sticky;
  top: 8px;
  z-index: 32;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: start;
  padding: 10px 12px;
  gap: 10px 12px;
  border-radius: 16px;
  background: rgba(12, 13, 16, .88);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

html[data-theme="light"] .role-gallery .gal-controls {
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 40px rgba(26, 31, 40, .09);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.gal-search-wrap { min-width: 0; }
.role-gallery .gal-search input { min-height: 40px; }
.role-gallery .gal-qnote { margin: 7px 0 0; }
.gal-primary-row { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.role-gallery .gal-filters { gap: 6px; }
.role-gallery .gal-chip { min-height: 38px; padding-inline: 11px; font-size: 11.5px; }

.gal-more { position: relative; flex: 0 0 auto; }
.gal-more summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--glass-line);
  border-radius: var(--control-radius);
  background: rgba(16, 17, 19, .82);
  color: rgba(247, 247, 251, .76);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}
.gal-more summary::-webkit-details-marker { display: none; }
.gal-more summary span:last-child { transition: transform 160ms ease; }
.gal-more[open] summary span:last-child { transform: rotate(180deg); }
.gal-more.has-active-filter summary,
.gal-more[open] summary { border-color: var(--signal); color: #fff; }
.gal-more-panel {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 4;
  width: min(520px, calc(100vw - 48px));
  padding: 14px;
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  background: rgba(10, 11, 14, .97);
  box-shadow: 0 22px 64px rgba(0, 0, 0, .38);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.gal-filter-label {
  margin: 0 0 9px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gal-extra-filters { display: flex; flex-wrap: wrap; }
.gal-more-panel .gal-viewbar {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  gap: 8px;
}

html[data-theme="light"] .gal-more summary {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
}
html[data-theme="light"] .gal-more.has-active-filter summary,
html[data-theme="light"] .gal-more[open] summary { border-color: #ff4338; color: #c92f28; }
html[data-theme="light"] .gal-more-panel {
  border-color: var(--line);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 22px 58px rgba(26, 31, 40, .16);
}

/* Desktop exhibition rhythm: hero, diptych, triptych. */
.role-gallery .gal-grid:not(.is-list) {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  column-gap: clamp(20px, 2.5vw, 40px);
  row-gap: clamp(42px, 6vw, 88px);
  margin: 4px 0 42px;
}

.role-gallery .gal-grid:not(.is-list) .gal-card { grid-column: span 4; }
.role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(6n + 1) { grid-column: 1 / -1; }
.role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(6n + 2) { grid-column: span 5; }
.role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(6n + 3) { grid-column: span 7; }
.role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(6n + 4),
.role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(6n + 5),
.role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(6n + 6) { grid-column: span 4; }

.role-gallery .gal-card,
html[data-theme="light"] .role-gallery .gal-card {
  min-width: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  transition: transform 220ms ease;
}

.role-gallery .gal-card:hover,
html[data-theme="light"] .role-gallery .gal-card:hover {
  border: 0;
  box-shadow: none;
  transform: translateY(-3px);
}

.role-gallery .gal-card.is-win,
html[data-theme="light"] .role-gallery .gal-card.is-win {
  border: 0;
  background: transparent;
}

.role-gallery .gal-shot {
  width: 100%;
  aspect-ratio: var(--shot-ratio, 4 / 3);
  overflow: hidden;
  border: 1px solid rgba(247, 247, 251, .13);
  border-radius: 18px;
  background: #090a0d;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .2);
}

html[data-theme="light"] .role-gallery .gal-shot {
  border-color: rgba(23, 25, 31, .09);
  background: #eceef1;
  box-shadow: 0 22px 54px rgba(23, 28, 36, .1);
}

.role-gallery .gal-shot img {
  object-fit: contain;
  transition: transform 520ms cubic-bezier(.2, .7, .2, 1);
}

.role-gallery .gal-card:hover .gal-shot img { transform: scale(1.012); }

.role-gallery .gal-card-body {
  gap: 8px;
  padding: 16px 2px 0;
}

.role-gallery .gal-title {
  max-width: 28ch;
  font-size: clamp(18px, 1.65vw, 25px);
  line-height: 1.3;
  letter-spacing: -.025em;
}

.role-gallery .gal-by { font-size: 12px; }
.role-gallery .gal-intro-line { max-width: 58ch; font-size: 12.5px; }

.role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(6n + 1) {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(260px, 4fr);
  gap: clamp(24px, 4vw, 68px);
  align-items: center;
}

.role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(6n + 1) .gal-card-body {
  padding: 0;
}

.role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(6n + 1) .gal-title {
  font-size: clamp(28px, 3vw, 48px);
  line-height: 1.12;
}

@media (min-width: 921px) {
  /* Desktop uses a steady three-up exhibition wall: enough work is visible at once,
     while every piece keeps the same visual weight. */
  .role-gallery .gal-grid:not(.is-list) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: clamp(18px, 1.8vw, 28px);
    row-gap: clamp(36px, 3.2vw, 52px);
    margin-top: 12px;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-card,
  .role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(n),
  .role-gallery .gal-grid:not(.is-list) .gal-card:last-child:nth-child(6n + 2) {
    position: relative;
    display: flex;
    grid-column: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-card::after {
    content: "";
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 999px;
    background-color: rgba(5, 6, 10, .42);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 17 17 7M9 7h8v8' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 18px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 180ms ease, transform 180ms ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    pointer-events: none;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-card:hover::after,
  .role-gallery .gal-grid:not(.is-list) .gal-card:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
  }

  .role-gallery .gal-grid:not(.is-list) .gal-shot {
    aspect-ratio: 4 / 3;
    border-radius: 20px;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(n) .gal-card-body {
    min-height: 104px;
    gap: 6px;
    padding: 13px 3px 0;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(n) .gal-title {
    max-width: 100%;
    font-size: clamp(19px, 1.6vw, 24px);
    line-height: 1.25;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-fixture-badge,
  .role-gallery .gal-grid:not(.is-list) .gal-row-no,
  .role-gallery .gal-grid:not(.is-list) .gal-intro-line,
  .role-gallery .gal-grid:not(.is-list) .gal-tags { display: none; }
}

.gal-fixture-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(255, 67, 56, .45);
  border-radius: 999px;
  background: transparent;
  color: #ff645a;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
}

html[data-theme="light"] .gal-fixture-badge { color: #c92f28; border-color: rgba(201, 47, 40, .35); }

/* Compact index remains available without competing with the exhibition view. */
.role-gallery .gal-grid.is-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 16px 0 44px;
  border-top: 1px solid var(--line);
}

.role-gallery .gal-grid.is-list .gal-card {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  min-height: 132px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  transform: none;
}

.role-gallery .gal-grid.is-list .gal-shot {
  width: 148px;
  height: 108px;
  aspect-ratio: auto;
  border-radius: 14px;
  box-shadow: none;
}

.role-gallery .gal-grid.is-list .gal-card-body { padding: 0 0 0 20px; }
.role-gallery .gal-grid.is-list .gal-title { font-size: 20px; }

/* Artwork first, information second in the detail view. */
.role-gallery .gal-modal { padding: 24px; }
.role-gallery .gal-modal-back { background: rgba(2, 3, 6, .72); backdrop-filter: blur(10px); }
.role-gallery .gal-modal-inner,
html[data-theme="light"] .role-gallery .gal-modal-inner {
  width: min(1180px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 34px 100px rgba(0, 0, 0, .34);
}

.role-gallery .gal-modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  float: none;
  margin: 0;
  z-index: 4;
  width: 44px;
  height: 44px;
  background: rgba(4, 5, 10, .8);
  color: #fff;
}

.role-gallery .gal-modal-body { padding: 0; }
.gal-d-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); min-height: 620px; }
.gal-d-stage { min-width: 0; padding: 28px; background: #090a0d; }
html[data-theme="light"] .gal-d-stage { background: #e9ebee; }
.gal-d-info { min-width: 0; padding: 64px 38px 32px; }
.gal-d-title { margin-top: 18px; font-size: clamp(28px, 3.2vw, 44px); letter-spacing: -.035em; }
.gal-d-text { font-weight: 500; }
.gal-d-shots { gap: 22px; margin: 0; }
.gal-d-shots figure { margin: 0; }
.gal-d-shots img,
html[data-theme="light"] .gal-d-shots img {
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 18px;
  background: transparent;
}
.gal-d-shots figcaption {
  margin-top: 7px;
  color: rgba(247, 247, 251, .5);
  font: 600 10px/1.4 "IBM Plex Mono", monospace;
  letter-spacing: .08em;
  text-align: right;
}
html[data-theme="light"] .gal-d-shots figcaption { color: #737b86; }
.gal-d-empty { min-height: 520px; display: grid; place-content: center; gap: 8px; color: rgba(247, 247, 251, .48); text-align: center; }
.gal-d-empty span { font-size: 34px; }
.gal-d-empty b { font-size: 12px; }
.gal-d-actions { margin-top: 24px; }
.gal-d-vote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid #f7f7fb;
  border-radius: var(--control-radius);
  background: #f7f7fb;
  color: #050505;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}
.gal-d-vote:hover { border-color: var(--signal); background: var(--signal); color: #050505; }
.gal-d-links a {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 10px 13px;
  word-break: normal;
}
.gal-d-links a span { display: grid; gap: 3px; min-width: 0; }
.gal-d-links a b { color: inherit; font-size: 13px; }
.gal-d-links a small {
  overflow: hidden;
  color: var(--muted);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gal-d-nav { margin-top: 28px; }

.gal-return-note {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 28px);
  min-height: 46px;
  padding: 8px 9px 8px 14px;
  border: 1px solid rgba(255, 67, 56, .5);
  border-radius: 999px;
  background: rgba(8, 9, 12, .94);
  box-shadow: 0 18px 52px rgba(0, 0, 0, .38);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  animation: gal-return-in 180ms ease-out;
}
.gal-return-note button {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  cursor: pointer;
}
html[data-theme="light"] .gal-d-vote { border-color: #17191f; background: #17191f; color: #fff; }
html[data-theme="light"] .gal-return-note { background: rgba(255, 255, 255, .96); color: var(--ink); }
html[data-theme="light"] .gal-return-note button { background: rgba(23, 25, 31, .08); color: var(--ink); }

.role-gallery .gal-about {
  max-width: 760px;
  justify-self: center;
  margin-top: 30px;
}

.role-gallery .gal-foot { margin-top: 6px; }

@media (max-width: 1100px) {
  .role-gallery .gal-controls { grid-template-columns: minmax(0, 1fr); }
  .gal-primary-row { justify-content: space-between; }
}

@media (max-width: 920px) and (min-width: 761px) {
  .role-gallery .gal-grid:not(.is-list) .gal-card,
  .role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(n) { grid-column: span 6; display: flex; }
  .role-gallery .gal-grid:not(.is-list) .gal-card:first-child { grid-column: 1 / -1; display: grid; }
  .gal-d-layout { grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); }
  .gal-d-stage { padding: 20px; }
  .gal-d-info { padding-inline: 28px; }
}

@media (max-width: 760px) {
  .role-gallery .vote-topbar {
    min-height: 92px;
    padding: 62px 10px 10px;
  }

  .role-gallery .brand { max-width: calc(100vw - 98px); gap: 9px; }
  .role-gallery .brand-back { flex-basis: 38px; width: 38px; height: 38px; }
  .role-gallery .brand-text h1 { font-size: 23px; }
  .role-gallery .progress-pill { min-width: 72px; padding-inline: 7px; font-size: 9.5px; }

  .role-gallery .vote-shell {
    width: 100%;
    padding: 6px 0 72px;
    gap: 10px;
  }

  .role-gallery .demo-mode-note { margin: 2px 10px 0; }

  .role-gallery .gal-controls,
  html[data-theme="light"] .role-gallery .gal-controls {
    position: sticky;
    top: env(safe-area-inset-top, 0);
    grid-template-columns: minmax(0, 1fr);
    margin-inline: 0;
    padding: 8px 10px;
    gap: 8px;
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: 0 10px 28px rgba(26, 31, 40, .08);
  }

  .role-gallery .gal-search input { min-height: 44px; padding-inline: 13px 42px; font-size: 14px; }
  .role-gallery .gal-q-clear { right: 0; width: 44px; height: 44px; }
  .role-gallery .gal-qnote { margin-top: 6px; }
  .gal-primary-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .role-gallery #gal-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .role-gallery #gal-filters::-webkit-scrollbar { display: none; }
  .role-gallery .gal-chip { flex: 0 0 auto; min-height: 44px; scroll-snap-align: start; }
  .gal-more summary { min-height: 44px; max-width: 132px; padding-inline: 10px; }
  .gal-more summary span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gal-more-panel {
    width: calc(100vw - 20px);
    max-height: min(68vh, 520px);
    overflow: auto;
    padding: 13px;
  }
  .gal-more-panel .gal-filters {
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
  .gal-more-panel .gal-viewbar { flex-wrap: nowrap; gap: 6px; align-items: center; }
  .role-gallery .gal-sort { min-width: 0; flex: 1 1 auto; }
  .role-gallery .gal-sort label { display: none; }
  .role-gallery .gal-sort select { width: 100%; min-height: 44px; padding-inline: 9px 28px; font-size: 11.5px; }
  .role-gallery .gal-modes { flex: 0 0 auto; }
  .role-gallery .gal-modes button { min-height: 44px; padding-inline: 9px; font-size: 11.5px; }

  .role-gallery .gal-grid:not(.is-list) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 2px;
    grid-auto-flow: row;
    align-items: start;
    column-gap: 10px;
    row-gap: 10px;
    margin: 2px 12px 32px;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-card,
  .role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(n) {
    display: flex;
    grid-column: auto !important;
    position: relative;
    isolation: isolate;
    width: 100%;
    margin: 0;
    min-width: 0;
    height: auto;
    aspect-ratio: 4 / 5;
    align-self: start;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(247, 247, 251, .12);
    border-radius: 20px;
    background: #090a0d;
    box-shadow: 0 14px 32px rgba(4, 5, 10, .14);
    gap: 0;
    align-items: stretch;
    transform: none;
    touch-action: manipulation;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(4n + 2),
  .role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(4n + 3) {
    aspect-ratio: 3 / 4;
  }

  html[data-theme="light"] .role-gallery .gal-grid:not(.is-list) .gal-card {
    border-color: rgba(23, 25, 31, .08);
    background: #15171b;
    box-shadow: 0 12px 30px rgba(23, 28, 36, .14);
  }

  .role-gallery .gal-grid:not(.is-list) .gal-card + .gal-card { padding-top: 0; }
  .role-gallery .gal-grid:not(.is-list) .gal-card:active { transform: scale(.985); }

  .role-gallery .gal-grid:not(.is-list) .gal-card::after {
    content: "↗";
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 999px;
    background: rgba(5, 6, 10, .4);
    color: #fff;
    font: 800 16px/1 "IBM Plex Mono", monospace;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    pointer-events: none;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-shot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border: 0;
    border-radius: inherit;
    background: #090a0d;
    box-shadow: none;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-shot::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 6, 10, .02) 28%, rgba(5, 6, 10, .24) 56%, rgba(5, 6, 10, .94) 100%);
    pointer-events: none;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-shot img {
    object-fit: cover;
    transform: none;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(n) .gal-card-body {
    position: absolute;
    inset: 0;
    z-index: 3;
    justify-content: flex-end;
    gap: 5px;
    padding: 54px 13px 14px;
    color: #fff;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-card-top {
    position: absolute;
    top: 11px;
    left: 11px;
    right: 50px;
    gap: 4px;
    min-height: 0;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-row-no { display: none; }
  .role-gallery .gal-grid:not(.is-list) .gal-fixture-badge { display: none; }
  .role-gallery .gal-grid:not(.is-list) .gal-demo-no,
  .role-gallery .gal-grid:not(.is-list) .gal-award {
    min-height: 22px;
    max-width: 100%;
    padding: 2px 7px;
    overflow: hidden;
    border-color: rgba(255, 255, 255, .3);
    background: rgba(5, 6, 10, .46);
    color: #fff;
    font-size: 8.5px;
    text-overflow: ellipsis;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  .role-gallery .gal-grid:not(.is-list) .gal-card:nth-child(n) .gal-title {
    display: -webkit-box;
    order: 2;
    max-width: 100%;
    overflow: hidden;
    color: #fff;
    font-family: "Noto Sans SC", sans-serif;
    font-size: clamp(15px, 4.25vw, 18px);
    line-height: 1.3;
    letter-spacing: -.025em;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .54);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-title.is-todo { color: rgba(255, 255, 255, .76); }
  .role-gallery .gal-grid:not(.is-list) .gal-by {
    order: 3;
    overflow: hidden;
    color: rgba(255, 255, 255, .66);
    font-size: 10.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .role-gallery .gal-grid:not(.is-list) .gal-intro-line { display: none; }
  .role-gallery .gal-grid:not(.is-list) .gal-tags {
    display: flex;
    order: 1;
    margin: 0 0 1px;
  }
  .role-gallery .gal-grid:not(.is-list) .gal-tag {
    display: none;
    padding: 0;
    background: transparent;
    color: rgba(255, 255, 255, .62);
    font-family: "IBM Plex Mono", monospace;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: .06em;
  }
  .role-gallery .gal-grid:not(.is-list) .gal-tag:first-child { display: inline-block; }

  .role-gallery .gal-grid.is-list { margin-inline: 14px; }
  .role-gallery .gal-grid.is-list .gal-card { grid-template-columns: 96px minmax(0, 1fr); padding-block: 14px; }
  .role-gallery .gal-grid.is-list .gal-shot { width: 96px; height: 82px; }
  .role-gallery .gal-grid.is-list .gal-card-body { padding-left: 12px; }
  .role-gallery .gal-grid.is-list .gal-title { font-size: 16px; }
  .role-gallery .gal-grid.is-list .gal-intro-line,
  .role-gallery .gal-grid.is-list .gal-tags { display: none; }

  .role-gallery .gal-modal { padding: 0; }
  .role-gallery .gal-modal-inner,
  html[data-theme="light"] .role-gallery .gal-modal-inner { width: 100%; max-height: 100dvh; border: 0; border-radius: 0; }
  .role-gallery .gal-modal-x { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; }
  .gal-d-layout { display: block; min-height: 0; }
  .gal-d-stage { padding: 0; }
  .gal-d-shots { gap: 1px; }
  .gal-d-shots figure { background: #090a0d; }
  .gal-d-shots figcaption { margin: 0; padding: 8px 12px; }
  .gal-d-empty { min-height: 55vh; }
  .gal-d-info { padding: 26px 18px calc(28px + env(safe-area-inset-bottom)); }
  .gal-d-title { margin-top: 14px; font-size: 30px; }
  .gal-d-nav { position: sticky; bottom: 0; z-index: 2; padding-top: 10px; background: var(--paper); }

  .role-gallery .gal-modal:not([hidden]) .gal-modal-inner {
    animation: gal-detail-in 220ms cubic-bezier(.2, .75, .25, 1);
  }

  .role-gallery .gal-about { margin: 18px 14px 0; }
  .role-gallery .gal-foot { margin-inline: 18px; }
}

@keyframes gal-detail-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gal-return-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .role-gallery .gal-card,
  .role-gallery .gal-shot img { transition: none; }
  .role-gallery .gal-modal:not([hidden]) .gal-modal-inner,
  .gal-return-note { animation: none; }
}
