/* 漫画棚の見た目。
   iPhone のふつうのアプリの決まりに合わせてある:
   ・文字の大きさは iOS の段階(34 / 28 / 22 / 20 / 17 / 16 / 15 / 13 / 12 / 11)だけを使う
   ・押せるものは 44 以上の高さ(見た目が小さいものは、押せる範囲だけ広げる)
   ・色は役目で名前を付ける(地・面・塗り・区切り・文字・強調)
   ・動きは短く、シートは iOS と同じ伸び方。「視差効果を減らす」のときは、すべる動きをやめる */

:root {
  /* 地と面(上に重なるほど少し明るい) */
  --bg: #0e0f13;
  --bg-1: #18191f;
  --bg-2: #1c1d24;
  --bg-3: #272831;
  --card: var(--bg-1);
  /* 塗り(ボタンや入力欄の地) */
  --fill-1: rgba(124, 128, 146, 0.36);
  --fill-2: rgba(124, 128, 146, 0.24);
  --fill-3: rgba(124, 128, 146, 0.14);
  --sep: rgba(255, 255, 255, 0.14);
  /* 文字 */
  --text: #f3f4f6;
  --text-2: rgba(236, 237, 245, 0.66);
  --text-3: rgba(236, 237, 245, 0.4);
  /* 強調(いちばん大事な操作と、選ばれている印) */
  --tint: #f5a83c;
  --tint-ink: #1f1503;
  --tint-soft: rgba(245, 168, 60, 0.17);
  --tint-text: #ffcf8a;
  --red: #ff6159;
  --red-soft: rgba(255, 97, 89, 0.16);
  --red-text: #ffa29c;
  --blue: #4fa3f0;
  --green: #44c987;
  --pink: #ff7a93;
  --switch-on: #30d158;
  --seg-on: #5c5e6c;
  --material: rgba(17, 18, 23, 0.84); /* 帯の地。後ろをぼかせない環境でも、下の文字と重なって読みにくくならない濃さにしてある */
  /* 動き */
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease: cubic-bezier(0.25, 0.8, 0.25, 1);
  /* 大きさ */
  --tabbar-h: 50px;
  --nav-h: 44px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --pad-l: calc(16px + var(--sal));
  --pad-r: calc(16px + var(--sar));
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  font-size: 17px;
  line-height: 1.35;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
/* 指2本で画面ぜんたいが拡大されないようにする(送る動きだけ通す。読む画面の拡大は自前でやる) */
body { position: fixed; inset: 0; overflow: hidden; touch-action: pan-x pan-y; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
button:disabled { cursor: default; }
input, textarea, select { font: inherit; color: inherit; -webkit-user-select: text; user-select: text; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }

.ico { display: inline-flex; flex: none; }
.ico svg { width: 22px; height: 22px; display: block; }
.muted { color: var(--text-2); }
.small { font-size: 13px; line-height: 18px; }
.center { text-align: center; }
.danger-text { color: var(--red); }
.dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.dot.scene { background: var(--blue); }
.dot.climax { background: var(--tint); }
.dot.peak { background: var(--red); }
.dot.mark { background: var(--green); }

/* ---- 土台 ---- */
#app { position: absolute; inset: 0; max-width: 640px; margin: 0 auto; }
body.reading #app { visibility: hidden; }
body.reading.pulling #app { visibility: visible; }
#app.back { animation: app-back 0.3s var(--ease) both; }
@keyframes app-back { from { opacity: 0.35; transform: scale(0.975); } to { opacity: 1; transform: none; } }

#view {
  position: absolute; inset: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: calc(var(--sat) + 6px) var(--pad-r) calc(var(--tabbar-h) + var(--sab) + 32px) var(--pad-l);
}

/* 上の細い帯。少しでも下へ送ると、時計や電池の表示の後ろに地が敷かれ(veil)、
   大きい見出しが隠れると、小さい見出しの帯が出る(on) */
#nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  height: calc(var(--sat) + var(--nav-h)); padding: var(--sat) 60px 0;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
#nav::before, #nav::after {
  content: ""; position: absolute; left: 0; right: 0;
  background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  opacity: 0; transition: opacity 0.18s;
}
#nav::before { top: 0; height: var(--sat); }
#nav::after { top: var(--sat); bottom: 0; border-bottom: 0.5px solid var(--sep); }
#nav.veil::before, #nav.on::after { opacity: 1; }
#nav-title { position: relative; z-index: 1; font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0; transition: opacity 0.18s; }
#nav.on #nav-title { opacity: 1; }

/* 下のタブ。中身が後ろを通って見える、すりガラスの帯 */
#tabs {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  height: calc(var(--tabbar-h) + var(--sab)); padding: 0 var(--sar) var(--sab) var(--sal);
  display: flex;
  background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--sep);
}
#tabs button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: rgba(236, 237, 245, 0.52); font-size: 10px; line-height: 12px; font-weight: 600; letter-spacing: 0.02em;
}
#tabs button .ico svg { width: 25px; height: 25px; transition: transform 0.25s var(--spring); }
#tabs button:active .ico svg { transform: scale(0.88); }
#tabs button.on { color: var(--tint); }
#tabs button.on .f { fill: currentColor; }

/* 画面の大きい見出し(「top」という名前は、読む画面の上の帯や、重ねて出すシートの印に使っているので、ここでは使わない) */
.page-top { margin-bottom: 10px; }
.top-over { margin-top: 6px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text-2); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; }
.page-top h1 { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: 0.01em; }
.top-right { display: flex; align-items: center; gap: 8px; min-width: 0; }

