/* DRAW — 包み紙と荷札（P2）。色はカンプから抜いたもの */
:root {
  --kraft: #cf9f6e;
  --kraft-deep: #b98a5c;
  --paper: #f3e7d3;      /* 荷札・伝票 */
  --print: #fbf7ef;      /* 写真のふち */
  --holly: #8e2b2b;      /* ゴム印・リボン */
  --holly-deep: #6f1f1f;
  --fir: #213c2c;        /* 文字・線 */
  --fir-soft: #3d5c47;
  --ink: #1d261f;
  --line: rgba(33, 60, 44, .55);
  --font-ui: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-hand: "Klee One", "Zen Kaku Gothic New", cursive;
  --font-logo: "Dela Gothic One", "Zen Kaku Gothic New", sans-serif;
  --nav-h: 72px;
  --gutter: clamp(16px, 3.4vw, 48px);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  font-family: var(--font-ui); font-weight: 500; font-size: 16px; line-height: 1.8; color: var(--fir);
  background-color: var(--kraft);
  /* クラフト紙の繊維（SVGのノイズ） */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35  0 0 0 0 .22  0 0 0 0 .1  0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .09' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .3  0 0 0 0 .15  0 0 0 .28 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  touch-action: manipulation;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--holly); }
:focus-visible { outline: 3px solid var(--holly); outline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--paper); padding: 8px 14px; z-index: 1000; }
.skip:focus { top: 8px; }

/* ---------- ナビ ---------- */
.nav {
  height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 0 var(--gutter); border-bottom: 2px solid var(--fir);
  padding-top: env(safe-area-inset-top);
}
.logo { font-family: var(--font-logo); font-size: clamp(30px, 3.4vw, 44px); line-height: 1; letter-spacing: .01em; text-decoration: none; color: var(--fir); display: inline-flex; align-items: center; gap: 6px; }
.logo:hover { color: var(--fir); }
.holly { width: 42px; height: 28px; transform: rotate(-12deg) translateY(-6px); }
.nav nav { display: flex; align-items: center; gap: clamp(14px, 2.6vw, 40px); font-weight: 700; }
.nav nav a { text-decoration: none; padding: 10px 2px; min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; }
.nav nav a.is-current { background: var(--holly); color: var(--paper); padding: 6px 14px; min-height: 0; position: relative; }
.nav nav a.is-current::after { content: ""; position: absolute; left: 50%; bottom: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: var(--holly); transform: translateX(-50%); }
.nav .lang { border-left: 2px solid var(--fir); padding-left: clamp(14px, 2.2vw, 28px); }

/* ---------- フッター ---------- */
.foot { margin: auto var(--gutter) 0; padding: 18px 0 calc(22px + env(safe-area-inset-bottom)); border-top: 2px solid var(--fir); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 14px; }
.foot-brand { margin: 0; display: flex; gap: 16px; align-items: center; font-weight: 700; }
.logo-s { font-family: var(--font-logo); font-size: 22px; padding-right: 16px; border-right: 2px solid var(--fir); line-height: 1; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot nav a { padding: 10px 0; }
.show-sm { display: none; }

/* ---------- メイン ---------- */
.main { flex: 1; padding: 0 var(--gutter); }
.main-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px 32px; flex-wrap: wrap; padding: 22px 0 10px; }
.lead { margin: 0; font-weight: 700; font-size: clamp(22px, 2.4vw, 34px); line-height: 1.35; letter-spacing: .02em; text-wrap: balance; }
.filters { display: flex; align-items: center; gap: 0; font-weight: 700; font-size: 15px; }
.filters a { text-decoration: none; padding: 10px 12px; min-height: 44px; display: inline-flex; align-items: center; position: relative; white-space: nowrap; }
.filters a + a::before { content: "/"; position: absolute; left: -4px; color: var(--fir); opacity: .7; font-weight: 500; }
.filters a[aria-current]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 3px; background: var(--holly); border-radius: 2px; transform: rotate(-1deg); }
.filters .tag-filter { color: var(--holly); }

/* 舞台：写真（左）＋荷札とリボン（右） */
.stage {
  --maxh: max(300px, calc(100dvh - var(--nav-h) - 210px));
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 460px); gap: clamp(40px, 6vw, 110px);
  align-items: center; padding: 8px 0 28px; min-height: calc(var(--maxh) + 40px);
}
.stage-print { display: grid; place-items: center; min-width: 0; touch-action: pan-y; }

