.history-hero .history-hero-rail .history-hero-mark img{
  width:auto;
  height:auto;
  max-width:min(124px, 100%);
  max-height:84px;
  aspect-ratio:auto;
  object-fit:contain;
}

.history-hero--milestone-view .history-status-box--milestone .history-hero-mark img{
  max-height:104px;
}
.history-metrics{grid-template-columns:repeat(auto-fit,minmax(min(170px,100%),1fr))}
.history-status-box a.history-status-label:hover,
.history-status-box a.history-status-label:focus-visible{
  border-color:var(--accent);
}

@media (max-width: 980px){
  .history-hero--milestone-view .history-status-box--milestone{
    justify-items:center;
  }

  .history-hero--milestone-view .history-hero-mark{
    justify-items:center;
  }

  .history-hero--milestone-view .history-watch-note{
    max-width:44ch;
    text-align:center;
  }
}

.history-photo-archive-head{flex-wrap:wrap}
.history-photo-archive-tools{--photo-control-height:48px;display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:flex-end;gap:12px;width:100%;padding-top:14px;border-top:1px solid var(--line)}
.history-photo-archive-tools .history-photo-select{display:grid;gap:6px;flex:1 1 180px;max-width:300px;min-width:0;margin:0;color:var(--muted);font-size:12px;font-weight:600}
.history-photo-archive-tools [hidden]{display:none!important}
.history-photo-select select{width:100%;min-width:0;height:var(--photo-control-height);padding:10px 32px 10px 12px;border:1px solid var(--line);border-radius:12px;background:#17171e;color:var(--text);font:inherit;font-size:14px;color-scheme:dark}
.history-photo-select option{background:#17171e;color:#f0f0f6}
.history-photo-archive-tools :is(.history-photo-shuffle,.history-photo-shuffle-reset){border:1px solid var(--line);border-radius:999px;background:rgba(255,255,255,.04);color:var(--text);font:inherit;cursor:pointer}
.history-photo-archive-tools .history-photo-shuffle-reset{background:transparent;color:var(--muted)}
.history-photo-archive-tools :is(.history-photo-shuffle,.history-photo-shuffle-reset):hover{border-color:var(--accent);background:var(--glow2);color:var(--text)}
.history-photo-select select:focus-visible,:is(.history-photo-shuffle,.history-photo-shuffle-reset):focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.history-photo-archive-actions{display:grid;grid-auto-flow:column;grid-auto-columns:124px;gap:8px;min-width:0}
.history-photo-archive-actions>:is(button,.badge,.history-photo-restored-toggle){display:flex;align-items:center;justify-content:center;box-sizing:border-box;height:var(--photo-control-height);min-width:0;margin:0;padding:2px 6px;transform:none;white-space:normal;text-align:center;font-size:12px;line-height:1.15}
.history-photo-archive-actions .history-photo-shuffle-progress{font-variant-numeric:tabular-nums}
.history-photo-archive-actions .history-photo-restored-toggle input{flex:none}
.history-photo-reset-dialog{box-sizing:border-box;width:min(100% - 32px,370px);padding:22px;border:1px solid var(--line);border-radius:18px;background:#17171e;color:var(--text);box-shadow:0 18px 54px #0008}
.history-photo-reset-dialog::backdrop{background:#0b0b12b8}
.history-photo-reset-dialog h2{margin:0 0 8px;font-size:18px}
.history-photo-reset-dialog p{margin:0;color:var(--muted);font-size:14px;line-height:1.55}
.history-photo-reset-dialog strong{color:var(--text)}
.history-photo-reset-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;margin-top:18px}
.history-photo-reset-actions button{min-height:44px;padding:8px 14px;border:1px solid var(--line);border-radius:999px;background:rgba(255,255,255,.04);color:var(--text);font:inherit;font-size:13px;cursor:pointer}
.history-photo-reset-actions .history-photo-reset-confirm{border-color:var(--accent);background:var(--glow2);font-weight:600}
.history-photo-reset-actions button:hover{border-color:var(--accent)}
.history-photo-reset-actions button:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media(max-width:760px){
  .history-photo-archive-actions{grid-auto-flow:row;grid-template-columns:repeat(4,minmax(0,1fr));width:100%;gap:6px}
  .history-photo-archive-actions>*{grid-column:span 2}
  .history-photo-archive-actions:has(.history-photo-shuffle-progress:not([hidden])) .history-photo-shuffle{grid-column:2/span 2}
}
@media(max-width:540px){
  .history-photo-archive-tools .history-photo-select{flex-basis:100%;max-width:none}
}

/* Keep readable captions and the source badge inside each archive photograph. */
#historyPhotoArchiveGrid{display:grid;gap:16px}
#historyPhotoArchiveGrid .history-photo-grid{align-items:start;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}
.history-photo-albums{--album-columns:4;--album-gap:14px;min-width:0;margin-top:12px;padding-top:18px;border-top:1px solid var(--line)}
.history-photo-albums h3{margin:0 0 14px;font-size:18px}
.history-photo-album-grid{display:grid;grid-template-columns:repeat(var(--album-columns),minmax(0,1fr));gap:var(--album-gap)}
.history-photo-album{display:flex;flex-direction:column;min-width:0}
.history-photo-album[open]{grid-column:1/-1}
.history-photo-album[open]>.history-photo-album-head{width:calc((100% + var(--album-gap)) / var(--album-columns) - var(--album-gap));flex:none}
.history-photo-album:not([open])>.history-photo-grid{display:none!important}
.history-photo-album[open]>.history-photo-grid{margin-top:16px;padding:16px 0 20px;border-bottom:1px solid var(--line)}
.history-photo-album-head{display:grid;flex:1;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto 1fr auto;align-items:center;gap:5px 10px;overflow:hidden;border:1px solid var(--line);border-radius:14px;background:#18181f;cursor:pointer;list-style:none}
.history-photo-album-head::-webkit-details-marker{display:none}
.history-photo-album-head:hover,.history-photo-album[open]>.history-photo-album-head{border-color:var(--accent);background:#231a22}
.history-photo-album-head:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.history-photo-album-cover{display:block;grid-column:1/-1;width:100%;height:clamp(72px,9vw,112px);object-fit:cover;background:rgba(255,255,255,.06)}
.history-photo-album-title{grid-column:1/-1;align-self:start;min-width:0;padding:4px 12px 0;font-size:15px;font-weight:700;line-height:1.35;overflow-wrap:anywhere}
.history-photo-album-head .badge{justify-self:start;margin:0 0 10px 12px;white-space:nowrap}
.history-photo-album-chevron{width:8px;height:8px;margin:-8px 14px 0 0;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg)}
.history-photo-album[open] .history-photo-album-chevron{transform:rotate(225deg);margin-top:4px}
#historyPhotoArchiveGrid .history-photo-card{min-width:0;height:auto;gap:10px;grid-template-rows:auto auto}
#historyPhotoArchiveGrid figcaption{height:auto;min-height:0;grid-template-rows:none;gap:8px}
#historyPhotoArchiveGrid figcaption>strong,#historyPhotoArchiveGrid .history-photo-credit--archive{display:block;max-height:none;overflow:visible;-webkit-line-clamp:unset;overflow-wrap:anywhere}
#historyPhotoArchiveGrid figcaption>strong{font-size:.9rem;line-height:1.4}
#historyPhotoArchiveGrid .history-photo-credit--archive{font-size:.78rem;line-height:1.45}
#historyPhotoArchiveGrid .history-photo-source-pill--overlay{display:flex;position:absolute;right:8px;bottom:8px;box-sizing:border-box;width:max-content;min-width:0;max-width:calc(100% - 16px);min-height:44px;padding:5px 8px;align-items:center;text-align:center;background:rgba(11,14,18,.82);border-color:rgba(255,255,255,.18);box-shadow:0 8px 20px rgba(0,0,0,.25)}
#historyPhotoArchiveGrid span.history-photo-source-pill--overlay{pointer-events:none}
#historyPhotoArchiveGrid .history-photo-source-name{display:-webkit-box;max-width:112px;white-space:normal;overflow:hidden;overflow-wrap:anywhere;line-height:1.2;-webkit-box-orient:vertical;-webkit-line-clamp:2}
#historyPhotoArchiveGrid :is(a,button):focus-visible,#historyPhotoLb :is(a,button):focus-visible{outline:2px solid var(--accent);outline-offset:3px}
#historyPhotoLb{box-sizing:border-box;margin:0;border:0;width:100%;height:100%;max-width:none;max-height:none;color:var(--text)}
#historyPhotoLb:not([open]){display:none}
#historyPhotoLb .lb-inner{height:100%;min-height:0}
#historyPhotoLb .lb-toolbar{flex-wrap:wrap;flex-shrink:0}
#historyPhotoLb .lb-toolbar button{min-height:44px;min-width:44px;white-space:nowrap}
#historyPhotoLb .history-lightbox-version-controls{display:flex;gap:inherit}
#historyPhotoLb .history-lightbox-restored-button{width:auto;height:auto;border-radius:999px;padding-inline:12px;font-size:.82rem;font-weight:700;color:var(--text)}
#historyPhotoLb .lb-caption{flex-shrink:0;max-height:25%;overflow:auto;overflow-wrap:anywhere}
#historyPhotoLb .lb-stage img{max-height:100%}
@media(max-width:900px){
  #historyPhotoArchiveGrid .history-photo-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .history-photo-albums{--album-columns:3}
}
@media(max-width:600px){
  #historyPhotoArchiveGrid .history-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 12px}
  .history-photo-albums{--album-columns:2;--album-gap:10px}
  .history-photo-album-head .badge{padding-inline:8px}
  #historyPhotoLb{padding:12px}
  #historyPhotoLb .mall-store-lightbox-actions{justify-content:flex-start;gap:6px}
  #historyPhotoLb .lb-toolbar button{padding-inline:10px}
}
@media(max-width:360px){#historyPhotoArchiveGrid .history-photo-grid{grid-template-columns:minmax(0,1fr)}}