/* 中身を見せる画面の、見出しつきのかたまり */
.sec { margin-top: 30px; }
.sec.first { margin-top: 18px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.sec-title { font-size: 22px; line-height: 28px; font-weight: 700; }
.sec-link { flex: none; display: inline-flex; align-items: center; gap: 1px; min-height: 28px; color: var(--tint); font-size: 15px; position: relative; }
.sec-link::after { content: ""; position: absolute; inset: -8px -6px; }
.sec-link .ico svg { width: 15px; height: 15px; }

/* 設定のような、行を並べたかたまり */
.grp { margin-top: 30px; }
.grp-head { margin: 0; padding: 0 16px 7px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text-2); }
.grp-body { background: var(--card); border-radius: 12px; overflow: hidden; }
.grp-foot { padding: 7px 16px 0; font-size: 13px; line-height: 18px; color: var(--text-2); }
.grp-foot .link { display: flex; margin-top: 2px; }
.cell {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 9px 16px;
  font-size: 17px; line-height: 22px; text-align: left;
}
.cell + .cell::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--sep); }
button.cell { transition: background-color 0.12s; }
button.cell:active { background: var(--fill-3); }
.cell-text { flex: 1; min-width: 0; }
.cell-text small { display: block; margin-top: 1px; font-size: 13px; line-height: 18px; font-weight: 400; color: var(--text-2); }
.cell.tint { color: var(--tint); }
.cell.danger { color: var(--red); }
.cell.dim { color: var(--text-2); }
.cell-ico svg { width: 22px; height: 22px; }
.cell-chev, .cell-more { color: var(--text-3); }
.cell-chev svg { width: 15px; height: 15px; stroke-width: 2.4; }
.cell-value { color: var(--text-2); font-variant-numeric: tabular-nums; }
.cell.stack { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 16px 14px; }
.pad { display: flex; flex-direction: column; gap: 14px; }
.pad .grp { margin-top: 2px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---- ボタン・入力 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 12px;
  background: var(--fill-2); font-size: 16px; line-height: 21px; font-weight: 600; white-space: nowrap; text-align: center;
  transition: transform 0.12s, opacity 0.12s, background-color 0.12s;
}
.btn:active { transform: scale(0.97); opacity: 0.8; }
.btn:disabled { opacity: 0.4; transform: none; }
.btn.large { min-height: 50px; padding: 0 20px; border-radius: 14px; font-size: 17px; line-height: 22px; }
.btn.small { position: relative; min-height: 34px; padding: 0 12px; border-radius: 17px; font-size: 14px; line-height: 19px; }
.btn.small::after { content: ""; position: absolute; inset: -5px 0; } /* 見た目は小さく、押せる範囲は 44 */
.btn.primary { background: var(--tint); color: var(--tint-ink); }
.btn.glass { background: rgba(255, 255, 255, 0.16); }
.btn.plain { background: none; color: var(--tint); }
.btn.wide { width: 100%; white-space: normal; }
.btn.grow { flex: 1; white-space: normal; }
.btn .ico svg { width: 18px; height: 18px; }
.btn .ico .f { fill: currentColor; }
.btn.small .ico svg { width: 16px; height: 16px; }
.icon-btn { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; transition: background-color 0.12s; }
.icon-btn:active { background: var(--fill-3); }
.icon-btn.on { color: var(--tint); }
.link { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; color: var(--tint); font-size: 15px; line-height: 20px; font-weight: 400; text-align: left; }
.link .ico svg { width: 16px; height: 16px; }

.input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: var(--fill-3); border: 1px solid transparent; border-radius: 10px; font-size: 17px; line-height: 22px;
  -webkit-appearance: none; appearance: none;
}
.input:focus { outline: none; border-color: var(--tint); }
.input::placeholder { color: var(--text-3); }
.input.small { min-height: 38px; padding: 6px 10px; font-size: 16px; }
.input.bad { border-color: var(--red); }
textarea.input { resize: vertical; line-height: 1.5; }
.select {
  min-height: 36px; padding: 0 30px 0 12px; border-radius: 9px; border: 0; color: var(--text);
  background: var(--fill-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a6a8b3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  -webkit-appearance: none; appearance: none; font-size: 16px; max-width: 55%; flex: none;
}

/* 検索の入力欄 */
.search-field {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 4px 0 9px;
  border-radius: 11px; background: var(--fill-2); transition: box-shadow 0.15s;
}
.search-field:focus-within { box-shadow: 0 0 0 2px rgba(245, 168, 60, 0.5); }
.search-field > .ico { color: var(--text-2); }
.search-field > .ico svg { width: 18px; height: 18px; }
.search-input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; outline: none;
  font-size: 17px; -webkit-appearance: none; appearance: none;
}
.search-input:focus-visible { outline: none; }
.search-input::placeholder { color: var(--text-2); }
.search-input::-webkit-search-cancel-button, .search-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.search-clear { width: 34px; height: 38px; flex: none; display: grid; place-items: center; }
.search-clear .ico { width: 18px; height: 18px; border-radius: 50%; background: var(--text-2); color: var(--bg-2); display: grid; place-items: center; }
.search-clear .ico svg { width: 10px; height: 10px; stroke-width: 3.4; }

/* 切り替えスイッチ */
.switch {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0;
  width: 51px; height: 31px; border-radius: 16px; background: rgba(120, 122, 136, 0.42); position: relative;
  transition: background-color 0.22s; cursor: pointer;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); transition: transform 0.26s var(--spring);
}
.switch:checked { background: var(--switch-on); }
.switch:checked::after { transform: translateX(20px); }
.switch-row { cursor: pointer; }

/* 横並びの切り替え。選んだ所へ板がすべる */
.seg {
  position: relative; display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr));
  min-height: 40px; padding: 2px; border-radius: 10px; background: var(--fill-2);
}
.seg-pill {
  position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--n, 2));
  transform: translateX(calc(var(--i, 0) * 100%));
  border-radius: 8px; background: var(--seg-on); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s var(--spring);
}
.seg button {
  position: relative; z-index: 1; min-height: 36px; padding: 3px 5px; border-radius: 8px;
  font-size: 13px; line-height: 16px; font-weight: 500; color: var(--text-2); text-align: center;
  transition: color 0.15s;
}
.seg button.on { color: var(--text); font-weight: 600; }

.stepper-wrap { flex: none; display: inline-flex; align-items: center; gap: 10px; }
.stepper-val { min-width: 3em; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; background: var(--fill-2); border-radius: 9px; }
.stepper button { position: relative; width: 46px; height: 34px; font-size: 20px; line-height: 34px; text-align: center; }
.stepper button::after { content: ""; position: absolute; inset: -5px 0; }
.stepper button + button { box-shadow: -0.5px 0 0 var(--sep); }
.stepper button:active { background: var(--fill-3); }
.stepper button:disabled { color: var(--text-3); }
.bar { height: 6px; background: var(--fill-2); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--tint); border-radius: 3px; transition: width 0.2s; }

