/* =====================================================================================
   album.css — the album (a Franco-Belgian comic album, ligne claire) + the photo UI:
   stop strips, the add-photo sheet, the viewer, the toast. Owner: ALBUM.

   Uses only the tokens in site.css. The thick ink frame around panels is the comic's own
   convention (ligne claire); balloons and récitatif boxes keep their printed colours in both themes:
   balloons white with enamel ink, récitatifs iris yellow with iris ink.
   ===================================================================================== */

/* ---------- speech balloons (shared by the album, the stop strips, the sheet and the viewer) ---------- */
.bd-balloon{position:absolute;z-index:2;top:10px;left:10px;max-width:calc(100% - 20px);background:var(--enamel-ink);color:var(--enamel);border:2.5px solid var(--enamel);border-radius:18px;padding:6px 12px 7px;font-family:var(--text);font-size:15px;font-weight:400;line-height:1.3;text-align:left;pointer-events:none;transform-origin:22px 100%}
.bd-balloon .bd-text{display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.bd-balloon::before,.bd-balloon::after{content:"";position:absolute;pointer-events:none}
.bd-balloon::before{left:20px;bottom:-14px;width:17px;height:14px;background:var(--enamel);clip-path:polygon(0 0,100% 0,12% 100%)}
.bd-balloon::after{left:22.5px;bottom:-9.5px;width:11px;height:10px;background:var(--enamel-ink);clip-path:polygon(0 0,100% 0,8% 100%)}
.bd-who{position:absolute;left:8px;bottom:-42px;width:28px;height:28px;border-radius:50%;background:var(--enamel);color:var(--enamel-ink);border:2px solid var(--enamel-ink);display:grid;place-items:center;font-family:var(--display);font-size:14px;line-height:1}
.bd-r{left:auto;right:10px;transform-origin:calc(100% - 22px) 100%}
.bd-r::before{left:auto;right:20px;clip-path:polygon(0 0,100% 0,88% 100%)}
.bd-r::after{left:auto;right:22.5px;clip-path:polygon(0 0,100% 0,92% 100%)}
.bd-r .bd-who{left:auto;right:8px}
.bd-solo{position:absolute;z-index:2;top:10px;left:10px;width:28px;height:28px;pointer-events:none}
.bd-solo .bd-who{position:static}
.bd-solo.bd-r{left:auto;right:10px}
/* the speaker's initial inside a balloon (album panels: the photographer is outside the picture) */
.bd-tag{display:inline-grid;place-items:center;width:20px;height:20px;margin:0 6px 0 0;border-radius:50%;background:var(--enamel);color:var(--enamel-ink);font-family:var(--display);font-weight:400;font-size:12px;line-height:1;vertical-align:2px}
/* the prompt in drawn panels: no speaker, so the tail points at the drawing */
.bd-prompt{font-style:italic}
.bd-small{font-size:14px;padding:5px 10px 6px}

/* =====================================================================================
   THE ALBUM SECTION
   ===================================================================================== */
.al{background:var(--bg);padding-block:clamp(80px,9vw,140px) clamp(72px,8vw,120px);scroll-margin-top:0}
.al-top{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:clamp(28px,4vw,64px) 24px;align-items:start}
.al-volume{grid-column:1 / 6;position:relative;isolation:isolate;padding-bottom:30px}
.al-aside{grid-column:7 / 13;display:flex;flex-direction:column;gap:28px;min-width:0}

/* the cover: a hardback BD album on a Brussels-blue field, cloth spine, tricolour ribbon */
.al-cover{position:relative;aspect-ratio:3 / 4;background:var(--field);color:var(--field-ink);border-radius:3px 10px 10px 3px;overflow:hidden;container-type:inline-size}
.al-spine{position:absolute;left:0;top:0;bottom:0;width:7.5%;background:var(--enamel)}
.al-spine::after{content:"";position:absolute;top:0;bottom:0;right:-2.4%;width:1.2%;min-width:3px;background:var(--enamel);opacity:.55}
.al-cover-in{position:absolute;inset:0;display:flex;flex-direction:column;gap:3.4cqw;padding:8cqw 7cqw 7cqw 15cqw}
.al-title{font-family:var(--display);font-size:15.5cqw;line-height:.88;letter-spacing:-.035em;margin:0 0 0 -.04em;color:var(--field-ink)}
.al-title span{display:block}
.al-sub{margin:0;font-size:max(15px,3.7cqw);line-height:1.3}
.al-art{flex:1 1 auto;min-height:0;position:relative;background:var(--paper);color:var(--ink);border:max(3px,1cqw) solid var(--enamel);overflow:hidden;margin-top:1.5cqw}
.al-art svg{position:absolute;inset:0;width:100%;height:100%;display:block}
.al-art img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.al-cover-foot{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto;column-gap:4cqw;align-items:end}
.al-mark{grid-row:1 / 3;width:15cqw;height:15cqw;color:var(--iris);display:block}
.al-mark svg{width:100%;height:100%;display:block}
.al-count{margin:0;text-align:right;font-size:max(15px,3.4cqw);line-height:1.3;font-variant-numeric:tabular-nums}
.al-pour{margin:0;text-align:right;font-style:italic;font-size:max(17px,4.6cqw);line-height:1.2}
.al-ribbon{position:absolute;z-index:-1;left:3.5%;bottom:0;display:flex;width:18px;height:58px;clip-path:polygon(0 0,100% 0,100% 100%,50% 84%,0 100%)}
.al-ribbon i{flex:1}
.al-ribbon i:nth-child(1){background:var(--be-black)}
.al-ribbon i:nth-child(2){background:var(--be-yellow)}
.al-ribbon i:nth-child(3){background:var(--be-red)}

/* beside the cover */
.al-acts{display:flex;flex-wrap:wrap;gap:12px}
.al-acts .btn{min-height:52px}
.al-job{display:flex;flex-direction:column;gap:10px;max-width:520px}
.al-job-t{margin:0;font-size:var(--s-small);font-weight:600;line-height:1.4}
.al-job-alt{margin:0;font-size:var(--s-small);color:var(--muted)}
.al-job-alt a{color:var(--ink);font-weight:600}
.al-bar{height:8px;border-radius:4px;background:var(--surface);overflow:hidden}
.al-bar span{display:block;height:100%;background:var(--field);transform:scaleX(0);transform-origin:0 50%;transition:transform .35s var(--ease-out)}
.al-job.is-done .al-bar span{background:var(--iris)}
.al-toc{display:flex;flex-direction:column;gap:14px}
.al-toc h3{font-size:var(--s-lead);line-height:1.1}
.al-toc-l{list-style:none;margin:0;padding:0;columns:2;column-gap:28px}
.al-toc-l li{break-inside:avoid}
.al-toc-l a{display:grid;grid-template-columns:3.1em minmax(0,1fr) auto;align-items:center;gap:10px;min-height:42px;padding:4px 0;text-decoration:none;font-size:16px;line-height:1.25}
.al-toc-t{font-variant-numeric:tabular-nums;font-weight:600}
.al-toc-n{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.al-toc-l a:hover .al-toc-n{text-decoration:underline;text-decoration-thickness:3px;text-decoration-color:var(--iris);text-underline-offset:5px}
.al-toc-c{display:inline-flex;align-items:center;gap:4px;min-height:26px;padding:2px 9px 2px 7px;border-radius:999px;background:var(--field);color:var(--field-ink);font-size:14px;font-weight:600;font-variant-numeric:tabular-nums;line-height:1}
.al-toc-c svg{width:15px;height:15px}

/* ---------- the pages ---------- */
.al-pages{margin-top:clamp(64px,8vw,120px)}
.al-book{--gut:9px;position:relative;background:var(--paper);color:var(--ink);padding:clamp(22px,3.4vw,52px) clamp(16px,3.4vw,52px);border-radius:3px}
.al-book.is-spread{column-count:2;column-gap:clamp(64px,7vw,104px);column-fill:balance}
/* the fold of the open album */
.al-book.is-spread::before{content:"";position:absolute;top:0;bottom:0;left:50%;width:clamp(22px,2.4vw,34px);transform:translateX(-50%);background:var(--bg)}

.al-strip{position:relative;display:flex;flex-direction:column;gap:var(--gut);break-inside:avoid;page-break-inside:avoid;margin:0 0 clamp(34px,3.6vw,52px);scroll-margin-top:24px}
.al-strip:last-child{margin-bottom:0}
.al-book.is-spread .al-strip:last-child{margin-bottom:clamp(34px,3.6vw,52px)}

/* the récitatif: Hergé's yellow narration box, straddling the top of the first panel */
.al-reci{align-self:flex-start;position:relative;z-index:3;display:flex;flex-direction:column;max-width:88%;margin:0 0 calc(-1 * (var(--gut) + var(--ink-line))) -5px;padding:6px 12px 7px;background:var(--iris);color:var(--iris-ink);border:var(--ink-line) solid var(--iris-ink);line-height:1.25}
.al-reci-t{font-family:var(--text);font-weight:600;font-size:16px;line-height:1.25;letter-spacing:0;text-wrap:balance;overflow-wrap:anywhere}
.al-reci-s{margin:0;font-size:15px;line-height:1.3;text-wrap:balance;overflow-wrap:anywhere}

/* the gaufrier: tiers of equal height on a twelve-column grid */
.al-tier{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));grid-template-rows:minmax(0,1fr);gap:var(--gut);aspect-ratio:1.5}
.al-tier.is-solo{aspect-ratio:1.9}
.al-panel{position:relative;display:block;min-width:0;margin:0;padding:0;border:var(--ink-line) solid var(--ink);border-radius:0;background:var(--paper);color:var(--ink);font:inherit;text-align:left;overflow:hidden;container-type:inline-size}
.al-photo{cursor:pointer;background:var(--surface)}
.al-photo img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;transition:transform .7s var(--ease)}
.al-photo img.is-broken{opacity:0}
@media (hover:hover){.al-photo:hover img{transform:scale(1.035)}}
.al-photo:active img{transform:scale(.99);transition-duration:var(--t-press)}
.al-photo:focus-visible{outline:3px solid var(--iris);outline-offset:3px}
.al-photo.is-pending img{opacity:.78}
/* the balloon hangs from the panel's top edge, flat against the frame (Hergé's frame-attached balloon): no tail,
   the initial inside, and only as many lines as the panel can spare. The whole caption is in the viewer. */
