.portrait-edit-history {grid-column:1/-1;width:100%;box-sizing:border-box;color:#172842;text-align:left;border-top:1px solid #c5d3e7;padding-block:12px}
.portrait-edit-history summary {cursor:pointer;font-weight:650;padding:8px 0;color:#184eb0}
.portrait-edit-history label,.portrait-edit-history textarea,.portrait-edit-history strong,.portrait-edit-history a {display:block;margin:8px 0}
.portrait-edit-history textarea {box-sizing:border-box;width:100%;font:inherit;padding:10px;border:1px solid #8d9eb6;border-radius:0}
.history-photo .portrait-edit-history a img {display:inline-block;width:48px;height:60px;object-fit:contain;vertical-align:middle;margin-inline-end:8px}
.portrait-edit-history p {overflow-wrap:anywhere}

.portrait-edit-instruction {white-space:pre-wrap}
.portrait-edit-history .portrait-edit-target {border-top:1px solid #c5d3e7;padding-top:12px;margin-top:16px}

.portrait-viewer{box-sizing:border-box;width:min(96vw,1120px);max-width:100vw;max-height:96vh;max-height:96dvh;margin:auto;padding:12px;border:1px solid #bec6cf;background:#fff;color:#162137}
.portrait-viewer::backdrop{background:rgba(13,18,24,.78)}
.portrait-viewer-tools{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-bottom:8px}
.history-photo .portrait-viewer button,.portrait-compare{width:auto;min-height:44px;margin:0;padding:8px 14px;border:1px solid #425d84;background:#fff;color:#1c487f;font:inherit;cursor:pointer}
.portrait-viewer-tools button[aria-pressed=true]{border-color:#153eac;background:#153eac;color:white}
.portrait-viewer-tools button:last-child{margin-inline-start:auto}
.portrait-viewer-navigation{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px;margin:6px 0 10px}
.portrait-viewer-navigation span{font-variant-numeric:tabular-nums;text-align:center}
.portrait-viewer input[readonly]{width:100%;box-sizing:border-box;min-height:44px;padding:8px;margin-bottom:8px;font:inherit}
.portrait-viewer-brief{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 16px;text-align:start;padding:8px 0 12px;border-top:1px solid #c5d3e7}
.portrait-viewer-brief small,.portrait-viewer-brief time{font-size:.85rem;color:#425d74}
.portrait-viewer-brief p{width:100%;margin:0}
.portrait-viewer p:empty{display:none}
.portrait-viewer-stage{display:grid;place-items:center;background:#eee}
.portrait-viewer-stage figure{width:100%;min-width:0;margin:0}
.portrait-viewer-pair{grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;gap:4px;background:white}
.portrait-viewer-pair figure{display:grid;grid-template-rows:1fr auto;align-items:center;background:#eee}
.portrait-viewer-pair .portrait-viewer-source{order:-1}
.portrait-viewer-pair figcaption{padding:6px 8px;color:#25364c;background:white;font-size:.875rem}
.portrait-viewer-pair figure img{height:clamp(120px,64vw,65dvh)}
.portrait-viewer-stage img{grid-area:1/1;display:block;width:100%;height:min(76vh,880px);height:min(76dvh,880px);object-fit:contain}
.portrait-viewer [hidden]{display:none}
