:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --text: #24212a;
  --muted: #6b6573;
  --line: #e2ddd5;
  --accent: #1f8a7a;
  --accent-ink: #ffffff;
  --warn-bg: #fff4cc;
  --warn-line: #e6c34d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18171c;
    --surface: #232229;
    --text: #ece9f1;
    --muted: #a49eae;
    --line: #37343f;
    --accent: #48c2ad;
    --accent-ink: #0f1a18;
    --warn-bg: #3a3218;
    --warn-line: #8c7425;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Zen Kaku Gothic New", system-ui, sans-serif; line-height: 1.75;
}
a { color: var(--accent); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

.site-head { background: var(--accent); color: var(--accent-ink); padding: 18px 0 14px; margin-bottom: 20px; }
.site-head h1 { margin: 0; font-family: "M PLUS Rounded 1c", sans-serif; font-weight: 800; font-size: 1.6rem; letter-spacing: .04em; }
.site-head h1 a { color: inherit; text-decoration: none; }
.site-head p { margin: 2px 0 0; font-size: .9rem; opacity: .9; }

.draft-banner { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: .9rem; }
.ep-meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: .85rem; margin-bottom: 8px; }
.tag { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 10px; font-weight: 700; }

/* ---------- 漫画本体（常に紙の白） ---------- */
.comic {
  width: 100%; max-width: 460px; margin: 0 auto; background: #fff; color: #222;
  padding: 14px 14px 10px; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.12);
  font-family: "M PLUS Rounded 1c", sans-serif;
}
.comic-head { display: flex; justify-content: space-between; font-size: 12px; color: #1f8a7a; font-weight: 800; }
.comic-title { font-size: 18px; line-height: 1.4; margin: 2px 0 10px; font-weight: 800; color: #222; }
.comic-foot { font-size: 10.5px; color: #666; line-height: 1.5; margin-top: 2px; }

.panel {
  position: relative; aspect-ratio: 4 / 3; border: 3px solid #222; margin-bottom: 10px;
  overflow: hidden; container-type: inline-size; background: #fff;
}
.bg-plain { background: radial-gradient(#e4e4e4 1.2px, transparent 1.4px) 0 0 / 8px 8px, #fff; }
.bg-pharmacy { background: linear-gradient(to bottom, transparent 64%, #cfe7df 64%), repeating-linear-gradient(to bottom, #eef8f5 0 24px, #c6e2d9 24px 27px); }
.bg-home { background: linear-gradient(to bottom, transparent 64%, #ecd6b6 64%), linear-gradient(90deg, transparent 8%, #dff0ff 8% 34%, transparent 34%) 0 12% / 100% 34% no-repeat, #fbf1e1; }
.bg-office { background: linear-gradient(to bottom, transparent 64%, #d9dde3 64%), repeating-linear-gradient(90deg, #f3f5f8 0 40px, #e8ebf0 40px 80px); }
.bg-sparkle { background: radial-gradient(#ffd0de 1.6px, transparent 1.8px) 0 0 / 14px 14px, radial-gradient(circle at 50% 60%, #fff 0 30%, #ffeaf1 75%); }
.fx-shock { background: repeating-conic-gradient(from 0deg at 50% 58%, #fff 0 4deg, #e9e9e9 4deg 8deg) !important; }
.fx-gloom::before {
  content: ""; position: absolute; inset: 0 0 45% 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(60,60,100,.22) 0 2px, transparent 2px 9px);
  -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent);
}

.char { position: absolute; bottom: -4%; height: 72%; aspect-ratio: 2 / 3; z-index: 2; }
.char svg { width: 100%; height: 100%; display: block; }
.char.pos-left { left: 3%; }
.char.pos-right { right: 3%; }
.char.pos-center { left: 50%; transform: translateX(-50%); }

.bubble {
  position: absolute; top: 2.6cqw; width: 48%; z-index: 4;
  background: #fff; color: #1d1b20; border: 2.5px solid #222; border-radius: 4cqw;
  padding: 1.6cqw 2.2cqw; font-size: 3.8cqw; line-height: 1.4; font-weight: 500;
}
.bubble::after {
  content: ""; position: absolute; bottom: -1.9cqw; width: 3.2cqw; height: 3.2cqw; background: inherit;
  border-right: 2.5px solid #222; border-bottom: 2.5px solid #222; transform: rotate(45deg);
}
.bubble.side-left { left: 2.5%; }
.bubble.side-left::after { left: calc(37% - 1.6cqw); }
.bubble.side-right { right: 2.5%; }
.bubble.side-right::after { left: calc(63% - 1.6cqw); }
.bubble.side-center { left: 50%; transform: translateX(-50%); width: 62%; }
.bubble.side-center::after { left: calc(50% - 1.6cqw); }
.bubble.shout { border-width: 3.5px; font-weight: 800; background: #fffbe3; font-size: 4.2cqw; }
.bubble.think { border-style: dashed; border-radius: 7cqw; }
.bubble.think::after { border: 2.5px solid #222; border-radius: 50%; transform: none; width: 2.6cqw; height: 2.6cqw; bottom: -4cqw; }

.prop {
  position: absolute; left: 50%; bottom: 7%; max-width: 46%; white-space: nowrap; z-index: 3;
  transform: translateX(-50%) rotate(-2deg);
  background: #fffef2; border: 3px solid #222; box-shadow: 3px 3px 0 #222;
  font-weight: 800; font-size: 3.3cqw; line-height: 1.35; text-align: center; padding: 1.6cqw 2.2cqw; color: #c0392b;
}
.caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; background: rgba(34,34,34,.86); color: #fff;
  font-size: 2.9cqw; padding: .8cqw 2cqw; text-align: center;
}

/* ---------- 下部 ---------- */
.actions { display: flex; gap: 10px; justify-content: center; margin: 14px 0 6px; }
button, .btn {
  font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; text-decoration: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 99px; padding: 6px 18px;
}
button:hover, .btn:hover { border-color: var(--accent); }
.notes, .checks, .archive { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 18px 12px; margin: 16px 0; }
.notes h3, .checks h3, .archive h3 { font-size: 1rem; margin: 12px 0 6px; }
.notes ul { padding-left: 1.2em; margin: 0; }
.notes li { margin: 4px 0; }
.comment { border-left: 4px solid var(--accent); padding: 4px 12px; margin: 12px 0; }
.comment .who { display: block; font-size: .8rem; font-weight: 700; color: var(--accent); }
.source { font-size: .85rem; color: var(--muted); word-break: break-all; }
.checks table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.checks th, .checks td { border-top: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: top; }
.checks th { color: var(--muted); font-weight: 700; }
.archive ul { list-style: none; padding: 0; margin: 0; }
.archive li a { display: flex; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.archive li:first-child a { border-top: 0; }
.archive li.current a { color: var(--accent); font-weight: 700; }
.archive time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.archive em { font-style: normal; font-size: .75rem; color: #b07d00; flex: none; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.site-foot { font-size: .78rem; color: var(--muted); padding-bottom: 40px; }