.al-photo .bd-balloon{top:0;left:0;max-width:calc(100% - 14px);border-width:0 2.5px 2.5px 0;border-radius:0 0 16px 0;padding:5px 12px 6px 8px;font-size:15px;line-height:1.28;transform-origin:0 0}
.al-photo .bd-balloon.bd-r{left:auto;right:0;border-width:0 0 2.5px 2.5px;border-radius:0 0 0 16px;padding:5px 9px 6px 11px;transform-origin:100% 0}
.al-photo .bd-balloon::before,.al-photo .bd-balloon::after{display:none}
.al-photo .bd-balloon .bd-text{-webkit-line-clamp:4;line-clamp:4}
.al-photo .bd-solo{top:6px;left:6px}
.al-photo .bd-solo.bd-r{left:auto;right:6px}
.al-photo .bd-solo .bd-tag{width:28px;height:28px;margin:0;font-size:14px;border:2px solid var(--enamel-ink)}
@container (max-width:240px){
  .al-photo .bd-balloon{font-size:14px;line-height:1.25;padding:4px 10px 5px 7px}
  .al-photo .bd-balloon.bd-r{padding:4px 7px 5px 10px}
  .al-photo .bd-balloon .bd-text{-webkit-line-clamp:3;line-clamp:3}
  .al-photo .bd-tag{width:18px;height:18px;margin-right:5px;font-size:11px}
}
@container (min-width:420px){.al-photo .bd-balloon .bd-text{-webkit-line-clamp:5;line-clamp:5}}
.al-chip{position:absolute;z-index:2;right:8px;bottom:8px;padding:3px 10px 4px;border-radius:999px;background:var(--enamel);color:var(--enamel-ink);font-size:14px;font-weight:600;line-height:1.3}

