/* 作る画面。テーマの見た目に引きずられないよう、.tpk の中だけで完結させます。 */
.tpk{
  /* 色は子テーマの --tp-… を借りる（サイト全体で1か所）。子テーマが無いときは右の値 */
  --paper:var(--tp-kinari,#F2ECE0); --paper-hi:var(--tp-kinari-hi,#FAF6EE); --ink:var(--tp-ink,#22201C); --ink-sub:var(--tp-ink-sub,#5C574D);
  --rule:var(--tp-rule,#D8CFBE); --green:var(--tp-green,#2F4F43); --vermilion:var(--tp-vermilion,#9B4A33);
  color:var(--ink); font-size:1rem; line-height:1.8;
}
.tpk *{box-sizing:border-box}
.tpk [hidden]{display:none!important}

/*
 * 並べ方は制作画面モック（mock_19）に合わせる。
 *   広い画面：左に見本（スクロールしても付いてくる）、右に手順のパネル（392px）
 *   狭い画面：見本を上に小さく貼りつけ、その下で手順を進める。
 *             写真を選ぶまでは見本を出さない（空の枠で画面を取らない）
 */
.tpk-cols{display:grid;grid-template-columns:minmax(0,1fr) 392px;gap:28px;align-items:start}
.tpk-stagewrap{grid-column:1;grid-row:1;position:sticky;top:calc(var(--tpk-top,0px) + 20px)}
.tpk-steps{grid-column:2;grid-row:1;min-width:0;background:var(--paper-hi);border:1px solid var(--rule)}

/* 手順 */
.tpk-step{border-bottom:1px solid var(--rule);padding:18px 20px}
.tpk-step:last-child{border-bottom:0}
.tpk-step[aria-disabled="true"]{opacity:.42;pointer-events:none}
.tpk-step h2{display:flex;align-items:center;gap:9px;font-size:.9rem;font-weight:700;margin:0 0 10px;line-height:1.5}
.tpk-step h2 i{font-style:normal;font-size:.66rem;letter-spacing:.1em;color:var(--tp-white,#fff);background:var(--green);
  padding:2px 7px;border-radius:1px}
.tpk-note{font-size:.76rem;color:var(--ink-sub);margin:6px 0 0;line-height:1.7}
.tpk-field{margin:0 0 14px}
.tpk-field:last-child{margin-bottom:0}
/* 錦絵の切り方は、組み方の説明のすぐ下に来るので、説明の続きに見えないよう少しあける（確認係） */
#tpk-tpldesc + #tpk-trimrow{margin-top:14px}
.tpk-field label{display:block;font-size:.74rem;color:var(--ink-sub);margin-bottom:5px}
#tpk-size{margin-top:10px}
/* 端末の4つは1行に同じ幅で。1つだけ次の行に落ちると、別の種類の選択肢に見える */
#tpk-use{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
#tpk-use .tpk-opt{padding:9px 4px;white-space:nowrap;text-align:center}
/* 狭いスマホでは 2×2 に（1行だと「わからない」が切れる） */
@container tpk (max-width:400px){#tpk-use{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:420px){#tpk-use{grid-template-columns:repeat(2,minmax(0,1fr))}}
.tpk input[type=text],.tpk input[type=search],.tpk select{
  width:100%;min-height:44px;padding:10px 10px;border:1px solid var(--rule);background:var(--tp-white,#fff);
  border-radius:2px;font-size:.88rem;color:var(--ink);font-family:inherit
}
.tpk-find{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.tpk-find input{grid-column:1 / -1}

/* 選択肢。指で押せる高さ（44px。サイトのボタンの決まり）をそろえる */
.tpk-opts{display:flex;flex-wrap:wrap;gap:7px}
.tpk-opt{
  min-height:44px;padding:10px 15px;border:1px solid var(--rule);background:var(--tp-white,#fff);color:var(--ink-sub);
  border-radius:2px;font-size:.8rem;cursor:pointer;line-height:1.4;font-family:inherit
}
.tpk-opt:hover:not(:disabled){border-color:var(--green)}
.tpk-opt[aria-pressed="true"]{background:var(--green);border-color:var(--green);color:var(--tp-white,#fff);font-weight:500}
.tpk-opt:disabled{opacity:.38;cursor:not-allowed}
.tpk-opt:focus-visible,.tpk-btn:focus-visible,.tpk-card:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.tpk-toggle{display:flex;align-items:center;gap:8px;font-size:.78rem;color:var(--ink-sub);margin-top:12px}
.tpk-lock{display:flex;gap:8px;align-items:flex-start;font-size:.74rem;color:var(--ink-sub);line-height:1.7;
  background:var(--tp-kinari-mid,#F1EADC);border-left:2px solid var(--green);padding:9px 11px;margin-top:12px}

/* 1 写真を選ぶ */
.tpk-picked{display:flex;gap:12px;align-items:flex-start}
.tpk-picked img{width:88px;height:64px;object-fit:cover;border:1px solid var(--rule);flex:none;background:var(--tp-kinari-deep,#E6DED0)}
.tpk-pk-name{margin:0 0 2px;font-weight:700;font-size:.88rem;line-height:1.4}
.tpk-picked dl{margin:0;font-size:.74rem;color:var(--ink-sub);display:grid;grid-template-columns:auto 1fr;gap:1px 9px;line-height:1.6}
.tpk-picked dt{color:var(--tp-ink-mute,#6B6559)}
.tpk-picked dd{margin:0}
.tpk-rights{margin:10px 0 0;font-size:.72rem;color:var(--ink-sub);line-height:1.7;
  background:var(--tp-kinari-mid,#F1EADC);border-left:2px solid var(--green);padding:8px 10px}
#tpk-findbox{margin-top:12px}
.tpk-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:8px;margin-top:10px}
.tpk-card{border:1px solid var(--rule);background:var(--tp-white,#fff);padding:0;cursor:pointer;text-align:left;font-family:inherit}
.tpk-card:hover{border-color:var(--green)}
.tpk-card[aria-pressed="true"]{outline:2px solid var(--green);outline-offset:-2px}
.tpk-card img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;background:var(--paper)}
.tpk-card b{display:block;font-size:.76rem;font-weight:600;padding:6px 7px 0;line-height:1.35}
.tpk-card span{display:block;font-size:.68rem;color:var(--ink-sub);padding:1px 7px 7px}

/* 見本 */
.tpk-stage{background:var(--tp-kinari-deep,#E6DFD2);border:1px solid var(--rule);padding:26px;
  display:flex;flex-direction:column;justify-content:center;align-items:center;gap:16px;min-height:440px}
.tpk-ph{font-size:.84rem;color:var(--ink-sub);text-align:center;line-height:1.8;max-width:26em}
.tpk-frame{position:relative;box-shadow:0 8px 30px rgba(0,0,0,.22);line-height:0}
.tpk-frame canvas{display:block;width:100%;height:auto}
.tpk-frame.v{width:min(260px,60vw)}
.tpk-frame.h{width:min(520px,100%)}
.tpk-stagewrap > .tpk-note{text-align:center;font-size:.74rem}

/* 5 保存する */
.tpk-btn{
  display:flex;align-items:center;justify-content:center;width:100%;min-height:48px;padding:13px 18px;
  border:1px solid var(--green);background:var(--green);color:var(--tp-white,#fff);border-radius:2px;
  font-size:.9rem;font-weight:500;cursor:pointer;margin-top:10px;font-family:inherit
}
.tpk-btn:hover:not(:disabled){background:var(--tp-green-hi,#3C6454)}
.tpk-btn:disabled{opacity:.4;cursor:not-allowed}
.tpk-alt{display:inline-block;margin-top:10px;padding:0;border:0;background:none;font-family:inherit;
  color:var(--ink-sub);font-size:.78rem;text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:var(--tp-ul-offset,.45em); text-decoration-color:var(--tp-ul-color);cursor:pointer}

/*
 * 狭いとき。**画面の幅ではなく、置かれた場所の幅で**切り替えます。
 * テーマによっては、広い画面でも本文が 620px ほどに絞られます。画面の幅で決めると、
 * その狭い箱に2列を押し込んで詰まります（Twenty Twenty-Four で起きた）。
 * @container が効かない古いブラウザ（iOS 15 など）のために、画面の幅での切り替えも残します。
 */
.tpk{container-type:inline-size;container-name:tpk}
@container tpk (max-width:780px){
  .tpk-cols{grid-template-columns:1fr;gap:16px}
  .tpk-steps,.tpk-stagewrap{grid-column:1;grid-row:auto}
  .tpk-stagewrap{order:-1;display:none;z-index:5;top:var(--tpk-top,0px)}
  .tpk.tpk-has .tpk-stagewrap,.tpk.tpk-wait .tpk-stagewrap{display:block}
  /* 写真を読み込んでいる間も、見本と同じ高さの場所を取っておく（入ったときに下が押し下げられないように） */
  .tpk.tpk-wait:not(.tpk-has) .tpk-ph{min-height:min(34vh,280px);min-height:min(34dvh,280px);display:flex;align-items:center;justify-content:center}
  .tpk-stage{min-height:0;padding:10px;gap:6px;box-shadow:0 6px 16px rgba(0,0,0,.08)}
  /* 高さで大きさを決める。縦長の見本が画面を占領しないように */
  .tpk-frame.v{width:auto}
  .tpk-frame.v canvas{height:min(34vh,280px);height:min(34dvh,280px);width:auto}
  .tpk-frame.h{width:100%}
  .tpk-stagewrap > .tpk-note{background:var(--paper);margin:0;padding:4px 8px}
}
@media (max-width:900px){
  .tpk-cols{grid-template-columns:1fr;gap:16px}
  .tpk-steps,.tpk-stagewrap{grid-column:1;grid-row:auto}
  .tpk-stagewrap{order:-1;display:none;z-index:5;top:var(--tpk-top,0px)}
  .tpk.tpk-has .tpk-stagewrap,.tpk.tpk-wait .tpk-stagewrap{display:block}
  /* 写真を読み込んでいる間も、見本と同じ高さの場所を取っておく（入ったときに下が押し下げられないように） */
  .tpk.tpk-wait:not(.tpk-has) .tpk-ph{min-height:min(34vh,280px);min-height:min(34dvh,280px);display:flex;align-items:center;justify-content:center}
  .tpk-stage{min-height:0;padding:10px;gap:6px;box-shadow:0 6px 16px rgba(0,0,0,.08)}
  /* 高さで大きさを決める。縦長の見本が画面を占領しないように */
  .tpk-frame.v{width:auto}
  .tpk-frame.v canvas{height:min(34vh,280px);height:min(34dvh,280px);width:auto}
  .tpk-frame.h{width:100%}
  .tpk-stagewrap > .tpk-note{background:var(--paper);margin:0;padding:4px 8px}
}

/* 時計とアイコンの目安。--u は canvas の幅から JS が入れます */
.tpk-ov{position:absolute;inset:0;pointer-events:none;display:none}
.tpk-ov.on{display:block}
.tpk-ov .clock{position:absolute;top:7%;left:0;right:0;text-align:center;color:#fff;
  font-size:calc(11 * var(--u));font-weight:300;text-shadow:0 1px 6px rgba(0,0,0,.45);line-height:1.2}
.tpk-ov .dock{position:absolute;left:8%;right:8%;bottom:2.5%;height:calc(13 * var(--u));
  border-radius:calc(4.5 * var(--u));background:rgba(255,255,255,.22);backdrop-filter:blur(4px)}
.tpk-ov .row{position:absolute;left:9%;right:9%;bottom:calc(2.5% + calc(16 * var(--u)));
  display:flex;justify-content:space-between}
.tpk-ov .row i{display:block;width:calc(15 * var(--u));height:calc(15 * var(--u));
  border-radius:calc(3.4 * var(--u));background:rgba(255,255,255,.20);position:relative}
.tpk-ov .row i::after{content:"";position:absolute;left:12%;right:12%;top:calc(100% + calc(1.6 * var(--u)));
  height:calc(2 * var(--u));border-radius:calc(1 * var(--u));background:rgba(255,255,255,.26)}
.tpk-ov .home{position:absolute;left:50%;transform:translateX(-50%);bottom:1.1%;width:35%;
  height:calc(.9 * var(--u));border-radius:calc(.5 * var(--u));background:rgba(255,255,255,.55)}
.tpk-frame.h .tpk-ov .clock,.tpk-frame.h .tpk-ov .row,.tpk-frame.h .tpk-ov .home{display:none}
.tpk-frame.h .tpk-ov .dock{left:auto;right:2%;bottom:auto;top:4%;
  width:calc(6 * var(--u));height:calc(22 * var(--u));border-radius:calc(1 * var(--u))}

.tpk-thanks{padding:22px 20px 20px}
.tpk-thanks h2{font-size:1.15rem;margin:0 0 6px}
.tpk-done{font-size:1.6rem!important;line-height:1.5;color:var(--green)}
.tpk-thanks h3{font-size:.92rem;margin:26px 0 6px;font-weight:600}
.tpk-thanks .tpk-note{margin:4px 0 0}

/* 押せるものは、幅をそろえて並べる。文字数でばらけると押しにくい */
.tpk-share{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px;margin:12px 0 0}
.tpk-share a,.tpk-share button{
  display:block;padding:10px 6px;border:1px solid var(--rule);background:var(--tp-white,#fff);color:var(--ink-sub);
  border-radius:3px;font-size:.82rem;text-decoration:none;text-align:center;cursor:pointer;
  line-height:1.4;font-family:inherit
}
.tpk-share a:hover,.tpk-share button:hover{border-color:var(--green);color:var(--green)}

/* 引用の箱は block で。インラインのままだと、折り返しで行が重なる */
.tpk-quote{display:block;background:var(--paper-hi);border:1px solid var(--rule);
  padding:12px 14px;border-radius:3px;white-space:pre-wrap;overflow-wrap:anywhere;
  font-size:.82rem;line-height:1.9;color:var(--ink)}
.tpk-again{margin-top:30px}
/* 保存のあとの「この場所をもっと知る」（改善案28） */
.tpk-thx-more{margin-top:30px}
.tpk-thx-rows{list-style:none; margin:8px 0 0; padding:0; border-top:1px solid var(--rule)}
.tpk-thx-rows a{display:flex; align-items:center; gap:12px; min-height:52px; border-bottom:1px solid var(--rule); color:var(--ink); text-decoration:none}
.tpk-thx-rows b{font-family:var(--tp-mincho,serif); font-weight:500; letter-spacing:.06em}
.tpk-thx-rows small{margin-left:auto; font-size:.75rem; color:var(--ink-sub,#5C574D)}
.tpk-thx-rows span{width:1em; text-align:center; color:var(--ink-sub,#5C574D)}
.tpk-thx-rows a:hover b{text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:var(--tp-ul-offset,.45em); text-decoration-color:var(--tp-ul-color-hover);}

/* ギャラリー */
.tpk-gal-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:18px;margin-top:14px}
.tpk-gal-item{display:block;text-decoration:none;color:inherit}
/* 元の写真を正方形に。縦いっぱいに合わせ、左右は切れてよい */
.tpk-gal-item img{display:block;width:100%;height:auto;aspect-ratio:1/1;object-fit:cover;object-position:center;
  background:var(--paper);border:1px solid var(--rule)}
.tpk-gal-item b{display:block;font-size:.84rem;font-weight:600;margin-top:8px;line-height:1.4}
.tpk-gal-item span{display:block;font-size:.7rem;color:var(--ink-sub)}
.tpk-gal-item:hover img{border-color:var(--green)}
.tpk-gal-nav{display:flex;gap:18px;justify-content:center;margin-top:30px;font-size:.86rem}

.tpk-err{color:var(--vermilion)}
.tpk-small{display:inline-block;margin-top:4px;font-size:.78rem;color:var(--ink-sub)}

/*
 * 作品をもとに作っているときの知らせ。**控えめに。**
 * 以前は緑の太い枠と大きなボタンで、手順より目立っていました。
 * ここは「何をもとにしているか」を知らせるだけ。選ぶのは「5 保存する」で。
 */
.tpk-fixbar{margin:0 0 16px;padding:10px 14px;background:var(--paper-hi);border:1px solid var(--rule);border-radius:2px}
.tpk-fixbar p{margin:0;font-size:.82rem;line-height:1.7;display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px}
.tpk-fixbar .tpk-note{margin-top:2px;font-size:.74rem}
.tpk-fixtag{font-size:.68rem;letter-spacing:.06em;color:var(--green);border:1px solid var(--green);border-radius:2px;padding:0 6px;line-height:1.7}
.tpk-fixback{margin-left:auto;font-size:.76rem;color:var(--ink-sub)}

/* 5 保存する の中の、もう一つの保存のしかた */
.tpk-fixalt{margin-top:18px;padding-top:14px;border-top:1px dashed var(--rule)}
.tpk-fixalt-h{margin:0;font-size:.8rem;font-weight:600;color:var(--ink)}
.tpk-btn-line{background:var(--tp-white,#fff);color:var(--green);min-height:44px;font-size:.84rem}
.tpk-btn-line:hover:not(:disabled){background:var(--tp-green-pale,#EDF2EA)}

/* 保存ボタンの下の小さな注記（端末名・規約）。フレックスにしない：文の途中で段に割れるため */
.tpk-fine{margin-top:10px;font-size:.72rem;line-height:1.7;color:var(--ink-sub)}
.tpk-fine p{margin:0}
.tpk-fine p + p{margin-top:4px}
.tpk-fine a{color:inherit;text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:var(--tp-ul-offset,.45em); text-decoration-color:var(--tp-ul-color);}
.tpk-nw{white-space:nowrap}

/* 規約とポリシーへの同意。文とリンクを span にまとめ、フレックスで段に割れないように */
.tpk-agree{display:flex;gap:10px;align-items:flex-start;margin:14px 0 6px;padding:10px 12px;border:1px solid var(--rule);border-radius:6px;
  background:var(--paper-hi);font-size:.82rem;line-height:1.6;color:var(--ink);cursor:pointer}
.tpk-agree input{flex:none;width:18px;height:18px;margin:2px 0 0;accent-color:var(--green);cursor:pointer}
.tpk-agree span{flex:1;min-width:0}
.tpk-agree a{color:var(--green);text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:var(--tp-ul-offset,.45em); text-decoration-color:var(--tp-ul-color);}
.tpk-agree.tpk-need{border-color:var(--vermilion);box-shadow:0 0 0 2px rgba(155,74,51,.25)}
#tpk-s5.tpk-noagree #tpk-save,#tpk-s5.tpk-noagree #tpk-fixsave,#tpk-s5.tpk-noagree #tpk-savealt{opacity:.45}
/* 分かち合いの見出しだけ、中央に */
.tpk-sharehead{text-align:center}

/* 共有ボタン：アイコンと名前を横に並べる（アイコンの色は kioku-site.css） */
.tpk-share a,.tpk-share button{display:inline-flex;align-items:center;justify-content:center;gap:8px}

/*
 * 押せる大きさと、大きいボタンの高さをそろえる（確認係の報告 2026-09-25）。
 * 大きいボタンは、サイト全体で 52px・太さ 700 に（写真のページの保存、作品のページのボタンと同じ）
 */
.tpk-btn{min-height:52px;box-sizing:border-box;font-weight:700}
.tpk-agree{min-height:44px;box-sizing:border-box}
/* 「ほかの写真を選ぶ」は文字のリンクの見た目のまま、押せる高さだけ 44px に（hidden のときは出さない） */
#tpk-repick:not([hidden]){display:inline-flex;align-items:center;min-height:44px;margin-top:0}
/* 写真を選ぶ段の一覧を、古写真と錦絵に分ける見出し（2026-09-25） */
.tpk-list-h{margin:18px 0 0;font-size:.86rem;font-weight:600;letter-spacing:.06em}
.tpk-list-h:first-child{margin-top:10px}
.tpk-list-h small{margin-left:8px;font-size:.74rem;font-weight:400;color:var(--ink-sub)}
/* 字を取りに行っている間の見本（組んでいます）。薄くして、描き直し中と分かるように（指示書 P2-5） */
.tpk-frame.is-wait{opacity:.55;transition:opacity .2s}
/* うまく保存できないとき（指示書 P2-3） */
.tpk-savehelp{margin-top:10px;font-size:.8rem;color:var(--ink-sub)}
.tpk-savehelp summary{cursor:pointer;min-height:44px;display:flex;align-items:center;text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:var(--tp-ul-offset,.45em); text-decoration-color:var(--tp-ul-color);}
.tpk-savehelp ol{margin:0 0 6px;padding-left:1.4em;line-height:1.75}
.tpk-savehelp li + li{margin-top:4px}

/*
 * スマホの見直し（確認係 2026-09-25）
 * 入力欄の字が 16px より小さいと、iPhone は押すたびに画面を拡大して、見本もボタンも外へ出てしまう
 */
@media (max-width:781px){
  .tpk input[type=text],.tpk input[type=search],.tpk select{font-size:1rem}
}
/* 「名所・資料・刊行」の小さな見出しが、地の色に対して薄すぎた */
.tpk-picked dt{color:var(--ink-sub)}
/* チェックの四角を指で押しやすく */
.tpk-agree input{width:22px;height:22px;margin-top:1px}
.tpk-toggle{min-height:44px;cursor:pointer}
.tpk-toggle input{flex:none;width:22px;height:22px;margin:0;accent-color:var(--green);cursor:pointer}
/* 同意する前だけ出る、保存ボタンの下の1行 */
.tpk-needagree{margin-top:6px}
/* ボタンは画面の組み立ての途中で入るので、その行の高さを先に取っておく（入った瞬間に下がずれないように） */
.tpk-opts{min-height:44px}
/* 写真の一覧が届くまで、その場所を取っておく */
.tpk-list-wait{min-height:min(60vh,520px);min-height:min(60dvh,520px)}
/* 保存ボタンのすぐ上の説明：保存するとまず自分が使え、同時にみんなの壁紙にも並ぶ（2026-09-26 本人の依頼） */
.tpk-saveabout{margin:14px 0 0;padding:12px 14px;background:var(--tp-kinari-mid,#F1EADC);border-left:2px solid var(--green)}
.tpk-saveabout p{margin:0;font-size:.84rem;line-height:1.8;color:var(--ink)}
.tpk-saveabout .tpk-saveabout__sub{margin-top:4px;font-size:.74rem;color:var(--ink-sub)}
.tpk-saveabout + .tpk-btn{margin-top:10px}

/* 細かく整える（文字の太さ・位置・出典）。はじめはたたんでおく（2026-09-26 本人の決定） */
.tpk-adj{margin:14px 0 0;border-top:1px solid var(--rule);border-bottom:1px solid var(--rule)}
.tpk-adj > summary{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 10px;min-height:48px;padding:12px 28px 12px 0;cursor:pointer;
  position:relative;list-style:none;font-size:.86rem;font-weight:600;color:var(--ink)}
.tpk-adj > summary::-webkit-details-marker{display:none}
.tpk-adj > summary::after{content:"";position:absolute;right:6px;top:50%;width:8px;height:8px;margin-top:-6px;
  border-right:1.5px solid var(--ink-sub);border-bottom:1.5px solid var(--ink-sub);transform:rotate(45deg)}
.tpk-adj[open] > summary::after{margin-top:-2px;transform:rotate(-135deg)}
.tpk-adj > summary span{font-size:.72rem;font-weight:400;color:var(--ink-sub)}
.tpk-adj > summary:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.tpk-adj__in{padding:4px 0 16px}
/* 手順の見出しの番号（2-1 など）が詰まらないように */
.tpk-step h2 i{white-space:nowrap}

/*
 * スマホで手順を読み進めたら、上に付いてくる見本を小さく（2026-09-26 本人の決定）。
 * 上へ戻ると元の大きさに（kioku-create.js の miniStage）
 */
@media (max-width:900px){
  .tpk.tpk-mini .tpk-frame.v canvas{height:min(16vh,128px);height:min(16dvh,128px)}
  .tpk.tpk-mini .tpk-frame.h{width:46%}
  .tpk.tpk-mini .tpk-stage{padding:6px}
  /* 並びの高さは保ったまま、空いたところは透かして、下の手順を押せるように */
  .tpk.tpk-mini .tpk-stagewrap{pointer-events:none}
  .tpk.tpk-mini .tpk-stage{pointer-events:auto}
  .tpk.tpk-mini .tpk-stagewrap > .tpk-note{display:none}
}
/* 保存ボタンの上の説明は、ことばの切れ目で折り返す（1〜2字だけ次の行に落ちないように） */
.tpk-saveabout p{word-break:auto-phrase}

/*
 * 組みかたの小さな見本（2026-09-26 本人の依頼）。ボタンの中、名前の上に。押された組みかたは深緑の枠
 * 縦長の端末は5つ横に並べ、横長（パソコン）は2つずつ
 */
#tpk-tpl{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
#tpk-tpl.tpk-tpl--h{grid-template-columns:repeat(2,minmax(0,1fr))}
#tpk-tpl .tpk-opt{display:flex;flex-direction:column;align-items:center;gap:6px;padding:6px 4px 8px;min-width:0;font-size:.74rem;white-space:nowrap}
#tpk-tpl .tpk-opt[aria-pressed="true"]{background:var(--tp-white,#fff);color:var(--green);border-color:var(--green);box-shadow:inset 0 0 0 1px var(--green)}
.tpk-tpl-mini{display:block;width:100%;height:auto;max-height:120px;object-fit:contain;border:1px solid var(--rule);background:var(--paper)}
#tpk-tpl.tpk-tpl--h .tpk-tpl-mini{max-height:none}
.tpk-tpl-mini[hidden]{display:none}
#tpk-tpl .tpk-opt:disabled .tpk-tpl-mini{opacity:.4}

/*
 * スマホで読みやすく押しやすく（スマホの確認係の報告 2026-09-26）。
 *   文字：補足は 12px 以上、説明は 13px 以上に（作る画面だけ、ほかのページより一回り小さかった）
 *   組み方の5つのボタン：幅 400px 以下では 3つと2つの2段に（1段に5つだと、1つの幅が 39px で文字もはみ出していた）
 */
.tpk-step h2 i{font-size:.75rem}
.tpk-card span,.tpk-fixtag,.tpk-gal-item span,.tpk-rights,.tpk-fine,.tpk-adj > summary span,#tpk-tpl .tpk-opt{font-size:.75rem}
.tpk-field label,.tpk-lock,.tpk-picked dl,.tpk-stagewrap > .tpk-note,.tpk-fixbar .tpk-note,.tpk-list-h small,.tpk-saveabout .tpk-saveabout__sub{font-size:.8125rem}
@media (max-width:400px){
  #tpk-tpl:not(.tpk-tpl--h){grid-template-columns:repeat(3,minmax(0,1fr)); row-gap:10px}
}

/* ------------------------------------------------------------------
 * 仕上がりの見本（2026-10-02、申し送りの作業9。前の仮の名前は「レイアウト確認」）
 *   1. スマホの幅で上に付く見本に、小見出し「仕上がりの見本」と添え書き「タップで大きく」
 *   2. 縦長の見本は、画面の高さの約半分（小見出しと余白を足して 50% ほど）。前は 34% で、時計や文字の重なりが見づらかった
 *   3. 縦長の見本は、細い角丸の枠でスマホの画面らしく（角の丸みは見本の幅に合わせる。--u は幅の 1/100）
 *   4. 見本を押すと、ライトボックス（#tpk-lv）で大きく。時計とアイコンを重ねる・外すを切り替えられる
 * ------------------------------------------------------------------ */
.tpk-stagehead{display:none}
@container tpk (max-width:780px){
  .tpk.tpk-has .tpk-stagehead,.tpk.tpk-wait .tpk-stagehead{display:flex}
  .tpk-frame.v canvas{height:46vh;height:46dvh}
  .tpk.tpk-wait:not(.tpk-has) .tpk-ph{min-height:46vh;min-height:46dvh}
}
@media (max-width:900px){
  .tpk.tpk-has .tpk-stagehead,.tpk.tpk-wait .tpk-stagehead{display:flex}
  .tpk-frame.v canvas{height:46vh;height:46dvh}
  .tpk.tpk-wait:not(.tpk-has) .tpk-ph{min-height:46vh;min-height:46dvh}
}
/* 小見出しは、トップの小見出しと同じ小さなゴシックと字間。地は見本の下の注記と同じ生成り（下の手順の文字と重ならないように） */
.tpk-stagehead{align-items:baseline;justify-content:space-between;gap:12px;margin:0;padding:6px 10px 4px;background:var(--paper);
  font-size:.75rem;line-height:1.5;letter-spacing:.16em;color:var(--ink-sub)}
.tpk-stagehead__t{color:var(--ink);font-weight:700}
.tpk-stagehead__hint{letter-spacing:.06em}
/* 手順を読み進めて見本が小さくなったら、小見出しはしまう（見本だけを残す） */
.tpk.tpk-mini .tpk-stagehead{display:none}

/* スマホの画面らしい枠：細い線と角丸（縦長のときだけ。パソコン用の横長は四角のまま） */
.tpk-frame.v{border-radius:calc(4.5 * var(--u, 2.6px));overflow:hidden;
  box-shadow:0 0 0 1px rgba(34,32,28,.28),0 8px 30px rgba(0,0,0,.22)}

/* 見本の上に重ねる、押せる面（見た目は変えない。スクリプトが動くときだけ出す） */
.tpk-zoom{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;background:transparent;cursor:zoom-in;border-radius:inherit}
/* 枠は内側に描く（縦長の見本は角丸で外側を切っているので、外に出すと見えない。確認係） */
.tpk-zoom:focus-visible{outline:2px solid var(--green);outline-offset:-3px}
.tpk-zoom:focus:not(:focus-visible){outline:none}

/* ロック画面のウィジェットの目安（時計のすぐ下の、角の丸い帯） */
.tpk-ov .wid{position:absolute;left:14%;right:14%;top:calc(7% + calc(16 * var(--u)));height:calc(10 * var(--u));
  border-radius:calc(3 * var(--u));background:rgba(255,255,255,.22)}
.tpk-frame.h .tpk-ov .wid{display:none}

/*
 * ライトボックス。地は、写真のページのライトボックスと同じ暗い色（明るい・墨の設定にかかわらず。墨の配色の地・文字・罫と同じ値）。
 * 上に小見出しと ×、真ん中に見本、下に「時計とアイコンを重ねる」の入り切りと注記
 */
html.tpk-lv-open{overflow:hidden}
.tpk-lv{box-sizing:border-box;width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;
  background:#191816;color:#EAE3D2;overflow:hidden;font-family:var(--tp-gothic,sans-serif)}
.tpk-lv[open]{display:flex;flex-direction:column}
.tpk-lv::backdrop{background:rgba(20,19,17,.9)}
.tpk-lv:focus{outline:none}
.tpk-lv__h{flex:none;margin:0;padding:calc(14px + env(safe-area-inset-top, 0px)) 72px 0 20px;min-height:56px;box-sizing:border-box;
  font-size:.75rem;font-weight:700;line-height:1.5;letter-spacing:.16em;color:#B0A796}
.tpk-lv__view{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;padding:8px 16px;box-sizing:border-box;touch-action:pinch-zoom}
/* 移してきた見本の大きさ：画面に収まるいちばん大きな大きさ（縦横の比率は崩さない） */
#tpk-lv .tpk-frame{width:auto;flex:none;box-shadow:0 0 0 1px rgba(234,227,210,.22),0 12px 40px rgba(0,0,0,.5)}
#tpk-lv .tpk-frame canvas{width:auto;height:auto;max-width:calc(100vw - 32px);max-height:calc(100vh - 200px);max-height:calc(100dvh - 200px)}
#tpk-lv .tpk-zoom{display:none}
/* 大きくした見本は、押すと小さく戻る（2026-10-03 ご主人） */
#tpk-lv .tpk-frame{cursor:zoom-out}
/* 見本の左右の余白を押しても大きくなる（kioku-create.js の lvBind）。押せるのが分かるように、指の形を虫めがねに */
.tpk-lvok.tpk-has .tpk-stagewrap{cursor:zoom-in}
.tpk-lvok.tpk-has .tpk-stagewrap > .tpk-note{cursor:auto}
.tpk-lv__bar{flex:none;display:flex;flex-direction:column;align-items:center;gap:6px;padding:8px 16px calc(14px + env(safe-area-inset-bottom, 0px))}
.tpk-lv__ov{min-height:44px;padding:8px 16px;border:1px solid #3D3A33;border-radius:2px;background:transparent;color:#EAE3D2;
  font:inherit;font-size:.8125rem;letter-spacing:.04em;cursor:pointer}
.tpk-lv__ov[aria-pressed="true"]{background:#9DBBA9;border-color:#9DBBA9;color:#191816;font-weight:700}
.tpk-lv__note{margin:0;font-size:.75rem;line-height:1.6;color:#B0A796;text-align:center;word-break:auto-phrase}
/* × は大きめに（2026-10-03 ご主人。48px から 56px、しるしも 22px から 28px に。縁は見本の縁取りと同じ薄い生成りで、暗い地でも丸の形が分かるように） */
.tpk-lv__close{position:absolute;top:calc(2px + env(safe-area-inset-top, 0px));right:6px;display:flex;align-items:center;justify-content:center;width:56px;height:56px;
  padding:0;border:1px solid rgba(234,227,210,.22);border-radius:50%;background:rgba(25,24,22,.7);color:#EAE3D2;cursor:pointer}
.tpk-lv__close:hover{background:rgba(60,57,51,.85)}
.tpk-lv button:focus-visible{outline:2px solid #9DBBA9;outline-offset:2px}
.tpk-lv button:focus:not(:focus-visible){outline:none}
/* 下へなでて閉じるときの動き（指に付いてくる）。「動きを減らす」設定では付けない */
.tpk-lv__view.is-back{transition:transform .2s ease-out}
@media (prefers-reduced-motion:reduce){ .tpk-lv__view.is-back{transition:none} }
/* 「タップで大きく表示」は、ライトボックスが開けるときだけ（dialog の無い古いブラウザでは出さない） */
/* 指で操作する端末だけ（マウスの人に「タップ」と出さない。確認係） */
.tpk-stagehead__hint{display:none}
@media (hover:none),(pointer:coarse){ .tpk-lvok .tpk-stagehead__hint{display:inline} }
/* スマホを横にしたときは高さが足りないので、注記をしまい、上下の余白を詰めて見本を大きく（確認係） */
@media (max-height:500px){
  .tpk-lv__h{padding-top:calc(8px + env(safe-area-inset-top, 0px));min-height:36px}
  .tpk-lv__note{display:none}
  .tpk-lv__bar{padding-top:4px;padding-bottom:calc(6px + env(safe-area-inset-bottom, 0px))}
  #tpk-lv .tpk-frame canvas{max-height:calc(100vh - 110px);max-height:calc(100dvh - 110px)}
}

/* ページの見出し（h1）。見た目には出さず、読み上げと検索エンジンにだけ（このページの型は題を出さないため。2026-10-13） */
.tpk-h1{position:absolute !important; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0}
