/* ===== Photo.Satto 閲覧画面（写真が主役） ===== */
:root {
  --bg: #f4f1ec; --ink: #1d221f; --muted: #6f746f; --line: #e2ddd4; --accent: #2f5d4a; --sel: #2f5d4a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.7 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif; }
a { color: var(--accent); }
.brand { color: inherit; text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; letter-spacing: .02em; }
.brand.big { font-size: 26px; }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: #f4f1ec; font-size: 17px; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; padding: 6px; }

/* ログイン */
.login-hero { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 20% 10%, #e9e2d6 0%, transparent 60%), radial-gradient(900px 500px at 90% 90%, #dfe8e1 0%, transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); background: rgba(255,255,255,.75); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.9); border-radius: 22px; padding: 36px 28px; text-align: center; box-shadow: 0 20px 60px rgba(40,40,30,.10); }
.lead { color: var(--muted); margin: 14px 0 22px; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 13px 18px; border-radius: 12px; background: #fff; border: 1px solid #d8d3ca; color: #1f1f1f; font-weight: 600; text-decoration: none; min-height: 50px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.google-btn:hover { background: #fafafa; }
.google-btn .g { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 800; color: #fff; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); font-size: 13px; }
.fine { color: var(--muted); font-size: 12.5px; margin: 18px 0 0; }
.notice { text-align: left; font-size: 13.5px; padding: 10px 12px; border-radius: 10px; margin-bottom: 16px; }
.notice.err { background: #fbeceb; color: #9c2a22; }

/* 上の帯 */
.vtop { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(244,241,236,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.vtop .logout { margin-left: auto; }
.back { font-size: 28px; line-height: 1; text-decoration: none; color: var(--ink); padding: 0 6px; }
.vwrap { max-width: 1400px; margin: 0 auto; padding: 16px 16px 120px; }
.vh1 { font-size: 22px; margin: 6px 0 4px; }
.empty-v { text-align: center; color: var(--muted); padding: 60px 16px; }

/* アルバム一覧 */
.albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 12px; }
.album { display: block; text-decoration: none; color: var(--ink); background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.05); transition: transform .15s; }
.album:hover { transform: translateY(-2px); }
.album .cover { display: block; aspect-ratio: 4/3; background: #e8e3da; }
.album .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album .ph { display: grid; place-items: center; height: 100%; font-size: 40px; color: #c6bfb2; }
.album .meta { display: block; padding: 10px 14px 14px; }
.album .meta b { display: block; } .album .meta small { color: var(--muted); }

/* 写真一覧 */
.album-head { margin-bottom: 8px; }
.expiry { color: var(--muted); font-size: 13px; margin: 0; }
.expiry.soon { color: #9c2a22; font-weight: 600; }
.toolbar { position: sticky; top: 53px; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px; background: var(--bg); }
.selall { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; padding: 6px 10px; border-radius: 99px; background: #fff; border: 1px solid var(--line); }
.selall input { width: 18px; height: 18px; accent-color: var(--sel); margin: 0; }
.selinfo { color: var(--muted); font-size: 13px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
@media (max-width: 600px) { .pgrid { grid-template-columns: repeat(3, 1fr); gap: 3px; } .vwrap { padding: 10px 6px 120px; } .album-head, .toolbar { padding-left: 6px; padding-right: 6px; } }
.pcell { position: relative; margin: 0; aspect-ratio: 1; background: #e6e1d8; overflow: hidden; border-radius: 6px; }
@media (max-width: 600px) { .pcell { border-radius: 2px; } }
.pcell .open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.pcell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.pcell .nothumb { display: grid; place-content: center; height: 100%; color: var(--muted); font-weight: 700; text-align: center; padding: 6px; word-break: break-all; }
.pcell .nothumb small { font-weight: 400; font-size: 10.5px; }
.pick { position: absolute; top: 0; left: 0; padding: 8px; cursor: pointer; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick span { display: block; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.22); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.pick input:checked + span { background: var(--sel); border-color: #fff; }
.pick input:checked + span::after { content: ""; display: block; width: 7px; height: 12px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translate(8px, 3px) rotate(45deg); }
.pick input:focus-visible + span { outline: 3px solid #8fb5a3; }
.pcell.on img { transform: scale(.9); border-radius: 6px; }
.pcell.on { background: #d6dfd9; }

/* ダウンロードの帯 */
.dlbar { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 20px; background: var(--ink); color: #fff; border-radius: 99px; box-shadow: 0 10px 30px rgba(0,0,0,.25); width: max-content; max-width: calc(100% - 20px); }
.dlinfo { display: grid; line-height: 1.3; } .dlinfo span { font-size: 12px; opacity: .75; }
.dl-btn { border: 0; border-radius: 99px; padding: 12px 20px; background: #f4f1ec; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; min-height: 44px; }
.dl-btn:disabled { opacity: .5; }

/* 進み具合 */
.progress { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(20,22,20,.45); padding: 20px; }
.pbox { background: #fff; border-radius: 16px; padding: 22px; width: min(420px, 100%); text-align: center; }
.pbar { height: 10px; background: #ece8e1; border-radius: 99px; overflow: hidden; margin: 12px 0; }
.pbar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.pbar.indet span { width: 35% !important; animation: indet 1.2s infinite ease-in-out; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.pbox.err p { color: #9c2a22; }

/* 拡大表示 */
body.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: #0d0f0e; color: #eee; display: grid; grid-template-rows: auto 1fr auto; touch-action: pan-y; }
.lightbox[hidden] { display: none; }
.lb-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); font-size: 13px; }
#lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } #lb-pos { opacity: .7; }
.lb-btn { color: #eee; background: rgba(255,255,255,.1); border: 0; border-radius: 99px; padding: 8px 14px; text-decoration: none; font: inherit; font-size: 13px; cursor: pointer; min-height: 38px; display: inline-flex; align-items: center; }
.lb-stage { display: grid; place-items: center; overflow: hidden; padding: 0 8px; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-stage .nothumb { color: #aaa; text-align: center; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 72px; border: 0; background: rgba(255,255,255,.08); color: #fff; font-size: 38px; cursor: pointer; border-radius: 12px; }
.lb-nav.prev { left: 8px; } .lb-nav.next { right: 8px; }
.lb-nav:disabled { opacity: .15; }
@media (max-width: 600px) { .lb-nav { display: none; } }
.lb-pick { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); font-size: 14px; cursor: pointer; }
.lb-pick input { width: 20px; height: 20px; accent-color: #8fb5a3; }

.pcell .nothumb .hint { display: block; margin-top: 4px; font-size: 10px; line-height: 1.4; color: #8a7f6c; }

/* プレビュー環境の帯 */
.preview-bar{position:fixed;top:0;left:0;right:0;z-index:1000;background:#7a4b00;color:#fff;font-size:12px;line-height:1.5;padding:5px 12px;text-align:center}
body:has(.preview-bar){padding-top:48px}