/* ---- タグ ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 13px;
  border-radius: 17px; background: var(--fill-3); font-size: 15px; line-height: 20px; white-space: nowrap;
  transition: transform 0.12s, background-color 0.15s, color 0.15s;
}
button.chip::after, label.chip::after { content: ""; position: absolute; inset: -5px 0; }
button.chip:active { transform: scale(0.95); }
.chip small { color: var(--text-2); font-size: 12px; }
.chip .ico svg { width: 16px; height: 16px; }
.chip.on { background: var(--tint-soft); color: var(--tint-text); box-shadow: inset 0 0 0 1px rgba(245, 168, 60, 0.45); }
.chip.on small { color: inherit; opacity: 0.75; }
.chip.ex { background: var(--red-soft); color: var(--red-text); box-shadow: inset 0 0 0 1px rgba(255, 97, 89, 0.42); }
.chip.ex .chip-text { text-decoration: line-through; }
.chip .chip-x { margin-right: -4px; opacity: 0.8; }
.chip .chip-x svg { width: 13px; height: 13px; stroke-width: 2.6; }
.chip.soft { min-height: 26px; padding: 0 9px; font-size: 13px; line-height: 18px; background: rgba(255, 255, 255, 0.13); }
.chips.ctx, .chips.tool-row {
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--pad-r)) 0 calc(-1 * var(--pad-l)); padding: 5px var(--pad-r) 5px var(--pad-l);
}
.chips.ctx::-webkit-scrollbar, .chips.tool-row::-webkit-scrollbar { display: none; }
.chip.ctx-chip { min-height: 30px; padding: 0 12px; font-size: 14px; line-height: 19px; font-weight: 600; background: var(--tint-soft); color: var(--tint-text); }
.chips.ctx { margin-top: -6px; }
.chip.tool-chip { background: var(--fill-2); font-weight: 500; }
.chip.tool-chip.on { background: var(--tint-soft); }
.chip-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tint); color: var(--tint-ink) !important;
  font-size: 12px !important; line-height: 18px; font-weight: 700; text-align: center; opacity: 1 !important;
}
.select-chip select { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; opacity: 0; font-size: 16px; -webkit-appearance: none; appearance: none; }
.select-chip:focus-within { outline: 2px solid var(--tint); outline-offset: 2px; }
.active-chips { margin-top: 5px; }

/* ---- 小さい画像 ---- */
.thumb { position: relative; flex: none; overflow: hidden; background: #2a2b34; border-radius: 6px; }
.thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.16); pointer-events: none; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 0.22s; }
.thumb.loaded img { opacity: 1; }
.thumb.now img { transition: none; }
.thumb-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-weight: 700; font-size: 20px; }
.thumb.loaded .thumb-ph { display: none; }
.thumb-prog { position: absolute; z-index: 1; left: 4px; right: 4px; bottom: 4px; height: 3px; border-radius: 2px; background: rgba(0, 0, 0, 0.6); overflow: hidden; }
.thumb-prog i { display: block; height: 100%; border-radius: 2px; background: var(--tint); }
.cover { width: 56px; aspect-ratio: 5 / 7; }
.cover.big { width: 112px; border-radius: 9px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5); }
.thumb.page { width: 100%; aspect-ratio: 5 / 7; }

/* 表紙をぼかして敷く背景 */
.ambient {
  position: absolute; inset: -30%; z-index: -1; background: center / cover no-repeat;
  -webkit-filter: blur(42px) saturate(1.9) brightness(0.44); filter: blur(42px) saturate(1.9) brightness(0.44);
  opacity: 0; transition: opacity 0.4s; transform: translateZ(0); pointer-events: none;
}
.ambient.on { opacity: 1; }

/* ---- 一覧 ---- */
.list { display: flex; flex-direction: column; }
.unit-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: calc(100% + 16px);
  margin: 0 -8px; padding: 9px 8px; border-radius: 12px; text-align: left; transition: background-color 0.12s;
}
.unit-row:active { background: var(--fill-3); }
.unit-row + .unit-row::before { content: ""; position: absolute; top: 0; left: 76px; right: 8px; border-top: 0.5px solid var(--sep); }
.unit-main { flex: 1; min-width: 0; }
.unit-title { font-size: 17px; line-height: 22px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.unit-sub { font-size: 15px; line-height: 20px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-meta { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 4px; font-size: 13px; line-height: 18px; color: var(--text-2); }
.meta-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge { flex: none; padding: 0 7px; border-radius: 6px; background: var(--fill-2); font-size: 12px; line-height: 18px; font-weight: 600; white-space: nowrap; }
.badge.new { background: var(--tint-soft); color: var(--tint-text); }
.badge.off { background: var(--fill-3); color: var(--text-2); }
.unit-row.off .thumb.loaded img, .unit-card.off .thumb.loaded img { opacity: 0.42; }
.fav { flex: none; color: var(--pink); }
.fav svg { width: 18px; height: 18px; }
.fav .f, .card-fav .f { fill: currentColor; }
.empty { padding: 48px 12px; text-align: center; color: var(--text-2); font-size: 15px; line-height: 21px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.list-tail { height: 1px; margin-top: 8px; }

/* 横に送る棚 */
.hscroll {
  display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--pad-r)) 0 calc(-1 * var(--pad-l)); padding: 0 var(--pad-r) 4px var(--pad-l);
  scroll-snap-type: x proximity; scroll-padding: 0 var(--pad-r) 0 var(--pad-l);
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; }
.unit-card { width: 112px; flex: none; display: flex; flex-direction: column; align-items: stretch; text-align: left; transition: transform 0.15s; }
.unit-card:active { transform: scale(0.96); }
.card-cover { position: relative; }
.unit-card .cover { width: 100%; border-radius: 8px; }
.card-title { margin-top: 7px; font-size: 13px; line-height: 17px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-sub { margin-top: 1px; font-size: 12px; line-height: 16px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-badge { position: absolute; z-index: 1; top: 5px; left: 5px; padding: 0 6px; border-radius: 6px; background: var(--tint); color: var(--tint-ink); font-size: 11px; line-height: 17px; font-weight: 700; }
.card-fav { position: absolute; z-index: 1; top: 5px; right: 5px; color: var(--pink); -webkit-filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)); }
.card-fav svg { width: 17px; height: 17px; }
.card-off { position: absolute; z-index: 1; right: 5px; bottom: 5px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; display: grid; place-items: center; }
.card-off svg { width: 15px; height: 15px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 18px 12px; margin-top: 8px; }
.unit-card.tile { width: auto; }

/* さがすの道具 */
.tool-row { margin-top: 7px; }
.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 13px 0 6px; }
.result-count { min-width: 0; font-size: 13px; line-height: 18px; color: var(--text-2); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-actions { flex: none; display: flex; align-items: center; gap: 8px; }
.view-toggle { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill-3); }
.view-toggle button { position: relative; width: 36px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: var(--text-2); }
.view-toggle button::after { content: ""; position: absolute; inset: -7px 0; }
.view-toggle button.on { background: var(--seg-on); color: var(--text); }
.view-toggle svg { width: 18px; height: 18px; }

