/* 印刷所の机。style 属性は使わない（CSP: style-src 'self'）。寸法の動的な値は CSSOM（setProperty）で入れる */
:root {
  --ink: #222; --ink-soft: #5b5446; --paper: #f6f1e6; --paper-2: #efe8d8; --line: #cfc5ae;
  --stamp: #c8382b; --stamp-dark: #a52a1f;
  --direct: #1f7a6d; --relay: #b8741a; --unknown: #6d6a8c;
  --sans: system-ui, "Hiragino Sans", "Noto Sans JP", sans-serif;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
  --dock-h: 128px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: #cdbf9f; overflow-x: clip; }
body { margin: 0; color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55;
  background: #cdbf9f url("/assets/desk.webp") repeat; background-size: 512px; min-height: 100vh; min-height: 100dvh; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.noscript { padding: 16px; background: #fff; }
.mono { font-family: var(--mono); }
.small { font-size: 13px; color: var(--ink-soft); margin: 6px 0; line-height: 1.5; }
.center { text-align: center; }

.desk { min-height: 100vh; min-height: 100dvh; display: flex; justify-content: center; }
.paper-sheet { width: 100%; max-width: 480px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--paper) url("/assets/paper-texture.webp") repeat; background-size: 256px;
  box-shadow: 0 0 0 1px rgba(60,40,10,.18), 0 18px 40px rgba(40,25,5,.35), 0 3px 6px rgba(40,25,5,.3); }
@media (min-width: 520px) { .desk { padding: 24px 0 40px; } .paper-sheet { min-height: calc(100vh - 64px); min-height: calc(100dvh - 64px); border-radius: 3px; } }
body.has-dock .paper-sheet { padding-bottom: calc(var(--dock-h) + 24px); }
.tech { scroll-margin-bottom: calc(var(--dock-h) + 24px); }

/* 上の帯 */
.top { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 6px 64px; min-height: 56px; }
.title { margin: 0; font-family: var(--serif); font-size: 19px; letter-spacing: .05em; font-weight: 700; }
.tools { display: flex; gap: 8px; }
.round { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: #fffdf7; cursor: pointer; display: grid; place-items: center; padding: 0; font-size: 13px; font-weight: 700; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.round svg { width: 22px; height: 22px; }
.round:active { transform: translateY(1px); }

/* ステップの帯 */
.steps { padding: 0 12px 6px; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.step { width: 100%; min-height: 44px; border: 0; border-bottom: 3px solid var(--line); background: transparent; padding: 2px 0 4px; cursor: pointer; display: grid; justify-items: center; gap: 0; font-size: 11px; color: var(--ink-soft); }
.step .num { width: 20px; height: 20px; border-radius: 10px; background: var(--paper-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.step.current { color: var(--ink); border-bottom-color: var(--stamp); font-weight: 700; }
.step.current .num { background: var(--stamp); border-color: var(--stamp); color: #fff; }
.step.done .num { background: var(--direct); border-color: var(--direct); color: #fff; }
.step.todo, .step.skip { opacity: .55; }
.step.skip .skip-tag { font-size: 9px; line-height: 1.1; color: var(--ink-soft); white-space: nowrap; }
.step.skip { opacity: .5; }
.reason, .stamp-sub, .limits li, .lead, .small, .notice, .ended-note, .check, .info, .pick-hint, .sample-no-open { word-break: keep-all; overflow-wrap: anywhere; }

main { flex: 1; padding: 6px 16px 16px; outline: none; }
.foot { padding: 4px 16px 18px; }
.trademark { font-size: 11px; color: var(--ink-soft); text-align: center; margin: 0; }

/* ボタン */
.btn { min-height: 56px; padding: 0 18px; border-radius: 12px; border: 2px solid var(--ink); background: #fffdf7; color: var(--ink); font-size: 17px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 rgba(0,0,0,.25); }
.btn.primary { background: var(--stamp); border-color: var(--stamp-dark); color: #fff; box-shadow: 0 3px 0 var(--stamp-dark); }
.btn.primary:active { box-shadow: 0 1px 0 var(--stamp-dark); transform: translateY(2px); }
.btn.ghost { border-color: var(--line); box-shadow: none; }
.btn.small { min-height: 44px; font-size: 15px; padding: 0 14px; }
.btn.is-disabled { opacity: .45; }
.link-btn { background: none; border: 0; padding: 8px 4px; min-height: 44px; color: #1f5a8a; text-decoration: underline; cursor: pointer; font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.headline { font-family: var(--serif); font-size: 25px; line-height: 1.3; margin: 8px 0 6px; font-weight: 700; }
.headline.small { font-size: 21px; }
.lead { margin: 0 0 12px; font-size: 15px; line-height: 1.6; }
.notice { background: #fbeee0; border: 1px solid #d9a56a; border-left: 5px solid var(--relay); padding: 10px 12px; border-radius: 4px; margin: 10px 0; font-size: 14px; }
.notice p { margin: 2px 0; }
/* 周回10: 作り直す画面の注意は、場所を先に取る（出ても消えても下のボタンが動かない） */
.paste-err { min-height: 3.6em; margin: 6px 0; box-sizing: border-box; }
.paste-err.is-off { visibility: hidden; }
.check.pending { visibility: hidden; }
.note-tag { display: inline-block; background: #fff3a8; color: #4a3d00; font-family: var(--serif); font-size: 13px; padding: 3px 10px; transform: rotate(-1.5deg); box-shadow: 0 2px 3px rgba(0,0,0,.2); border-radius: 1px; }
.ico { width: 22px; height: 22px; display: inline-block; flex: none; background-repeat: no-repeat; background-position: center; }
.ico-cam { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 8h4l2-3h6l2 3h4v11H3z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E"); }
.ico-lock { width: 16px; height: 16px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b5446' stroke-width='2.2'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E"); }

/* 最初の画面 */
.entries { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.entries .wide { grid-column: 1 / -1; min-height: 64px; font-size: 20px; }
.entries .btn { min-height: 64px; }
.sample-head { margin: 14px 0 2px; }
.samples { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 8px; border-radius: 10px; padding: 4px; }
.samples.pulse { animation: pulse 0.9s ease-out; }
.sample { padding: 0; border: 0; background: rgba(255,255,255,.35); border-radius: 8px; cursor: pointer; display: block; text-align: center; overflow: hidden; }
.sample:active { transform: scale(.98); }
.sample .sample-art { display: block; width: 100%; height: auto; aspect-ratio: 5 / 4; }
.sample .cap { display: block; font-size: 12px; font-weight: 600; padding: 2px 4px 5px; color: var(--ink-soft); }
.privacy-line { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; background: none; border: 0; font-size: 13px; color: var(--ink-soft); text-decoration: underline; cursor: pointer; }
.pc-hint { text-align: center; font-size: 12px; color: var(--ink-soft); margin: 2px 0; }
@media (max-height: 700px) {
  .top { min-height: 52px; padding-top: 4px; padding-bottom: 2px; }
  .headline { font-size: 22px; line-height: 1.25; margin: 0 0 2px; }
  .lead { font-size: 13px; line-height: 1.45; margin-bottom: 6px; }
  .entries { gap: 6px; }
  .entries .btn { min-height: 56px; font-size: 16px; }
  .entries .wide { min-height: 60px; }
  .start .sample-head { display: none; }
  .start .samples { gap: 6px; margin: 8px 0 2px; padding: 0; }
  .start .sample .sample-art { aspect-ratio: 4 / 3; }
  .start .sample .cap { font-size: 11px; padding: 0 2px 3px; }
  .privacy-line { min-height: 40px; font-size: 12px; }
  main { padding-top: 2px; }
}

/* カメラ */
.camera { display: grid; gap: 8px; }
.viewfinder { position: relative; background: #151210; border-radius: 12px; overflow: hidden; height: calc(100vh - 250px); height: calc(100dvh - 250px); min-height: 220px; max-height: 560px; }
.viewfinder video, .snap-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.snap-canvas { opacity: 0; }
.snap-canvas.on { opacity: 1; }
.viewfinder .dim { position: absolute; inset: 0; box-shadow: inset 0 0 80px rgba(0,0,0,.45); pointer-events: none; }
.frame { position: absolute; left: 14%; top: 22%; width: 72%; height: 50%; transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease; }
.frame-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 3px rgba(0,0,0,.6)); }
.viewfinder.snapped .frame { left: var(--fl); top: var(--ft); width: var(--fw); height: var(--fh); }
.viewfinder.snapped .frame-svg { animation: glow .4s ease-out; }
.scan { position: absolute; left: 14%; width: 72%; height: 2px; background: linear-gradient(90deg, transparent, #fff, transparent); top: 24%; animation: scan 2.2s ease-in-out infinite alternate; opacity: .8; }
.viewfinder.snapped .scan { display: none; }
.cam-hint { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; }
.hold-art { width: 70px; height: auto; }
.cam-msg { margin: 0; font-size: 15px; line-height: 1.45; min-height: 3em; }
.cam-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.cam-actions .btn { min-height: 52px; font-size: 15px; padding: 0 10px; }
.cam-blocked { display: grid; gap: 12px; padding: 8px 0; }
.paper-note { background: #fffdf7; border: 1px solid var(--line); border-radius: 3px; padding: 20px 16px; text-align: center; transform: rotate(-0.8deg); box-shadow: 0 8px 14px -6px rgba(40,25,5,.45); }
.paper-note b { font-family: var(--serif); font-size: 20px; }
.paper-note p { margin: 6px 0 0; font-size: 14px; }
.cam-blocked .entries { grid-template-columns: 1fr; }

/* 結果 */
.result { display: grid; gap: 10px; }
/* 判定の札: 和紙の札に判を押した形（保存の朱の判「PNG」と同じ絵の言葉）。判の縁は 実線／二重線／点線 で、色だけに頼らない */
.stamp { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 28px; background: #fbf6e6 url("/assets/washi-tag.webp") 50% 50% / 150% 220% no-repeat; cursor: pointer; border-radius: 4px 12px 4px 12px; color: var(--c); border: 1px solid #cbbb98; position: relative; box-shadow: 0 5px 8px -4px rgba(40,25,5,.45), 0 1px 0 #fff inset; transform: rotate(-.4deg); }
.stamp::before { content: ""; position: absolute; left: 9px; top: 50%; width: 9px; height: 9px; margin-top: -5px; border-radius: 50%; background: #cdbf9f; box-shadow: inset 0 1px 2px rgba(0,0,0,.45); }
.stamp[data-verdict="direct"] { --c: var(--direct); }
.stamp[data-verdict="relay"] { --c: var(--relay); }
.stamp[data-verdict="unknown"] { --c: var(--unknown); }
.stamp[data-verdict="none"] { --c: var(--ink-soft); }
.stamp[data-ended] { --c: #6b5d86; }
.stamp-text { min-width: 0; }
.stamp-word { display: inline-block; border: 3px solid var(--c); border-radius: 5px; padding: 0 10px; transform: rotate(-1.6deg); opacity: .93; mix-blend-mode: multiply; }
.stamp[data-verdict="relay"] .stamp-word { border-style: double; border-width: 6px; }
.stamp[data-verdict="unknown"] .stamp-word { border-style: dashed; }
.stamp[data-verdict="none"] .stamp-word { font-size: 22px; padding: 2px 10px; border-width: 2px; }
.stamp-sub { margin-top: 6px; text-wrap: balance; word-break: auto-phrase; }
.ended-seal { position: absolute; top: -10px; right: 10px; transform: rotate(4deg); background: #efeaf6; color: #4d4166; border: 2px dashed #6b5d86; border-radius: 4px; padding: 1px 9px; font-size: 12px; font-weight: 800; line-height: 1.5; box-shadow: 0 2px 4px rgba(40,25,5,.3); }
.tag-sh { filter: url(#pa-sh); }
.mult { mix-blend-mode: multiply; }
.btn.done { background: #e3f3ee; border-color: var(--direct); color: #14584e; }
.dock .primary.saved { background: var(--direct); border-color: #14584e; box-shadow: 0 3px 0 #14584e; }
.step.skip { cursor: default; border-bottom-style: dotted; }
.step.skip .num { background: transparent; border-style: dashed; }
.read-band { position: absolute; left: 0; right: 0; bottom: 10%; margin: 0 auto; width: max-content; max-width: 90%; background: #1f7a6d; color: #fff; font-weight: 800; font-size: 18px; padding: 8px 20px; border-radius: 999px; opacity: 0; transform: translateY(10px); box-shadow: 0 4px 10px rgba(0,0,0,.4); pointer-events: none; }
.viewfinder.snapped .read-band { opacity: 1; transform: none; transition: opacity .18s ease-out, transform .18s ease-out; }
.viewfinder.snapped .frame-svg path { stroke: #8dffc0; }
.stamp-ico { width: 52px; height: 52px; flex: none; }
.stamp-ico svg { width: 100%; height: 100%; display: block; }
.stamp-word { font-family: var(--serif); font-size: 36px; font-weight: 800; line-height: 1.1; letter-spacing: .04em; }
.stamp-sub { font-size: 13px; color: var(--ink); margin-top: 2px; line-height: 1.4; }
.stamp.drop { animation: stampdrop .22s cubic-bezier(.2, .8, .3, 1); }
.path-wrap { background: #e8dcc0; border-radius: 8px; padding: 4px; box-shadow: inset 0 0 0 1px #cdbd97; }
.path-art { display: block; width: 100%; height: auto; }
.pstep.hot { cursor: pointer; }
.pstep:focus-visible { outline: 2px solid var(--stamp); }
.road-band.draw, .road-edge.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .7s .15s ease-out forwards; }
.road-edge.draw { stroke-dasharray: 1; }
.content { background: #fffdf7; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.url-line { font-family: var(--mono); word-break: break-all; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.url-line .url-host { font-size: 20px; color: var(--ink); font-weight: 800; letter-spacing: .01em; }
.url-line.big .url-host { font-size: 22px; }
.url-rest { color: #8a8270; }
.iso { unicode-bidi: isolate; }
.url-user { color: #8a8270; text-decoration: line-through; text-decoration-color: var(--stamp); }
.url-port { font-size: 16px; font-weight: 700; color: var(--ink); }
.ascii { word-break: break-all; }
.url-scheme { color: #8a8270; }
.reason { margin: 0; font-size: 15px; line-height: 1.55; }
.limits { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.ended-note { margin: 0; padding: 6px 10px; background: #efeaf6; border-left: 4px solid var(--unknown); font-size: 14px; font-weight: 600; }
.sample-no-open { margin: 0; font-size: 13px; color: var(--ink-soft); text-align: center; border: 1px dashed var(--line); padding: 8px; border-radius: 6px; }
.open-link { justify-self: start; }
.kv { display: grid; grid-template-columns: 7em 1fr auto; gap: 6px; padding: 4px 0; font-size: 14px; align-items: center; border-bottom: 1px dotted var(--line); }
.kv .k { color: var(--ink-soft); font-size: 12px; }
.kind-name { font-family: var(--serif); font-size: 18px; display: block; margin-bottom: 4px; }
.raw-wrap summary { font-size: 13px; color: var(--ink-soft); padding: 8px 0; cursor: pointer; min-height: 44px; }
.raw { white-space: pre-wrap; word-break: break-all; margin: 0; font-size: 13px; }
.bizcard { display: grid; gap: 2px; background: #fff; border-left: 5px solid #1f5a63; }
.bc-name { font-family: var(--serif); font-size: 20px; }

/* 作る、比べる */
.got { display: grid; gap: 6px; margin: 4px 0 10px; }
.qr-holder { display: grid; place-items: center; padding: 12px; background: #e8dcc0; border-radius: 8px; transition: box-shadow .3s; }
.qr-holder .qr { width: min(280px, 100%); height: auto; display: block; box-shadow: 0 6px 12px -4px rgba(40,25,5,.5); }
.qr-holder.lit { animation: lit .5s ease-out; }
.qr.building .qr-row { opacity: 0; animation: rowin .3s ease-out forwards; animation-delay: var(--d, 0ms); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--direct); margin: 10px 0 4px; font-size: 14px; line-height: 1.4; }
.tick { width: 24px; height: 24px; border-radius: 12px; background: var(--direct); color: #fff; display: grid; place-items: center; flex: none; font-size: 14px; }
.info { margin: 0; font-size: 12.5px; color: var(--ink-soft); font-family: var(--mono); }
.three { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.three li { display: flex; gap: 10px; background: #fffdf7; border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.three .n { width: 28px; height: 28px; border-radius: 14px; background: var(--stamp); color: #fff; font-weight: 800; display: grid; place-items: center; flex: none; }
.three .grow { flex: 1; min-width: 0; }
.three b { display: block; margin-bottom: 6px; font-size: 15px; }
.addr-art { width: 150px; height: auto; pointer-events: none; user-select: none; opacity: .9; }
#paste-input { width: 100%; border: 2px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; font-family: var(--mono); font-size: 14px; resize: vertical; min-height: 64px; }
#paste-input:focus { outline: 3px solid #f0c9c2; border-color: var(--stamp); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0; }
.duo figure { margin: 0; text-align: center; }
.duo figcaption { font-weight: 700; font-size: 14px; margin-top: 4px; }
.tagged { background: #fffdf7; padding: 8px; border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 6px 10px -5px rgba(40,25,5,.5); position: relative; transform: rotate(-1deg); }
.tagged.direct { transform: rotate(1deg); border-color: var(--direct); }
.tagged .qr { width: 100%; height: auto; display: block; }
.ok-badge { position: absolute; right: -8px; top: -8px; width: 26px; height: 26px; border-radius: 13px; background: var(--direct); color: #fff; display: grid; place-items: center; font-size: 15px; }
.qr-na { aspect-ratio: 1; display: grid; place-items: center; color: var(--ink-soft); }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.cmp th, .cmp td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: center; }
.cmp td { white-space: nowrap; font-size: 13px; }
.cmp th:first-child { text-align: left; font-weight: 600; font-size: 13px; }
.dists { display: grid; gap: 6px; margin: 6px 0; }
.dist-row { display: grid; grid-template-columns: 3.5em 1fr 4.6em; gap: 8px; align-items: center; font-size: 13px; }
.dist-track { height: 14px; background: var(--paper-2); border-radius: 7px; overflow: hidden; }
.dist-bar { height: 100%; width: 0; border-radius: 7px; transition: width .6s ease-out; }
.dist-bar.a { background: var(--relay); }
.dist-bar.b { background: var(--direct); }
.dist-val { text-align: right; font-weight: 700; }
.advice { background: #fffdf7; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; display: grid; gap: 8px; font-size: 14.5px; }
.advice p { margin: 0; }

/* 刷る大きさ */
.edge-row { display: grid; grid-template-columns: 5.5em 1fr; gap: 10px; align-items: center; margin: 6px 0; }
.edge-val { font-family: var(--mono); font-weight: 800; font-size: 22px; }
input[type=range] { width: 100%; height: 44px; accent-color: var(--stamp); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.chip { min-height: 44px; padding: 4px 12px; border-radius: 22px; border: 2px solid var(--line); background: #fffdf7; cursor: pointer; display: grid; font-size: 12px; line-height: 1.2; text-align: center; place-items: center; }
.chip b { font-size: 14px; }
.chip.on { border-color: var(--stamp); background: #fbe7e3; }
.stage { background: #e8dcc0; border-radius: 8px; padding: 10px; display: grid; justify-items: center; overflow: hidden; }
.real-wrap { display: grid; gap: 2px; max-width: 100%; }
.real-wrap .ruler { display: block; max-width: 100%; }
.real-wrap .real { display: block; box-shadow: 0 6px 12px -4px rgba(40,25,5,.5); }
.stage.show-quiet .real { outline: 2px dashed var(--stamp); outline-offset: 3px; }
.stage { padding: 14px; }
.tech { margin: 2px 0 6px; }
.tech summary { font-size: 12px; color: var(--ink-soft); cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.pick-hint { margin: 6px 0 2px; padding: 10px 12px; background: #fff3a8; color: #4a3d00; font-weight: 700; font-size: 15px; border-radius: 6px; border: 2px solid #c9a600; }
.samples.ask { outline: 3px solid var(--stamp); outline-offset: 2px; background: rgba(200,56,43,.08); }
.notice { scroll-margin-bottom: calc(var(--dock-h) + 16px); }
.sample { scroll-margin-bottom: calc(var(--dock-h) + 16px); }
.foot { padding-bottom: 24px; }
.cal-band { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.size-info .big-num { margin: 4px 0 0; font-size: 20px; font-weight: 800; font-family: var(--serif); }
.dist-box { background: #fffdf7; border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.dist-art { width: 100%; height: auto; display: block; }
.sec { font-size: 14px; margin: 14px 0 4px; color: var(--ink-soft); font-weight: 700; }
.tabs { display: flex; gap: 6px; }
.tab { flex: 1; min-height: 44px; border: 2px solid var(--line); border-bottom: 0; background: var(--paper-2); border-radius: 8px 8px 0 0; cursor: pointer; font-size: 14px; }
.tab.on { background: #fffdf7; border-color: var(--ink); font-weight: 700; }
.paper-box { background: #d8ccb0; padding: 14px 8px 8px; display: grid; justify-items: center; border-radius: 0 0 8px 8px; gap: 6px; }
.paper-art { display: block; max-width: 100%; height: auto; filter: drop-shadow(0 5px 6px rgba(40,25,5,.45)); }
.toggle { display: flex; align-items: center; gap: 10px; background: none; border: 0; min-height: 48px; cursor: pointer; font-size: 15px; padding: 0; text-align: left; }
.toggle .knob { width: 46px; height: 26px; border-radius: 13px; background: #bbb2a0; position: relative; flex: none; transition: background .15s; }
.toggle .knob::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 10px; background: #fff; transition: transform .15s; }
.toggle[aria-checked="true"] .knob { background: var(--direct); }
.toggle[aria-checked="true"] .knob::after { transform: translateX(20px); }
.toggle.small { font-size: 13px; }
.cal-stage { display: grid; place-items: center; min-height: 240px; background: #e8dcc0; border-radius: 8px; overflow: hidden; margin: 8px 0; }
.cal-frame { border: 3px solid #6a6a6a; border-radius: 12px; background: rgba(180,180,180,.35); }
.cal-frame.coin { border-radius: 50%; }
.cal-frame.match { border-color: #2f9b4a; background: rgba(47,155,74,.25); }

/* 持ち帰る */
.save { display: grid; gap: 8px; }
.stamp-wrap { position: relative; display: grid; place-items: center; background: #e8dcc0; border-radius: 8px; padding: 12px; overflow: hidden; }
.pressed .qr { display: block; box-shadow: 0 6px 12px -4px rgba(40,25,5,.5); }
.stamp-wrap.pressing .pressed { animation: press .25s ease-out; }
.png-stamp { position: absolute; right: 18px; bottom: 14px; font-family: var(--serif); font-weight: 800; font-size: 22px; color: var(--stamp); border: 3px solid var(--stamp); border-radius: 6px; padding: 0 8px; transform: rotate(-12deg); opacity: 0; }
.stamp-wrap.pressing .png-stamp { animation: stampin .9s ease-out forwards; }
.save-btns { display: grid; gap: 8px; }

/* 下の固定の操作の帯 */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: linear-gradient(#f6f1e6f2, #efe6d0); border-top: 1px solid var(--line); box-shadow: 0 -6px 14px rgba(40,25,5,.18); padding-bottom: env(safe-area-inset-bottom); }
.dock-in { max-width: 480px; margin: 0 auto; padding: 8px 12px 4px; display: grid; gap: 2px; }
.dock-row { display: flex; gap: 8px; align-items: center; }
.dock-row.end { justify-content: space-between; min-height: 44px; }
.dock .back { min-width: 84px; min-height: 56px; padding: 0 12px; font-size: 15px; }
.dock .primary { flex: 1; min-height: 56px; font-size: 17px; }
.dock .primary:not(.is-disabled) { animation: beat 2.4s ease-in-out 1; }
.again { background: none; border: 0; min-height: 44px; padding: 0 8px; color: var(--ink); font-size: 14px; text-decoration: underline; cursor: pointer; }
.keys { font-size: 11px; color: var(--ink-soft); }
@media (max-height: 700px) { :root { --dock-h: 116px; } .dock .back, .dock .primary { min-height: 52px; } }

/* 板と知らせ */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(30,20,5,.5); }
.sheet-panel { position: relative; width: 100%; max-width: 480px; max-height: 86vh; max-height: 86dvh; overflow: auto; background: var(--paper); border-radius: 16px 16px 0 0; padding: 12px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { margin: 0; font-family: var(--serif); font-size: 20px; }
.sheet-close { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: #fffdf7; font-size: 22px; cursor: pointer; }
.checks { padding-left: 20px; display: grid; gap: 10px; font-size: 14px; }
.csp { display: block; font-family: var(--mono); font-size: 11px; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 6px; margin: 6px 0; word-break: break-word; line-height: 1.6; }
.csp-hot { background: #fff3a8; }
.check-out { font-size: 13px; font-weight: 600; margin: 4px 0; }
/* 知らせは上の帯の下に、流れの中で出す（結果や操作の帯に重ならない）。スクロールしても上に残る */
/* 場所を取らない（下の余白を負にして、出ても画面全体が下へずれない）。上の帯の下の内容に重なって出る */
.toast { position: fixed; left: 12px; right: 12px; bottom: 16px; width: auto; max-width: 456px; box-sizing: border-box; margin: 0 auto; z-index: 30; background: #2c2822; color: #fff; padding: 2px 6px 2px 14px; min-height: 48px; border-radius: 10px; font-size: 14px; line-height: 1.4; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.toast-in { display: flex; gap: 12px; align-items: center; justify-content: space-between; min-height: 44px; }
.toast span { flex: 1; min-width: 0; }
.toast-act { flex: none; white-space: nowrap; background: none; border: 0; color: #ffd27a; font-weight: 700; min-width: 72px; min-height: 44px; padding: 0 10px; cursor: pointer; text-decoration: underline; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes drop { 0% { transform: translateY(-26px) rotate(-3deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
/* 判が押される: 少し大きく現れて沈む（約0.2秒）。紙の影が遠くから近くへ */
@keyframes stampdrop { 0% { transform: rotate(-.4deg) scale(1.05); opacity: 0; box-shadow: 0 22px 20px -8px rgba(40,25,5,.12); } 55% { opacity: 1; transform: rotate(-.4deg) scale(.98); box-shadow: 0 1px 2px rgba(40,25,5,.5); } 100% { transform: rotate(-.4deg) scale(1); box-shadow: 0 5px 8px -4px rgba(40,25,5,.45), 0 1px 0 #fff inset; } }
@keyframes rowin { to { opacity: 1; } }
@keyframes scan { from { top: 24%; } to { top: 70%; } }
@keyframes glow { 0% { filter: drop-shadow(0 0 0 #fff); } 40% { filter: drop-shadow(0 0 10px #fff) brightness(1.6); } 100% { filter: drop-shadow(0 0 3px rgba(0,0,0,.6)); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(200,56,43,.5); } 100% { box-shadow: 0 0 0 16px rgba(200,56,43,0); } }
@keyframes lit { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.9); } 100% { box-shadow: 0 0 0 18px rgba(255,255,255,0); } }
@keyframes beat { 0%, 100% { filter: none; } 15% { filter: brightness(1.12); } 30% { filter: none; } }
.dock .primary { min-width: 0; }
.dock, .dock-in { max-width: 100vw; overflow-x: clip; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes press { 0% { transform: scale(1); } 50% { transform: scale(.97) translateY(2px); } 100% { transform: scale(1); } }
@keyframes stampin { 0% { opacity: 0; transform: rotate(-12deg) scale(1.6); } 30% { opacity: .9; transform: rotate(-12deg) scale(1); } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; animation-delay: 0s !important; transition-duration: .001s !important; }
  .road-band.draw, .road-edge.draw { stroke-dashoffset: 0; }
  .stamp.drop { animation: none; }
  .qr.building .qr-row { opacity: 1; }
}
.save-row { margin: 0; }
.btn.save-card.done, #save-svg.done { background: #e4f1ec; border-color: var(--direct); color: #14584e; }
.steps ol { align-items: stretch; }
.steps li { display: flex; min-width: 0; }
.step { flex: 1; align-content: start; }
/* 上の帯は流れず残る: スクロールした中身が、左上の「作った話と感想」の丸の下に入らない */
.top { position: sticky; top: 0; z-index: 15; background: var(--paper, #f6f1e6); }

/* 確かめた札の棚（最初の画面。記録がある時だけ） */
.shelf { margin: 12px 0 6px; min-width: 0; }
.shelf-title { font-family: var(--serif); font-size: 17px; margin: 0; }
.shelf-note { margin: 2px 0 6px; }
.shelf-row { display: flex; gap: 10px; overflow-x: auto; padding: 6px 4px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; max-width: 100%; }
.shelf-card { flex: none; width: 132px; scroll-snap-align: start; padding: 0 0 6px; border: 1px solid var(--line); border-radius: 4px; background: #fffdf7; cursor: pointer; text-align: left; display: grid; gap: 1px; box-shadow: 0 3px 6px -2px rgba(40,25,5,.3); font: inherit; color: var(--ink); min-height: 44px; }
.shelf-card:nth-child(odd) { transform: rotate(-.8deg); }
.shelf-card:nth-child(even) { transform: rotate(.8deg); }
.shelf-card:active { transform: scale(.98); }
.shelf-art { display: block; width: 132px; height: 69px; background: var(--paper-2); }
.shelf-thumb { display: block; width: 132px; height: auto; }
.shelf-word { font-family: var(--serif); font-weight: 700; font-size: 14px; padding: 4px 8px 0; }
.shelf-who { font-family: var(--mono); font-size: 11px; padding: 0 8px; white-space: nowrap; }
.shelf-day { font-size: 11px; color: var(--ink-soft); padding: 0 8px; }
.shelf-actions { display: flex; gap: 12px; justify-content: flex-end; }
.entry-art { min-height: 120px; }
.entry-thumb { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 4px 10px rgba(40,25,5,.3); }
.btn.danger { border-color: var(--stamp-dark); color: var(--stamp-dark); }
.confirm .row, .entry .row { flex-wrap: wrap; }

/* 保存した札: 写真のように結果の画面に置かれ、そこに留まる */
.saved-photo { margin: 4px auto 14px; width: min(76%, 300px); background: #fffdf7; padding: 6px 6px 8px; border-radius: 2px; box-shadow: 0 8px 16px -4px rgba(40,25,5,.45); transform: rotate(-1.6deg); animation: photo-in .55s cubic-bezier(.2,.9,.3,1.15) both; }
.saved-photo canvas { display: block; width: 100%; height: auto; }
.saved-photo figcaption { font-family: var(--serif); font-size: 12px; color: var(--ink-soft); text-align: center; padding-top: 4px; }
@keyframes photo-in { 0% { transform: translateY(-46px) rotate(6deg) scale(.82); opacity: 0; } 70% { opacity: 1; } 100% { transform: rotate(-1.6deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .saved-photo { animation: none; } }

/* 周回4: 記録がある人の最初の画面は、棚を入口のすぐ下へ。見本は棚の下。0件の画面は変えない */
.start.has-shelf .shelf { margin: 10px 0 8px; }
.start.has-shelf .sample-head { margin-top: 8px; }
.shelf-who.plain { font-family: var(--sans); color: var(--ink-soft); }
/* PC では棚を折り返して5枚とも見せる（横に送れると気づきにくいため） */
@media (hover: hover) and (pointer: fine) { .shelf-row { flex-wrap: wrap; overflow: visible; scroll-snap-type: none; } }
/* 知らせは上の帯（と左上の丸、右上の EN）の下に出す。丸と EN を覆わない */
/* 周回10: 知らせは下に出す（題や上の道しるべに重ならない）。下の帯がある画面では、その上 */
.toast { top: auto; bottom: 16px; }
body.has-dock .toast { bottom: calc(var(--dock-h) + 4px); }

/* 周回4: 「この大きさで読めるか試す」（刷る大きさの画面の中） */
.try-open { width: 100%; margin: 10px 0 4px; }
.try-box { margin: 10px 0 4px; padding: 10px; background: #fffdf7; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 3px 6px -3px rgba(40,25,5,.3); min-width: 0; }
.try-title { margin: 0 0 8px; font-weight: 700; font-size: 15px; }
/* スマホのカメラの画面: 暗い縁と角の丸い枠、中は選んだ見本の紙の色の地。絵そのものは読む部品にかけた絵（粒もぼかしも足さない） */
.try-view-wrap { display: flex; justify-content: center; }
.try-view { width: min(100%, 320px); padding: 9px; background: #151210; border-radius: 22px; box-shadow: 0 5px 12px -4px rgba(20,12,2,.55), inset 0 0 0 1.5px #3b342c; line-height: 0; }
.try-screen { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 14px; background-color: #7d6d58; }
.try-view { --tone: #fdfbf5; }
.try-view[data-paper="flyer"] { --tone: #f7f1e2; }
.try-view[data-paper="poster"] { --tone: #f3d9a6; }
/* 机と紙の絵（paper-layout.js が低い解像度で描く。引き伸ばして QR と同じくらいぼかす）。QR の絵の後ろ */
.try-scene { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* QR の白い余白のまわりは、紙の絵の側（paper-layout.js）で紙の色から白へゆるく変える。QR の canvas には縁も影も付けない */
.try-papers { margin: 0 0 8px; }
.chip.try-paper { flex: 1 1 0; min-width: 0; font-size: 14px; font-weight: 600; }
.chip.try-paper.on { font-weight: 700; }
.try-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 48%, rgba(0,0,0,.5) 100%); }
.try-canvas { position: absolute; display: block; }
.try-corners { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; color: rgba(40,40,40,.55); overflow: visible; }
.try-box[data-state="ok"] .try-corners { color: #0fa36b; }
.try-box[data-state="ng"] .try-corners { color: #d6402f; stroke-dasharray: 3 3; }
.try-sizes-label, .try-ladder-title { margin: 10px 0 4px; font-weight: 700; }
.try-sizes { margin: 0; }
.try-ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 5px; }
/* 1行に size / 結果 / 収まる印。高さは全部の行で同じ（折れない。390 と 360、日英） */
.try-ladder .lad { display: grid; grid-template-columns: 3.3em auto 1fr; column-gap: 8px; align-items: baseline; padding: 5px 8px; min-height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #faf6ea; font-size: 12.5px; min-width: 0; white-space: nowrap; }
.try-ladder .lad-fit { justify-self: end; font-size: 11px; color: var(--direct); overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.try-ladder .lad.over .lad-fit { color: var(--stamp-dark); font-weight: 700; }
.try-ladder .lad.over { border-style: dashed; }
.chip.try-size { flex-direction: column; gap: 0; align-items: center; line-height: 1.25; }
.chip-fit { display: block; font-size: 10.5px; font-weight: 400; color: var(--direct); }
.chip.try-size.over .chip-fit { color: var(--stamp-dark); font-weight: 700; }
.chip.try-size.over { border-style: dashed; }
.try-recorded { margin: 4px 0; color: var(--direct); }
.entry-tried, .shelf-tried { color: #14584e; font-weight: 700; }
.shelf-tried { font-size: 10.5px; padding: 0 8px; line-height: 1.3; }
.ask-place-label { margin: 4px 0 0; }
.ask-place { width: 100%; min-height: 44px; padding: 8px 10px; font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-sizing: border-box; scroll-margin-bottom: calc(var(--dock-h) + 24px); }
.ask-btn { scroll-margin-bottom: calc(var(--dock-h) + 24px); }
html { scroll-padding-bottom: calc(var(--dock-h) + 24px); }
.try-ladder .lad.wait { border-style: dashed; color: var(--ink-soft); background: transparent; }
.try-ladder .lad.on { border-color: var(--direct); box-shadow: inset 0 0 0 1px var(--direct); background: #e9f4ef; }
.try-ladder .lad[data-state="none"] { color: var(--stamp-dark); }
.try-ladder .lad-size { font-family: var(--mono); }
.try-ladder .lad-res { font-weight: 700; overflow-wrap: anywhere; }
.try-hint { margin: 8px 0 0; }
.chip.try-size { min-width: 0; }
.try-badge { margin: 10px 0 2px; min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 18px; font-weight: 800; border: 3px solid var(--ink-soft); }
.try-badge[data-state="ok"] { color: #14584e; background: #e4f1ec; border-color: var(--direct); border-style: solid; }
.try-badge[data-state="ng"] { color: var(--stamp-dark); background: #fbe7e3; border-color: var(--stamp); border-style: dashed; }
.try-row { grid-template-columns: 4.5em 1fr; }
.try-row input[type=range] { touch-action: pan-y; min-height: 44px; }
.try-limit { margin: 6px 0 2px; font-weight: 700; font-size: 15px; font-family: var(--serif); }
.try-honest { margin-top: 8px; font-size: 12px; }
.try-open, .try-box { scroll-margin-bottom: calc(var(--dock-h) + 24px); }
/* 周回5: 作った人への頼み方、霧の理由 */
.ask { display: grid; gap: 6px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 6px; background: #fffdf7; min-width: 0; scroll-margin-bottom: calc(var(--dock-h) + 24px); }
.ask .ask-lead { margin: 0; color: var(--ink-soft); }
.ask .ask-btn { justify-self: start; max-width: 100%; }
.ask .ask-status { margin: 0; min-height: 0; }
.ask .ask-status:empty { display: none; }
.ask-text { margin: 0; padding: 8px 10px; border-left: 4px solid var(--direct); background: #f4f1e6; border-radius: 3px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.fog-note { margin: 0; padding-left: 10px; border-left: 3px dotted #7c78a0; color: var(--ink-soft); scroll-margin-bottom: calc(var(--dock-h) + 24px); }
.ask-text, .try-ladder, .try-hint { scroll-margin-bottom: calc(var(--dock-h) + 24px); }
.try-sizes, .chip.try-size, .try-range, #try-range { scroll-margin-bottom: calc(var(--dock-h) + 24px); }

/* 周回8: 最初の画面の動く見本（記録が0件の時だけ）。門の側だけ数秒ごとに閉じて、行き先の札が霧に消える */
.demo { margin: 4px 0 8px; }
.demo-row { display: grid; grid-template-columns: 2fr 3fr; gap: 8px; align-items: end; }
/* 周回9: 2本の道は押せる（見本の結果へ）。ボタンの見た目を消し、紙の縁と押した時の反応を付ける */
.demo-fig { margin: 0; min-width: 0; min-height: 44px; padding: 3px 3px 4px; font: inherit; color: inherit; text-align: center; background: rgba(255,255,255,.35); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; display: block; box-shadow: 0 2px 5px -2px rgba(40,25,5,.35); -webkit-tap-highlight-color: transparent; transition: transform .12s, box-shadow .12s; }
.demo-fig:active { transform: translateY(1px) scale(.98); box-shadow: 0 0 2px rgba(40,25,5,.3); background: rgba(255,255,255,.6); }
.demo-fig:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; }
@media (hover: hover) { .demo-fig:hover { background: rgba(255,255,255,.6); } }
.demo-fig .path-wrap { padding: 3px; border-radius: 6px; pointer-events: none; position: relative; }
/* 周回10: 右下の札「見本を見る ›」。押す前に押せると分かる。高さは取らない（絵の上に重ねる） */
.demo-tap { position: absolute; right: 6px; bottom: 1px; padding: 0 6px; font-size: 10px; font-weight: 700; line-height: 1.45; color: var(--stamp); background: #fffdf5; border: 1px solid var(--stamp); border-radius: 9px; box-shadow: 0 1px 2px rgba(40,25,5,.3); white-space: nowrap; }
.demo-tap .tap-short { display: none; }
.demo-fig .demo-cap { display: block; font-size: 11px; line-height: 1.3; color: var(--ink-soft); text-align: center; padding-top: 2px; word-break: keep-all; overflow-wrap: anywhere; }
.demo-art { overflow: hidden; }
.demo-bar, .demo-fog { opacity: 0; }
.demo-bar { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); }
.demo-art.demo-relay .demo-bar { animation: demo-bar 7s ease-in-out infinite; }
.demo-art.demo-relay .demo-fog { animation: demo-fog 7s ease-in-out infinite; }
.demo-art.demo-relay .demo-dest { animation: demo-dest 7s ease-in-out infinite; }
@keyframes demo-bar { 0%, 30% { opacity: 0; transform: scaleY(0); } 38%, 82% { opacity: 1; transform: scaleY(1); } 92%, 100% { opacity: 0; transform: scaleY(0); } }
@keyframes demo-fog { 0%, 34% { opacity: 0; } 46%, 80% { opacity: 1; } 92%, 100% { opacity: 0; } }
@keyframes demo-dest { 0%, 34% { opacity: 1; } 46%, 80% { opacity: .12; } 92%, 100% { opacity: 1; } }
/* 動きを減らす設定と共有用の画像: 門が閉じた状態で止める（閉じた門の絵と、開いたままのまっすぐな道で違いが分かる） */
.demo-art.demo-closed .demo-bar, .demo-art.demo-closed .demo-fog { animation: none; opacity: 1; transform: none; }
.demo-art.demo-closed .demo-dest { animation: none; opacity: .12; }
@media (prefers-reduced-motion: reduce) {
  .demo-art.demo-relay .demo-bar, .demo-art.demo-relay .demo-fog { animation: none !important; opacity: 1; transform: none; }
  .demo-art.demo-relay .demo-dest { animation: none !important; opacity: .12; }
}
/* 低い画面（360×640 など）: 入口を送らずに見せるため、字の札を畳む。2本の道は並べたまま残る（実測: 入口の下の端は 360×640 で約 400） */
@media (max-height: 700px) {
  .demo { margin: 2px 0 4px; }
  .demo-fig .demo-cap { display: none; }
  .demo-tap .tap-full { display: none; }
  .demo-tap .tap-short { display: inline; }
}

/* 周回8: 計測の札（F21）。札の名前は並べて出す。外す時は取り消し線 */
.track { margin: 10px 0; padding: 10px 12px; background: #f6efd9; border: 1px dashed #b9a98a; border-radius: 6px; min-width: 0; }
.track p { margin: 2px 0 6px; }
.track-title { font-weight: 700; font-size: 14px; word-break: keep-all; overflow-wrap: anywhere; }
.track-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 4px 0 6px; min-width: 0; }
.track-chip { display: inline-flex; max-width: 100%; min-width: 0; font-family: var(--mono); font-size: 12px; background: #fffdf5; border: 1px solid #cbbb98; border-radius: 3px; padding: 1px 6px; overflow-wrap: anywhere; word-break: break-all; }
.track-chip b { font-weight: 700; }
.track-chip.cut { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--stamp); color: var(--ink-soft); }
.track-more { font-size: 12px; color: var(--ink-soft); align-self: center; }
.track-explain, .track-diff { word-break: keep-all; overflow-wrap: anywhere; }
.track-state { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.track[data-stripped="true"] .track-state { color: #14584e; }
.track .toggle { width: 100%; }
/* 紙を替えて大きさが自動で替わった時の一言（大きさの札の近く） */
.paper-notice { margin: 4px 0; padding: 6px 10px; background: #fff3d0; border-left: 4px solid #d9a56a; border-radius: 3px; font-size: 13px; word-break: keep-all; overflow-wrap: anywhere; }
/* 周回8 修正: 紙替えの一言は、替えた札のそば（試す箱の大きさの札、紙の絵）に、高さを取らず重ねて出す */
.notice-slot { position: relative; height: 0; z-index: 6; }
.notice-slot .paper-notice { position: absolute; left: 0; right: 0; top: 4px; margin: 0; box-shadow: 0 4px 10px -3px rgba(40,25,5,.45); }

/* 周回9: 札を保存した瞬間の手ざわり。保存した札が小さくなって棚へ入り、次の最初の画面で新しい札だけ少し光る。動きを減らす設定では動かさない */
.fly-card { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; transform-origin: 0 0; border: 5px solid #fffdf7; border-radius: 2px; box-shadow: 0 8px 16px -4px rgba(40,25,5,.45); box-sizing: border-box; will-change: transform, opacity; }
.shelf-card.fresh { box-shadow: 0 0 0 2px var(--stamp), 0 0 14px 3px rgba(217,165,106,.85); animation: shelf-glow 2.2s ease-out 1 both; }
@keyframes shelf-glow { 0% { box-shadow: 0 0 0 2px var(--stamp), 0 0 18px 6px rgba(255,214,120,.95); } 100% { box-shadow: 0 3px 6px -2px rgba(40,25,5,.3), 0 0 0 0 rgba(217,165,106,0); } }
@media (prefers-reduced-motion: reduce) { .shelf-card.fresh { animation: none; box-shadow: 0 0 0 2px var(--stamp), 0 3px 6px -2px rgba(40,25,5,.3); } }
.entry-stripped, .shelf-stripped { color: #6b4a10; font-weight: 700; }
.shelf-stripped { font-size: 10.5px; padding: 0 8px; line-height: 1.3; }
.compare-lead { margin: 2px 0 6px; word-break: keep-all; overflow-wrap: anywhere; }
.save-stripped { margin: 2px 0 6px; padding: 4px 10px; background: #fff3d0; border-left: 4px solid #d9a56a; border-radius: 3px; font-weight: 700; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
