:root {
  --bg: #14121a;
  --corridor: #14121a;
  --panel: #1e1a2a;
  --panel-2: #262032;
  --border: #3a3350;
  --text: #eee7f5;
  --text-dim: #a89ec2;
  --accent: #e8b866;
  --accent-dim: #b5905a;
  --owl-bubble: #2c2540;
  --user-bubble: #3d3157;
  --danger: #e0708a;
  --ok: #7fd0a0;
  --paper: #f3ead5;
  --ink: #2a2115;
  --ink-dim: #6b5d48;
  --ink-accent: #7a5a20;
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: linear-gradient(180deg, var(--corridor), #0b0a10 85%) fixed;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  line-break: strict; /* 「っ」「ー」や句読点が行頭に来ないように */
  transition: background 1.2s ease;
}
button, textarea, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }

#app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}

/* ---- ヘッダー ---- */
.header {
  position: sticky; top: 0; z-index: 20;
  margin: 0 -16px; padding: calc(10px + var(--safe-area-inset-top, env(safe-area-inset-top))) 16px 6px;
  background: rgba(16,14,22,0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(58,51,80,0.6);
  margin-bottom: 8px;
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.header .gauge { margin: 8px 0 2px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 600; letter-spacing: 0.08em; }
.phase { font-size: 12px; color: var(--text-dim); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.menu-btn { background: none; border: 1px solid var(--border); color: var(--text-dim); border-radius: 8px; padding: 4px 10px; font-size: 13px; }
.mock-banner { font-size: 12px; color: var(--accent); background: rgba(232,184,102,0.08); border: 1px dashed var(--accent-dim); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }

/* ---- ボタン ---- */
.primary {
  background: var(--accent); color: #2a2115; border: none; border-radius: 12px;
  padding: 12px 20px; font-weight: 700; font-size: 16px;
}
.primary:disabled { opacity: 0.45; }
.secondary {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 12px; padding: 11px 16px; font-size: 15px;
}
.secondary:hover, .menu-btn:hover { color: var(--text); border-color: var(--accent-dim); }
.text-btn { background: none; border: none; color: var(--text-dim); text-decoration: underline; font-size: 14px; padding: 6px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.grow { flex: 1; }

/* ---- フクロウ ---- */
.owl-wrap { display: inline-block; line-height: 0; animation: owlIdle 4s ease-in-out infinite; }
.owl-wrap.flipped { transform: rotate(180deg); animation: none; }
.owl-wrap.react { animation: owlFlap 0.6s ease; }
@keyframes owlIdle { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes owlFlap { 0% { transform: scale(1); } 30% { transform: scale(1.15) rotate(-5deg); } 60% { transform: scale(1.08) rotate(5deg); } 100% { transform: scale(1); } }
.owl-blink { animation: blinkEye 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes blinkEye { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(0.12); } }

/* ---- ようこそ ---- */
.welcome { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 18px; padding: 24px 0 48px; }
.welcome h1 { margin: 0; font-size: 28px; letter-spacing: 0.15em; color: var(--accent); }
.welcome .catch { font-family: var(--serif); font-size: 18px; color: var(--text); margin: 0; }
.steps { list-style: none; padding: 0; margin: 4px 0; text-align: left; display: grid; gap: 8px; }
.steps li { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.steps b { color: var(--accent); margin-right: 6px; }
.hint { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

/* ---- 合言葉 ---- */
.gate { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; max-width: 360px; margin: 0 auto; width: 100%; text-align: center; }
.field { width: 100%; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-size: 16px; }
.error { color: var(--danger); font-size: 14px; }

/* ---- 進み具合 ---- */
.gauge { margin: 4px 0 10px; }
.gauge-bar { height: 5px; border-radius: 3px; background: var(--border); margin-bottom: 6px; overflow: hidden; }
.gauge-bar .fill { height: 100%; border-radius: 3px; background: var(--ok); transition: width 0.8s ease; }
.gauge-labels { display: flex; flex-wrap: nowrap; gap: 4px; overflow: hidden; }
.gauge-labels span { white-space: nowrap; font-size: 11px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-dim); }
.gauge-labels span.done { border-color: var(--ok); color: var(--ok); }

/* ---- 対話 ---- */
.stage { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.log { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 8px 0 12px; }
.msg { display: flex; gap: 8px; max-width: 92%; }
.msg.fresh { animation: msgIn 0.25s ease-out; }
@keyframes msgIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.msg.owl { align-self: flex-start; }
.msg.user { align-self: flex-end; }
.msg .bubble { padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; }
budoux-ja { word-break: keep-all; overflow-wrap: anywhere; }
.msg.owl .bubble { background: var(--owl-bubble); border-top-left-radius: 4px; }
.msg.user .bubble { background: var(--user-bubble); border-top-right-radius: 4px; }
.msg .avatar { flex-shrink: 0; margin-top: 2px; }
.thinking { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 14px; padding: 4px 0; }
.dots span { animation: dot 1.4s infinite; opacity: 0.2; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot { 40% { opacity: 1; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.chip {
  background: var(--panel-2); border: 1px solid var(--accent-dim); color: var(--accent);
  border-radius: 999px; padding: 7px 14px; font-size: 14px; text-align: left;
}
.chip:hover { background: rgba(232,184,102,0.12); }

.doors { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 6px; scrollbar-width: none; }
.door { flex-shrink: 0; background: var(--panel); border: 1px solid var(--border); color: var(--text-dim); border-radius: 10px; padding: 6px 12px; font-size: 13px; }
.door.open { border-color: var(--accent-dim); color: var(--accent); }
.door-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; margin-bottom: 8px; animation: msgIn 0.3s ease-out; }
.door-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 13px; text-align: left; }
.door-card small { display: block; color: var(--text-dim); font-size: 11px; line-height: 1.5; margin-top: 2px; }
.door-card:hover { border-color: var(--accent-dim); }

.composer {
  position: sticky; bottom: 0; z-index: 10;
  padding: 10px 0 calc(10px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom)));
  background: linear-gradient(0deg, rgba(14,12,20,0.98) 75%, rgba(14,12,20,0));
}
.input-row { display: flex; gap: 8px; align-items: flex-end; }
.input-row textarea {
  flex: 1; resize: none; min-height: 46px; max-height: 160px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 11px 14px; font-size: 16px; line-height: 1.5;
}
.input-row textarea:focus, .field:focus { outline: none; border-color: var(--accent-dim); }
.send { padding: 11px 16px; border-radius: 14px; }
.finish-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.finish-btn { background: none; border: 1px solid var(--border); color: var(--text-dim); border-radius: 999px; padding: 6px 14px; font-size: 13px; }
.finish-btn.ready {
  border-color: var(--accent); color: #2a2115; background: var(--accent); font-weight: 700; font-size: 15px; padding: 9px 18px;
  animation: glow 2.2s ease-in-out infinite;
}
@keyframes glow { 0%,100% { box-shadow: 0 0 0 0 rgba(232,184,102,0.0); } 50% { box-shadow: 0 0 18px 2px rgba(232,184,102,0.45); } }

/* ---- まとめ（設計図） ---- */
.blueprint { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin: 6px 0 14px; }
.blueprint h2 { font-size: 13px; color: var(--text-dim); font-weight: 500; margin: 0 0 10px; }
.bp-item { margin-bottom: 12px; }
.bp-item label { display: block; font-size: 12px; color: var(--accent); margin-bottom: 3px; }
.bp-item textarea, .bp-item input {
  width: 100%; background: transparent; border: 1px solid transparent; border-bottom: 1px dashed var(--border);
  border-radius: 6px; padding: 4px 6px; resize: none; line-height: 1.6; font-size: 15px;
}
.bp-item textarea:focus, .bp-item input:focus { outline: none; border-color: var(--accent-dim); background: var(--panel-2); }
.bp-title input { font-family: var(--serif); font-size: 20px; color: var(--text); }
.beats { margin: 0; padding-left: 0; list-style: none; counter-reset: beat; }
.beats li { display: flex; gap: 6px; align-items: flex-start; counter-increment: beat; }
.beats li::before { content: counter(beat); color: var(--accent-dim); font-size: 13px; width: 16px; padding-top: 6px; flex-shrink: 0; }
.lengths { display: flex; gap: 8px; margin-top: 4px; }
.lengths button { flex: 1; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px; font-size: 14px; color: var(--text-dim); }
.lengths button.on { border-color: var(--accent); color: var(--accent); }
.big-button { width: 100%; padding: 16px; font-size: 18px; border-radius: 16px; letter-spacing: 0.08em; animation: glow 2.2s ease-in-out infinite; }

/* ---- 生成中 ---- */
.generating { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 16px 0 40px; }
.door-stage {
  position: relative; width: 100%; max-width: 420px; height: 200px; border-radius: 12px; overflow: hidden;
  background: #0d0b12; margin: 12px 0 18px; transition: height 0.8s ease;
}
.door-stage .light { position: absolute; inset: 0; background: radial-gradient(circle, rgba(232,184,102,0.55), transparent 70%); }
.door-stage .half { position: absolute; top: 0; bottom: 0; width: 50%; background: linear-gradient(135deg, #2c2540, #3a3350); transition: width 1.2s ease; }
.door-stage .half.l { left: 0; border-right: 2px solid var(--accent-dim); }
.door-stage .half.r { right: 0; border-left: 2px solid var(--accent-dim); }
.door-stage .knob { position: absolute; top: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-dim); }
.door-stage.opened { height: 64px; }
.narration { font-family: var(--serif); color: var(--accent); font-size: 17px; letter-spacing: 0.1em; min-height: 1.8em; text-align: center; transition: opacity 0.4s; }
.meter { width: 100%; max-width: 420px; height: 4px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.meter div { height: 100%; background: var(--accent); transition: width 0.5s ease; }

/* ---- 脚本（紙） ---- */
.paper {
  width: 100%;
  background: var(--paper); color: var(--ink);
  border-radius: 6px; padding: 26px 20px 30px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.4);
  font-family: var(--serif); line-height: 2; font-size: 15.5px;
}
.paper.unfold { animation: unfold 0.7s ease-out; transform-origin: top center; }
@keyframes unfold { from { transform: scaleY(0.04); opacity: 0; } to { transform: none; opacity: 1; } }
.paper .s-title { text-align: center; font-size: 21px; font-weight: 700; letter-spacing: 0.12em; margin: 0 0 18px; }
.paper .s-heading { font-weight: 700; color: var(--ink-accent); margin-top: 22px; }
.paper .s-action { color: var(--ink-dim); padding-left: 2.5em; }
.paper .s-dialogue { display: flex; }
.paper .s-dialogue .who { flex-shrink: 0; font-weight: 600; }
.paper .s-blank { height: 0.6em; }
.paper .line { border-radius: 4px; transition: background 0.2s; position: relative; }
.paper.pinnable .line:not(.s-title):not(.s-blank) { cursor: pointer; }
.paper .line.pinned { background: rgba(232,184,102,0.35); box-shadow: -6px 0 0 rgba(232,184,102,0.35); }
.paper .line.pinned::after { content: "気になる"; position: absolute; right: -4px; top: -10px; font-family: var(--sans); font-size: 10px; background: var(--ink-accent); color: #fff; border-radius: 999px; padding: 0 6px; line-height: 1.7; }
.cursor::after { content: "▍"; color: var(--ink-accent); animation: dot 1s infinite; }

.versions { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.versions button { background: var(--panel-2); border: 1px solid var(--border); color: var(--text-dim); border-radius: 999px; padding: 3px 12px; font-size: 13px; }
.versions button.on { border-color: var(--accent); color: var(--accent); }
.read-hint { font-size: 13px; color: var(--text-dim); margin: 6px 0; }

.talk { margin-top: 18px; }
.fab {
  position: fixed; right: 16px; bottom: calc(18px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom))); z-index: 30;
  background: var(--owl-bubble); border: 1px solid var(--accent-dim); color: var(--accent);
  border-radius: 999px; padding: 8px 14px 8px 8px; display: flex; align-items: center; gap: 6px; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* ---- 自分で直す ---- */
.edit-paper .eline { display: block; width: 100%; border: none; background: transparent; resize: none; font-family: var(--serif); font-size: 15.5px; line-height: 1.9; color: var(--ink); padding: 2px 4px; border-radius: 4px; overflow: hidden; }
.edit-paper .eline:focus { outline: none; background: rgba(232,184,102,0.25); }
.edit-paper .eline.h { font-weight: 700; color: var(--ink-accent); margin-top: 14px; }
.edit-paper .eline.a { color: var(--ink-dim); padding-left: 2.5em; }
.edit-paper .full { width: 100%; min-height: 60vh; border: none; background: transparent; font-family: var(--serif); font-size: 15px; line-height: 1.9; color: var(--ink); resize: vertical; }
.edit-paper .full:focus { outline: none; }
.edit-bar { position: sticky; bottom: 0; padding: 10px 0 calc(12px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom))); background: linear-gradient(0deg, rgba(14,12,20,0.98) 75%, rgba(14,12,20,0)); }

/* ---- 完成 ---- */
.done-head { text-align: center; padding: 10px 0 6px; }
.done-head .bubble { display: inline-block; text-align: left; background: var(--owl-bubble); border-radius: 16px; padding: 12px 16px; white-space: pre-wrap; margin-top: 8px; }

/* ---- メニュー ---- */
.sheet-wrap { position: fixed; inset: 0; background: rgba(8,6,12,0.7); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--panel); border: 1px solid var(--border); border-radius: 18px 18px 0 0; width: 100%; max-width: 720px; padding: 18px 16px calc(18px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom))); display: grid; gap: 10px; max-height: 85dvh; overflow: auto; }
.sheet h3 { margin: 0; font-size: 15px; color: var(--text-dim); font-weight: 500; }
.shelf-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--panel-2); border-radius: 10px; padding: 10px 12px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--owl-bubble); border: 1px solid var(--accent-dim); color: var(--text); padding: 8px 16px; border-radius: 999px; font-size: 14px; z-index: 60; animation: msgIn 0.2s; }