.al-draw{background:var(--paper)}
.al-drawing{position:absolute;inset:0;padding:10px 6px 0}
.al-drawing svg{display:block;width:100%;height:100%}
.al-tier.is-solo:has(.is-big){aspect-ratio:1.45}
.al-draw.is-big .al-drawing{padding:62px 10% 62px}
@media (max-width:600px){.al-tier.is-solo:has(.is-big){aspect-ratio:1.18}.al-draw.is-big .al-drawing{padding:74px 5% 62px}}
/* one column on a tablet: the stops still to photograph stay short, so the album isn't a wall of empty panels */
@media (min-width:601px){
  .al-book:not(.is-spread) .al-tier.is-solo:has(.is-big){aspect-ratio:2.2}
  .al-book:not(.is-spread) .al-draw.is-big .al-drawing{padding:56px 22% 18px}
}
.al-add{position:absolute;z-index:2;right:10px;bottom:10px;display:inline-flex;align-items:center;gap:8px;min-height:46px;padding:8px 18px 8px 14px;border:0;border-radius:999px;background:var(--iris);color:var(--iris-ink);font-family:var(--text);font-weight:600;font-size:16px;line-height:1.1;cursor:pointer;transition:transform var(--t-hover) var(--ease)}
.al-add svg{width:22px;height:22px;flex:none}
.al-add:hover{transform:translateY(-2px)}
.al-add:active{transform:scale(.96);transition-duration:var(--t-press)}
/* the drawn panel beside a lone photo: the drawing centred, its button under it */
.al-draw:not(.is-big) .al-drawing{padding:40px 8px 66px}
.al-add.is-small{padding:8px 14px 8px 12px;right:50%;bottom:12px;top:auto;transform:translateX(50%)}
.al-add.is-small:hover{transform:translateX(50%) translateY(-2px)}
.al-add.is-small:active{transform:translateX(50%) scale(.96)}
.al-draw .bd-small{display:none}
/* after the walk: the drawing on its own, a quiet panel of the finished album */
.al-strip.is-over .al-draw.is-big .al-drawing{padding-bottom:14px}
.al-strip.is-over .al-draw:not(.is-big) .al-drawing{padding:20px 8px}
.al-more{display:flex;justify-content:flex-end}
.al-add.is-line{position:static;margin-right:-10px;background:transparent;color:var(--ink);min-height:44px;font-size:15px;text-decoration:underline;text-decoration-thickness:2px;text-decoration-color:var(--iris);text-underline-offset:5px}
.al-add.is-line svg{width:20px;height:20px}
@container (max-width:130px){
  .al-add.is-small{padding-inline:10px}
  .al-add.is-small svg{display:none}
}

