/* まえあと報告書(作業の前後の写真の報告書を作る道具)だけの追加のスタイル。基本は /style.css。色は style.css の変数(ライト・ダーク両対応)を使う。
   スマホで使う人が多い前提: 押す物は指で押せる大きさにし、写真の見本は2列で並べる。 */
/* style.css が指定していない入力欄(日付)を、ほかの入力欄と同じ見た目にそろえる */
form.stack input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-weight: 400;
}
form.stack input[type="date"] {
  max-width: 14em;
  min-height: 46px;
}
/* 入力した文字を太字にしない */
form.stack input[type="email"],
form.stack input[type="text"],
form.stack textarea,
.maeato-note input {
  font-weight: 400;
}
/* 写真を選ぶ2つの入口。label をボタンの見た目にして、中の input[type="file"] は見えなくする(OS の「選択されていません」の表示を出さない)。
   セレクタは form.stack から書く: style.css の form.stack label(0,1,2)より強い(0,2,2)。input の側も、form.stack から書いて(0,3,3)、
   入力欄の見た目の指定(input[type="text"] などの 0,1,1。この後ろに form.stack input[type="file"] を足しても 0,2,2)に負けないようにする。 */
.maeato-picks {
  display: grid;
  gap: 10px;
}
@media (min-width: 520px) {
  .maeato-picks {
    grid-template-columns: 1fr 1fr;
  }
}
form.stack label.maeato-pick {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}
form.stack label.maeato-pick:hover {
  background: var(--accent-hover);
}
/* 見えなくするが、キーボードのフォーカスは受ける(display: none・hidden にはしない) */
form.stack label.maeato-pick input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}
/* 見えない input にフォーカスが当たったら、label に枠を出す(style.css の .button:focus-visible と同じ枠) */
form.stack label.maeato-pick:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* 読み込み中・作成中(中の input は disabled) */
form.stack label.maeato-pick.is-disabled {
  opacity: .5;
  cursor: not-allowed;
}
form.stack label.maeato-pick.is-disabled:hover {
  background: var(--accent);
}
form.stack label.maeato-pick.is-disabled input[type="file"] {
  cursor: not-allowed;
}
/* 「この写真を選び直す」が開く、1枚だけ選ぶ欄。画面には出さない(ボタンから開く)。display: none にすると開けないブラウザがあるので、画面の外に置く */
.maeato-offscreen {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.maeato-errors {
  margin: 8px 0;
  padding-left: 1.2em;
  color: var(--warn-fg);
  overflow-wrap: anywhere;
}
.maeato-errors:empty {
  display: none;
}
#photo-status:empty,
#progress:empty,
#forget-done:empty {
  display: none;
}
.maeato-pairs {
  display: grid;
  gap: 14px;
  margin: 12px 0;
}
.maeato-pair {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.maeato-pair-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.maeato-pair-head h3 {
  margin: 0;
  font-size: 16px;
}
.maeato-pair-acts {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 10px;
}
/* 指で押せる大きさ(高さ 44px 以上)。押し間違えないように、間を 10px あける */
.maeato-pair-acts .button.small,
.maeato-thumbs .button.small,
#forget {
  min-height: 44px;
  padding: 8px 12px;
}
/* 削除は、ほかの操作から離して右端に置く */
.maeato-pair-acts [data-act="del"] {
  margin-left: auto;
}
.maeato-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.maeato-thumbs figure {
  margin: 0;
  min-width: 0;
}
.maeato-thumbs figcaption {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 700;
}
/* 枠ごとの「この写真を選び直す」 */
.maeato-thumbs .button.small {
  width: 100%;
  margin-top: 6px;
}
.maeato-thumbs canvas {
  display: block;
  max-width: 100%;
  max-height: 200px;
  width: auto;
  height: auto;
  border-radius: 4px;
  background: var(--soft);
}
.maeato-none {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 14px;
}
.maeato-note {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
}
.maeato-note input {
  font-size: 16px; /* スマホで、入力のときに画面が拡大されない大きさ */
}
.maeato-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
/* 「PDF を作る」は、スマホでは幅いっぱい */
#make {
  min-height: 52px;
  flex: 1 1 240px;
  max-width: 560px;
}
#make-hint {
  margin-top: 4px;
}
/* 「最初からやり直す」は、「PDF を作る」とは別の行に、離して置く */
.maeato-restart {
  margin-top: 28px;
}
.maeato-restart .button {
  min-height: 44px;
}
#result:focus {
  outline: none;
}
#cta-panel {
  margin-top: 12px;
}
/* 同意のチェック欄: 押しやすい大きさと余白(素材あつめ便と同じ) */
form.stack label.agree {
  padding: 8px 0;
}
form.stack label.agree input {
  width: 20px;
  height: 20px;
  vertical-align: -4px;
  margin-right: 6px;
}
/* 送信後に表示するアドレスが長くても、はみ出さない */
#doneto {
  overflow-wrap: anywhere;
}
/* プライバシーの説明の事業者の表の1列目。style.css の min-width: 14em を、同じセレクタで上書きする */
.table-scroll table.plain td:first-child {
  min-width: 8em;
}

/* ---- 「ひな形・書き方」のページ(lib/guide-pages.js)の表。スマホの幅では、1行を1枚のカードにして縦に並べる(横にはみ出さない) ---- */
table.guide {
  width: 100%;
  margin: 12px 0 20px;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 15px;
}
table.guide th,
table.guide td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
table.guide thead th {
  background: var(--soft);
}
table.guide tbody th {
  font-weight: 700;
}
@media (max-width: 719px) {
  /* 見出しの行は画面から隠し(読み上げには残す)、各セルの前に列の名前を出す */
  table.guide thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  table.guide,
  table.guide tbody,
  table.guide tr,
  table.guide th,
  table.guide td {
    display: block;
  }
  table.guide {
    background: transparent;
  }
  table.guide tr {
    margin: 0 0 10px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }
  table.guide tbody th,
  table.guide td {
    padding: 2px 0;
    border: 0;
  }
  table.guide td::before {
    content: attr(data-label) ": ";
    color: var(--muted);
    font-size: 13px;
  }
}