/* ---- きょう ---- */
.pick { position: relative; isolation: isolate; overflow: hidden; border-radius: 22px; background: var(--bg-1); padding: 14px 16px 16px; }
.pick::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(14, 15, 19, 0.2), rgba(14, 15, 19, 0.58)); pointer-events: none; }
.pick-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; margin-bottom: 10px; }
.pick-label { min-width: 0; font-size: 13px; line-height: 18px; font-weight: 700; letter-spacing: 0.02em; color: var(--tint-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-reroll {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 12px;
  border-radius: 16px; background: rgba(255, 255, 255, 0.15); font-size: 13px; line-height: 18px; font-weight: 600; transition: transform 0.12s;
}
.pick-reroll::after { content: ""; position: absolute; inset: -6px -2px; }
.pick-reroll:active { transform: scale(0.95); }
.pick-reroll .ico svg { width: 15px; height: 15px; stroke-width: 2.2; }
.pick-body { display: flex; align-items: flex-start; gap: 14px; }
.pick-cover { flex: none; transition: transform 0.15s; }
.pick-cover:active { transform: scale(0.97); }
.pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 2px; }
.pick-title { font-size: 22px; line-height: 28px; font-weight: 700; text-align: left; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pick-sub { font-size: 15px; line-height: 20px; color: rgba(255, 255, 255, 0.74); }
.pick-meta { font-size: 13px; line-height: 18px; color: rgba(255, 255, 255, 0.6); font-variant-numeric: tabular-nums; }
.pick .chips { gap: 6px; margin-top: 6px; }
.pick-btns { display: flex; gap: 10px; margin-top: 16px; }
.pick-off { display: flex; align-items: center; gap: 8px; min-height: 44px; color: rgba(255, 255, 255, 0.7); font-size: 14px; line-height: 20px; }

.moods { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.mood {
  min-height: 70px; padding: 11px 13px; border-radius: 16px; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  background: linear-gradient(140deg, hsl(var(--hue, 36) 62% 36% / 0.62), hsl(var(--hue, 36) 58% 22% / 0.42)), var(--bg-1);
  transition: transform 0.15s;
}
.mood:active { transform: scale(0.95); }
.mood-name { font-size: 16px; line-height: 21px; font-weight: 700; overflow-wrap: anywhere; }
.mood-count { font-size: 12px; line-height: 16px; color: rgba(255, 255, 255, 0.68); font-variant-numeric: tabular-nums; }
.mood.mine { box-shadow: inset 0 0 0 1.5px hsl(var(--hue, 36) 72% 68% / 0.75); }
.mood.add {
  flex-direction: row; align-items: center; justify-content: center; gap: 5px; padding: 8px 6px;
  background: none; border: 1px dashed rgba(255, 255, 255, 0.24); color: var(--text-2); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.mood.add .ico svg { width: 16px; height: 16px; }

.welcome { margin-top: 44px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.welcome-mark { width: 88px; height: 88px; border-radius: 20px; margin-bottom: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.welcome h2 { font-size: 22px; line-height: 28px; font-weight: 700; }
.welcome p { max-width: 30em; color: var(--text-2); font-size: 15px; line-height: 22px; }
.welcome-btns { width: 100%; max-width: 340px; margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.hint { display: flex; gap: 11px; margin-top: 14px; padding: 13px 14px; border-radius: 14px; background: var(--tint-soft); color: var(--tint-text); }
.hint .ico { margin-top: 1px; }
.hint b { display: block; font-size: 15px; line-height: 20px; color: #ffe2b6; }
.hint p { margin-top: 3px; font-size: 13px; line-height: 19px; }

/* ---- ながす ---- */
.play-source { margin-top: 4px; }
.play-source .grp-foot { padding-left: 4px; padding-right: 4px; }
.play-card { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; padding: 14px; border-radius: 16px; background: var(--card); }
.play-desc { font-size: 14px; line-height: 20px; color: var(--text-2); }
.play-count { margin-top: -4px; font-size: 13px; line-height: 18px; color: var(--text-2); text-align: center; font-variant-numeric: tabular-nums; }
.act-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.act-tile { min-height: 100px; padding: 14px; border-radius: 16px; background: var(--card); display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; transition: transform 0.15s, background-color 0.12s; }
.act-tile:active { transform: scale(0.96); }
.act-tile .ico { margin-bottom: 9px; color: var(--tint); }
.act-tile .ico svg { width: 24px; height: 24px; }
.act-tile b { font-size: 16px; line-height: 21px; font-weight: 600; }
.act-tile small { font-size: 13px; line-height: 18px; color: var(--text-2); }

/* ---- 下から出るシート ---- */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap.top { z-index: 200; }
.sheet-wrap.closing, .dialog-wrap.closing { pointer-events: none; }
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.52); opacity: 0; transition: opacity 0.32s; }
.sheet {
  --card: var(--bg-3);
  position: relative; width: 100%; max-width: 640px; max-height: calc(100% - var(--sat) - 40px);
  display: flex; flex-direction: column; background: var(--bg-2); border-radius: 18px 18px 0 0; padding-bottom: var(--sab);
  transform: translate3d(0, 100%, 0); transition: transform 0.46s var(--spring); will-change: transform; outline: none;
  box-shadow: 0 -10px 44px rgba(0, 0, 0, 0.4);
}
/* 引き上げたときに、下にすき間が見えないようにする */
.sheet::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 40vh; background: var(--bg-2); }
.sheet-wrap.full .sheet { height: calc(100% - max(var(--sat), 14px) - 10px); max-height: none; }
.sheet-wrap.open .backdrop, .dialog-wrap.open .backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-head {
  position: relative; flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  min-height: 58px; padding: 12px 6px 2px; touch-action: none;
}
.grabber { position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--text-3); }
.sheet-side { display: flex; min-width: 0; }
.sheet-side.trail { justify-content: flex-end; }
.sheet-title { max-width: calc(100vw - 150px); font-size: 17px; line-height: 22px; font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-btn { min-height: 44px; padding: 0 10px; color: var(--tint); font-size: 17px; white-space: nowrap; }
.sheet-btn.strong { font-weight: 700; }
.sheet-btn:active { opacity: 0.5; }
.sheet-x .ico { width: 30px; height: 30px; border-radius: 50%; background: var(--fill-2); color: var(--text-2); display: grid; place-items: center; }
.sheet-x .ico svg { width: 14px; height: 14px; stroke-width: 2.8; }
.sheet-x:active { background: none; opacity: 0.6; }
.sheet-body {
  --pad-l: calc(16px + var(--sal)); --pad-r: calc(16px + var(--sar));
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 6px var(--pad-r) 26px var(--pad-l);
}
.sheet-head::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-bottom: 0.5px solid var(--sep); opacity: 0; transition: opacity 0.2s; }
.sheet.scrolled .sheet-head::before { opacity: 1; }
.detail-sheet .sheet-head::before { display: none; }
.sheet-foot { flex: none; display: flex; gap: 10px; padding: 10px calc(16px + var(--sar)) 10px calc(16px + var(--sal)); border-top: 0.5px solid var(--sep); }

/* まん中に出る確認・入力 */
.dialog-wrap { position: fixed; left: 0; right: 0; top: 0; height: 100%; z-index: 120; display: grid; place-items: center; padding: 24px; }
.dialog-wrap.top { z-index: 220; }
.alert {
  position: relative; width: min(100%, 300px); max-height: 100%; overflow: hidden; display: flex; flex-direction: column;
  border-radius: 16px; background: rgba(42, 43, 53, 0.94); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  transform: scale(1.12); opacity: 0; transition: transform 0.24s var(--ease), opacity 0.18s; outline: none;
}
.dialog-wrap.open .alert { transform: none; opacity: 1; }
.dialog-wrap.closing .alert { transform: none; }
.alert-body { display: flex; flex-direction: column; gap: 6px; padding: 20px 16px 18px; text-align: center; overflow-y: auto; }
.alert-title { font-size: 17px; line-height: 22px; font-weight: 600; }
.alert-msg { font-size: 13px; line-height: 19px; color: rgba(243, 244, 246, 0.86); overflow-wrap: anywhere; }
.alert-body .input { margin-top: 10px; text-align: left; background: rgba(0, 0, 0, 0.28); }
.alert-btns { flex: none; display: flex; border-top: 0.5px solid var(--sep); }
.alert-btn { flex: 1; min-height: 46px; padding: 6px 8px; color: var(--tint); font-size: 17px; line-height: 22px; text-align: center; }
.alert-btn + .alert-btn { box-shadow: -0.5px 0 0 var(--sep); }
.alert-btn.strong { font-weight: 700; }
.alert-btn.danger { color: var(--red); }
.alert-btn:active { background: var(--fill-3); }

/* 下から出る選択肢 */
.dialog-wrap.as-wrap { place-items: end center; padding: 8px calc(8px + var(--sar)) calc(8px + var(--sab)) calc(8px + var(--sal)); }
.as {
  position: relative; width: min(100%, 460px); max-height: 100%; display: flex; flex-direction: column; gap: 8px;
  transform: translate3d(0, calc(100% + 60px), 0); transition: transform 0.42s var(--spring); outline: none;
}
.dialog-wrap.open .as { transform: none; }
.as-group { min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-radius: 16px; background: rgba(42, 43, 53, 0.95); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.as-title { padding: 13px 16px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text-2); text-align: center; overflow-wrap: anywhere; }
.as-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 16px; font-size: 17px; line-height: 22px; text-align: left; }
.as-item + .as-item::before, .as-title + .as-item::before { content: ""; position: absolute; top: 0; left: 0; right: 0; border-top: 0.5px solid var(--sep); }
.as-item:active { background: var(--fill-3); }
.as-text { flex: 1; min-width: 0; }
.as-text small { display: block; margin-top: 1px; font-size: 13px; line-height: 18px; color: var(--text-2); }
.as-item .ico { color: var(--text-2); }
.as-item.danger { color: var(--red); }
.as-item.danger .ico { color: inherit; }
.as-item .as-check { color: var(--tint); }
.as-item .as-check svg { stroke-width: 2.4; }
.as-cancel { flex: none; min-height: 56px; border-radius: 16px; background: rgba(50, 51, 62, 0.98); color: var(--tint); font-size: 17px; font-weight: 700; text-align: center; }
.as-cancel:active { background: rgba(70, 71, 84, 0.98); }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--sab) + 14px); z-index: 300; width: max-content; max-width: min(88vw, 420px);
  padding: 11px 18px; border-radius: 22px; background: rgba(54, 56, 68, 0.94); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  color: #fff; font-size: 15px; line-height: 20px; text-align: center; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, 10px) scale(0.96); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.26s var(--ease);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
body.reading #toast { bottom: calc(var(--sab) + 196px); }
body.reading.no-jumps:not(.bare) #toast { bottom: calc(var(--sab) + 155px); } /* 飛ぶボタンの列がないぶん、帯が低い */
body.reading.bare #toast { bottom: calc(var(--sab) + 46px); }

/* ---- 作品の情報 ---- */
/* 表紙を上まで広げるので、見出しの帯は中身の上に重ねる。下へ送ると、帯に地と題名が出る */
.detail-sheet .sheet-head { position: absolute; top: 0; left: 0; right: 0; z-index: 3; border-radius: 18px 18px 0 0; transition: background-color 0.2s; }
.detail-sheet .sheet-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-bottom: 0.5px solid var(--sep); opacity: 0; transition: opacity 0.2s; }
.detail-sheet .sheet-body { padding-top: 0; }
.detail-sheet .sheet-x .ico { background: rgba(0, 0, 0, 0.36); color: #fff; }
.detail-sheet .grabber { background: rgba(255, 255, 255, 0.5); }
.detail-sheet .sheet-title { opacity: 0; transition: opacity 0.2s; }
.detail-sheet.scrolled .sheet-head { background: rgba(28, 29, 36, 0.88); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.detail-sheet.scrolled .sheet-head::after, .detail-sheet.scrolled .sheet-title { opacity: 1; }
.detail { display: flex; flex-direction: column; }
.hero {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  margin: 0 calc(-1 * var(--pad-r)) 0 calc(-1 * var(--pad-l)); padding: 64px 22px 14px; border-radius: 18px 18px 0 0;
}
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(28, 29, 36, 0.1) 0%, rgba(28, 29, 36, 0.5) 55%, var(--bg-2) 100%); pointer-events: none; }
.hero-cover { width: 148px; margin-bottom: 14px; border-radius: 10px; box-shadow: 0 14px 38px rgba(0, 0, 0, 0.55); }
.hero-title { font-size: 22px; line-height: 28px; font-weight: 700; overflow-wrap: anywhere; }
.hero-sub { font-size: 15px; line-height: 20px; color: rgba(255, 255, 255, 0.72); }
.hero-tools { display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.stars { display: flex; }
.star { width: 34px; height: 44px; display: grid; place-items: center; color: rgba(255, 255, 255, 0.34); transition: transform 0.12s; }
.star:active { transform: scale(0.85); }
.star svg { width: 24px; height: 24px; }
.star.on { color: var(--tint); }
.star.on .f { fill: currentColor; }
.fav-btn { color: rgba(255, 255, 255, 0.5); }
.fav-btn.on { color: var(--pink); }
.fav-btn.on .f { fill: currentColor; }
.detail-cta { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.jump-row { gap: 8px; padding-top: 5px; padding-bottom: 5px; margin-top: -5px; margin-bottom: -5px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; padding: 11px 0; border-top: 0.5px solid var(--sep); border-bottom: 0.5px solid var(--sep); }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 6px; text-align: center; }
.stat + .stat { box-shadow: -0.5px 0 0 var(--sep); }
.stat small { font-size: 11px; line-height: 13px; color: var(--text-2); letter-spacing: 0.02em; }
.stat b { font-size: 17px; line-height: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.block { margin-top: 28px; }
.block-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 20px; line-height: 25px; font-weight: 700; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-name { margin-bottom: 6px; font-size: 13px; line-height: 18px; color: var(--text-2); }
.hl-lines { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 15px; line-height: 20px; font-variant-numeric: tabular-nums; }
.hl-lines > div { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.hl-lines b { color: var(--text-2); font-weight: 600; }
.strip { gap: 10px; padding-top: 3px; padding-bottom: 6px; }
.strip-item { flex: none; width: 64px; text-align: center; font-size: 12px; line-height: 16px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.strip-item .thumb { box-shadow: 0 0 0 2px var(--blue); }
.strip-item.climax .thumb { box-shadow: 0 0 0 2px var(--tint); }
.strip-item.peak .thumb { box-shadow: 0 0 0 2px var(--red); }
.strip-item.mark .thumb { box-shadow: 0 0 0 2px var(--green); }
.strip-item span { display: block; margin-top: 5px; }
.chars { padding: 2px 14px; border-radius: 12px; background: var(--card); }
.char { padding: 10px 0; font-size: 15px; line-height: 21px; }
.char + .char { border-top: 0.5px solid var(--sep); }
.note-text { font-size: 15px; line-height: 1.6; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.notice { display: flex; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--fill-3); color: var(--text-2); font-size: 14px; line-height: 20px; }

/* ---- 編集・絞り込み ---- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form .grp { margin-top: 14px; }
.form .grp:first-child { margin-top: 4px; }
.form-card { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px 14px; border-radius: 12px; background: var(--card); }
.form-card .input, .edit-field .input, .event-row .input { background: rgba(0, 0, 0, 0.24); }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row > span { font-size: 13px; line-height: 18px; color: var(--text-2); }
.form-title { margin: 14px 0 0; font-size: 20px; line-height: 25px; font-weight: 700; }
.form-foot { padding: 0 4px; font-size: 13px; line-height: 19px; color: var(--text-2); }
.edit-fields { display: flex; flex-direction: column; gap: 10px; }
.edit-field { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--card); }
.edit-field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.add-row { display: flex; gap: 8px; align-items: center; }
.add-row .input { flex: 1; }
.filter { display: flex; flex-direction: column; gap: 14px; padding-top: 2px; }
.fgroups { display: flex; flex-direction: column; border-radius: 12px; background: var(--card); overflow: hidden; }
.fgroups:empty { display: none; }
.fgroup { position: relative; padding: 0 14px; }
.fgroup + .fgroup::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 0.5px solid var(--sep); }
.fgroup summary { display: flex; align-items: center; gap: 10px; min-height: 48px; font-size: 17px; line-height: 22px; list-style: none; cursor: pointer; }
.fgroup summary::-webkit-details-marker { display: none; }
.fgroup summary span { flex: 1; min-width: 0; }
.fgroup summary small { color: var(--text-2); font-size: 13px; }
.fgroup summary small.picked { color: var(--tint-text); font-weight: 600; }
.fgroup summary::after {
  content: ""; flex: none; width: 7px; height: 7px; margin: -3px 3px 0 0;
  border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); transition: transform 0.2s;
}
.fgroup[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.fgroup .chips { margin: 0 0 14px; }
.event-row { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--card); }
.event-line { display: flex; align-items: center; gap: 6px; }
.event-line .input { flex: 1; min-width: 0; }
.event-line .input.md { flex: 0 0 84px; padding: 6px 4px; text-align: center; }
.event-label { flex: 0 0 auto; margin-right: 4px; color: var(--text-2); font-size: 13px; }
.import-label { font-size: 15px; line-height: 21px; color: var(--text-2); }
.import-log { display: flex; flex-direction: column; gap: 7px; font-size: 15px; line-height: 21px; }
.log-line { display: flex; gap: 8px; align-items: flex-start; }
.log-line .ico { margin-top: 1px; }
.log-line .ico svg { width: 18px; height: 18px; stroke-width: 2.4; }
.log-line.ok .ico { color: var(--green); }
.log-line.ng { color: var(--red-text); }

/* ---- 読む画面 ---- */
#reader {
  position: fixed; inset: 0; z-index: 150; overflow: hidden; color: #fff;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
#reader.enter { animation: reader-in 0.24s var(--ease) both; }
@keyframes reader-in { from { opacity: 0; transform: scale(1.035); } to { opacity: 1; transform: none; } }
.r-bg { position: absolute; inset: 0; background: #000; }
#reader[data-bg="gray"] .r-bg { background: #2b2c31; }
#reader[data-bg="white"] .r-bg { background: #f2efe8; }
/* 白い地のときも、上の時計や電池の表示(いつも白い字)が読めるようにする */
#reader[data-bg="white"] .r-bg::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--sat) * 1.3); background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0)); }
.stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.panel { position: absolute; inset: 0; will-change: transform; }
.pages { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; transform-origin: 50% 50%; will-change: transform; }
.pages img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.pages.two img { max-width: 50%; }
#reader.rtl .pages.two { flex-direction: row-reverse; }
.missing { padding: 20px; color: #9a9ca8; font-size: 15px; text-align: center; }
.dimmer { position: absolute; inset: 0; z-index: 1; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.2s; }

/* タップの場所の案内 */
.zones { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.zones.show { opacity: 1; }
.zone { position: absolute; display: grid; place-items: center; padding: 6px; text-align: center; }
.zone.next { background: rgba(245, 168, 60, 0.4); }
.zone.prev { background: rgba(79, 163, 240, 0.4); }
.zone.menu { background: rgba(255, 255, 255, 0.24); }
.zone span, .zone-center span { max-width: 100%; padding: 5px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.66); color: #fff; font-size: 13px; line-height: 18px; font-weight: 700; text-align: center; }
.zone-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; }
.zone-center span { display: block; }
.zone-center small { display: block; font-size: 11px; line-height: 14px; font-weight: 600; opacity: 0.78; }

/* 進み具合の線 */
.sprog { position: absolute; z-index: 3; top: calc(var(--sat) + 7px); left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); display: flex; gap: 3px; height: 3px; pointer-events: none; transition: opacity 0.2s; }
.sprog i { flex: 1; min-width: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.32); overflow: hidden; box-shadow: 0 0 2px rgba(0, 0, 0, 0.4); }
.sprog b { display: block; width: 0; height: 100%; border-radius: 2px; background: #fff; }
#reader:not(.bare) .sprog, #reader.pulling .sprog, #reader.pulling .hud, #reader.pulling .zones { opacity: 0; }

.chrome {
  position: absolute; left: 0; right: 0; z-index: 4; display: flex;
  background: rgba(17, 18, 23, 0.86); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  transition: transform 0.3s var(--ease), opacity 0.22s;
}
.chrome.top { top: 0; align-items: center; gap: 2px; padding: calc(var(--sat) + 2px) calc(4px + var(--sar)) 4px calc(4px + var(--sal)); border-bottom: 0.5px solid var(--sep); }
.chrome.bottom { bottom: 0; flex-direction: column; gap: 7px; padding: 10px calc(12px + var(--sar)) calc(var(--sab) + 4px) calc(12px + var(--sal)); border-top: 0.5px solid var(--sep); }
#reader.bare .chrome.top { transform: translateY(-100%); opacity: 0; pointer-events: none; }
#reader.bare .chrome.bottom { transform: translateY(100%); opacity: 0; pointer-events: none; }
.r-title { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 4px; }
.r-title b, .r-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-title b { font-size: 15px; line-height: 20px; font-weight: 600; }
.r-title small { font-size: 12px; line-height: 16px; color: rgba(255, 255, 255, 0.62); }
.jumps { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-12px - var(--sar)) 0 calc(-12px - var(--sal)); padding: 0 calc(12px + var(--sar)) 0 calc(12px + var(--sal)); }
.jumps::-webkit-scrollbar { display: none; }
.jump { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 17px; background: rgba(255, 255, 255, 0.15); font-size: 13px; line-height: 18px; font-weight: 600; white-space: nowrap; }
.jump::after { content: ""; position: absolute; inset: -5px 0; }
.jump:active { background: rgba(255, 255, 255, 0.26); }
.jump .ico svg { width: 15px; height: 15px; }
.scrub-row { display: flex; align-items: center; gap: 10px; }
.plabel { flex: none; min-width: 64px; min-height: 40px; padding: 0 2px; color: #e8eaf0; font-size: 13px; line-height: 18px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scrub { flex: 1; height: 40px; display: flex; align-items: center; touch-action: none; cursor: pointer; outline-offset: -4px; }
.track { position: relative; width: 100%; height: 5px; background: rgba(255, 255, 255, 0.24); border-radius: 3px; }
.bands i { position: absolute; top: 0; height: 100%; border-radius: 3px; }
.bands .scene { background: var(--blue); }
.bands .climax { background: var(--tint); }
.bands .peak { background: var(--red); top: -4px; height: 13px; width: 3px !important; border-radius: 2px; margin-left: -1px; }
.bands .tick { background: rgba(255, 255, 255, 0.55); top: -2px; height: 9px; width: 2px !important; margin-left: -1px; }
.bands .mark { background: var(--green); top: -9px; height: 7px; width: 4px !important; border-radius: 1px; margin-left: -2px; }
.knob { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); transition: transform 0.15s; }
.scrub.active .knob { transform: scale(1.25); }
.controls { display: flex; justify-content: space-between; gap: 2px; }
.ctl {
  flex: 1; min-width: 0; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 10px; color: #d8dbe4; font-size: 11px; line-height: 13px; font-weight: 500; text-align: center; transition: background-color 0.12s;
}
.ctl span:last-child { white-space: nowrap; }
.ctl .ico svg { width: 23px; height: 23px; }
.ctl:active { background: rgba(255, 255, 255, 0.12); }
.ctl.on { color: var(--tint); }
.ctl.on .f { fill: currentColor; }
.ctl:disabled { opacity: 0.3; background: none; }
.hud {
  position: absolute; left: 50%; bottom: calc(var(--sab) + 8px); z-index: 3; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 11px; background: rgba(0, 0, 0, 0.46);
  color: rgba(255, 255, 255, 0.74); font-size: 11px; line-height: 16px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
.hud .ico svg { width: 10px; height: 10px; stroke-width: 3; }
.hud .f { fill: currentColor; }
#reader.bare .hud { opacity: 1; }
#reader.no-hud .hud { display: none; }
.bubble {
  position: fixed; z-index: 6; transform: translateX(-50%); pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 6px 5px;
  border-radius: 13px; background: rgba(42, 43, 53, 0.96); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.6);
}
.bubble-thumb { width: 100px; aspect-ratio: 5 / 7; border-radius: 8px; background: #2a2b34 center / cover no-repeat; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px 10px; }
.grid-item { text-align: center; font-size: 12px; line-height: 16px; color: var(--text-2); font-variant-numeric: tabular-nums; transition: transform 0.12s; }
.grid-item:active { transform: scale(0.95); }
.grid-item .thumb { box-shadow: 0 0 0 2px transparent; }
.grid-item.scene .thumb { box-shadow: 0 0 0 2px var(--blue); }
.grid-item.climax .thumb { box-shadow: 0 0 0 2px var(--tint); }
.grid-item.peak .thumb { box-shadow: 0 0 0 2px var(--red); }
.grid-item span { display: block; margin-top: 5px; }
.grid-item.cur span { color: var(--tint); font-weight: 700; }
.grid-item.marked .thumb::before {
  content: ""; position: absolute; z-index: 1; top: 0; right: 9px; width: 13px; height: 20px; background: var(--green);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); -webkit-filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* 読む画面の設定: タップの場所の型 */
.zone-picker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 3px 0 2px; }
.zone-tile { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-2); font-size: 12px; line-height: 16px; text-align: center; white-space: nowrap; }
/* 色を塗っていない所は「帯を出す・しまう」なので、地をその色にしておく */
.zone-map { position: relative; width: 100%; max-width: 56px; aspect-ratio: 52 / 86; border-radius: 9px; background: #5a5c68; overflow: hidden; transition: box-shadow 0.15s; }
.zone-map i { position: absolute; }
.zone-map .next, .zone-legend .next { background: var(--tint); }
.zone-map .prev, .zone-legend .prev { background: var(--blue); }
.zone-map .menu, .zone-legend .menu { background: #5a5c68; }
.zone-tile.on { color: var(--text); font-weight: 600; }
.zone-tile.on .zone-map { box-shadow: 0 0 0 2.5px var(--tint); }
.zone-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; line-height: 16px; color: var(--text-2); }
.zone-legend span { display: inline-flex; align-items: center; gap: 5px; }
.zone-legend i { width: 10px; height: 10px; border-radius: 3px; }

/* 横向きなど、縦が短いときは下の帯を低くする */
@media (max-height: 480px) {
  .chrome.bottom { gap: 3px; padding-top: 6px; }
  .jump { min-height: 30px; }
  .scrub, .plabel { height: 32px; min-height: 32px; }
  .ctl { flex-direction: row; gap: 6px; min-height: 38px; font-size: 12px; }
  body.reading #toast { bottom: calc(var(--sab) + 150px); }
  body.reading.no-jumps:not(.bare) #toast { bottom: calc(var(--sab) + 117px); }
  .sheet { max-height: calc(100% - 8px); }
  .sheet-wrap.full .sheet { height: calc(100% - 8px); }
  .hero { padding-top: 54px; }
  .hero-cover { width: 104px; }
}
@media (min-width: 700px) {
  #tabs { border: 0.5px solid var(--sep); border-bottom: 0; border-radius: 18px 18px 0 0; }
  #nav::after { border-radius: 0 0 14px 14px; }
}
/* すりガラスを描けない環境では、地を濃くして読めるようにする */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  #nav::before, #nav::after, #tabs, .chrome { background: rgba(14, 15, 19, 0.96); }
}
/* 「透明度を下げる」のとき: 帯を透かさず、濃い地にする */
@media (prefers-reduced-transparency: reduce) {
  #nav::before, #nav::after, #tabs, .chrome { background: #111217; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .detail-sheet.scrolled .sheet-head { background: var(--bg-2); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* 「視差効果を減らす」のとき: すべる・はずむ動きをやめて、ふわっと出すだけにする */
@media (prefers-reduced-motion: reduce) {
  .sheet { transform: none; opacity: 0; transition: opacity 0.2s; }
  .sheet-wrap.open .sheet { opacity: 1; }
  .as { transform: none; opacity: 0; transition: opacity 0.2s; }
  .dialog-wrap.open .as { opacity: 1; }
  .alert { transform: none; }
  #reader.enter, #app.back { animation: none; }
  .seg-pill, .switch::after, .knob, .btn, .chip, .mood, .unit-card, .act-tile, .star, .grid-item, #tabs button .ico svg, .chrome { transition-duration: 0.01ms; }
  .btn:active, button.chip:active, .mood:active, .unit-card:active, .act-tile:active, .star:active, .grid-item:active { transform: none; }
}