/* =====================================================================================
   THE STRIP INSIDE A ROUTE STOP (mountStopPhotos)
   ===================================================================================== */
.ph-strip{display:flex;flex-direction:column;gap:10px;min-width:0}
.ph-strip:not(.has-photos){flex-direction:row;align-items:center;gap:16px}
.ph-row{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:8px;max-width:560px}
.ph-strip:not(.has-photos) .ph-row{grid-template-columns:96px;flex:none}
.ph-row li{position:relative;aspect-ratio:1;min-width:0}
.ph-row li:hover,.ph-row li:focus-within{z-index:3}
.ph-thumb{position:relative;display:block;width:100%;height:100%;padding:0;margin:0;border:var(--ink-line) solid var(--ink);border-radius:0;background:var(--surface);cursor:pointer}
.ph-thumb img{display:block;width:100%;height:100%;object-fit:cover;transition:transform var(--t-ui) var(--ease-out)}
.ph-thumb:active img{transform:scale(.97)}
.is-pending .ph-thumb img{opacity:.75}
.ph-chip{position:absolute;left:4px;right:4px;bottom:4px;padding:2px 6px;border-radius:6px;background:var(--enamel);color:var(--enamel-ink);font-size:13px;font-weight:600;line-height:1.25;text-align:center}
.ph-tip{position:absolute;left:-3px;bottom:calc(100% + 18px);width:max-content;max-width:min(260px,70vw);opacity:0;transform:translateY(6px);transition:opacity var(--t-hover) ease,transform var(--t-ui) var(--ease-out);pointer-events:none}
.ph-tip:empty{display:none}
.ph-tip .bd-balloon{position:relative;top:auto;left:auto;max-width:none;display:block}
.ph-tip .bd-who,.ph-tip .bd-solo{display:none}
@media (hover:hover){.ph-thumb:hover .ph-tip{opacity:1;transform:none}}
.ph-thumb:focus-visible .ph-tip{opacity:1;transform:none}
.ph-add{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;height:100%;padding:6px;border:0;border-radius:0;background:var(--iris);color:var(--iris-ink);font-weight:600;font-size:15px;line-height:1.15;text-align:center;cursor:pointer;transition:transform var(--t-press) var(--ease)}
.ph-add svg{width:30px;height:30px}
.ph-add:active{transform:scale(.96)}
.ph-empty{margin:0;font-size:var(--s-small);color:var(--muted);font-style:italic}
.ph-empty .nw{white-space:nowrap}

/* =====================================================================================
   DIALOGS: the add-photo sheet, the viewer
   ===================================================================================== */
