/* Photos */
.app-photos { --ps: 150px; }
.app-photos [hidden] { display: none !important; }

/* sidebar */
.app-photos .photos-side { width: 210px; }
.app-photos .side-item.drop { background: rgba(var(--accent-rgb), .2); box-shadow: inset 0 0 0 2px var(--accent); }
.app-photos .photos-albums-label { display: flex; align-items: center; justify-content: space-between; padding-right: 4px; }
.app-photos .photos-add-album { width: 24px; height: 24px; border-radius: 7px; color: var(--text-2); }
.app-photos .photos-side-hint { font-size: 12px; color: var(--text-3); padding: 4px 10px; line-height: 1.45; }

/* toolbar */
.app-photos .photos-toolbar { height: 54px; padding: 0 14px 0 18px; gap: 10px; }
.app-photos .photos-heading { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.app-photos .photos-title { margin: 0; font-size: 19px; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; }
.app-photos .photos-sub { font-size: 12.5px; color: var(--text-3); font-weight: 600; white-space: nowrap; }
.app-photos .photos-zoom-wrap { display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.app-photos .photos-zoom { width: 90px; height: 4px; }
.app-photos .photos-zoom::-webkit-slider-thumb { width: 14px; height: 14px; }
.app-photos .photos-selbar { display: flex; align-items: center; gap: 2px; }
.app-photos .photos-selcount { font-size: 12.5px; font-weight: 700; color: var(--accent); margin-right: 6px; white-space: nowrap; }
.app-photos .photos-selbar .icon-btn.on { color: #ff4d6d; background: rgba(255, 77, 109, .12); }
.app-photos .photos-selsep { width: 1px; height: 20px; background: var(--line-2); margin: 0 6px; }
.app-photos .photos-import .ic { display: inline; }

/* grid */
.app-photos .photos-scroll { flex: 1; padding: 0 18px 24px; outline: none; }
.app-photos .photos-section-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline; gap: 10px; padding: 14px 2px 10px; margin: 0 -2px;
  background: linear-gradient(var(--surface) 70%, transparent);
}
.app-photos .photos-section-head b { font-size: 15px; font-weight: 750; }
.app-photos .photos-section-head span { font-size: 12px; color: var(--text-3); font-weight: 600; }
.app-photos .photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--ps), 1fr)); gap: 6px; margin-bottom: 8px; }
.app-photos .photos-tile {
  position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--surface-3);
  cursor: default; isolation: isolate; transition: transform .18s var(--ease), box-shadow .18s;
}
.app-photos .photos-img { position: absolute; inset: 0; transition: transform .45s var(--ease), filter .2s; }
.app-photos .photos-tile:hover .photos-img { transform: scale(1.06); filter: brightness(1.04) saturate(1.06); }
.app-photos .photos-tile:hover { box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .55); }
.app-photos .photos-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.app-photos .photos-tile.sel { box-shadow: 0 0 0 3px var(--accent); transform: scale(.94); border-radius: 12px; }
.app-photos .photos-tile.sel::after { content: ''; position: absolute; inset: 0; background: rgba(var(--accent-rgb), .14); }
.app-photos .photos-fav {
  position: absolute; left: 7px; bottom: 7px; z-index: 1; color: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55));
}
.app-photos .photos-fav .ic { fill: #fff; }
.app-photos .photos-check {
  position: absolute; right: 7px; bottom: 7px; z-index: 2; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-fg); box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, .35);
  opacity: 0; transform: scale(.5); transition: opacity .15s, transform .2s var(--ease);
}
.app-photos .photos-tile.sel .photos-check { opacity: 1; transform: none; }
.app-photos .photos-empty-ic {
  width: 66px; height: 66px; border-radius: 20px; display: grid; place-items: center; color: #fff; margin-bottom: 4px;
  background: linear-gradient(150deg, #ff5f8f, #ff9a3c); box-shadow: 0 12px 26px -12px rgba(255, 95, 143, .8);
}
.app-photos .empty-state { min-height: 100%; }
.app-photos .empty-state .btn { margin-top: 10px; }

/* drop overlay */
.app-photos .photos-drop {
  position: absolute; inset: 10px; z-index: 20; border-radius: 16px; display: grid; place-items: center; pointer-events: none;
  background: rgba(var(--accent-rgb), .12); box-shadow: inset 0 0 0 2px var(--accent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .15s;
}
.app-photos .photos-drop.on { opacity: 1; }
.app-photos .photos-drop > div { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text); text-align: center; }
.app-photos .photos-drop .ic { color: var(--accent); }
.app-photos .photos-drop b { font-size: 16px; }
.app-photos .photos-drop span { font-size: 12.5px; color: var(--text-2); }

/* ---------- viewer (always dark) ---------- */
.win.photos-viewing .win-bar { background: #0c0d10; color: #f2f3f5; border-bottom-color: rgba(255, 255, 255, .06); -webkit-backdrop-filter: none; backdrop-filter: none; }
.win.photos-viewing:not(.focused) .win-bar { color: rgba(255, 255, 255, .6); }
.app-photos .photos-viewer {
  position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; background: #0c0d10; color: #f2f3f5;
  opacity: 0; pointer-events: none; transform: scale(1.02); transition: opacity .2s, transform .25s var(--ease);
  --pv-hover: rgba(255, 255, 255, .1); --pv-line: rgba(255, 255, 255, .08); --pv-text-2: rgba(255, 255, 255, .62);
}
.app-photos .photos-viewer.open { opacity: 1; pointer-events: auto; transform: none; }
.app-photos .pv-bar { height: 52px; flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 10px; }
.app-photos .pv-back {
  height: 34px; display: inline-flex; align-items: center; gap: 2px; padding: 0 12px 0 6px; border: 0; border-radius: 10px;
  background: none; color: #fff; font-size: 13.5px; font-weight: 600; flex: 0 0 auto;
}
.app-photos .pv-back:hover { background: var(--pv-hover); }
.app-photos .pv-title { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.25; text-align: center; }
.app-photos .pv-title b { font-size: 13.5px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-photos .pv-title span { font-size: 11.5px; color: var(--pv-text-2); white-space: nowrap; }
.app-photos .pv-actions { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.app-photos .pv-btn { width: 36px; height: 34px; border: 0; border-radius: 10px; background: none; color: #f2f3f5; display: grid; place-items: center; transition: background .12s, color .12s, transform .1s; }
.app-photos .pv-btn:hover { background: var(--pv-hover); }
.app-photos .pv-btn:active { transform: scale(.92); }
.app-photos .pv-btn.on { color: var(--accent); background: rgba(var(--accent-rgb), .16); }
.app-photos .pv-fav.on { color: #ff4d6d; background: rgba(255, 77, 109, .14); }
.app-photos .pv-fav.on .ic { fill: #ff4d6d; animation: pv-pop .35s var(--ease); }
@keyframes pv-pop { 40% { transform: scale(1.3); } }
.app-photos .pv-del:hover { color: #ff6b6b; }

.app-photos .pv-body { flex: 1; min-height: 0; display: flex; }
.app-photos .pv-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-photos .pv-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; touch-action: pan-y; }
.app-photos .pv-frame { position: relative; transition: width .3s var(--ease), height .3s var(--ease); }
.app-photos .pv-pic {
  position: absolute; left: 50%; top: 50%; border-radius: 6px; background-size: cover; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .8);
  transition: transform .35s var(--ease), width .3s var(--ease), height .3s var(--ease);
}
.app-photos .pv-pic.in { animation: pv-in .32s var(--ease); }
@keyframes pv-in { from { opacity: .2; filter: blur(6px); } }
.app-photos .pv-nav {
  position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; border: 0; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: rgba(30, 32, 38, .55);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  opacity: 0; transition: opacity .2s, background .12s;
}
.app-photos .pv-prev { left: 14px; }
.app-photos .pv-next { right: 14px; }
.app-photos .pv-stage:hover .pv-nav:not(:disabled) { opacity: 1; }
.app-photos .pv-nav:hover { background: rgba(60, 63, 72, .75); }
.app-photos .pv-nav:disabled { opacity: 0 !important; pointer-events: none; }
.app-photos .pv-strip {
  height: 64px; flex: 0 0 auto; display: flex; align-items: center; justify-content: safe center; gap: 4px; padding: 6px 14px 12px; overflow-x: auto; scrollbar-width: none;
}
.app-photos .pv-strip::-webkit-scrollbar { display: none; }
.app-photos .pv-thumb { flex: 0 0 auto; width: 34px; height: 42px; border: 0; padding: 0; border-radius: 5px; overflow: hidden; position: relative; opacity: .55; transition: width .25s var(--ease), opacity .2s, margin .25s; }
.app-photos .pv-thumb span { position: absolute; inset: 0; }
.app-photos .pv-thumb:hover { opacity: .85; }
.app-photos .pv-thumb.on { width: 66px; opacity: 1; margin: 0 6px; box-shadow: 0 0 0 2px #fff; }

.app-photos .pv-info {
  width: 0; flex: 0 0 auto; overflow: hidden; border-left: 1px solid transparent; background: #15171c;
  transition: width .28s var(--ease); padding: 0;
}
.app-photos .with-info .pv-info { width: 290px; border-left-color: var(--pv-line); padding: 20px 20px 24px; overflow-y: auto; }
.app-photos .pv-info h3 { margin: 0; font-size: 17px; font-weight: 750; word-break: break-word; }
.app-photos .pv-info-date { margin: 4px 0 18px; font-size: 12.5px; color: var(--pv-text-2); }
.app-photos .pv-info dl { margin: 0; display: flex; flex-direction: column; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.app-photos .pv-info dl > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-bottom: 1px solid var(--pv-line); }
.app-photos .pv-info dl > div:last-child { border-bottom: 0; }
.app-photos .pv-info dt { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--pv-text-2); font-weight: 600; }
.app-photos .pv-info dd { margin: 0 0 0 22px; font-size: 13px; font-weight: 600; word-break: break-word; }
.app-photos .pv-swatches { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; font-weight: 600; color: var(--pv-text-2); }
.app-photos .pv-swatches div { display: flex; gap: 6px; }
.app-photos .pv-swatches i { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.app-photos .pv-info-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.app-photos .pv-info-actions .btn { justify-content: flex-start; background: rgba(255, 255, 255, .08); color: #f2f3f5; box-shadow: none; height: 34px; }
.app-photos .pv-info-actions .btn:hover { background: rgba(255, 255, 255, .14); }

/* ---------- phone ---------- */
[data-layout="mobile"] .app-photos .app-split { flex-direction: column; }
[data-layout="mobile"] .app-photos .photos-side {
  width: auto; flex-direction: row; align-items: center; gap: 6px; padding: 8px 12px; overflow-x: auto; overflow-y: hidden;
  border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; background: var(--surface);
}
[data-layout="mobile"] .app-photos .photos-side::-webkit-scrollbar { display: none; }
[data-layout="mobile"] .app-photos .photos-side .side-group-label, [data-layout="mobile"] .app-photos .photos-side-hint { display: none; }
[data-layout="mobile"] .app-photos .photos-side .side-item { width: auto; flex: 0 0 auto; height: 32px; border-radius: 16px; background: var(--tile); padding: 0 12px; gap: 6px; }
[data-layout="mobile"] .app-photos .photos-side .side-item.on { background: var(--accent); color: var(--accent-fg); }
[data-layout="mobile"] .app-photos .photos-side .side-item.on .ic { color: inherit; }
[data-layout="mobile"] .app-photos .photos-side .side-item .count { display: none; }
[data-layout="mobile"] .app-photos .photos-zoom-wrap { display: none; }
[data-layout="mobile"] .app-photos .photos-scroll { padding: 0 4px 20px; --ps: 100px !important; }
[data-layout="mobile"] .app-photos .photos-grid { gap: 2px; grid-template-columns: repeat(3, 1fr); }
[data-layout="mobile"] .app-photos .photos-tile { border-radius: 0; }
[data-layout="mobile"] .app-photos .photos-section-head { padding-left: 10px; }
[data-layout="mobile"] .app-photos .pv-title span { display: none; }
[data-layout="mobile"] .app-photos .pv-back span { display: none; }
[data-layout="mobile"] .app-photos .with-info .pv-info { position: absolute; left: 0; right: 0; bottom: 0; width: auto; max-height: 55%; border-left: 0; border-radius: 18px 18px 0 0; z-index: 3; }
[data-layout="mobile"] .app-photos .pv-nav { display: none; }
