/* Libit の画面（メイン・ビューアー）。色・大きさは libit-tokens.css、部品は libit-components.css
   デザイン：Claude Design「Libit 画面デザイン」の B メイン画面・C 写真ビューアー（確定版） */
html, body { height: 100%; margin: 0; }
body.libit { overflow: hidden; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1; }
.phone-only { display: none !important; }
.libit .icon { width: var(--icon-m); height: var(--icon-m); }

/* ---- 上部（56px） ---- */
.topbar {
  height: var(--header-h); flex: none;
  display: flex; align-items: center; gap: var(--sp-24);
  padding: 0 var(--sp-20);
  background: var(--bg); border-bottom: var(--line-w) solid var(--line);
  position: relative; z-index: var(--z-header);
}
.brand { display: flex; align-items: center; gap: var(--sp-8); color: inherit; text-decoration: none; flex: none; }
.brand-mark { width: 20px; height: 20px; flex: none; fill: var(--accent); }
.brand-name { font-size: var(--fs-16); font-weight: var(--fw-bold); letter-spacing: var(--ls-logo); }
.brand-sub { font-family: var(--font-serif); font-size: var(--fs-16); letter-spacing: .04em; color: var(--accent-strong); }
.dev-badge { font-size: var(--fs-12); padding: 2px 8px; border: var(--line-w) solid var(--accent); color: var(--accent-strong); }
.theme-seg { height: var(--btn-h-sm); }
.theme-seg > button { padding: 0 10px; font-size: var(--fs-12); }
.theme-seg .icon { width: 15px; height: 15px; stroke-width: 1.4; }
.user-btn { height: var(--btn-h); padding: 0 var(--sp-8); display: flex; align-items: center; gap: var(--sp-8); border: 0; background: none; font-size: var(--fs-13); cursor: pointer; }
.user-btn:hover { background: var(--surface); }
.user-btn .icon { width: var(--icon-l); height: var(--icon-l); stroke-width: 1.2; }
.chev { width: 10px; height: 10px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.2; }

/* ---- 全体の配置 ---- */
.layout { display: flex; height: calc(100% - var(--header-h)); }
.sidebar { width: var(--sidebar-w); flex: none; display: flex; flex-direction: column; min-height: 0; border-right: var(--line-w) solid var(--line); background: var(--bg); }
.sidebar-tree { flex: 1; min-height: 0; overflow: auto; padding: var(--sp-16) 0 var(--sp-8); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: var(--sp-24) var(--sp-24) 40px; display: flex; flex-direction: column; gap: var(--sp-24); overscroll-behavior: contain; position: relative; }

/* ---- ツリー（部品 .tree を使う） ---- */
.tree-drive { color: var(--text-sub); text-decoration: none; }
a.tree-drive:hover { background: var(--surface); }
a.tree-drive.is-current, a.tree-drive.is-current:hover { background: var(--accent-strong); color: var(--on-accent); font-weight: var(--fw-bold); }
.tree-drive.is-current .state { color: inherit; }
.tree-drive .icon { width: var(--icon-s); height: var(--icon-s); }
.tree-drive .state { color: var(--text-sub); }
.tree-drive .state.is-off { color: var(--danger); }
.tree-row .twisty[hidden] { visibility: hidden; display: flex !important; }
.tree-empty { padding: 0 var(--sp-20); color: var(--text-sub); font-size: var(--fs-13); }
.tree-foot a.current { background: var(--accent-strong); color: var(--on-accent); font-weight: var(--fw-bold); }
.tree-foot a.current .count { color: inherit; }

/* ---- ツールバー（52px） ---- */
.toolbar {
  min-height: var(--toolbar-h); flex: none;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8) var(--sp-16);
  padding: var(--sp-8) var(--sp-24); border-bottom: var(--line-w) solid var(--line-2);
}
.breadcrumb { flex: 1 1 280px; min-width: 0; }
.breadcrumb ol { margin: 0; padding: 0; list-style: none; display: flex; align-items: center; gap: var(--sp-8); font-size: var(--fs-13); white-space: nowrap; overflow: hidden; }
.breadcrumb li { display: flex; align-items: center; gap: var(--sp-8); min-width: 0; }
.breadcrumb li a { color: var(--text-sub); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb li a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb li .sep { color: var(--text-sub); }
.breadcrumb li[aria-current="page"] { font-weight: var(--fw-bold); overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); }
.tool-btn {
  height: var(--btn-h-sm); padding: 0 var(--sp-12);
  display: inline-flex; align-items: center; gap: 6px;
  border: var(--line-w) solid var(--line); background: transparent; font-size: var(--fs-13); cursor: pointer; white-space: nowrap;
}
.tool-btn:hover { background: var(--surface); }
.tool-btn .icon { width: var(--icon-s); height: var(--icon-s); }
.sort-box { position: relative; padding-right: 10px; }
.sort-box select { appearance: none; -webkit-appearance: none; border: 0; background: none; padding: 0 14px 0 0; margin-right: -14px; font-size: var(--fs-13); cursor: pointer; }
.sort-box .chev { pointer-events: none; }
.size-seg > button { min-width: 34px; width: auto; padding: 0 8px; }
.select-btn { padding: 0 18px; }
.filter-chip .chip { height: var(--btn-h-sm); font-size: var(--fs-13); }

/* 選択モードのバー（ツールバーの代わり） */
.select-bar { min-height: var(--toolbar-h); flex: none; display: flex; align-items: center; gap: var(--sp-8) var(--sp-16); padding: var(--sp-8) var(--sp-24); border-bottom: var(--line-w) solid var(--line-2); background: var(--accent-soft); }
.select-bar .title { font-weight: var(--fw-bold); white-space: nowrap; }
/* 幅が足りないときは説明の末尾を「…」で省き、ボタンを 2 段目に回さない（全文は title で出る） */
.select-bar .hint { font-size: var(--fs-13); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-bar .btn { background: var(--bg); flex: none; white-space: nowrap; }
body.selecting .toolbar { display: none; }
.select-head, .select-hint { display: none; }   /* iPhone の選択モードだけで使う */

/* ---- 見出し・お知らせ ---- */
.head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px var(--sp-20); }
.head .meta { font-size: var(--fs-13); }
.notice { padding: var(--sp-12) var(--sp-16); background: var(--danger-soft); color: var(--text); font-size: var(--fs-14); }
.live-banner .btn-text { height: 32px; }