html.ph-locked,html.ph-locked body{overflow:hidden}
dialog.ph-dlg{border:0;padding:0;margin:0;background:transparent;color:var(--ink);max-width:none;max-height:none;overflow:visible}
dialog.ph-dlg::backdrop{background:var(--scrim);opacity:0;transition:opacity var(--t-ui) ease}
dialog.ph-dlg.is-in::backdrop{opacity:1}
dialog.ph-dlg:focus{outline:none}

/* ---------- the add-photo sheet ---------- */
dialog.ph-sheet{position:fixed;inset:auto 0 0 0;width:100%;height:auto}
.ph-sheet-in{display:flex;flex-direction:column;max-height:min(94vh,94svh);background:var(--paper);color:var(--ink);border-radius:22px 22px 0 0;box-shadow:var(--shadow-float);transform:translateY(104%);transition:transform .34s var(--ease-out);overflow:hidden} /* taste-skill-ignore: floating sheet */
.ph-sheet.is-in .ph-sheet-in{transform:none}
.ph-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 20px 4px}
.ph-head h2{font-size:clamp(30px,8vw,42px);line-height:1}
.ph-x,.ph-rm,.pv-x{position:relative;flex:none;width:44px;height:44px;border:0;border-radius:50%;background:var(--surface);color:var(--ink);cursor:pointer;transition:transform var(--t-press) var(--ease)}
.ph-x:active,.ph-rm:active,.pv-x:active{transform:scale(.92)}
.ph-x span::before,.ph-x span::after,.ph-rm span::before,.ph-rm span::after,.pv-x span::before,.pv-x span::after{content:"";position:absolute;left:50%;top:50%;width:18px;height:3px;margin:-1.5px 0 0 -9px;border-radius:2px;background:currentColor;transform:rotate(45deg)}
.ph-x span::after,.ph-rm span::after,.pv-x span::after{transform:rotate(-45deg)}
.ph-body{display:flex;flex-direction:column;gap:16px;padding:12px 20px 18px;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}