.spacer { height: 24px; }

/* ---- 10/13 本人FBの反映 ---- */
/* 設計図：項目ごとの「フクロウと直す」 */
.bp-item label { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.talk-fix { background: none; border: 1px solid var(--border); color: var(--text-dim); border-radius: 999px; padding: 1px 10px; font-size: 11px; white-space: nowrap; }
.talk-fix:hover { color: var(--accent); border-color: var(--accent-dim); }
.bp-view { border-bottom: 1px dashed var(--border); padding: 8px 0; }
.bp-view-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--accent); margin-bottom: 4px; }
.bp-view-body { font-size: 14.5px; line-height: 1.7; }
.finish-row .finish-btn + .finish-btn { margin-left: auto; }

/* 自分で直す：気になる印 */
.edit-paper .eline.pinned { background: rgba(232,184,102,0.35); box-shadow: -6px 0 0 rgba(232,184,102,0.6); }
.pin-list { background: var(--panel); border: 1px solid var(--accent-dim); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 13.5px; }
.pin-list-head { color: var(--accent); font-size: 12px; margin-bottom: 4px; }
.pin-list-item { padding: 2px 0; }

/* ライブラリー */
.book {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  width: 64px; height: 150px; padding: 12px 4px 8px; border: none; border-radius: 3px 6px 6px 3px;
  background: linear-gradient(90deg, rgba(0,0,0,0.25), transparent 18%, transparent 82%, rgba(0,0,0,0.2)), var(--book);
  box-shadow: inset 3px 0 0 rgba(255,255,255,0.12), 0 4px 10px rgba(0,0,0,0.35);
  color: #f3ead5; font-family: var(--serif);
}
.book-title { writing-mode: vertical-rl; font-size: 15px; letter-spacing: 0.12em; max-height: 105px; overflow: hidden; font-weight: 600; }
.book-meta { font-size: 9.5px; font-family: var(--sans); opacity: 0.8; writing-mode: horizontal-tb; text-align: center; line-height: 1.3; }
.bookshelf {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  padding: 16px 12px 0; border-radius: 10px;
  background: repeating-linear-gradient(180deg, transparent 0 150px, #3b2c22 150px 162px) 0 16px / 100% 162px repeat-y, #1c1622;
}
.bookshelf .book { margin-bottom: 12px; }
.library-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 16px; }
.library-title { font-family: var(--serif); font-size: 22px; color: var(--accent); letter-spacing: 0.1em; }
.shelve { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 22px 0 18px; padding: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; }
.shelve-text { font-family: var(--serif); color: var(--accent); font-size: 16px; line-height: 1.8; }
.book.landing { animation: bookIn 1.4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes bookIn {
  0% { transform: translateY(-60px) rotate(-12deg) scale(1.4); opacity: 0; }
  60% { transform: translateY(4px) rotate(2deg) scale(1); opacity: 1; }
  100% { transform: none; opacity: 1; }
}

/* 読む・直す：フクロウと直すか、自分の手で直すかを選べる（10/14 本人FB） */
.fix-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom))); z-index: 30;
  display: flex; gap: 8px; width: calc(100% - 32px); max-width: 520px; transition: opacity 0.25s, transform 0.25s;
}
.fix-bar.hidden { opacity: 0; pointer-events: none; transform: translate(-50%, 12px); }
.fix-choice {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--owl-bubble); border: 1px solid var(--accent-dim); color: var(--accent);
  border-radius: 999px; padding: 10px 12px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,0.45);
}
.fix-choice:disabled { opacity: 0.4; }
.fix-choice + .fix-choice { background: var(--accent); color: #2a2115; font-weight: 700; }

/* ---- 10/15 本人FB ---- */
/* 設計図の「シナリィと直す」：押せるボタンだと分かる大きさに */
.talk-fix.big {
  font-size: 13.5px; font-weight: 700; padding: 6px 14px;
  color: #2a2115; background: var(--accent); border: none;
  box-shadow: 0 2px 0 var(--accent-dim);
}
.talk-fix.big:active { transform: translateY(1px); box-shadow: none; }
.bp-item label { margin-bottom: 6px; }
/* 設計図の更新 */
.upd-tag { display: inline-block; margin-left: 6px; font-size: 10.5px; color: #2a2115; background: var(--ok); border-radius: 999px; padding: 0 7px; vertical-align: 1px; font-weight: 700; }
.bp-view.updated { background: rgba(127,208,160,0.08); border-radius: 8px; padding: 8px; margin: 0 -8px; }
.finish-btn.bp-updated { border-color: var(--ok); color: var(--ok); }
.finish-btn .dot { margin-left: 6px; font-size: 11px; background: var(--ok); color: #1b2a22; border-radius: 999px; padding: 0 6px; font-weight: 700; }
.note {
  align-self: center; display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px; color: var(--ok); background: rgba(127,208,160,0.08); border: 1px solid rgba(127,208,160,0.45);
  border-radius: 999px; padding: 5px 12px;
}
.note span { text-decoration: underline; }
.note.fresh { animation: msgIn 0.25s ease-out; }

/* ---- 10/26 FB（りこぴん・たいせー）---- */
.promises { list-style: none; padding: 0; margin: 0 auto; max-width: 320px; display: grid; gap: 6px; text-align: left; font-size: 14px; color: var(--text-dim); }
.promises li::before { content: "・"; color: var(--accent); }
.lyra-note { color: var(--accent); max-width: 300px; }
/* 自分の手で直した行 */
.paper .line.edited { background: rgba(127,208,160,0.28); box-shadow: -6px 0 0 rgba(127,208,160,0.6); border-radius: 4px; }
.edit-paper .eline.edited { background: rgba(127,208,160,0.22); }
.edited-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: rgba(127,208,160,0.6); vertical-align: -1px; margin-right: 4px; }

/* ---- アプリ版（10/27） ---- */
.gate, .welcome { padding-top: max(24px, var(--safe-area-inset-top, env(safe-area-inset-top))); }
.consent { gap: 12px; }
.consent-head { display: flex; align-items: center; gap: 10px; }
.consent-head h3 { font-size: 18px; color: var(--text); }
.consent-list { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; font-size: 14.5px; line-height: 1.7; }
.consent-list b { color: var(--accent); font-weight: 600; }
.sheet a, .hint a { color: var(--accent); }
.text-btn.small { font-size: 12px; opacity: 0.8; }

/* 起動中の表示 */
.boot-wait { min-height: 70dvh; gap: 14px; }
.boot-wait .hint { margin: 0; }

/* お題で作るモード */
.odai-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 8px 0 2px; padding: 10px 12px; border: 1px solid var(--accent-dim); border-radius: 14px; background: rgba(232,184,102,0.08); }
.odai-label { font-size: 12px; color: var(--accent); letter-spacing: 0.1em; margin-right: 4px; }
.odai-chip { display: inline-flex; flex-direction: column; line-height: 1.3; padding: 4px 10px; border-radius: 10px; background: var(--panel-2); font-weight: 700; font-size: 15px; }
.odai-chip small { font-weight: 400; font-size: 10.5px; color: var(--text-dim); }
.odai-x { color: var(--text-dim); }
.odai-bar .text-btn { margin-left: auto; }

/* 設計図までの進み具合 */
.gauge-head { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.gauge-head b { font-size: 15px; color: var(--accent); font-variant-numeric: tabular-nums; }
.gauge-tip { margin-left: auto; color: var(--ok); font-size: 12px; }

/* 選択肢の開く・閉じる（11/4） */
.chip-toggle { background: none; border: 1px dashed var(--border); color: var(--text-dim); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }

/* 感想を送る（11/4） */
.feedback-link { display: inline-block; text-decoration: none; padding: 10px 18px; border-radius: 999px; }

/* 扉を画面いっぱいに（11/4） */
.generating .door-stage { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; margin: 0; border-radius: 0; z-index: 60; transition: opacity 0.9s ease 0.4s; }
.generating .door-stage .half { transition: width 1.4s cubic-bezier(.6,.05,.3,1); }
.generating .door-stage .knob { width: 12px; height: 12px; }
.generating .door-stage.opened { height: 100dvh; }
.generating .door-stage.gone { opacity: 0; pointer-events: none; }
.door-caption { position: absolute; left: 0; right: 0; bottom: calc(18vh + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; padding: 0 24px; z-index: 2; }
.door-caption .meter { max-width: 280px; }