/* ---- 子フォルダ（部品 .folder-card） ---- */
.folder-grid:empty { display: none; }
body.selecting .folder-grid { opacity: .45; }
.folder-card .cover > .icon { width: 40px; height: 40px; stroke: var(--accent); stroke-width: 1; }
.folder-card .name > .icon { width: 18px; height: 18px; stroke-width: 1.2; }

/* ---- 空のとき ---- */
.empty { max-width: 520px; margin: 40px auto 0; display: flex; flex-direction: column; align-items: center; gap: var(--sp-16); text-align: center; }
.empty .icon { width: 48px; height: 48px; stroke: var(--text-sub); stroke-width: 1; }
.empty .title { margin: 0; font-size: var(--fs-16); }
.empty .body { margin: 0; line-height: var(--lh-text); color: var(--text-sub); }

/* ---- サムネイルの一覧（仮想スクロール。見た目は部品 .thumb に合わせる） ---- */
.grid { position: relative; flex: none; }
.tile { position: absolute; display: block; overflow: hidden; background: var(--tile-bg); color: #ffffff; text-decoration: none; cursor: pointer; }
.tile > img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity var(--dur) var(--ease); }
.tile > img.loaded { opacity: 1; }
.tile::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.tile:hover::after { box-shadow: inset 0 0 0 2px var(--accent); }
.tile.is-last::after { box-shadow: inset 0 0 0 3px var(--accent-strong); }
.tile.is-selected::after { box-shadow: inset 0 0 0 4px var(--accent-strong); }
.grid.is-selecting .tile.is-last:not(.is-selected)::after { box-shadow: none; }
.tile .new { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid #ffffff; pointer-events: none; }
.tile .marks { position: absolute; top: 6px; left: 6px; height: 20px; padding: 0 4px; display: flex; align-items: center; gap: 4px; background: var(--thumb-marks-bg); pointer-events: none; }
.tile .marks svg { width: 12px; height: 12px; }
.tile .badge, .tile .duration { position: absolute; bottom: 6px; padding: 2px 5px; font-size: var(--fs-10); font-weight: 700; letter-spacing: .06em; line-height: 1.4; color: #ffffff; background: var(--thumb-badge-bg); pointer-events: none; }
.tile .badge { left: 6px; }
.tile .duration { right: 6px; display: flex; align-items: center; gap: 3px; }
.tile .duration svg { width: 7px; height: 7px; fill: #ffffff; }
.tile .check { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; display: none; align-items: center; justify-content: center; border: 2px solid var(--thumb-check-line); background: var(--thumb-check-off); pointer-events: none; }
.tile .check svg { width: 16px; height: 16px; fill: none; stroke: #ffffff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.grid.is-selecting .tile .check { display: flex; }
.grid.is-selecting .tile .marks { display: none; }
.tile.is-selected .check { background: var(--accent-strong); }
.tile.is-selected .check svg { visibility: visible; }
.tile .fileicon { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; background: var(--surface); color: var(--text-sub); }
/* 種類の札。書類用の --badge-* の色は消えたので（Home の色とロゴ、2026-11-16）、補足の文字の色を地にする */
.tile .fileicon .ext { padding: 3px 5px; font-size: var(--fs-10); font-weight: 700; letter-spacing: .06em; color: var(--bg); background: var(--text-sub); }
.tile .fileicon .fname { max-width: 100%; font-size: var(--fs-12); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.placeholder { pointer-events: none; }
/* サムネイルを作っている間：灰色の地に小さく回る印。できたものから順に出す */
.tile .gen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.tile.is-generating .new, .tile.is-generating .badge, .tile.is-generating .duration, .tile.is-generating .marks { display: none; }
/* 小さいタイル（極小・最小。D-049）：印を省き、新着の点と選択の印を小さくする */
.grid.is-tiny .tile .badge, .grid.is-tiny .tile .duration, .grid.is-tiny .tile .marks { display: none; }
.grid.is-tiny .tile .new { top: 3px; right: 3px; width: 7px; height: 7px; border-width: 1px; }
.grid.is-tiny .tile .check { top: 3px; left: 3px; width: 16px; height: 16px; border-width: 1px; }
.grid.is-tiny .tile .check svg { width: 11px; height: 11px; }
.grid.is-tiny .tile.is-selected::after { box-shadow: inset 0 0 0 2px var(--accent-strong); }
.grid.is-tiny .tile .fileicon .fname { display: none; }
/* ピンチの間。ブラウザのページの拡大はさせず、縦横のスクロールだけ任せる */
.grid.is-pinching .tile { pointer-events: none; }
.grid { touch-action: pan-x pan-y; }

/* ---- 選択中の操作バー（下に固定） ---- */
.actionbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: var(--z-actionbar); }
.actionbar .icon { width: var(--icon-m); height: var(--icon-m); stroke-width: 1.5; }
.actionbar [aria-disabled="true"] { opacity: .45; pointer-events: none; }
body.selecting .content { padding-bottom: calc(var(--actionbar-h) + 24px); }
.toast.has-actionbar { bottom: calc(var(--actionbar-h) + 20px); }

/* ---- タグの一覧・変更履歴のページ ---- */
.page { display: flex; flex-direction: column; gap: var(--sp-16); max-width: 1100px; }
.page .lead { margin: 0; color: var(--text-sub); font-size: var(--fs-13); }
.tag-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-top: var(--line-w) solid var(--line-2); }
.tag-list li { border-bottom: var(--line-w) solid var(--line-2); }
.tag-list a { height: 52px; display: flex; align-items: center; gap: var(--sp-12); padding: 0 var(--sp-12); color: inherit; text-decoration: none; }
.tag-list a:hover { background: var(--surface); }
.tag-list .icon { stroke: var(--text-sub); stroke-width: 1.2; }
.tag-list .name { font-size: 15px; }
.tag-list .num { margin-left: auto; font-size: var(--fs-13); color: var(--text-sub); }
.history { width: 100%; border-collapse: collapse; font-size: var(--fs-13); }
.history th, .history td { text-align: left; padding: 8px 10px; border-bottom: var(--line-w) solid var(--line-2); vertical-align: middle; }
.history th { color: var(--text-sub); font-weight: var(--fw-normal); }
.history .undone { color: var(--text-sub); }
.history td.num { font-variant-numeric: tabular-nums; }

/* ---- ダイアログの中身 ---- */
.menu-list { display: flex; flex-direction: column; gap: var(--sp-8); }
.menu-list .who { color: var(--text-sub); font-size: var(--fs-13); margin: 0 0 8px; }
.menu-list a.btn { text-decoration: none; }
.menu-list .theme-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); margin-bottom: var(--sp-8); }
.dialog .opts { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dialog .opts legend { margin-bottom: 8px; font-size: var(--fs-12); }
.dialog .opts label, .dialog .opt-check { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.dialog input[type="radio"], .dialog input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent-strong); }
.dialog .error-text { color: var(--danger); min-height: 1.4em; }
/* 通知はダイアログより前に出す（タグを付けたあとの「取り消す」を押せるように） */
.toast { z-index: calc(var(--z-dialog) + 5); }

/* ---- ビューアー（写真の部分は常に暗い。情報パネルだけライト・ダークに従う） ---- */
body.viewer-open { overflow: hidden; }
.viewer { --info-w: 360px; position: fixed; inset: 0; z-index: var(--z-viewer); display: flex; background: var(--viewer-bg); color: var(--viewer-fg); font-family: var(--font-sans); letter-spacing: var(--ls-body); }
.viewer[hidden] { display: none; }
.v-stage { position: relative; flex: 1; min-width: 0; overflow: hidden; touch-action: none; display: flex; align-items: center; justify-content: center; user-select: none; -webkit-user-select: none; }
.v-frame { position: relative; flex: none; transform-origin: center center; will-change: transform; }
.v-img { width: 100%; height: 100%; display: block; object-fit: contain; -webkit-user-drag: none; }
.viewer.zoomed .v-stage { cursor: grab; }
.v-video { width: 100%; height: 100%; object-fit: contain; background: none; outline: none; }
.v-message { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: min(480px, 90%); padding: var(--sp-16) var(--sp-20); background: var(--viewer-ctrl-strong); font-size: var(--fs-14); line-height: var(--lh-text); text-align: center; color: #d0d0d0; }
.v-chrome { transition: opacity var(--dur) var(--ease); }
.viewer.idle .v-chrome { opacity: 0; pointer-events: none; }
.viewer.idle .v-stage { cursor: none; }
.viewer.idle.zoomed .v-stage { cursor: grab; }
.viewer .icon { width: 22px; height: 22px; stroke: #ffffff; stroke-width: 1.3; }

.v-top { position: absolute; top: 0; left: 0; right: 0; height: 64px; display: flex; align-items: center; gap: var(--sp-16); padding: 0 var(--sp-12); background: var(--viewer-ctrl-strong); z-index: 2; }
.v-btn { width: var(--tap); height: var(--tap); flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: inherit; cursor: pointer; }
.v-btn:hover { background: rgba(255, 255, 255, .1); }
.v-btn[aria-pressed="true"] { background: rgba(255, 255, 255, .18); }
.v-fav[aria-pressed="true"] { background: none; }
.v-fav[aria-pressed="true"] .icon { fill: var(--viewer-accent); stroke: var(--viewer-accent); }
.v-dl { width: auto; padding: 0 var(--sp-8); gap: 6px; }
.v-dl .chev { stroke: #ffffff; stroke-width: 1.3; }
.v-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 14px; }
.v-name { font-size: 15px; font-weight: var(--fw-bold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-pos { font-size: var(--fs-13); color: var(--viewer-sub); white-space: nowrap; font-variant-numeric: tabular-nums; }
.v-actions { display: flex; align-items: center; gap: var(--sp-16); }
.v-members { display: inline-flex; height: var(--btn-h-sm); border: var(--line-w) solid rgba(255, 255, 255, .4); }
.v-members:empty { display: none; }
.v-members button { padding: 0 var(--sp-12); border: 0; background: none; color: var(--viewer-sub); font-size: var(--fs-12); cursor: pointer; }
.v-members button[aria-pressed="true"] { background: #ffffff; color: #111111; font-weight: var(--fw-bold); }

.v-nav { position: absolute; top: 50%; margin-top: -32px; width: 48px; height: 64px; display: flex; align-items: center; justify-content: center; border: 0; background: var(--viewer-ctrl); color: #fff; cursor: pointer; z-index: 2; }
.v-nav:hover { background: var(--viewer-ctrl-strong); }
.v-nav:disabled { opacity: 0; pointer-events: none; }
.v-nav .icon { width: 26px; height: 26px; }
.v-prev { left: var(--sp-16); }
.v-next { right: var(--sp-16); }
.v-badges { position: absolute; left: 0; right: 0; bottom: var(--sp-20); display: flex; justify-content: center; gap: var(--sp-8); pointer-events: none; z-index: 2; }
.v-badges span { height: 28px; padding: 0 var(--sp-12); display: flex; align-items: center; gap: var(--sp-8); background: var(--thumb-badge-bg); font-size: var(--fs-12); }
.v-badges .zoom { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.v-badges .loading { color: #dddddd; }
.v-badges .loading::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #ffffff; animation: libit-spin .9s linear infinite; }
.v-bottom { display: none; }
/* ---- 動画の操作（デザイン D）。ブラウザ標準の操作の代わり ---- */
.v-stage.is-preparing .v-video { opacity: .3; }
.v-prep { position: absolute; inset: 64px 0 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 0 var(--sp-20); text-align: center; pointer-events: none; }
.v-prep .t { margin: 0; font-size: 18px; font-weight: var(--fw-bold); }
.v-prep .d { margin: 0; font-size: var(--fs-14); line-height: 1.8; color: #d0d0d0; }
.v-prep .v-spin { width: 28px; height: 28px; box-sizing: border-box; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #ffffff; animation: libit-spin .9s linear infinite; }
.v-prep-dl { pointer-events: auto; height: 40px; padding: 0 18px; display: flex; align-items: center; gap: 8px; border: 1px solid rgba(255, 255, 255, .6); background: none; color: #ffffff; font: inherit; font-size: var(--fs-14); cursor: pointer; }
.v-prep-dl .icon { width: 18px; height: 18px; stroke-width: 1.4; }
.v-player { position: absolute; left: 24px; right: 24px; bottom: 20px; z-index: 2; display: flex; flex-direction: column; gap: 8px; padding: 10px 14px 12px; background: rgba(0, 0, 0, .65); }
.vp-seek { position: relative; height: 16px; display: flex; align-items: center; }
.vp-track, .vp-buf, .vp-done { position: absolute; left: 0; height: 4px; pointer-events: none; }
.vp-track { right: 0; background: rgba(255, 255, 255, .3); }
.vp-buf { width: 0; background: rgba(255, 255, 255, .5); }
.vp-done { width: 0; background: var(--viewer-accent); }
.vp-range, .vp-vol { position: relative; margin: 0; padding: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.vp-range { width: 100%; height: 16px; }
.vp-range::-webkit-slider-runnable-track { height: 16px; background: none; }
.vp-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: 1px; border: 0; border-radius: 50%; background: #ffffff; }
.vp-range::-moz-range-track { height: 16px; background: none; }
.vp-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #ffffff; }
.vp-vol { --vol: 100%; width: 80px; height: 16px; }
.vp-vol::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(#ffffff, #ffffff) 0 0 / var(--vol) 100% no-repeat, rgba(255, 255, 255, .3); }
.vp-vol::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border: 0; border-radius: 50%; background: #ffffff; }
.vp-vol::-moz-range-track { height: 4px; background: rgba(255, 255, 255, .3); }
.vp-vol::-moz-range-progress { height: 4px; background: #ffffff; }
.vp-vol::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #ffffff; }
.vp-range:focus-visible, .vp-vol:focus-visible { outline: 2px solid var(--viewer-accent); outline-offset: 2px; }
.vp-row { display: flex; align-items: center; gap: 8px; }
.vp-btn { width: 44px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: none; color: #ffffff; cursor: pointer; }
.vp-btn .icon { width: 22px; height: 22px; stroke-width: 1.4; }
.vp-fs .icon { width: 20px; height: 20px; }
.viewer .icon.is-fill { fill: #ffffff; stroke: none; }
.vp-time { font-size: var(--fs-13); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vp-rate { height: 40px; padding: 0 12px; border: 0; background: none; color: #ffffff; font: inherit; font-size: var(--fs-13); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; cursor: pointer; }
.v-play-big { display: none; }

.viewer.info-open .v-top, .viewer.info-open .v-badges { right: var(--info-w); }
.viewer.info-open .v-next { right: calc(var(--info-w) + var(--sp-16)); }

/* 情報パネル（PC は右、iPhone は下からのシート） */
.v-info { width: var(--info-w); flex: none; display: flex; flex-direction: column; background: var(--surface); color: var(--text); border-left: var(--line-w) solid var(--line); z-index: 3; letter-spacing: var(--ls-body); }
:root:not([data-theme="dark"]) .v-info { background: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .v-info { background: var(--surface); } }
.v-info[hidden] { display: none; }
.v-info .icon { stroke: var(--text); width: var(--icon-l); height: var(--icon-l); stroke-width: 1.2; }
.v-info-head { height: 64px; flex: none; display: flex; align-items: center; padding: 0 var(--sp-12) 0 28px; border-bottom: var(--line-w) solid var(--line); }
.v-info-head h2 { margin: 0; font-family: var(--font-serif); font-weight: var(--fw-normal); font-size: var(--fs-18); letter-spacing: var(--ls-head); }
.v-info-head .grow { flex: 1; }
.v-info-head .icon-btn .icon { width: 19px; height: 19px; }
.v-info-grab { display: none; }
.v-info-body { flex: 1; min-height: 0; overflow: auto; padding: var(--sp-8) 28px var(--sp-24); }
.v-info dl { margin: 0; display: flex; flex-direction: column; }
.v-info .row { padding: var(--sp-16) 0; border-bottom: var(--line-w) solid var(--line-2); display: flex; flex-direction: column; gap: 4px; }
.v-info .row:last-child { border-bottom: 0; }
.v-info dt { font-size: var(--fs-12); color: var(--text-sub); }
.v-info dd { margin: 0; font-size: var(--fs-14); line-height: 1.7; word-break: break-all; }
.v-info .exp { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-8); }
.v-info .exp > div { display: flex; flex-direction: column; gap: 4px; }
.v-info .path .sep { color: var(--text-sub); margin: 0 4px; }
.v-info .open-folder { font-size: var(--fs-13); color: var(--accent-strong); }
.v-info .tags { display: flex; flex-wrap: wrap; gap: var(--sp-8); }
.v-info .tags .tag { height: 30px; padding: 0 var(--sp-12); display: flex; align-items: center; border: var(--line-w) solid var(--line); font-size: var(--fs-13); color: inherit; text-decoration: none; }
.v-info .tags .tag:hover { background: var(--surface); }
.v-info .tags .add { height: 30px; padding: 0 var(--sp-12); display: flex; align-items: center; gap: 4px; border: 0; background: var(--accent-strong); color: var(--on-accent); font-size: var(--fs-13); font-weight: var(--fw-bold); cursor: pointer; }
.v-info .sub { color: var(--text-sub); font-size: var(--fs-12); }
.v-keys { margin: 0; flex: none; padding: 14px 28px; border-top: var(--line-w) solid var(--line); font-size: var(--fs-12); line-height: 1.8; color: var(--text-sub); }
.viewer-open .dialog-backdrop, .viewer-open .toast { z-index: calc(var(--z-viewer) + 10); }

/* ---- タブレット・iPhone ---- */
@media (max-width: 899px) {
  .topbar { gap: var(--sp-16); }
  .theme-seg span { display: none; }
  .theme-seg > button { padding: 0 8px; }
}
/* iPad・小さめのノート PC（768〜1099px）：操作バーが 2 段に回らないよう、お気に入り・ダウンロードは印だけにする
   （名前は読み上げ用に残し、マウスを乗せると title で出る。名前つきで 1 段に収まるのは「5,000 件を選択」で幅 1080px から） */
@media (min-width: 768px) and (max-width: 1099px) {
  .actionbar { flex-wrap: nowrap; gap: 6px; padding: 10px var(--sp-16); }
  .actionbar .count { margin-right: 4px; white-space: nowrap; }
  .actionbar .btn { padding: 0 10px; white-space: nowrap; }
  .actionbar .btn-text { white-space: nowrap; }
  #actFav > span, #actZip > span.pc-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 767px) {
  .pc-only { display: none !important; }
  .phone-only { display: flex !important; }
  .tabbar.phone-only { display: grid !important; }
  .tabbar.phone-only[hidden] { display: none !important; }
  .topbar { height: var(--header-h-phone); gap: 0; padding: 0 4px 0 var(--sp-12); }
  .dev-badge { display: none; }
  .user-btn { width: var(--tap); height: var(--tap); justify-content: center; padding: 0; }
  .user-btn span, .user-btn .chev { display: none; }
  .user-btn .icon { width: 22px; height: 22px; }
  .layout { height: calc(100% - var(--header-h-phone) - var(--tabbar-h) - env(safe-area-inset-bottom)); }
  .sidebar { position: fixed; top: var(--header-h-phone); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); left: 0; z-index: 30; width: min(84vw, 320px); transform: translateX(-100%); transition: transform var(--dur) var(--ease); }
  body.sidebar-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: var(--header-h-phone) 0 0 0; background: var(--scrim); z-index: 25; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-header); }
  .tabbar > [aria-expanded="true"], .tabbar > .current { color: var(--accent-strong); font-weight: var(--fw-bold); }
  .toolbar { border-bottom: 0; padding: 4px var(--sp-16) 0; min-height: 0; }
  .breadcrumb { flex-basis: 100%; }
  .breadcrumb ol { font-size: var(--fs-13); }
  .tools { width: 100%; }
  .tools .seg, .tools .select-btn { display: none; }
  .tool-btn { height: var(--tap); font-size: var(--fs-14); padding: 0 14px; }
  .tools { flex-wrap: nowrap; }
  .sort-box { flex: 1; min-width: 0; }
  .sort-box .sub { display: none; }
  .sort-box select { flex: 1; min-width: 0; width: 100%; font-size: var(--fs-14); text-overflow: ellipsis; }
  .folder-grid .folder-card .name { flex-wrap: wrap; row-gap: 0; }
  .folder-grid .folder-card .name > span:first-of-type { flex: 0 1 auto; min-width: 0; }
  .folder-grid .folder-card .count { flex-basis: 100%; margin-left: 0; }
  /* 選択モード：上部を「すべて選択／N 件を選択／完了」に置き換え、選択モードの帯は出さない */
  body.selecting .topbar { padding: 0 4px; background: var(--accent-soft); }
  body.selecting .topbar > :not(.select-head) { display: none !important; }
  body.selecting .select-head { flex: 1; min-width: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr) 96px; align-items: center; }
  .select-head button { height: var(--tap); padding: 0 8px; border: 0; background: none; color: var(--accent-strong); font: inherit; font-size: 15px; letter-spacing: 0; white-space: nowrap; text-align: left; cursor: pointer; }
  .select-head .done { text-align: right; font-weight: var(--fw-bold); }
  .select-head .count { text-align: center; font-size: var(--fs-16); font-weight: var(--fw-bold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.selecting .select-bar { display: none; }
  body.selecting .head .select-hint { display: block; flex-basis: 100%; font-size: var(--fs-13); }
  .content { padding: var(--sp-12) var(--sp-16) 32px; gap: var(--sp-16); }
  .head .heading { font-size: 20px; }
  .head .meta { margin-left: auto; }
  .folder-grid { display: flex; gap: var(--sp-12); overflow-x: auto; margin: 0 calc(-1 * var(--sp-16)); padding: 0 var(--sp-16); }
  .folder-grid .folder-card { width: 132px; flex: none; }
  .folder-grid .folder-card .cover { aspect-ratio: auto; height: 88px; }
  .actionbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; min-height: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 0 0 env(safe-area-inset-bottom); position: fixed; z-index: calc(var(--z-header) + 1); }
  .actionbar[hidden] { display: none; }
  .actionbar .count, .actionbar .grow { display: none; }
  /* 下の帯は 7 つまで（「ゲストに見せる」を足したため。H6b）。選んだものを外すのは、上の「完了」で */
  .actionbar #actClear { display: none; }
  .actionbar .btn-text { height: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0; border: 0; background: none; color: var(--bar-fg); font-size: var(--fs-10); text-decoration: none; }
  .actionbar .btn-text .icon { width: 24px; height: 24px; stroke-width: 1.3; }
  .actionbar .btn { height: auto; flex-direction: column; gap: 3px; padding: 0; border: 0; background: none; color: var(--bar-fg); font-size: var(--fs-10); font-weight: var(--fw-normal); }
  .actionbar .btn.is-primary { background: none; color: var(--accent-on-bar); font-weight: var(--fw-bold); }
  .actionbar .btn .icon { width: 24px; height: 24px; stroke-width: 1.3; }
  body.selecting .content { padding-bottom: 32px; }
  .toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }

  /* ビューアー（iPhone） */
  .viewer { flex-direction: column; }
  .viewer.info-open .v-top, .viewer.info-open .v-badges { right: 0; }
  .v-top { height: auto; padding: env(safe-area-inset-top) 4px 0; min-height: 52px; gap: 0; }
  .v-title { flex-direction: column-reverse; align-items: center; gap: 1px; }
  .v-name { font-size: 11px; font-weight: var(--fw-normal); color: var(--viewer-sub); max-width: 100%; }
  .v-pos { font-size: 15px; font-weight: var(--fw-bold); color: #ffffff; }
  .v-actions .v-btn, .v-actions .v-dl { display: none; }
  .v-members { height: 30px; margin-right: var(--sp-8); }
  .v-members button { padding: 0 8px; font-size: 11px; }
  .v-actions { min-width: 44px; justify-content: flex-end; }
  .v-nav { display: none; }
  .v-badges { bottom: calc(64px + env(safe-area-inset-bottom) + 12px); }
  .v-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--viewer-ctrl-strong); }
  .v-bottom button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: #ffffff; font-size: 11px; cursor: pointer; }
  .v-bottom button[hidden] { display: none; }
  .v-bottom .icon { width: 24px; height: 24px; }
  .v-bottom .v-fav[aria-pressed="true"] .icon { fill: var(--viewer-accent); stroke: var(--viewer-accent); }
  .viewer.info-open .v-bottom { display: none; }
  /* 動画（iPhone）：下のメニューの上に細いバー、再生・一時停止は画面の中央の丸いボタン。音量は本体のボタンで */
  .v-player { left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); gap: 4px; padding: 8px 16px 6px; background: rgba(0, 0, 0, .55); }
  .vp-seek, .vp-range { height: 20px; }
  .vp-range::-webkit-slider-runnable-track { height: 20px; }
  .vp-range::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: 2px; }
  .vp-range::-moz-range-thumb { width: 16px; height: 16px; }
  .vp-play, .vp-mute, .vp-vol { display: none; }
  .vp-row { gap: 4px; }
  .vp-time { font-size: var(--fs-12); }
  .vp-btn, .vp-rate { height: 44px; }
  .vp-rate { padding: 0 10px; }
  .v-play-big { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .5); cursor: pointer; }
  .v-play-big .icon { width: 26px; height: 26px; }
  .viewer.info-open .v-player, .viewer.info-open .v-play-big { display: none; }
  .v-prep { inset: 52px 0 calc(64px + env(safe-area-inset-bottom)); }
  .v-info { position: relative; width: auto; height: min(470px, 60%); border-left: 0; padding-bottom: env(safe-area-inset-bottom); }
  .v-info-grab { display: flex; justify-content: center; padding-top: var(--sp-8); flex: none; }
  .v-info-grab span { width: 40px; height: 4px; background: var(--line); }
  .v-info-head { height: 52px; padding: 0 4px 0 var(--sp-20); }
  .v-info-head h2 { font-size: 17px; }
  .v-info-body { padding: 0 var(--sp-20) var(--sp-16); }
  .v-info .row { flex-direction: row; justify-content: space-between; align-items: baseline; gap: var(--sp-12); padding: var(--sp-12) 0; }
  .v-info .row dt { font-size: var(--fs-13); flex: none; }
  .v-info .row dd { text-align: right; }
  .v-info .row.is-block { flex-direction: column; align-items: stretch; }
  .v-info .row.is-block dd { text-align: left; }
  .v-info .exp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v-info .tags .tag, .v-info .tags .add { height: 36px; padding: 0 14px; font-size: var(--fs-14); }
  .v-keys { display: none; }
}
@media (min-width: 768px) { body.selecting .toast { bottom: calc(var(--actionbar-h) + 20px); } }

/* ---- 写真を上げる（H2） ---- */
.upload-link { flex: none; }
.upload-link .icon { width: 16px; height: 16px; stroke-width: 1.4; }
.upload-link.current { border-color: var(--accent-strong); color: var(--accent-strong); }
.up-pick { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-12) var(--sp-16); }
.up-choose { position: relative; overflow: hidden; }
.up-choose input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.up-choose:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.up-choose.is-disabled { opacity: .4; pointer-events: none; }
/* ドラッグで上げる（dropupload.js）：落とせる間だけ画面全体に出す。下の画面の操作の邪魔をしないよう、押せないようにする */
.drop-overlay { position: fixed; inset: 0; z-index: calc(var(--z-dialog) + 2); display: flex; align-items: center; justify-content: center; padding: var(--sp-24); background: color-mix(in srgb, var(--bg) 86%, transparent); pointer-events: none; }
.drop-overlay[hidden] { display: none; }
.drop-overlay::before { content: ""; position: absolute; inset: var(--sp-16); border: 2px dashed var(--accent); }
.drop-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--sp-8); text-align: center; }
.drop-box .icon { width: 48px; height: 48px; stroke: var(--accent-strong); stroke-width: 1.2; }
.drop-box .t { margin: 0; font-family: var(--font-serif); font-size: var(--fs-24); letter-spacing: var(--ls-head); color: var(--text); }
.drop-box .sub { margin: 0; font-size: var(--fs-13); color: var(--text-sub); }
/* 上の小さな進み具合（upload.js の .up-pill）：どの画面でも上の中央に重ねる。下の通知（.toast）と同じ色（四角） */
.up-pill { position: fixed; left: 50%; top: calc(var(--header-h) + var(--sp-8)); z-index: var(--z-toast); transform: translateX(-50%);
  width: min(440px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 6px; padding: var(--sp-8) var(--sp-8) var(--sp-8) var(--sp-16);
  background: var(--toast-bg); color: var(--toast-fg); font-size: var(--fs-13); line-height: var(--lh-ui); }
.up-pill[hidden] { display: none; }
.up-pill .row { min-height: 28px; display: flex; align-items: center; gap: var(--sp-8); }
.up-pill .t { flex: 1; min-width: 0; font-weight: var(--fw-bold); }
.up-pill .row > .icon { width: 16px; height: 16px; flex: none; stroke-width: 1.8; }
.up-pill .more { flex: none; padding: 4px 6px; color: inherit; font-size: var(--fs-12); text-decoration: underline; text-underline-offset: 3px; }
.up-pill .x { width: 28px; height: 28px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.up-pill .x .icon { width: 16px; height: 16px; stroke-width: 1.6; }
.up-pill .sub { padding-right: var(--sp-8); font-size: var(--fs-12); opacity: .85; }
.up-pill .bar { height: 3px; margin-right: var(--sp-8); background: rgba(255, 255, 255, .25); }
.up-pill .bar > i { display: block; height: 100%; background: var(--accent-on-bar); transition: width var(--dur) linear; }
.up-pill .ok { flex: none; font-weight: var(--fw-bold); color: var(--accent-on-bar); }
.up-pill.is-error .t { font-weight: var(--fw-normal); }
.up-pill .spin { width: 14px; height: 14px; flex: none; border: 2px solid rgba(255, 255, 255, .35); border-top-color: currentColor; border-radius: 50%; animation: libit-spin 900ms linear infinite; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .up-pill .bar { background: rgba(0, 0, 0, .15); } :root:not([data-theme="light"]) .up-pill .spin { border-color: rgba(0, 0, 0, .25); border-top-color: currentColor; } }
:root[data-theme="dark"] .up-pill .spin { border-color: rgba(0, 0, 0, .25); border-top-color: currentColor; }
:root[data-theme="dark"] .up-pill .bar { background: rgba(0, 0, 0, .15); }
@media (max-width: 767px) { .up-pill { top: calc(var(--header-h-phone) + var(--sp-8)); } }
.pc-only-inline { display: inline; }
@media (max-width: 767px) { .pc-only-inline { display: none; } }
.up-pick .sub { font-size: var(--fs-13); color: var(--text-sub); }
.up-section { display: flex; flex-direction: column; gap: var(--sp-8); }
.up-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-8) var(--sp-12); min-height: var(--btn-h-sm); }
.up-title { margin: 0; font-family: var(--font-serif); font-size: var(--fs-18); font-weight: var(--fw-normal); }
.up-sum { font-size: var(--fs-13); color: var(--text-sub); }
.up-list { margin: 0; padding: 0; list-style: none; border-top: var(--line-w) solid var(--line-2); }
.up-item { display: flex; align-items: center; gap: var(--sp-12); min-height: 56px; padding: var(--sp-8) 0; border-bottom: var(--line-w) solid var(--line-2); }
.up-item .btn { flex: none; }
.up-thumb { flex: none; display: block; width: 56px; height: 56px; overflow: hidden; background: var(--tile-bg); }
.up-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.up-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.up-name { font-size: var(--fs-14); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-meta { font-size: var(--fs-12); color: var(--text-sub); line-height: 1.5; }
.up-item[data-state="done"] .st { color: var(--ok); }
.up-item[data-state="failed"] .up-meta { color: var(--danger); }
.up-bar { position: relative; height: 3px; background: var(--line-2); }
.up-bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); transition: width var(--dur) linear; }
.up-empty { padding: var(--sp-16) 0; font-size: var(--fs-13); color: var(--text-sub); }
@media (max-width: 767px) {
  .topbar .upload-link.btn { width: var(--tap); height: var(--tap); padding: 0; border: 0; background: none; justify-content: center; }
  .upload-link .icon { width: 22px; height: 22px; stroke-width: 1.2; }
  .upload-link .upload-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .upload-link.current { color: var(--accent-strong); }
  .up-name { font-size: var(--fs-16); }
  .up-item .btn { height: var(--tap); }
}

/* ---- すべての写真（H3・D-036。フォルダを見せず、月ごとの見出しで並べる） ---- */
.side-main { border-top: 0; padding-top: var(--sp-16); }
.sidebar-tree:not([hidden]) { border-top: var(--line-w) solid var(--line); }
.filters { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8) var(--sp-20); }
.filters[hidden] { display: none; }
.filter-group { display: flex; align-items: center; gap: var(--sp-8); flex: none; }
.filters .chip { height: var(--btn-h-sm); font-size: var(--fs-13); padding: 0 var(--sp-12); }
.filters .chip .icon { width: var(--icon-s); height: var(--icon-s); fill: none; stroke: currentColor; stroke-width: 1.4; }
.filters .year-box { height: var(--btn-h-sm); flex: none; }
.grid-section { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-end; gap: var(--sp-12); padding-bottom: var(--sp-8); pointer-events: none; }
.grid-section .label { font-family: var(--font-serif); font-size: var(--fs-18); color: var(--text); letter-spacing: .02em; }
.grid-section .sub { font-size: var(--fs-12); color: var(--text-sub); }
@media (max-width: 767px) {
  /* スマホ：絞り込みは 1 行に収め、はみ出す分は横に送る */
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--sp-16)); padding: 0 var(--sp-16) 2px; gap: var(--sp-8) var(--sp-16); scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters .chip { height: 36px; font-size: var(--fs-14); }
  .filters .year-box { height: 36px; flex: none; }
  .grid-section .label { font-size: var(--fs-16); }
}

/* ---- アルバム（H4。新しい部品はアルバムの表紙のカードだけ。ほかは今の部品を使う） ---- */
.side-albums:empty { display: none; }
.tree-foot .side-albums a { height: 34px; padding-left: calc(var(--sp-20) + var(--icon-l) + 10px); font-size: var(--fs-13); }
.tree-foot .side-albums a .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-tools { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); }
.album-tools[hidden] { display: none; }
.album-card .name .count { margin-left: auto; }
.album-card .when { margin-top: -4px; font-size: var(--fs-12); color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-card.is-new { border: 0; padding: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.album-card.is-new .cover { border: var(--line-w) dashed var(--line); background: none; }
.album-card.is-new:hover .cover { background: var(--surface); }
/* アルバムに入れるダイアログ */
.album-new { display: flex; gap: var(--sp-8); align-items: stretch; }
.album-new .input { flex: 1; min-width: 0; }
.album-new .btn { flex: none; }
.album-pick { margin: 0; padding: 0; list-style: none; max-height: min(46vh, 420px); overflow-y: auto; border-top: var(--line-w) solid var(--line-2); }
.album-pick > li { border-bottom: var(--line-w) solid var(--line-2); }
.album-pick > li.sub { padding: var(--sp-12) 0; font-size: var(--fs-13); }
.album-pick-row { width: 100%; min-height: 56px; display: flex; align-items: center; gap: var(--sp-12); padding: 6px var(--sp-8); border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.album-pick-row:hover { background: var(--surface); }
.album-pick-row .thumb { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--surface); }
.album-pick-row .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-pick-row .thumb .icon { width: 22px; height: 22px; stroke: var(--accent); stroke-width: 1.2; }
.album-pick-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.album-pick-row .sub { flex: none; font-size: var(--fs-12); color: var(--text-sub); }
/* 日付で選ぶ */
.date-range { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-12); }
.date-range input[type="date"] { width: 100%; }
/* 月の見出しの「まとめて選ぶ」（見出しは押せないが、このボタンだけ押せる） */
.grid-section .sec-select { margin-left: auto; pointer-events: auto; height: 28px; padding: 0 var(--sp-8); border: 0; background: none; color: var(--accent-strong); font: inherit; font-size: var(--fs-13); cursor: pointer; }
.grid-section .sec-select:hover { text-decoration: underline; text-underline-offset: 3px; }
/* 長押し・なぞって選ぶため：写真の長押しメニューと文字の選択を出さない。選択中は写真をつかんで動かさない */
.tile { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.grid.is-selecting .tile, .grid.is-selecting .tile > img { -webkit-user-drag: none; }
.select-hint .btn-link { margin-left: var(--sp-8); font-size: inherit; }
@media (max-width: 599px) {
  .album-new { flex-direction: column; }
  .date-range { grid-template-columns: 1fr; }
  .grid-section .sec-select { height: 32px; }
}
.v-info .tags .cover-now { align-self: center; font-size: var(--fs-13); }

/* ---- 撮影地（H5。地図は国土地理院の地図＋Leaflet） ---- */
.page.is-map { max-width: none; gap: var(--sp-12); }
.map-tools { display: flex; flex-wrap: wrap; gap: var(--sp-8); }
.map-box { height: max(360px, calc(100dvh - 300px)); border: var(--line-w) solid var(--line-2); background: var(--surface); }
.map-note { margin: 0; }
.leaflet-container { font: inherit; font-size: var(--fs-12); background: var(--surface); }
.leaflet-container a { color: var(--accent-strong); }
/* 写真のまとまり：表紙の写真と枚数 */
.photo-pin { background: none; border: 0; }
.photo-pin .ph { display: block; width: 52px; height: 52px; overflow: hidden; border: 3px solid #ffffff; background: var(--tile-bg); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.photo-pin .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-pin .n { position: absolute; top: -8px; right: -10px; min-width: 22px; height: 22px; padding: 0 6px; display: flex; align-items: center; justify-content: center; border-radius: 11px; background: var(--accent-strong); color: var(--on-accent); font-size: 12px; font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
/* 場所のピン */
.place-pin { background: none; border: 0; }
.leaflet-marker-icon.place-pin svg.icon { width: 36px; height: 36px; fill: var(--accent-strong); stroke: #ffffff; stroke-width: 1.4; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
/* ダーク：地図の絵を暗くする（写真の印はそのまま） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
}
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
/* 場所を付けるダイアログ */
.place-map { height: min(42vh, 320px); border: var(--line-w) solid var(--line-2); cursor: crosshair; }
.place-picked { margin: 6px 0 0; font-size: var(--fs-13); }
.place-results { margin: 6px 0 0; padding: 0; list-style: none; border-top: var(--line-w) solid var(--line-2); max-height: 200px; overflow-y: auto; }
.place-results li { border-bottom: var(--line-w) solid var(--line-2); }
.place-results li.sub { padding: 8px 4px; font-size: var(--fs-13); }
.place-results button { width: 100%; min-height: 40px; padding: 6px 8px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.place-results button:hover { background: var(--surface); }
.dialog .chips .chip .icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; margin-right: 2px; }
.dialog-foot .grow { flex: 1; }
/* ビューアーの情報の欄の小さな地図 */
.v-minimap { height: 150px; margin: 4px 0 6px; border: var(--line-w) solid var(--line-2); cursor: pointer; }
.v-info .place-line { display: flex; flex-wrap: wrap; gap: 4px var(--sp-8); align-items: baseline; font-size: var(--fs-13); }
.v-info .place-line .sub { font-size: var(--fs-12); }
@media (max-width: 767px) {
  .map-box { height: max(320px, calc(100dvh - 330px)); margin: 0 calc(-1 * var(--sp-16)); border-left: 0; border-right: 0; }
  /* 場所を付ける画面の下のボタン：スマホでは「やめる・付ける」を上の段に、「外す」を下の段に */
  .place-foot { flex-wrap: wrap; gap: var(--sp-8); }
  .place-foot .grow { display: none; }
  .place-foot > .btn { flex: 1 1 0; }
  .place-foot > [data-remove] { order: 3; flex-basis: 100%; }
}
/* Google の地図に重ねる部品（写真の印・ピン・検索の目印） */
.gm-html-marker { position: absolute; cursor: pointer; }
.gm-html-marker.place-pin svg.icon { width: 36px; height: 36px; fill: var(--accent-strong); stroke: #ffffff; stroke-width: 1.4; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.gm-html-marker.search-hit span, .leaflet-marker-icon.search-hit span { display: block; width: 18px; height: 18px; border-radius: 50%; background: rgba(66, 133, 244, .9); border: 3px solid #ffffff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.place-results button .t { display: block; }
.place-results button .sub { display: block; font-size: var(--fs-12); }
.v-minimap .static-map { width: 100%; height: 100%; object-fit: cover; display: block; }