.ph-where{position:relative;display:flex;align-items:center;gap:14px}
.ph-plate{position:relative;flex:1 1 auto;min-width:0;display:flex;flex-direction:column;min-height:64px;justify-content:center;padding:10px 48px 10px 18px;background:var(--field);color:var(--field-ink);border-radius:var(--r-plate);outline:2px solid var(--field-ink);outline-offset:-6px;line-height:1.2}
.ph-plate b{font-weight:600;font-size:var(--s-body);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ph-plate span{font-size:var(--s-small);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ph-plate::after{content:"";position:absolute;right:22px;top:50%;width:10px;height:10px;margin-top:-8px;border-right:3px solid currentColor;border-bottom:3px solid currentColor;transform:rotate(45deg)}
.ph-select{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font-size:16px;-webkit-appearance:none;appearance:none}
.ph-where:has(.ph-select:focus-visible) .ph-plate{outline:3px solid var(--iris);outline-offset:-6px}
/* no place: the Hors-série strip. Not a street, so not an enamel plate: the yellow of the récitatif box */
.ph-where.is-weekend .ph-plate{background:var(--iris);color:var(--iris-ink);outline-color:var(--iris-ink)}
.ph-where.is-weekend:has(.ph-select:focus-visible) .ph-plate{outline-color:var(--field)}
.ph-when{flex:none;font-family:var(--display);font-size:var(--s-lead);pointer-events:none}

.ph-who{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.ph-who-l{font-weight:600;margin-right:6px}
.ph-pick-who{display:inline-flex;align-items:center;gap:10px;min-height:46px;padding:6px 18px 6px 6px;border:0;border-radius:999px;background:var(--surface);color:var(--ink);font-weight:600;font-size:16px;cursor:pointer;transition:transform var(--t-press) var(--ease),background-color var(--t-hover) ease}
.ph-pick-who:active{transform:scale(.96)}
.ph-pick-who[aria-pressed="true"]{background:var(--field);color:var(--field-ink)}
.ph-ini{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--field);color:var(--field-ink);font-family:var(--display);font-size:17px;line-height:1;flex:none}
.ph-pick-who[aria-pressed="true"] .ph-ini{background:var(--field-ink);color:var(--field)}

.ph-inputs{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.ph-inputs .btn{min-height:56px;padding-inline:10px;font-size:16px;cursor:pointer;text-align:center;white-space:nowrap}
.ph-inputs .btn:has(input:focus-visible){outline:3px solid var(--iris);outline-offset:3px}
.ph-inputs .btn:has(input:focus-visible).iris{outline-color:var(--field)}

.ph-blank{position:relative;margin:0;aspect-ratio:16 / 9;border:var(--ink-line) solid var(--ink);background:var(--paper);color:var(--ink);overflow:hidden}
.ph-blank-art{position:absolute;inset:0;padding:12px 18% 0}
.ph-blank-art svg{display:block;width:100%;height:100%}
.ph-stage.has-items .ph-blank{display:none}
.ph-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:16px}
.ph-item{display:grid;grid-template-columns:104px minmax(0,1fr) 44px;gap:16px;align-items:start}
.ph-item-pic{position:relative;aspect-ratio:1;border:var(--ink-line) solid var(--ink);background:var(--surface);overflow:hidden}
.ph-item-pic img{display:block;width:100%;height:100%;object-fit:cover}
.ph-noprev{display:grid;place-items:center;height:100%;padding:6px;font-size:13px;line-height:1.3;text-align:center;color:var(--muted)}
.ph-bar{position:absolute;left:0;right:0;bottom:0;height:8px;background:var(--paper);opacity:0;transition:opacity var(--t-ui) ease}
.ph-bar span{display:block;height:100%;background:var(--iris);transform:scaleX(0);transform-origin:0 50%;transition:transform .3s var(--ease-out)}
.ph-item.is-up .ph-bar,.ph-item.is-done .ph-bar,.ph-item.is-pending .ph-bar{opacity:1}
.ph-item.is-done .ph-bar span{background:var(--field)}
.ph-item-cap{display:flex;flex-direction:column;gap:6px;min-width:0;padding-top:2px}
.ph-state{margin:0 0 0 14px;font-size:var(--s-small);line-height:1.35;color:var(--muted)}
.ph-state:empty{display:none}
.ph-item.is-done .ph-state{color:var(--ink);font-weight:600}
.ph-item.is-error .ph-state{color:var(--ink);font-weight:600}
.ph-rm{background:var(--surface)}

/* a balloon that is a text field: its tail points at the photo it belongs to */
.bd-input{position:relative;display:block;top:auto;left:auto;max-width:none;padding:8px 14px 9px;margin-left:12px;pointer-events:auto;cursor:text;transform:none}
.bd-input::before{left:-14px;right:auto;top:18px;bottom:auto;width:15px;height:15px;clip-path:polygon(100% 0,100% 100%,0 6%)}
.bd-input::after{left:-9.5px;right:auto;top:20.5px;bottom:auto;width:10px;height:10px;clip-path:polygon(100% 0,100% 100%,0 4%)}
.bd-input textarea{display:block;width:100%;min-height:2.7em;margin:0;padding:0;border:0;background:transparent;color:var(--enamel);font:inherit;font-size:16px;line-height:1.35;resize:none;outline:none;field-sizing:content;max-height:9em}
.bd-input textarea::placeholder{color:var(--enamel);opacity:.55}
.bd-input:focus-within{outline:3px solid var(--iris);outline-offset:2px}
.bd-input textarea[readonly]{cursor:default}

.ph-foot{display:flex;flex-direction:column;gap:10px;padding:14px 20px calc(16px + var(--safe-b));background:var(--bg)}
.ph-status{margin:0;font-size:var(--s-small);font-weight:600;line-height:1.4}
.ph-status:empty{display:none}
.ph-go{width:100%;min-height:56px;font-size:18px}

@media (min-width:761px){
  dialog.ph-sheet{inset:0;margin:auto;width:min(680px,calc(100vw - 48px));height:fit-content;max-height:min(90vh,920px)}
  .ph-sheet-in{max-height:min(90vh,920px);border-radius:18px;transform:translateY(22px) scale(.98);opacity:0;transition:transform .34s var(--ease-out),opacity var(--t-ui) ease}
  .ph-sheet.is-in .ph-sheet-in{transform:none;opacity:1}
  .ph-head{padding:26px 28px 6px}
  .ph-body{padding:14px 28px 22px}
  .ph-foot{padding:16px 28px 22px;flex-direction:row;align-items:center;justify-content:space-between}
  .ph-status{flex:1 1 auto}
  .ph-go{width:auto;flex:none;padding-inline:28px}
}

/* ---------- the viewer ---------- */
dialog.ph-viewer{position:fixed;inset:0;width:100%;height:100%;height:100dvh}
.pv-in{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;height:100%;background:var(--enamel);color:var(--enamel-ink);opacity:0;transition:opacity var(--t-ui) ease}
.ph-viewer.is-in .pv-in{opacity:1}
.pv-head{display:flex;align-items:center;gap:14px;padding:max(14px,env(safe-area-inset-top,0px)) max(16px,env(safe-area-inset-right,0px)) 10px max(16px,env(safe-area-inset-left,0px))}
.pv-plate{display:inline-flex;flex-direction:column;min-width:0;max-width:calc(100% - 140px);padding:8px 16px 9px;background:var(--field);color:var(--field-ink);border-radius:var(--r-plate);outline:2px solid var(--field-ink);outline-offset:-6px;line-height:1.2}
.pv-plate b{font-weight:600;font-size:var(--s-body);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pv-plate span{font-size:var(--s-small);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ph-viewer.is-weekend .pv-plate{background:var(--iris);color:var(--iris-ink);outline-color:var(--iris-ink)}
.pv-count{margin-left:auto;font-size:var(--s-small);font-variant-numeric:tabular-nums;white-space:nowrap}
.pv-x{background:var(--field);color:var(--field-ink);width:48px;height:48px}
.pv-stage{position:relative;min-height:0;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none}
.pv-img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:block;transition:transform .38s var(--ease-out),opacity .28s ease;-webkit-user-drag:none}
.pv-img.is-broken{opacity:.2}
.pv-nav{position:absolute;top:50%;z-index:2;width:48px;height:48px;margin-top:-24px;border:0;border-radius:50%;background:var(--field);color:var(--field-ink);cursor:pointer;transition:transform var(--t-press) var(--ease)}
.pv-nav:active{transform:scale(.92)}
.pv-prev{left:max(12px,env(safe-area-inset-left,0px))}
.pv-next{right:max(12px,env(safe-area-inset-right,0px))}
.pv-nav span::before{content:"";position:absolute;left:50%;top:50%;width:12px;height:12px;margin:-6px 0 0 -4px;border-left:3px solid currentColor;border-bottom:3px solid currentColor;transform:rotate(45deg)}
.pv-next span::before{margin-left:-8px;transform:rotate(-135deg)}
.pv-foot{display:flex;flex-direction:column;gap:14px;width:100%;max-width:820px;margin:0 auto;padding:14px max(16px,env(safe-area-inset-right,0px)) calc(16px + var(--safe-b)) max(16px,env(safe-area-inset-left,0px))}
.pv-cap{min-height:0;padding-left:46px}
.pv-cap .bd-lg{position:relative;top:auto;left:auto;display:inline-block;max-width:100%;font-size:18px;line-height:1.4;padding:10px 16px 11px;transform-origin:0 50%}
.pv-cap .bd-lg .bd-text{display:block;-webkit-line-clamp:none;line-clamp:none;max-height:7.2em;overflow-y:auto}
.pv-cap .bd-lg::before{left:-15px;bottom:auto;top:14px;width:16px;height:16px;clip-path:polygon(100% 0,100% 100%,0 70%)}
.pv-cap .bd-lg::after{left:-10px;bottom:auto;top:16.5px;width:11px;height:11px;clip-path:polygon(100% 0,100% 100%,0 72%)}
.pv-cap .bd-lg .bd-who{left:-48px;bottom:auto;top:12px;width:34px;height:34px;font-size:17px}
.pv-cap.no-who{padding-left:0}
.pv-cap.no-who .bd-lg::before,.pv-cap.no-who .bd-lg::after{display:none}
/* the caption editor in the viewer points at nobody: no tail */
.pv-edit .bd-balloon::before,.pv-edit .bd-balloon::after{display:none}
.pv-meta{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 16px}
.pv-by{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;font-size:var(--s-small)}
.pv-by b{font-weight:600;font-size:var(--s-body)}
.pv-by span{color:var(--sky-day)}
.pv-by .pv-pend{flex-basis:100%;color:var(--iris)}
.pv-acts{display:flex;flex-wrap:wrap;gap:10px}
.pv-acts .btn{min-height:46px;padding:8px 20px;font-size:16px}
.ph-viewer .btn.alt{background:var(--field);color:var(--field-ink)}
.pv-danger{background:var(--enamel-ink);color:var(--enamel)}
.pv-confirm{display:flex;flex-direction:column;gap:12px}
.pv-confirm p{margin:0;font-family:var(--display);font-size:var(--s-lead);line-height:1.2}
.pv-edit{display:flex;flex-direction:column;gap:12px}
.pv-edit .bd-input{margin-left:12px}
.pv-status{margin:0;font-size:var(--s-small);color:var(--sky-day)}
.pv-status:empty{display:none}
@media (max-width:600px){
  /* the arrows get their own band under the photo instead of sitting on its corners */
  .pv-stage{padding-bottom:62px}
  .pv-img{inset:0 0 auto 0;height:calc(100% - 62px)}
  .pv-nav{top:auto;bottom:9px;margin-top:0;width:44px;height:44px}
  .pv-acts .btn{flex:1 1 auto;padding-inline:16px}
  .pv-wide{display:none} /* "Save", so the three buttons share one row */
}

/* ---------- the toast ---------- */
.ph-toast{position:fixed;left:50%;bottom:24px;z-index:var(--z-sheet);display:flex;align-items:center;gap:16px;max-width:calc(100vw - 32px);padding:8px 10px 8px 18px;border-radius:14px;background:var(--enamel);color:var(--enamel-ink);box-shadow:var(--shadow-float);font-size:var(--s-small);font-weight:600;line-height:1.35;opacity:0;transform:translate(-50%,16px);transition:opacity var(--t-ui) ease,transform var(--t-ui) var(--ease-out);pointer-events:none} /* taste-skill-ignore: floating toast */
.ph-toast.is-in{opacity:1;transform:translate(-50%,0);pointer-events:auto}
/* never sit on top of the add-stop sheet's pinned Save */
body:has(.rm-sheet.is-in) .ph-toast{opacity:0;pointer-events:none}
.ph-toast a{display:inline-flex;align-items:center;min-height:44px;padding:0 10px;color:var(--iris);white-space:nowrap}
@media (max-width:760px){.ph-toast{bottom:calc(var(--tabbar-h) + var(--safe-b) + 12px);width:max-content}}

/* =====================================================================================
   PHONES AND NARROW SCREENS
   ===================================================================================== */
@media (max-width:900px){
  .al-volume{grid-column:1 / 7}
  .al-aside{grid-column:7 / 13;padding-top:0}
  .al-toc-l{columns:1}
}
@media (max-width:760px){
  .al-top{grid-template-columns:minmax(0,1fr);gap:36px}
  .al-volume,.al-aside{grid-column:1}
  .al-volume{max-width:520px;width:100%;margin:0 auto}
  .al-aside{gap:22px}
  .al-acts .btn{flex:1 1 100%}
  .al-toc{display:none}
  .al-pages{margin-top:48px}
  .al-pages.in{padding-inline:0}
  .al-book{border-radius:0;padding:28px var(--gutter) 34px}
  .al-tier{aspect-ratio:1.42}
  .al-tier.is-solo{aspect-ratio:1.75}
  .ph-item{grid-template-columns:88px minmax(0,1fr) 44px;gap:12px}
}

/* =====================================================================================
   MOTION: the strips rise panel by panel; a new photo lands like a stamped panel
   ===================================================================================== */
@media (prefers-reduced-motion: no-preference){
  .al-wait .al-reci{opacity:0;transform:translateY(-10px)}
  .al-wait .al-panel{opacity:0;transform:translateY(24px) scale(.97)}
  .al-shown .al-reci{transition:opacity .5s ease,transform .7s var(--ease)}
  .al-shown .al-panel{transition:opacity .6s ease calc(var(--d,0) * 85ms + 120ms),transform .9s var(--ease) calc(var(--d,0) * 85ms + 120ms)}
  .al-new{animation:al-rise .8s var(--ease) both}
  .al-land,.ph-land{animation:al-land .75s var(--ease) both}
  .al-land .bd-balloon,.al-land .bd-solo{animation:al-pop .5s var(--ease-out) .4s both}
  .ph-land .ph-thumb{animation:al-land .75s var(--ease) both}
}
@keyframes al-rise{from{opacity:0;transform:translateY(28px)}to{opacity:1;transform:none}}
@keyframes al-land{from{opacity:0;transform:scale(1.1) rotate(-2deg)}55%{opacity:1}to{opacity:1;transform:none}}
@keyframes al-pop{from{opacity:0;transform:scale(.4)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion: reduce){
  .ph-sheet-in,.pv-in,.pv-img,.ph-toast,.al-bar span,.ph-bar span,.ph-tip,.al-photo img,.al-add,.ph-add,.ph-x,.ph-rm,.pv-x,.pv-nav,.ph-pick-who,.ph-thumb img{transition:none}
  dialog.ph-dlg::backdrop{transition:none}
  .al-land,.ph-land,.al-new{animation:none}
}
