:root {
  --bg: #fdf7f2;
  --card: #ffffff;
  --ink: #3b2a20;
  --muted: #8a7768;
  --line: #ead9cc;
  --pink: #e86f93;
  --pink-d: #c2476b;
  --blue: #2f6fb5;
  --ok: #2e8b57;
  --warn: #b7791f;
  --err: #c53030;
  --radius: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Noto Sans JP", sans-serif;
  font-size: 17px; line-height: 1.6;
}
main { max-width: 760px; margin: 0 auto; padding: 12px 16px 120px; }
h1 { font-size: 1.35rem; margin: 8px 0 12px; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
h3 { font-size: 1rem; margin: 0 0 6px; }
a { color: var(--blue); }
.muted { color: var(--muted); font-size: .9rem; }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin: 12px 0; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.btn {
  appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 10px 16px; font-size: 1rem; min-height: 44px; cursor: pointer;
  font-family: inherit; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--pink); border-color: var(--pink); color: #fff; font-weight: bold; }
.btn.primary:hover:not(:disabled) { background: var(--pink-d); }
.btn.big { width: 100%; font-size: 1.15rem; min-height: 56px; }
.btn.small { padding: 4px 10px; min-height: 36px; font-size: .9rem; }
.btn.danger { color: var(--err); border-color: #f1c0c0; }
.btn.icon { width: 44px; padding: 0; }
input[type=text], input[type=password], textarea, select {
  width: 100%; font: inherit; color: inherit; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff;
}
textarea { resize: vertical; min-height: 2.8em; }
input::placeholder, textarea::placeholder { color: #bba99b; }
label.field { display: block; margin: 10px 0; }
label.field > .lbl { display: flex; justify-content: space-between; gap: 8px; font-size: .92rem; color: var(--muted); }
.counter.over { color: var(--err); }
.unsaved { color: var(--warn); font-size: .8rem; margin-left: 6px; }
.emoji-warn { color: var(--err); font-size: .85rem; }
details.ko { margin-top: 4px; }
details.ko > summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.banner { border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.banner.err { background: #fdecec; color: var(--err); }
.banner.warn { background: #fff6e0; color: #7a5410; }
.banner.ok { background: #e9f7ef; color: #1f6b43; }
.savebar {
  position: sticky; top: 0; z-index: 5; background: rgba(253,247,242,.95); backdrop-filter: blur(4px);
  padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px;
}
.savebar .title { font-weight: bold; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.savestate { font-size: .85rem; white-space: nowrap; }
.savestate.ok { color: var(--ok); }
.savestate.busy { color: var(--muted); }
.savestate.bad { color: var(--err); }
.day { border-left: 6px solid var(--pink); }
.day[data-day="2"] { border-left-color: #6fb3e8; }
.day[data-day="3"] { border-left-color: #8cc56b; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; }
.photo-item { display: grid; grid-template-columns: 112px 1fr; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); }
.photo-item .thumb { width: 112px; height: 84px; object-fit: cover; border-radius: 8px; background: #eee; }
.photo-item .ops { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.photo-item .state { font-size: .85rem; }
.photo-item.failed .state { color: var(--err); }
.photo-item.uploading .thumb { opacity: .5; }
.tpl-list { display: flex; gap: 10px; flex-wrap: wrap; }
.tpl-list label { border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; cursor: pointer; }
.tpl-list input:checked + span { font-weight: bold; color: var(--pink-d); }
.badge { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: #f2e6dc; color: var(--ink); }
.badge.err { background: #fdecec; color: var(--err); }
.badge.ok { background: #e9f7ef; color: var(--ok); }
.badge.busy { background: #eef3fb; color: var(--blue); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.grid .cell { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.grid .cell img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #eee; }
.grid .cell .meta { padding: 6px 8px; font-size: .85rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.heart { border: none; background: none; font-size: 1.2rem; cursor: pointer; padding: 4px 6px; min-height: 40px; color: #bbb; }
.heart.on { color: var(--pink); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal .sheet { background: var(--bg); width: 100%; max-width: 760px; max-height: 88vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 16px; }
table.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.list td, table.list th { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.qr { width: 180px; height: 180px; background: #fff; }
.qr svg { width: 100%; height: 100%; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #333; color: #fff; padding: 10px 18px; border-radius: 999px; z-index: 30; font-size: .95rem; }
body.download main { padding-top: 15vh; }
body.download .lead { font-size: 1.1rem; }
/* スライドショー */
body.show { background: #000; color: #fff; margin: 0; overflow: hidden; }
.show-stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.show-stage img { max-width: 100vw; max-height: 100vh; object-fit: contain; transition: opacity .6s; }
.show-title { position: fixed; left: 16px; top: 10px; font-size: 1.2rem; opacity: .8; }
.show-qr { position: fixed; right: 16px; bottom: 16px; width: 150px; background: #fff; padding: 6px; border-radius: 8px; color: #000; text-align: center; font-size: .8rem; }
.show-qr svg { width: 100%; display: block; }
.show-offline { position: fixed; left: 16px; bottom: 12px; font-size: .9rem; opacity: .75; }
.show-empty { font-size: 1.6rem; opacity: .7; }

/* v2 入口（設計書 v2.0 4章） */
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.btn.pick { width: 100%; text-align: left; min-height: 52px; font-size: 1.05rem; }
.flyer-card { display: block; color: inherit; text-decoration: none; }
.host-link { margin-top: 28px; }
div.field { margin: 10px 0; }
div.field > label { display: block; font-size: .92rem; color: var(--muted); margin-bottom: 4px; }
.ver-row { border-top: 1px dashed var(--line); padding: 8px 0; }
.ver-link code { word-break: break-all; flex: 1; min-width: 0; }
.tpl-card { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 320px; }
.tpl-card.on { border-color: var(--pink); }
.tpl-card img { width: 100%; border-radius: 6px; display: block; }
/* フォトシャワーのスライドショー（同じ画面のまま全画面で重ねる） */
.show-overlay { position: fixed; inset: 0; background: #000; color: #fff; z-index: 40; cursor: pointer; }
.show-overlay .show-stage img { transition: opacity .3s; }
.show-overlay .qrsvg svg { width: 100%; display: block; }
/* 思い出動画（/movie）。ページのフレーム画像（/movie-frame）があれば背景に、無ければ CSS の飾り */
body.movie-page { background: radial-gradient(circle at 20% 15%, #fde3ec 0 18%, transparent 19%), radial-gradient(circle at 85% 80%, #dff1fb 0 20%, transparent 21%), #fff8f1; min-height: 100vh; }
body.movie-page main { max-width: 1280px; padding-top: 3vh; }
.movie-stage { display: flex; justify-content: center; }
.movie-screen { width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; padding: 10px; background: linear-gradient(135deg, #f7a8c0, #a8d8f0 50%, #c8e6a0); box-shadow: 0 10px 30px #0003; }
.movie-framed { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.movie-framed video { position: absolute; left: 10.9375%; top: 10.9028%; width: 78.125%; height: 78.125%; background: #000; display: block; }
.movie-framed__art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.movie-screen video { width: 100%; height: 100%; border-radius: 12px; background: #000; display: block; }
.movie-empty { text-align: center; padding: 12vh 16px; }
.movie-ops { justify-content: center; margin-top: 14px; }
