:root {
  --rose: #B07A6E;        /* やわらかいローズブラウン（アプリ版と同じ） */
  --rose-2: #8E5A4F;
  --rose-soft: #F6E8E3;
  --cream: #FFF8F5;
  --ink: #4A3630;
  --ink-2: #7A625A;
  --line: #EADBD5;
  --danger: #C0392B;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Yu Gothic', 'Meiryo', sans-serif;
  font-size: 17px;
  line-height: 1.7;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.4; }
p { margin: 0 0 8px; }

.view { min-height: 100vh; min-height: 100dvh; max-width: 560px; margin: 0 auto; padding-bottom: 96px; }
.bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: var(--cream); border-bottom: 1px solid var(--line);
}
.bar h2 { flex: 1; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back, .menu-btn {
  width: 44px; height: 44px; flex: none; border: none; background: none; font-size: 28px; color: var(--rose-2); cursor: pointer; border-radius: 12px;
}
.menu-btn { font-size: 22px; }
.body { padding: 14px 16px; }

.btn {
  display: block; width: 100%; min-height: 52px; margin-top: 12px; padding: 12px 16px; border-radius: 999px;
  border: 1.5px solid transparent; font: inherit; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--rose); color: #fff; }
.btn.ghost { background: #fff; color: var(--rose-2); border-color: var(--rose); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.text { background: none; color: var(--ink-2); font-weight: 400; text-decoration: underline; }
.btn.small { width: auto; min-height: 44px; margin: 0; padding: 8px 14px; font-size: 14px; }
.small { font-size: 13px; color: var(--ink-2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row2 .btn { font-size: 14px; padding: 8px; }

.fab {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 6;
  min-height: 56px; padding: 0 26px; border-radius: 999px; border: none; background: var(--rose); color: #fff;
  font: inherit; font-size: 17px; font-weight: 700; box-shadow: 0 6px 18px rgba(120, 70, 60, .35); cursor: pointer;
}

/* 表紙 */
.cover { display: flex; align-items: center; justify-content: center; text-align: center; background: linear-gradient(170deg, #FFF8F5, #F3DED6); max-width: none; }
.cover-in { padding: 24px; }
.cover-mark { width: 120px; height: 120px; }
.cover-mark ellipse, .cover-mark path { fill: none; stroke: var(--rose); stroke-width: 3; }
.cover-mark line { stroke: var(--rose); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .6; }
.cover h1 { font-size: 34px; letter-spacing: .12em; color: var(--rose-2); margin-top: 8px; }
.cover .tag { color: var(--ink-2); margin: 10px 0 18px; }
.cover .btn { width: 220px; margin: 0 auto 8px; }

/* 一覧 */
.search { width: 100%; font: inherit; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; }
.list { list-style: none; padding: 0; margin: 12px 0; }
.list li button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 16px; background: #fff; font: inherit; color: var(--ink); cursor: pointer;
}
.thumb { width: 52px; height: 69px; flex: none; border-radius: 10px; background: var(--rose-soft); object-fit: cover; }
.list b { display: block; font-size: 17px; }
.list small { color: var(--ink-2); font-size: 13px; }
.empty { text-align: center; color: var(--ink-2); margin: 30px 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-top: 18px; }
.card h3 { font-size: 15px; margin-bottom: 6px; }
.notice p { font-size: 14px; color: var(--ink-2); }

/* 同意 */
.to { font-size: 22px; margin: 8px 0 12px; }
.lead { font-size: 17px; }
.points { list-style: none; padding: 0; margin: 14px 0; }
.points li { display: flex; gap: 10px; padding: 8px 0; font-size: 16px; }
.points b { flex: none; width: 28px; text-align: center; }

/* 回の一覧 */
.sessions { list-style: none; padding: 0; margin: 0; }
.sessions li { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 12px; margin-bottom: 12px; }
.sessions li > button { all: unset; display: block; width: 100%; cursor: pointer; }
.sessions h3 { font-size: 16px; }
.quad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.quad figure { margin: 0; text-align: center; }
.quad img, .quad .noimg { width: 100%; aspect-ratio: 3 / 4; border-radius: 8px; object-fit: cover; background: var(--rose-soft); display: block; }
.quad figcaption { font-size: 11px; color: var(--ink-2); }
.memo-line { font-size: 14px; color: var(--ink-2); margin-top: 6px; }

/* 1回分 */
.angle-block h3 { font-size: 17px; margin: 14px 0 6px; }
.slot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slot { position: relative; }
.slot .sl { font-size: 13px; color: var(--ink-2); margin-bottom: 2px; }
.slot button.shot {
  display: block; width: 100%; aspect-ratio: 3 / 4; border-radius: 14px; border: 2px dashed var(--rose); background: var(--rose-soft);
  color: var(--rose-2); font: inherit; font-weight: 700; cursor: pointer; padding: 0; overflow: hidden;
}
.slot button.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot button.shot.has { border-style: solid; }
.slot .redo { font-size: 13px; margin-top: 4px; width: 100%; }
.field { display: block; margin-top: 16px; }
.field span { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
textarea, input[type=text] { width: 100%; font: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }

/* 撮る */
.view.dark { background: #1a1412; color: #fff; }
.view.dark .bar { background: #1a1412; border-color: #3a2e2a; }
.view.dark .back, .view.dark .menu-btn { color: #fff; }
.frame { position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: #000; }
.frame video, .frame #cap-ref { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame video.mirror { transform: scaleX(-1); }
.guide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.guide ellipse { fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 2.5; stroke-dasharray: 10 6; }
.guide line { stroke: rgba(255, 255, 255, .55); stroke-width: 1.5; }
.tag-on { position: absolute; left: 8px; top: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 99px; }
.cap-error { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; font-size: 15px; background: rgba(0,0,0,.7); }
.op { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; }
.op input { flex: 1; accent-color: var(--rose); }
.cap-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 14px; }
.cap-row .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.file-btn { display: inline-flex; align-items: center; justify-content: center; }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: var(--rose); cursor: pointer; box-shadow: 0 0 0 3px var(--rose); }
.shutter:disabled { opacity: .4; }

/* 比べる */
.seg { display: grid; gap: 6px; margin-bottom: 8px; }
.seg.two { grid-template-columns: 1fr 1fr; }
.seg.three { grid-template-columns: repeat(3, 1fr); margin-top: 10px; }
.segb { min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: 15px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.segb.on { background: var(--rose); color: #fff; border-color: var(--rose); }
.stage { position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; }
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.stage .split { position: absolute; top: 0; bottom: 0; width: 3px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.4); }
.stage .split::after { content: '◀ ▶'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #fff; color: var(--rose-2); font-size: 12px; padding: 6px 8px; border-radius: 99px; white-space: nowrap; }
.stage .lbl { position: absolute; top: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 99px; }
.pairbox { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; position: relative; background: var(--cream); padding: 6px; border-radius: 16px; touch-action: none; }
.pairbox figure { margin: 0; text-align: center; }
.pairbox b { display: block; font-size: 15px; letter-spacing: .15em; color: #6D4C41; }
.pairbox img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; display: block; }
.pairbox small { font-size: 11px; color: #6D4C41; }
.lines { position: absolute; left: 0; right: 0; pointer-events: none; }
.gl { position: absolute; left: 0; right: 0; height: 0; border-top: 2.5px dashed; }
.gl span { position: absolute; left: 6px; top: -22px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.85); padding: 0 6px; border-radius: 6px; }
.lines.edit { pointer-events: auto; }
.lines.edit .gl { cursor: ns-resize; }
.lines.edit .gl::before { content: ''; position: absolute; left: 0; right: 0; top: -16px; height: 32px; }
.missing { text-align: center; color: var(--ink-2); padding: 40px 16px; background: #fff; border-radius: 16px; border: 1px dashed var(--line); }
.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--rose); }

/* 小さな窓 */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(40, 24, 20, .5); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.sheet-in { background: #fff; color: var(--ink); border-radius: 20px; padding: 18px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; }
.sheet-in h3 { font-size: 18px; margin-bottom: 8px; }
.sheet-in img.preview { width: 100%; border-radius: 12px; display: block; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 30; background: rgba(60, 40, 34, .94); color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 14px; }
.btn.native { display: flex; margin-top: 14px; background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.view.dark .cap-note { color: #cbb; margin-top: 8px; }
.cap-error .btn { margin-top: 12px; }
