/* 利用者向けページ (index / order) の見た目。案 B「ネオブルータル」。
   白地に 3px の黒枠、右下にずらしたベタ塗りの影、原色 (黄・ピンク・青)、角丸なし。見出しは極太の Dela Gothic One。
   管理画面は style.css + admin.css のままで、このファイルは読まない。 */

/* 見出し用の書体。Google Fonts から読み込まず自前で配る (外部送信を減らすため、docs/legal/research.md 3 節)。
   サイトで使う文字だけに絞ったもの (tools/subset-font.py で作る)。ライセンスは SIL OFL 1.1 (/fonts/OFL.txt) */
@font-face {
  font-family: "Dela Gothic One";
  src: url("/fonts/dela-gothic-one-subset.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
:root {
  --bg: #ffffff;
  --paper: #f4f4f0;
  --ink: #111111;
  --mute: #5a5a5a;
  --yellow: #ffe600;
  --yellow-soft: #fff9c2;
  --pink: #ff7bc1;
  --blue: #4d8bff;
  --ng: #e02020;
  --ng-soft: #ffdada;
  --ok: #0b7a3e;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  /* うっすら方眼 (余白を「地」に見せる) */
  background-image: linear-gradient(rgba(17, 17, 17, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

.disp { font-family: "Dela Gothic One", "Hiragino Sans", "Yu Gothic", sans-serif; font-weight: 400; }

header, main, footer { max-width: 560px; margin: 0 auto; padding: 16px; }
header { padding-top: 26px; padding-bottom: 0; }
h1 { font-size: 1.8rem; margin: 0; line-height: 1.25; letter-spacing: 0.01em; }
h1 .ac { background: var(--yellow); padding: 0 8px; box-decoration-break: clone; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
.lead { margin: 6px 0 0; color: var(--ink); font-size: 0.9rem; font-weight: 700; }

/* 試用中・テストモードの帯 */
.banner {
  margin: 14px 0 0; padding: 9px 12px;
  background: var(--yellow-soft); border: 3px solid var(--ink);
  font-size: 0.82rem; line-height: 1.5; font-weight: 500;
}
.banner b { font-weight: 900; }

/* 3 ステップ */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); margin: 16px 0 0; border: 3px solid var(--ink); background: #fff; }
.steps span {
  text-align: center; font-size: 0.78rem; font-weight: 900; padding: 8px 4px;
  border-right: 3px solid var(--ink); color: var(--mute); background: #fff;
  transition: background .15s, color .15s;
}
.steps span:last-child { border-right: none; }
.steps span.on { background: var(--yellow); color: var(--ink); }
.steps span.done { background: var(--blue); color: #fff; }

.card {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 6px;
  box-shadow: 7px 7px 0 var(--ink);
  padding: 20px 18px;
  margin-top: 16px;
}
.card + .card { margin-top: 18px; }
.hidden { display: none !important; }

.field { display: block; margin-bottom: 20px; }
.lbl {
  display: inline-block; font-size: 0.74rem; font-weight: 900; letter-spacing: 0.08em;
  background: var(--ink); color: #fff; padding: 2px 8px; margin-bottom: 8px;
}
.hint { display: block; margin-top: 8px; font-size: 0.8rem; color: var(--mute); min-height: 1.2em; font-weight: 700; }
.hint.ok { color: var(--ok); }
.hint.ng { color: var(--ng); }
.limits { font-size: 0.74rem; color: var(--mute); margin: 8px 0 0; font-weight: 500; }

input[type="tel"], input[type="text"], input[type="email"] {
  width: 100%; height: 50px; padding: 0 14px;
  border: 3px solid var(--ink); border-radius: 0; background: #fff; color: var(--ink);
  font: inherit; font-size: 1.15rem; font-weight: 700; letter-spacing: 0.04em; font-variant-numeric: tabular-nums;
  transition: box-shadow .12s;
}
input[type="tel"]:focus, input[type="text"]:focus, input[type="email"]:focus { outline: none; box-shadow: 4px 4px 0 var(--blue); }

/* 通報フォーム (report.html) の select / textarea も同じ見た目に */
select, textarea {
  width: 100%; padding: 10px 14px;
  border: 3px solid var(--ink); border-radius: 0; background: #fff; color: var(--ink);
  font: inherit; font-size: 1rem; font-weight: 700;
}
select { height: 50px; }
select:focus, textarea:focus { outline: none; box-shadow: 4px 4px 0 var(--blue); }
input.ok { box-shadow: 4px 4px 0 var(--blue); }
input.ng { border-color: var(--ng); box-shadow: 4px 4px 0 var(--ng-soft); }
input:disabled { background: var(--paper); color: var(--mute); }

/* 原稿のドロップゾーン */
.drop {
  position: relative; display: flex; align-items: center; gap: 12px;
  border: 3px dashed var(--ink); background: var(--paper); padding: 14px;
  cursor: pointer; transition: transform .1s, background .15s, border-color .15s;
}
.drop:hover { background: #ecece6; }
.drop.over { border-color: var(--blue); background: #e7efff; transform: translate(-2px, -2px); }
.drop.has { animation: pop .25s ease-out; border-style: solid; }
.drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop .ico {
  width: 42px; height: 52px; background: var(--pink); border: 3px solid var(--ink);
  position: relative; flex-shrink: 0;
}
.drop .ico::after {
  content: ""; position: absolute; left: 7px; right: 7px; top: 10px; height: 3px;
  background: var(--ink); box-shadow: 0 8px 0 var(--ink), 0 16px 0 var(--ink);
}
.drop .txt { min-width: 0; }
.drop b { display: block; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop small { color: var(--mute); font-size: 0.78rem; font-weight: 700; }
.drop .chg {
  margin-left: auto; font-size: 0.76rem; font-weight: 900; white-space: nowrap;
  text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 3px;
}
@keyframes pop { 0% { transform: scale(.97); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }

.link {
  display: inline-block; margin-top: 8px; padding: 0; border: none; background: none;
  color: var(--ink); font: inherit; font-size: 0.82rem; font-weight: 900; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 3px;
}

.check { display: flex; align-items: flex-start; gap: 8px; font-size: 0.83rem; color: var(--mute); margin-bottom: 18px; font-weight: 500; }
.check input { margin-top: 4px; flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--ink); }

/* 料金 */
.price {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-top: 4px; padding: 10px 14px; border: 3px solid var(--ink); background: var(--yellow);
}
.price strong { font-size: 2.2rem; line-height: 1; }
.price span { font-size: 0.85rem; font-weight: 700; }
.price em { margin-left: auto; font-style: normal; font-size: 0.72rem; font-weight: 900; border: 2px solid var(--ink); background: #fff; padding: 1px 8px; }

/* ボタン */
button, .button { font: inherit; cursor: pointer; text-decoration: none; text-align: center; }
.primary {
  display: block; width: 100%; margin-top: 18px; padding: 15px; border: 3px solid var(--ink); border-radius: 0;
  background: var(--pink); color: var(--ink); font-size: 1.12rem; font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: 6px 6px 0 var(--ink); transition: transform .08s, box-shadow .08s, background .15s;
}
.primary:hover:not(:disabled) { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }
.primary:active:not(:disabled) { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--ink); }
.primary:disabled { background: var(--paper); color: var(--mute); box-shadow: 6px 6px 0 var(--mute); cursor: not-allowed; }
/* Dela Gothic One は 400 の 1 ウェイトだけ。900 を重ねると合成ボールドがかかって字が潰れる (読みにくい) */
.primary.disp, .ghost.disp { font-weight: 400; }
.primary:focus-visible, .ghost:focus-visible, .link:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.ghost {
  display: inline-block; padding: 13px 18px; border: 3px solid var(--ink); border-radius: 0;
  background: #fff; color: var(--ink); font-weight: 900; box-shadow: 4px 4px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.ghost:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.ghost.button { display: block; width: 100%; margin-top: 16px; }
.row { display: flex; align-items: stretch; gap: 12px; }
.row .primary { margin-top: 0; flex: 1; }
.note { text-align: center; font-size: 0.76rem; color: var(--mute); margin: 12px 0 0; font-weight: 700; }
.secure { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--mute); }

/* 使い方と FAQ (トップの下) */
.guide h2 + .howto, .guide h2 + .faq { margin-top: 0; }
.guide .faq { margin-bottom: 0; }
.guide > p { font-size: 0.9rem; line-height: 1.7; margin: 0 0 10px; }
.guide > p + h2 { margin-top: 20px; }

/* LINE からの入口 (/line) */
.line-lp h2 { margin-top: 26px; }
.line-lp > p { font-size: 0.9rem; line-height: 1.7; margin: 0 0 10px; }
.line-offer { background: var(--yellow-soft); border: 3px solid var(--ink); padding: 12px 14px; }
.line-offer p { margin: 0; font-size: 0.82rem; line-height: 1.6; }
.line-offer .line-offer-title { font-size: 1.05rem; margin-bottom: 6px; }
a.primary { text-align: center; text-decoration: none; box-sizing: border-box; }
.line-lp > .line-friend { text-align: center; margin: 30px 0 0; }
.line-friend img { display: inline-block; vertical-align: middle; }
.line-qr { display: none; text-align: center; margin-top: 14px; }
.line-qr p { margin: 6px 0 0; font-size: 0.8rem; color: var(--mute); }
@media (hover: hover) and (pointer: fine) { .line-qr { display: block; } }
.guide-line { font-weight: 700; }
.howto { margin: 0 0 22px; padding-left: 1.4em; font-size: 0.9rem; line-height: 1.7; }
.howto li + li { margin-top: 8px; }
.howto b { display: block; }
.faq details { border-top: 2px solid var(--ink); }
.faq details:last-child { border-bottom: 2px solid var(--ink); }
.faq summary { cursor: pointer; padding: 12px 4px; font-weight: 900; font-size: 0.92rem; list-style-position: inside; }
.faq p { margin: 0 4px 12px; font-size: 0.88rem; line-height: 1.7; }

/* 確認 */
.summary { display: grid; grid-template-columns: 5.5em 1fr; gap: 10px 12px; margin: 0 0 16px; font-size: 0.92rem; }
.summary dt { font-weight: 900; }
.summary dd { margin: 0; word-break: break-all; }
.summary dd small { display: block; font-weight: 500; color: var(--mute); font-size: 0.8rem; }
.warn { margin: 0 0 6px; padding: 10px 12px; border: 3px solid var(--ink); background: var(--yellow-soft); font-size: 0.84rem; font-weight: 700; }

/* お知らせ */
.notice { padding: 12px 14px; border: 3px solid var(--ink); background: var(--paper); margin: 16px 0 0; font-size: 0.9rem; white-space: pre-wrap; font-weight: 500; }
.notice.error { background: var(--ng-soft); }

/* 注文ページ */
.hero { text-align: center; padding: 6px 0 10px; }
.hero h1 { font-size: 1.8rem; }
.hero p { margin: 8px 0 0; color: var(--ink); font-size: 0.9rem; font-weight: 700; }
.mark { width: 88px; height: 88px; margin: 0 auto 14px; position: relative; border: 4px solid var(--ink); background: #fff; box-shadow: 6px 6px 0 var(--ink); }
.mark.wait { background: var(--blue); }
.mark.wait::after {
  content: ""; position: absolute; left: 24px; top: 26px; width: 32px; height: 28px;
  background: #fff; border: 3px solid var(--ink);
  animation: feed 1.2s ease-in-out infinite;
}
.mark.ok { background: var(--yellow); transform: rotate(-4deg); animation: stamp .25s ease-out; }
.mark.ok::after {
  content: ""; position: absolute; left: 28px; top: 18px; width: 22px; height: 40px;
  border: solid var(--ink); border-width: 0 9px 9px 0; transform: rotate(45deg);
}
.mark.ng { background: var(--ng-soft); }
.mark.ng::before, .mark.ng::after {
  content: ""; position: absolute; left: 36px; top: 18px; width: 9px; height: 46px; background: var(--ng);
}
.mark.ng::before { transform: rotate(45deg); }
.mark.ng::after { transform: rotate(-45deg); }
@keyframes feed { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes stamp { 0% { transform: rotate(-4deg) scale(1.4); opacity: 0; } 100% { transform: rotate(-4deg) scale(1); opacity: 1; } }

.tl { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border: 3px solid var(--ink); }
.tl li {
  text-align: center; font-size: 0.75rem; font-weight: 900; padding: 8px 2px;
  background: #fff; color: var(--mute); border-right: 3px solid var(--ink);
}
.tl li:last-child { border-right: none; }
.tl li.active { background: var(--yellow); color: var(--ink); }
.tl li.done { background: var(--blue); color: #fff; }
.tl li.fail { background: var(--ng); color: #fff; }
.tl-note { margin: 0 0 16px; font-size: 0.82rem; color: var(--mute); text-align: center; min-height: 1.2em; font-weight: 700; }
.error { color: var(--ng); font-size: 0.85rem; white-space: pre-wrap; word-break: break-all; font-weight: 700; }
.refund { color: var(--ng); font-size: 0.85rem; font-weight: 700; }

/* 送れなかったときの選択 (注文ページ) */
.choose { margin: 6px 0 16px; padding: 14px; border: 3px solid var(--ink); background: var(--yellow-soft); }
.choose-deadline { margin: 0 0 12px; font-size: 0.86rem; font-weight: 500; }
.choose-deadline b { font-weight: 900; background: var(--yellow); padding: 0 4px; }
.choose-actions { display: grid; gap: 12px; }
.choose-actions .primary { margin-top: 0; }
.choose-actions .primary.secondary { background: #fff; }
.choose-form { margin-top: 14px; display: grid; gap: 10px; }
.choose-form .primary { margin-top: 4px; }
.choose-note { margin: 0; font-size: 0.86rem; font-weight: 700; }
.choose > .link { margin-top: 14px; }

/* 紙吹雪 (配信完了のときだけ) */
.confetti { pointer-events: none; position: fixed; inset: 0; overflow: hidden; z-index: 5; }
#turnstile-box { display: flex; justify-content: center; margin-bottom: 14px; }
#turnstile-box.hidden { display: none; }

.confetti i {
  position: absolute; top: -12px; width: 10px; height: 14px;
  border: 2px solid var(--ink);
  animation: fall 2.6s ease-in forwards;
}
@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0.9; }
}

footer { color: var(--mute); font-size: 0.74rem; text-align: center; padding-top: 8px; padding-bottom: 34px; font-weight: 500; }
/* LINE ミニアプリのセーフエリア (縦: 下 34px、横: 左右 44px・下 21px)。横向きのスマホだけ余白を広げる */
@media (orientation: landscape) and (max-height: 500px) {
  header, main, footer { padding-left: 44px; padding-right: 44px; }
  footer { padding-bottom: 21px; }
}
footer a { color: var(--mute); text-decoration-thickness: 2px; }
footer .sep { margin: 0 6px; }
/* 送信確認・決済の画面では記事への導線を増やさない。 */
body:has(#step-input.hidden) .footer-guide { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------ 紙面スキャン (scan.js) */

.scan-link { margin: 0; }
.scan-note { display: block; margin-top: 2px; font-size: 0.72rem; color: var(--mute); font-weight: 500; }

.scan-ov {
  position: fixed; inset: 0; z-index: 50; overflow: auto;
  background: rgba(17, 17, 17, 0.55); padding: 20px 12px 28px;
}
.scan-card {
  max-width: 720px; margin: 0 auto; background: #fff;
  border: 3px solid var(--ink); box-shadow: 7px 7px 0 var(--ink); padding: 16px;
}
.scan-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.scan-head .link { margin-top: 0; }
.scan-hint { margin: 0 0 10px; font-size: 0.83rem; font-weight: 700; color: var(--ink); }
.scan-stage { position: relative; text-align: center; background: var(--paper); border: 3px solid var(--ink); padding: 8px; }
.scan-stage canvas#scan-canvas { display: block; margin: 0 auto; touch-action: none; max-width: 100%; }
.scan-stage.zoomable canvas#scan-canvas { cursor: zoom-in; touch-action: manipulation; }
.scan-stage.zoom { overflow: auto; max-height: 58vh; }
.scan-stage.zoom canvas#scan-canvas { max-width: none; margin: 0; cursor: zoom-out; touch-action: pan-x pan-y; }
#scan-loupe {
  position: absolute; top: 8px; right: 8px; width: 132px; height: 132px;
  border: 3px solid var(--ink); background: #fff; box-shadow: 4px 4px 0 var(--ink); pointer-events: none;
}
.scan-row { margin-top: 14px; }
.scan-row .ghost { flex-shrink: 0; }
.limits .sep2 { margin: 0 6px; font-weight: 900; }

/* スキャンのページ一覧 (複数枚) */
.scan-thumbs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 6px; min-height: 120px; }
.scan-thumbs figure { margin: 0; position: relative; }
.scan-thumbs img { display: block; width: 96px; height: auto; border: 3px solid var(--ink); background: #fff; }
.scan-thumbs figcaption {
  position: absolute; top: -8px; left: -8px; width: 24px; height: 24px; line-height: 24px; text-align: center;
  background: var(--yellow); border: 2px solid var(--ink); font-size: 0.75rem; font-weight: 900;
}
.scan-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.scan-add .ghost { cursor: pointer; font-size: 0.85rem; padding: 10px 14px; }
.scan-add .link { margin: 0 0 0 auto; }
#scan-video { display: block; width: 100%; max-height: 58vh; background: #111; }