/* 写真：どんな縦横比でも、幅と高さの両方に収まるよう計算する */
.print {
  --pad: clamp(8px, 1.1vw, 16px);
  position: relative; margin: 0;
  width: min(100%, calc(var(--maxh) * var(--ar) + var(--pad) * 2));
  padding: var(--pad) var(--pad) calc(var(--pad) * 1.15);
  background: var(--print);
  box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 14px 26px -14px rgba(60, 35, 10, .55);
  transform: rotate(-2.2deg);
  transform-origin: 50% 60%;
}
.print img { width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: contain; background: #e9dfcf; }
.tape { position: absolute; width: clamp(56px, 7vw, 110px); height: clamp(20px, 2.2vw, 32px); background: rgba(246, 240, 226, .62); box-shadow: 0 0 0 1px rgba(255,255,255,.15) inset; z-index: 2; }
.tape-a { left: -18px; top: 14px; transform: rotate(-32deg); }
.tape-b { right: 22%; bottom: -12px; transform: rotate(8deg); }
.sample-mark { position: absolute; right: calc(var(--pad) + 6px); bottom: 2px; font: 700 11px/1 var(--font-ui); letter-spacing: .18em; color: #6b5b48; }

/* 荷札 */
.stage-side { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.tag-wrap { position: relative; filter: drop-shadow(0 10px 14px rgba(60, 35, 10, .3)); transform: rotate(1.2deg); }
.tag {
  position: relative; background: var(--paper); color: var(--fir);
  padding: 36px 30px 26px 64px;
  clip-path: polygon(34px 0, 100% 0, 100% 100%, 34px 100%, 0 calc(100% - 34px), 0 34px);
}
.tag::before { /* 紙のむら */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(120% 80% at 10% 0%, rgba(255,255,255,.6), transparent 60%), radial-gradient(90% 70% at 100% 100%, rgba(160,120,70,.18), transparent 70%);
}
.hole { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; background: var(--kraft-deep); box-shadow: 0 0 0 5px #b5463f, inset 0 2px 3px rgba(0,0,0,.35); }
/* 紐：穴から左上へ出て、写真の角へ向かう */
.string { position: absolute; left: -132px; top: calc(50% - 64px); width: 160px; height: 120px; pointer-events: none; z-index: 2; display: none; }
.tag-title { margin: 0 0 6px; font: 600 clamp(28px, 2.7vw, 40px)/1.3 var(--font-hand); letter-spacing: .02em; border-bottom: 1.5px solid var(--line); padding-bottom: 6px; word-break: keep-all; word-break: auto-phrase; overflow-wrap: anywhere; text-wrap: balance; }
.tag-creator { margin: 0 0 10px; font: 600 22px/1.5 var(--font-hand); overflow-wrap: anywhere; }
.tag-tool { margin: -4px 0 8px; font-size: 14px; }
.tag-comment { margin: 0 0 12px; font: 600 17px/1.9 var(--font-hand); overflow-wrap: anywhere; }
.tag-links { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 20px; font-weight: 700; }
.tag-links a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: underline; text-decoration-color: var(--line); }
.tag-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.tag-more { font-size: 14px; font-weight: 700; padding: 10px 0; }

/* ゴム印（AI表示）：題材の「押した跡」。文字はかすれさせても読める濃さを保つ */
/* 浮かせて置くので、ラベルが長くてもタイトルと重ならない */
.stamp {
  float: right; position: relative; margin: -8px -6px 8px 14px;
  font: 400 23px/1 var(--font-logo); color: var(--holly); letter-spacing: .02em;
  border: 3px solid currentColor; border-radius: 6px; padding: 8px 10px 7px;
  transform: rotate(-9deg); filter: url(#ink); mix-blend-mode: multiply;
  white-space: nowrap; max-width: 60%;
}
.stamp-partial { font-size: 19px; padding: 8px 9px 7px; transform: rotate(-6deg); }
.stamp-full { color: #7a2222; }

.btn-line { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 2px solid var(--fir); border-radius: 10px; background: transparent; font-weight: 700; transition: background-color .15s ease-out, color .15s ease-out, transform .1s ease-out; }
.btn-line svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn-line:hover { background: rgba(33, 60, 44, .08); }
.btn-line:active { transform: scale(.97); }
.like[aria-pressed="true"] { color: var(--holly); border-color: var(--holly); }
.like[aria-pressed="true"] svg { fill: currentColor; }

/* リボンのボタン */
.ribbon {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%;
  min-height: 112px; padding: 10px 40px; border: 0; text-decoration: none;
  color: #fbf1e4; background-color: var(--holly);
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 3px), repeating-linear-gradient(0deg, rgba(0,0,0,.07) 0 1px, transparent 1px 3px), linear-gradient(180deg, rgba(255,255,255,.1), rgba(0,0,0,.14));
  clip-path: polygon(0 0, 100% 0, 93% 50%, 100% 100%, 0 100%, 7% 50%);
  filter: drop-shadow(0 8px 10px rgba(80, 20, 15, .35));
  transform: rotate(-1.5deg);
  transition: transform .16s ease-out, background-color .16s ease-out;
}
.ribbon:hover { background-color: #9c3030; color: #fff; }
.ribbon:active { transform: rotate(-1.5deg) scale(.97); }
.ribbon-main { font: 400 clamp(40px, 3.6vw, 54px)/1.05 var(--font-logo); letter-spacing: .08em; }
.ribbon-sub { font-weight: 700; font-size: 17px; letter-spacing: .1em; }
.ribbon-s { min-height: 72px; max-width: 360px; }
.ribbon-s .ribbon-main { font-size: 28px; }
.hint { margin: 10px 0 0; font-size: 13px; text-align: center; display: none; }
.draw-bar { padding: 0 6px; }

/* 引いたときの動き（1か所だけ）：古い写真が包みから外れ、新しい写真が置かれる */
.print.is-out { animation: out .2s cubic-bezier(.4, 0, 1, 1) forwards; }
.print.is-in { animation: in .38s cubic-bezier(.2, .8, .2, 1); }
@keyframes out { to { opacity: 0; transform: translate(-28px, 10px) rotate(-7deg); } }
@keyframes in { from { opacity: 0; transform: translateY(18px) rotate(1.5deg) scale(.985); } }
.tag.is-swap { animation: tagin .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes tagin { from { opacity: .2; transform: rotate(3deg) translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  .print.is-out, .print.is-in, .tag.is-swap { animation: none; }
  .ribbon, .btn-line { transition: none; }
}

.empty { padding: 80px 0; max-width: 560px; }
.empty p { font-size: 20px; font-weight: 700; }

/* ---------- 作品ページ ---------- */
.main.detail { padding-top: 18px; padding-bottom: 40px; }
.crumbs { display: flex; gap: 18px; align-items: center; font-weight: 700; margin: 0 0 18px; flex-wrap: wrap; }
.crumbs a { padding: 10px 0; }
.crumbs span { padding-left: 18px; border-left: 2px solid var(--fir); font-weight: 500; }
.detail .stage { min-height: 0; }
.share { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 8px; }
.report-link { background: none; border: 0; padding: 10px 0; text-decoration: underline; font-size: 14px; font-weight: 700; color: var(--fir); }
.tag-chips { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; font-weight: 700; }
.tag-chips a { display: inline-flex; min-height: 36px; align-items: center; }
.others { border-top: 2px solid var(--fir); margin-top: 26px; padding-top: 14px; }
.others h2 { margin: 0 0 14px; font-size: 20px; }
.others ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; align-items: start; }
.others a { text-decoration: none; display: block; }
.others .thumb { background: var(--print); padding: 7px; box-shadow: 0 8px 14px -10px rgba(60,35,10,.6); }
.others img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.others .cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; margin-top: 8px; font-weight: 700; }
.others .cap b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mini-stamp { flex: none; font: 400 13px/1 var(--font-logo); color: var(--holly); border: 2px solid currentColor; border-radius: 4px; padding: 5px 6px 4px; transform: rotate(-6deg); filter: url(#ink); }

dialog { border: 0; padding: 0; background: transparent; max-width: min(520px, calc(100vw - 32px)); width: 100%; overscroll-behavior: contain; }
dialog::backdrop { background: rgba(29, 38, 31, .55); }
.sheet { background: var(--paper); padding: 26px 26px 22px; box-shadow: 0 20px 40px rgba(0,0,0,.3); }
.sheet h2 { margin: 0 0 12px; font-size: 22px; }

/* ---------- フォーム（登録・編集・通報・管理） ---------- */
.p-submit .main, .p-edit .main { padding-bottom: 40px; }
.form-head { padding: 26px 0 18px; }
.form-head h1 { margin: 0; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.25; letter-spacing: .02em; }
.form-head p { margin: 4px 0 0; font-weight: 700; }
.submit-grid { display: grid; grid-template-columns: minmax(280px, 5fr) minmax(0, 10fr); gap: clamp(24px, 3vw, 44px); align-items: start; }
.drop-tag {
  position: relative; background: var(--paper); padding: 70px 26px 30px;
  clip-path: polygon(14% 0, 86% 0, 100% 9%, 100% 100%, 0 100%, 0 9%);
  filter: drop-shadow(0 10px 14px rgba(60,35,10,.3)); transform: rotate(-1deg);
}
.drop-tag .hole { left: 50%; top: 34px; margin-left: -11px; margin-top: 0; }
.drop { position: relative; display: grid; place-items: center; text-align: center; gap: 6px; min-height: 300px; padding: 22px 16px; border: 2px dashed var(--fir-soft); border-radius: 10px; }
.drop.is-over { background: rgba(142, 43, 43, .07); border-color: var(--holly); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop svg { width: 46px; height: 46px; stroke: var(--fir); fill: none; stroke-width: 2.2; }
.drop strong { font-size: 20px; }
.drop small { font-size: 14px; line-height: 1.6; }
.drop .btn-line { pointer-events: none; }
.drop-empty { display: grid; justify-items: center; gap: 8px; }
.preview { display: none; width: 100%; }
.has-file .preview { display: block; }
.has-file .drop-empty { display: none; }
.preview .print { --maxh: 320px; transform: rotate(-1.5deg); margin: 0 auto; }
.preview p { text-align: center; font-size: 13px; margin: 14px 0 0; overflow-wrap: anywhere; }
.wrap-note { margin: 22px 0 0 34%; font: 600 20px/1.4 var(--font-hand); transform: rotate(-4deg); text-decoration: underline wavy var(--holly) 1.5px; text-underline-offset: .4em; }

.slip { position: relative; background: var(--paper); padding: 30px clamp(18px, 3vw, 40px) 30px; box-shadow: 0 14px 24px -14px rgba(60,35,10,.55);
  -webkit-mask: radial-gradient(circle 5px at 50% 0, transparent 98%, #000) 0 0 / 14px 100% repeat-x, linear-gradient(#000,#000);
}
.slip-head { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid var(--fir); padding-bottom: 12px; margin-bottom: 18px; }
.slip-head h2 { margin: 0; font-size: clamp(22px, 2vw, 28px); }
.slip-stamp { font: 400 18px/1 var(--font-logo); color: var(--holly); border: 2.5px solid currentColor; padding: 6px 8px 5px; transform: rotate(-5deg); filter: url(#ink); }
.airmail { margin-left: auto; width: 150px; height: 18px; background: repeating-linear-gradient(-45deg, var(--fir-soft) 0 14px, transparent 14px 22px, var(--holly) 22px 36px, transparent 36px 44px); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 26px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label, .field > .lbl { display: block; font-weight: 700; margin-bottom: 4px; }
.req { display: inline-block; margin-left: 8px; font-size: 12px; line-height: 1; padding: 3px 5px; color: var(--holly); border: 1.5px solid currentColor; border-radius: 3px; vertical-align: 2px; }
.opt { font-weight: 500; font-size: 13px; margin-left: 6px; }
.help { margin: 4px 0 0; font-size: 13px; line-height: 1.6; }
input[type=text], input[type=url], input[type=email], input[type=password], textarea, select {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fffaf1; border: 2px solid var(--fir-soft); border-radius: 6px; padding: 10px 12px; min-height: 46px;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(142,43,43,.55); outline-offset: 1px; border-color: var(--holly); }
.sns-list { display: grid; gap: 8px; }
.err { color: #8b1f1f; font-weight: 700; font-size: 14px; margin: 4px 0 0; }
.field.has-err input, .field.has-err textarea { border-color: #8b1f1f; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 2px solid var(--holly); border-radius: 8px; color: var(--holly); font-weight: 700; background: #fffaf1; }
.choice span::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; }
.choice input:checked + span { background: var(--holly); color: #fbf1e4; }
.choice input:checked + span::before { background: #fbf1e4; box-shadow: inset 0 0 0 3px var(--holly); }
.choice input:focus-visible + span { outline: 3px solid var(--fir); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1.5px solid var(--fir-soft); border-radius: 999px; font-size: 14px; font-weight: 700; background: #fffaf1; }
.chip input:checked + span { background: var(--fir); color: var(--paper); border-color: var(--fir); }
.chip input:focus-visible + span { outline: 3px solid var(--holly); outline-offset: 2px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 700; min-height: 44px; padding-top: 8px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--holly); flex: none; }
.form-send { margin-top: 24px; display: grid; justify-items: center; gap: 8px; }
.check.remember { margin-top: 16px; font-weight: 400; }
.autofill { margin: 0 0 12px; }
.link-btn { background: none; border: 0; padding: 4px 2px; font: inherit; color: var(--holly); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 32px; }
.form-send .ribbon { max-width: 620px; min-height: 76px; clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%); }
.form-send .ribbon-main { font-size: clamp(26px, 2.4vw, 34px); }
.form-send p { margin: 0; font-weight: 700; }
.alert { background: #fff3ea; border-left: 5px solid #8b1f1f; padding: 12px 16px; margin: 0 0 18px; font-weight: 700; }
.notice { background: var(--paper); padding: 26px; max-width: 640px; box-shadow: 0 14px 24px -14px rgba(60,35,10,.55); }
.notice h1 { margin: 0 0 8px; font-size: 28px; }
.ribbon.is-busy { opacity: .75; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 22px; }
.stat { background: var(--paper); padding: 14px 16px; }
.stat dt { font-size: 13px; font-weight: 700; }
.stat dd { margin: 0; font: 400 32px/1.2 var(--font-logo); font-variant-numeric: tabular-nums; }
.danger { margin-top: 28px; padding-top: 18px; border-top: 2px dashed var(--line); }
.btn-danger { min-height: 44px; padding: 0 18px; border: 2px solid #8b1f1f; color: #8b1f1f; background: #fffaf1; border-radius: 8px; font-weight: 700; }

/* 文章ページ */
.doc { max-width: 760px; background: var(--paper); padding: clamp(22px, 4vw, 48px); margin: 26px 0 40px; box-shadow: 0 14px 24px -14px rgba(60,35,10,.55); }
.doc h1 { margin: 0 0 18px; font-size: clamp(26px, 3vw, 36px); line-height: 1.3; }
.doc h2 { font-size: 20px; margin: 28px 0 6px; }
.doc p, .doc li { line-height: 1.9; }

/* 管理画面 */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0; }
.admin-tabs a { padding: 8px 16px; background: var(--paper); text-decoration: none; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.admin-tabs a[aria-current] { background: var(--fir); color: var(--paper); }
.queue { display: grid; gap: 18px; }
.q-item { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; background: var(--paper); padding: 16px; }
.q-item img { width: 100%; height: 220px; object-fit: contain; background: #e9dfcf; }
.q-item dl { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 14px; font-size: 14px; }
.q-item dt { font-weight: 700; }
.q-item dd { margin: 0; overflow-wrap: anywhere; }
.q-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.q-actions button { min-height: 44px; padding: 0 16px; border-radius: 8px; font-weight: 700; border: 2px solid var(--fir); background: #fffaf1; }
.q-actions .ok { background: var(--fir); color: var(--paper); }

/* ---------- スマホ・タブレット ---------- */
@media (max-width: 900px) {
  :root { --nav-h: 60px; }
  .hide-sm, .nav nav a.hide-sm { display: none; }
  .show-sm { display: inline; }
  .holly { width: 34px; height: 22px; }
  .main-head { padding: 14px 0 4px; }
  .lead { font-size: 20px; }
  .filters { width: calc(100% + var(--gutter) * 2); margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; font-size: 14px; }
  .filters::-webkit-scrollbar { display: none; }
  .filters a:first-child { padding-left: 0; }
  .filters a:first-child[aria-current]::after { left: 0; }
  .stage { --maxh: min(56dvh, 560px); grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 12px; min-height: 0; }
  .stage-side { gap: 0; }
  .tag-wrap { margin: -22px 4px 0 12px; z-index: 3; }
  .tag { padding: 26px 18px 16px 50px; clip-path: polygon(26px 0, 100% 0, 100% 100%, 26px 100%, 0 calc(100% - 26px), 0 26px); }
  .hole { left: 14px; width: 16px; height: 16px; margin-top: -8px; box-shadow: 0 0 0 4px #b5463f, inset 0 2px 3px rgba(0,0,0,.35); }
  .tag-title { font-size: 24px; }
  .tag-creator { font-size: 19px; }
  .stamp { font-size: 19px; margin: -6px -4px 6px 10px; }
  .stamp-partial { font-size: 16px; }
  /* リボンは画面の下に固定して、いつでも押せるようにする */
  .p-main .draw-bar { position: sticky; bottom: 0; z-index: 20; margin: 14px calc(var(--gutter) * -1) 0; padding: 10px var(--gutter) calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(207,159,110,0), var(--kraft) 30%); }
  .ribbon { min-height: 74px; flex-direction: row; gap: 14px; }
  .ribbon-main { font-size: 32px; }
  .ribbon-sub { font-size: 15px; }
  .hint { display: block; margin-top: 2px; font-size: 12px; }
  .submit-grid { grid-template-columns: minmax(0, 1fr); }
  .drop { min-height: 200px; }
  .wrap-note { margin: 14px 0 0 18%; font-size: 17px; }
  .others ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-item { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .airmail { display: none; }
  .crumbs span { display: none; }
  .nav nav { gap: 14px; font-size: 14px; }
  .nav .lang { padding-left: 14px; }
  .nav nav a.is-current { padding: 5px 10px; }
  .foot { font-size: 13px; }
  .foot-brand span:last-child { display: none; }
}
@media (min-width: 901px) {
  .string { display: block; }
}

/* ---------- 使い方（荷札のポップアップ） ---------- */
.nav nav .nav-help { font: inherit; font-weight: 700; color: inherit; background: none; border: 0; padding: 10px 2px; min-height: 44px; cursor: pointer; white-space: nowrap; text-decoration: underline; text-decoration-style: wavy; text-decoration-color: var(--holly); text-underline-offset: 6px; }
.help-dlg { max-width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: visible; }
.help-dlg[open] { animation: help-in .22s ease-out; }
@keyframes help-in { from { opacity: 0; transform: translateY(12px) rotate(1.5deg); } }
.help-tag {
  position: relative; background: var(--paper); color: var(--fir);
  padding: 64px clamp(20px, 5vw, 34px) 24px; max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain;
  clip-path: polygon(12% 0, 88% 0, 100% 7%, 100% 100%, 0 100%, 0 7%);
  transform: rotate(-.8deg);
}
.help-tag .hole { left: 50%; top: 26px; margin-left: -11px; margin-top: 0; }
.help-tag h2 { margin: 0 0 16px; font: 400 clamp(24px, 6vw, 30px)/1.2 var(--font-logo); letter-spacing: .04em; text-align: center; }
.help-main { background: var(--print); border: 2px solid var(--fir); padding: 18px 18px 14px; margin-bottom: 18px; }
.help-ribbon { display: inline-block; background: var(--holly); color: var(--paper); font: 400 26px/1 var(--font-logo); letter-spacing: .1em; padding: 10px 26px 9px; margin-bottom: 12px; clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%); }
.help-main p { margin: 0; line-height: 1.85; }
.help-main b { display: block; font-size: 18px; line-height: 1.6; margin-bottom: 4px; word-break: auto-phrase; }
.help-main .help-alt { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--fir); font-size: 14px; }
.help-list { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; line-height: 1.75; }
.help-list dt { font-weight: 700; padding-top: 1px; white-space: nowrap; }
.help-list dt::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--holly); transform: rotate(45deg); margin: 0 8px 2px 0; }
.help-list dd { margin: 0; font-size: 15px; }
.help-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.help-go { background: var(--fir); color: var(--paper); text-decoration: none; }
@media (max-width: 600px) {
  .help-list { grid-template-columns: 1fr; gap: 2px; }
  .help-list dd { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) { .help-dlg[open] { animation: none; } }
