/* 目的: 贈答・香典の記録帳だけの見た目。手本は docs/design-tehon/zoutou.png
   （和紙の地・左寄せの明朝の題字・下線だけの記入欄・金の細線ではさんだ合計の段・罫線で区切った帳面の行・朱の「済」の判子）。
   白い箱・角丸の札・ぼんやりした影は使わない。区切りは罫線と余白だけ。 */

/* 目的: hidden を付けた物を確実に隠す（共通のボタンの見た目が display を上書きするため） */
[data-app="zoutou"] [hidden] { display: none !important; }

/* 目的: 目には見せず、読み上げにだけ残す見出し */
.zt-kakushi, .zt-midashi { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* 目的: 記録を直している間（「やめる」が出ている間）だけ、「記録を直す」と小さく見せる */
.zt-kinyuu:has(#zt-yameru:not([hidden])) .zt-midashi { position: static; width: auto; height: auto; margin: 0 0 4px; overflow: visible; clip-path: none; font-size: 13.5px; font-weight: 400; letter-spacing: .2em; color: var(--shu); }

.zt-tsume { margin: 6px 0; }

/* 目的: 題字は左寄せの大きな明朝。右に小さな金の菊の印（自分で描いた SVG を1つだけ。外の画像は使わない） */
.atama { padding-top: 20px; }
.atama h1 {
  font-size: clamp(27px, 7.7vw, 46px); letter-spacing: .03em; white-space: nowrap; margin-bottom: 4px;
  padding: 10px clamp(54px, 15vw, 84px) 10px 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 96' fill='none' stroke='%23a8842c' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M41 52C43 66 37 78 30 92'/%3E%3Cpath d='M39 68C50 62 60 64 66 72C56 76 46 75 39 68Z'/%3E%3Cpath d='M36 78C26 72 17 74 12 81C21 85 30 84 36 78Z'/%3E%3Cg%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(0.0 40 30)'/%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(22.5 40 30)'/%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(45.0 40 30)'/%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(67.5 40 30)'/%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(90.0 40 30)'/%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(112.5 40 30)'/%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(135.0 40 30)'/%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(157.5 40 30)'/%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(180.0 40 30)'/%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(202.5 40 30)'/%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(225.0 40 30)'/%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(247.5 40 30)'/%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(270.0 40 30)'/%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(292.5 40 30)'/%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(315.0 40 30)'/%3E%3Cellipse cx='40' cy='12.5' rx='3.4' ry='11.5' transform='rotate(337.5 40 30)'/%3E%3C/g%3E%3Cg fill='%23f1ebdd'%3E%3Cellipse cx='40' cy='20' rx='2.6' ry='6.2' transform='rotate(15.0 40 30)'/%3E%3Cellipse cx='40' cy='20' rx='2.6' ry='6.2' transform='rotate(45.0 40 30)'/%3E%3Cellipse cx='40' cy='20' rx='2.6' ry='6.2' transform='rotate(75.0 40 30)'/%3E%3Cellipse cx='40' cy='20' rx='2.6' ry='6.2' transform='rotate(105.0 40 30)'/%3E%3Cellipse cx='40' cy='20' rx='2.6' ry='6.2' transform='rotate(135.0 40 30)'/%3E%3Cellipse cx='40' cy='20' rx='2.6' ry='6.2' transform='rotate(165.0 40 30)'/%3E%3Cellipse cx='40' cy='20' rx='2.6' ry='6.2' transform='rotate(195.0 40 30)'/%3E%3Cellipse cx='40' cy='20' rx='2.6' ry='6.2' transform='rotate(225.0 40 30)'/%3E%3Cellipse cx='40' cy='20' rx='2.6' ry='6.2' transform='rotate(255.0 40 30)'/%3E%3Cellipse cx='40' cy='20' rx='2.6' ry='6.2' transform='rotate(285.0 40 30)'/%3E%3Cellipse cx='40' cy='20' rx='2.6' ry='6.2' transform='rotate(315.0 40 30)'/%3E%3Cellipse cx='40' cy='20' rx='2.6' ry='6.2' transform='rotate(345.0 40 30)'/%3E%3C/g%3E%3Ccircle cx='40' cy='30' r='3' fill='%23f1ebdd'/%3E%3C/svg%3E") right center / auto clamp(52px, 15vw, 80px) no-repeat;
}

/* ===== 記入欄: 見出しを左・下線だけの欄を右に置いた行を縦に並べる ===== */
.zt-kinyuu { margin: 18px 0 8px; padding: 0; }
.zt-gyou { display: flex; align-items: flex-end; gap: 14px; margin-top: 8px; }
.zt-gyou > label { flex: none; min-width: 4.2em; margin: 0; padding-bottom: 11px; font-size: 16px; letter-spacing: .14em; line-height: 1.5; white-space: nowrap; }
.zt-gyou > input, .zt-gyou > select, .zt-gyou > .zt-en, .zt-gyou > .zt-yoko { flex: 1; min-width: 0; }
/* 目的: 欄は白い地を敷かず、墨の細い下線だけにする */
.zt-kinyuu input[type="text"], .zt-kinyuu input[type="date"], .zt-kinyuu select { background-color: transparent; border-bottom-width: 1px; font-size: 19px; padding-left: 6px; }
.zt-kinyuu input:focus-visible, .zt-kinyuu select:focus-visible { background-color: transparent; }
.zt-en { display: flex; align-items: flex-end; border-bottom: 1px solid var(--sen); }
.zt-en input[type="text"] { flex: 1; min-width: 0; border-bottom: 0; }
.zt-en span { flex: none; padding: 0 6px 9px 4px; font-size: 17px; line-height: 1.5; }
.zt-en:focus-within { border-bottom-color: var(--iro); box-shadow: 0 2px 0 var(--iro); }
.zt-en input:focus-visible { box-shadow: none; }

/* 目的: 自分で足す行事の欄（箱で囲まず、行として足す） */
.zt-yoko { display: flex; align-items: flex-end; gap: 10px; }
.zt-yoko input { flex: 1; min-width: 0; }
.zt-yoko button { flex: none; min-height: 44px; padding: 6px 16px; font-size: 15px; }

/* 目的: 頂いた／贈った を1回押すだけで切り替える。選んだ方は藍の地に白い明朝、もう一方は字だけ、間に細い縦線 */
.zt-muki { display: flex; justify-content: center; align-items: center; gap: 25px; margin: 22px 0 10px; }
.zt-muki input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.zt-muki label { position: relative; margin: 0; width: 7.4em; min-height: 46px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; letter-spacing: .16em; text-indent: .16em; color: var(--ji); cursor: pointer; border-radius: 2px; }
.zt-muki input:checked + label { background: var(--iro); color: #fdfaf2; }
.zt-muki label:last-of-type::before { content: ""; position: absolute; left: -13px; top: 9px; bottom: 9px; width: 1px; background: var(--sen); }
.zt-muki input:focus-visible + label { outline: 2px solid var(--kin); outline-offset: 3px; }

.zt-memo { margin-top: 6px; }
.zt-memo summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; width: fit-content; font-family: var(--midashi); font-size: 14px; letter-spacing: .1em; color: var(--ji-usui); list-style: none; }
.zt-memo summary::-webkit-details-marker { display: none; }
.zt-memo summary::before { content: "＋"; color: var(--kin); font-size: 13px; }
.zt-memo[open] summary::before { content: "－"; }
.zt-memo label { margin-top: 0; font-size: 14px; }
.zt-memo textarea { background: transparent; }

.zt-ayamari { margin: 10px 0 0; color: var(--shu); font-weight: 700; font-size: 15px; }
.zt-shirase { margin: 0; min-height: 1.7em; text-align: center; }

/* 目的: 「記録する」は幅の広い藍の主ボタン。やめる・消すはその下に小さく並べる */
.zt-botan { justify-content: center; margin: 22px 0 8px; }
.zt-botan .omo { flex: 0 0 74%; min-height: 56px; font-size: 20px; letter-spacing: .3em; text-indent: .3em; border-radius: 2px; }
.zt-botan button:not(.omo) { min-height: 44px; font-size: 15px; }

.zt-modoshi { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.zt-modoshi button { min-height: 44px; }

/* ===== 合計の段: 上下を金の細線ではさみ、3つを細い縦線で区切る（箱を並べない） ===== */
.zt-chou { margin-top: 14px; }
.zt-goukei { display: flex; margin: 0 -8px; padding: 12px 0 10px; border-top: 1px solid var(--kin); border-bottom: 1px solid var(--kin); }
.zt-goukei > div { flex: 1 1 0; min-width: 0; padding: 0 6px; text-align: center; }
.zt-goukei > div + div { border-left: 1px solid var(--kin); }
.zt-goukei dt { font-family: var(--midashi); font-size: 14px; font-weight: 400; letter-spacing: .12em; color: var(--ji); line-height: 1.5; }
.zt-goukei dd { margin: 0; font-family: var(--midashi); font-size: clamp(19px, 5.9vw, 32px); font-weight: 500; line-height: 1.35; letter-spacing: 0; overflow-wrap: anywhere; font-variant-numeric: lining-nums; font-feature-settings: "palt"; }
.zt-goukei.zt-usui { opacity: .8; }

/* 目的: 絞る・探す（目立たせない。小さな見出しとうすい下線） */
.zt-shibori { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 0 18px; margin: 16px 0 0; }
.zt-shibori > div { min-width: 0; }
.zt-shibori label { margin: 0 0 -4px; font-size: 12px; font-weight: 400; letter-spacing: .08em; color: var(--ji-usui); white-space: nowrap; }
.zt-shibori select, .zt-shibori input[type="text"] { font-size: 15px; min-height: 44px; padding-top: 6px; padding-bottom: 6px; background-color: transparent; border-bottom: 1px solid var(--sen-usui); }
.zt-jouken { text-align: right; min-height: 1.7em; }

/* ===== 一覧: 帳面の行。罫線で区切り、日付・行事・名前・金額か品 ｜ お返しの印 を1行に並べる ===== */
.zt-ichiran { list-style: none; margin: 6px -8px 10px; padding: 0; border-top: 1px solid var(--sen); border-bottom: 1px solid var(--sen); }
.zt-fuda { display: grid; grid-template-columns: minmax(0, 1fr) 76px; align-items: center; column-gap: 4px; padding: 0 6px; }
.zt-fuda + .zt-fuda { border-top: 1px solid var(--sen); }
.zt-fuda.zt-naoshichuu { background: rgba(201, 165, 76, .2); }
/* 目的: 行の左側（押すと直せる）。札にせず、字だけを横に並べる */
.zt-fuda-naka {
  display: grid; grid-template-columns: 2.9em 4.3em minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 8px; align-items: baseline; justify-content: stretch;
  width: 100%; min-width: 0; min-height: 52px; margin: 0; padding: 17px 0 9px; text-align: left; border: 0; border-radius: 0; background: transparent;
  color: var(--ji); font-family: var(--midashi); font-weight: 400; font-size: 15px; letter-spacing: .02em; line-height: 1.45;
}
div.zt-fuda-naka { cursor: default; }
.zt-fuda-naka > span { min-width: 0; overflow-wrap: anywhere; }
.zt-hi { position: relative; font-feature-settings: "palt"; white-space: nowrap; }
.zt-nen { position: absolute; left: 0; bottom: 100%; font-size: 10px; line-height: 1; letter-spacing: .04em; color: var(--ji-usui); }
.zt-aite { letter-spacing: .06em; }
.zt-naiyou { font-variant-numeric: lining-nums; }
.zt-fuda-memo { grid-column: 2 / -1; font-family: var(--honbun); font-size: 12.5px; color: var(--ji-usui); white-space: pre-wrap; }
/* 目的: 行の右側。お返しの印（押すと付け外し）か、小さな「贈った」 */
.zt-shirushi { justify-self: center; font-family: var(--midashi); font-size: 12.5px; letter-spacing: .08em; color: var(--ji-usui); }
.zt-okaeshi { justify-self: stretch; min-height: 44px; min-width: 44px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; font-family: var(--midashi); font-weight: 400; font-size: 12.5px; letter-spacing: .04em; color: var(--ji); white-space: nowrap; }
button.zt-okaeshi[aria-pressed="false"] { text-decoration: underline; text-decoration-color: var(--kin); text-decoration-thickness: 1px; text-underline-offset: 5px; }
/* 目的: 「済」は朱色の丸い判子。少し傾けて、押した印らしくする */
.zt-han { display: inline-flex; align-items: center; justify-content: center; width: 31px; height: 31px; border: 1.6px solid var(--shu); border-radius: 50%; outline: 1px solid var(--shu); outline-offset: -4.5px; color: var(--shu); font-size: 15px; font-weight: 700; line-height: 1; letter-spacing: 0; transform: rotate(-7deg); }
.zt-rei { opacity: .8; }

/* 目的: 書き出す・読み込む・印刷は字だけ（金の細い下線）。目立たせない */
.zt-dougu { justify-content: center; gap: 0 14px; margin: 18px 0 4px; }
.zt-dougu button { border: 0; padding: 0 1px; min-height: 44px; font-size: 13px; font-weight: 400; letter-spacing: .03em; color: var(--ji); text-decoration: underline; text-decoration-color: var(--kin); text-decoration-thickness: 1px; text-underline-offset: 6px; }

@media (min-width: 560px) {
  .zt-gyou > label { font-size: 17px; }
  .zt-fuda { grid-template-columns: minmax(0, 1fr) 96px; }
  .zt-fuda-naka { font-size: 17.5px; grid-template-columns: 3.2em 5em minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 14px; padding: 19px 0 11px; }
  .zt-nen { font-size: 11px; }
  .zt-okaeshi, .zt-shirushi { font-size: 14px; }
  .zt-han { width: 34px; height: 34px; font-size: 16.5px; }
  .zt-goukei dt { font-size: 15px; }
  .zt-shibori label { font-size: 13px; }
  .zt-dougu { gap: 0 26px; }
  .zt-dougu button { font-size: 14.5px; letter-spacing: .08em; }
}

@media print {
  .atama h1 { font-size: 24px; background: none; padding: 0; }
  .lead { display: none; }
  .zt-chou { margin-top: 8px; }
  .zt-goukei { border-color: #000; margin: 0; }
  .zt-goukei > div + div { border-left-color: #000; }
  .zt-goukei dd { font-size: 18px; }
  .zt-goukei.zt-usui, .zt-rei { opacity: 1; }
  .zt-ichiran { margin: 8px 0; border-color: #000; }
  .zt-fuda { break-inside: avoid; }
  .zt-fuda + .zt-fuda { border-top-color: #666; }
  .zt-fuda.zt-naoshichuu { background: none !important; }
  .zt-fuda-naka { font-size: 12.5px; min-height: 0; padding: 14px 0 5px; }
  .zt-okaeshi { min-height: 0; text-decoration: none !important; }
  .zt-han { width: 24px; height: 24px; font-size: 12px; }
}

/* 目的: 狭い画面（スマホ）では一覧の1行を2段にする。上の段に日付と行事を小さく、下の段に名前（左）と金額か品（右）。名前や金額が途中で折れないようにする（2026-11-28 目視で見つけた折れの直し） */
@media (max-width: 480px) {
  .zt-fuda-naka { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "hi gy gy" "ai ai na"; row-gap: 0; column-gap: 10px; }
  .zt-fuda-naka .zt-hi { grid-area: hi; font-size: 14px; }
  .zt-fuda-naka .zt-gyouji { grid-area: gy; font-size: 13.5px; color: var(--ji-usui); }
  .zt-fuda-naka .zt-aite { grid-area: ai; font-size: 18.5px; }
  .zt-fuda-naka .zt-naiyou { grid-area: na; text-align: right; max-width: 46vw; font-size: 17px; }
  .zt-fuda-naka .zt-fuda-memo { grid-column: 1 / -1; }
}
