/* ================= Photos ================= */
.pho { display: flex; background: var(--bg); color: var(--label); height: 100%; position: relative; overflow: hidden; }
.pho-list { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.pho-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 18px 14px 6px 16px; }
.pho-title { font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.pho-btn { padding: 6px 14px; border-radius: 16px; background: var(--fill); font-size: 15px; font-weight: 600; color: var(--tint); transition: transform .12s; } .pho-btn:active { transform: scale(.94); }
.pho-scroll { flex: 1; min-height: 0; overflow: auto; }
.pho-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 2px; padding: 0 0 10px; }
.pho-day { grid-column: 1 / -1; padding: 12px 16px 6px; font-size: 15px; font-weight: 700; }
.pho-cell { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--fill); cursor: pointer; transition: transform .12s; }
.pho-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .3s, transform .3s; }
.pho-cell:active img { transform: scale(.96); } .pho-cell.on::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px var(--tint); }
.pho-dur { position: absolute; right: 5px; bottom: 4px; font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.7); display: flex; align-items: center; gap: 2px; }
.pho-fav { position: absolute; left: 5px; bottom: 4px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.pho-check { position: absolute; right: 5px; top: 5px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.2); display: none; place-items: center; color: transparent; }
.selecting .pho-check { display: grid; } .pho-cell.picked .pho-check { background: var(--tint); border-color: var(--tint); color: #fff; } .pho-cell.picked img { opacity: .75; transform: scale(.92); }
.pho-none { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 80px 20px; color: var(--label2); text-align: center; } .pho-none b { color: var(--label); font-size: 20px; margin-top: 6px; }
.pho-tabs { display: flex; justify-content: space-around; padding: 6px 8px calc(6px + var(--safe-b, 0px) * .35); border-top: .5px solid var(--sep); background: var(--blur-bg); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); }
.pho-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 500; color: var(--label2); padding: 2px 8px; transition: color .2s, transform .12s; } .pho-tab:active { transform: scale(.92); } .pho-tab.on { color: var(--tint); }
.pho-selbar { display: none; align-items: center; justify-content: space-between; padding: 12px 20px calc(12px + var(--safe-b, 0px) * .3); border-top: .5px solid var(--sep); background: var(--blur-bg); font-weight: 600; position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; }
.pho-selbar.on { display: flex; } .pho-selbar button { color: var(--tint); padding: 4px 10px; } .pho-selbar button[disabled] { opacity: .35; } .pho-selbar span { margin-right: auto; }

/* viewer */
.pho-viewer { position: absolute; inset: 0; z-index: 4; background: #000; color: #fff; display: none; overflow: hidden; --dim: 1; }
.pho.viewing .pho-viewer { display: block; }
.pho-stage { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; cursor: zoom-in; background: rgba(0,0,0,var(--dim)); }
.pho-stage.zoomed { cursor: grab; }
.pho-media { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; transition: transform .3s cubic-bezier(.2,.9,.25,1), filter .2s; user-select: none; }
.pho-vback { position: absolute; left: 10px; top: 14px; z-index: 6; display: flex; align-items: center; gap: 2px; padding: 8px 14px 8px 8px; border-radius: 20px; background: rgba(40,40,44,.55); backdrop-filter: blur(20px); font-size: 15px; font-weight: 500; color: #fff; }
.pho-vbar { position: absolute; right: 10px; top: 110px; z-index: 6; }
.pho-vbar.edgebar, .pho-vbar { width: 46px; padding: 6px 0; border-radius: 23px; display: flex; flex-direction: column; align-items: center; background: rgba(60,60,67,.5); backdrop-filter: blur(28px) saturate(1.7); -webkit-backdrop-filter: blur(28px) saturate(1.7); color: #fff; box-shadow: 0 0 0 .5px rgba(255,255,255,.18) inset; }
.pho-vbar .edgebtn { color: #fff; }
.pho-vcap { position: absolute; left: 0; right: 0; top: 12px; text-align: center; z-index: 5; display: flex; flex-direction: column; pointer-events: none; text-shadow: 0 1px 8px rgba(0,0,0,.6); } .pho-vcap b { font-size: 15px; } .pho-vcap small { font-size: 12px; opacity: .8; }
.pho-empty { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: rgba(255,255,255,.4); font-size: 16px; font-weight: 500; }
.pho-toast { position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 20; padding: 10px 18px; border-radius: 20px; background: rgba(40,40,44,.92); backdrop-filter: blur(20px); color: #fff; font-size: 14px; font-weight: 500; transition: opacity .35s; animation: pht .3s cubic-bezier(.2,1.2,.4,1); } .pho-toast.gone { opacity: 0; } @keyframes pht { from { opacity: 0; transform: translate(-50%, 14px); } }

/* edit */
.pho-edit { position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; padding: 12px 18px calc(16px + var(--safe-b, 0px) * .4); background: rgba(24,24,27,.94); backdrop-filter: blur(30px); border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .4s cubic-bezier(.2,.9,.25,1); display: flex; flex-direction: column; gap: 10px; }
.pho.editing .pho-edit { transform: none; } .pho.editing .pho-vbar, .pho.editing .pho-vback { opacity: 0; pointer-events: none; }
.pho-ehead { display: flex; justify-content: space-between; align-items: center; font-size: 16px; } .pho-ehead button { color: #fff; opacity: .85; } .pho-ehead .done { color: #ffd60a; font-weight: 600; opacity: 1; }
.pho-chips { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; } .pho-chip { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; opacity: .8; } .pho-chip.on { opacity: 1; color: #ffd60a; }
.pho-chip i { width: 54px; height: 54px; border-radius: 10px; background-size: cover; background-position: center; box-shadow: 0 0 0 1.5px rgba(255,255,255,.25); } .pho-chip.on i { box-shadow: 0 0 0 2px #ffd60a; }
.pho-sl { display: flex; flex-direction: column; gap: 4px; font-size: 13px; } .pho-sl > div { display: flex; justify-content: space-between; opacity: .8; } .pho-sl input[type=range] { width: 100%; accent-color: #ffd60a; height: 4px; }

/* compact: the list fills the window and the viewer overlays it */
@container win (max-width: 699px) { .pho-title { font-size: 30px; } .pho-vbar { top: 110px; } }
/* wide: grid left, viewer pane right */
@container win (min-width: 700px) {
  .pho-list { flex: none; width: 340px; border-right: .5px solid var(--sep); }
  .pho-viewer { position: relative; display: block; flex: 1; inset: auto; }
  .pho-vback { display: none; }
  .pho-empty { display: flex; } .pho-viewer.has .pho-empty { display: none; }
  .pho-vcap { top: 16px; }
  .pho-edit { border-radius: 22px 22px 0 0; }
  .pho-grid { grid-template-columns: repeat(3, 1fr); }
}
