/* トップページ(src/web/design/top/)と同じ見た目を、ほかの画面の部品の名前で作る。
   トップの style.css は読み込まない(トップの規則がほかの画面に効かないように)。
   色: 生成りの紙・深い藍緑の墨・朱。文字: 見出しは明朝(トップと同じ見出しの文字)、本文はゴシック。 */
@font-face {
  font-family: "Tip39 Mincho"; src: url("/top/assets/headings.woff") format("woff");
  font-weight: 700; font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #fbf8f1; --paper: #fffdf7; --ink: #172e34; --sub: #4f5a55;
  --line: #d9d4c9; --edge: #b9b5a7; --accent: #b83c22; --wash: #fcece0;
  --button: #c9482b; --button-hover: #aa361e; --on-button: #fff;
  --sand: #f1ece1; --sand-line: #e3ddcf; --note-ink: #4e544c; --note-strong: #873b28;
  --green: #2f5a48; --leaf: #e5ebe5; --red: #9b2c2a; --rose: #fbe3d5;
  --gold: #765442; --sun: #f3dbc5; --tea: #c5ab77; --focus: #23819e;
  --serif: "Tip39 Mincho", "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif CJK JP", serif;
  --sans: "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, Meiryo, "Noto Sans CJK JP", sans-serif;
}
@media (prefers-color-scheme: dark) {
  /* 暗い表示は、トップの大きな写真の帯と下の帯の藍緑を地にする */
  :root {
    color-scheme: dark;
    --bg: #11262c; --paper: #18333a; --ink: #fbf3e4; --sub: #c6d1c8;
    --line: #34525a; --edge: #6d8a8d; --accent: #f2967a; --wash: #4a2b22;
    --button: #c9482b; --button-hover: #a9381f; --on-button: #fff;
    --sand: #1f3a40; --sand-line: #3a5a5f; --note-ink: #e6e0d2; --note-strong: #ffc2a8;
    --green: #b3d6be; --leaf: #213f37; --red: #ffaaa2; --rose: #4a2a2a;
    --gold: #f2d0b2; --sun: #4b3a2c; --tea: #826d46; --focus: #7cc8de;
  }
}

/* 共通の骨組みと文字 */
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 1rem; line-height: 1.8;
  overflow-wrap: anywhere; -webkit-font-smoothing: antialiased;
}
main { max-width: 42rem; margin: auto; padding: clamp(1rem, 4vw, 2rem) 1.375rem calc(6rem + env(safe-area-inset-bottom)); } /* iPhone の Safari の下の住所欄に最後の行が隠れないよう、下を広く空ける */
main:has(> header.bar:first-child) { padding-top: 0; }
h1, h2, .money { font-family: var(--serif); font-weight: 700; }
h1, h2 { line-height: 1.45; letter-spacing: .035em; }
/* トップの小見出しの前にある朱の短い線を、文字なしで題の上に置く */
h1 { margin: 1.1em 0 .5em; font-size: clamp(1.75rem, 6.6vw, 2.35rem); }
h1::before { content: ""; display: block; width: 1.55rem; height: 2px; margin-bottom: .55rem; background: var(--accent); }
h2 { margin: 1.5em 0 .6em; font-size: clamp(1.3rem, 4.6vw, 1.5rem); }
p { margin: .7em 0; }
a { color: var(--accent); text-underline-offset: .22em; }
a:hover { color: var(--button-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sub, .muted { color: var(--sub); }
.sub { font-size: .9rem; line-height: 1.75; }
.muted { opacity: .72; }

/* 上の帯: トップと同じ、朱の器の印と明朝の「39tip」、右に丸いログインの枠 */
header.bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: .3rem 1rem; min-height: 66px; padding: .45rem 0;
  border-bottom: 1px solid var(--line); color: var(--ink);
  font-size: .88rem; font-weight: 700;
}
header.bar a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--ink); text-decoration: none; }
header.bar a:hover { color: var(--accent); }
header.bar > a:first-child {
  gap: .5rem; font-family: "Avenir Next","Futura","Segoe UI","Helvetica Neue",Arial,sans-serif; font-size: 1.6rem; font-weight: 800;
  line-height: 1; letter-spacing: .01em; white-space: nowrap;
}
header.bar > a:first-child::before {
  content: ""; flex: none; width: 2.2rem; height: 2.05rem; background: var(--button);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 48'%3E%3Cpath d='M3 24.8c.2 9 7.9 16.6 17.8 18.1v2.3c0 .9.8 1.6 1.7 1.6h7.6c1 0 1.8-.7 1.8-1.6v-2.4c9.6-1.7 16.9-9 17.2-18H3Z'/%3E%3Cpath fill='none' stroke='%23000' stroke-width='3.6' stroke-linecap='round' d='M2.8 20.3c10.8-3.3 34.7-3.3 46.1 0M13.3 14.3c4.8-3.1-2.4-6.7 1.1-10.2M37 13.5c4.5-3.2-1.9-6.6 1.3-10.2'/%3E%3Cpath d='M25.9 14.2s-7.7-4.1-7.7-8.7c0-4.4 5.2-5.8 7.7-2.4 2.8-3.4 7.7-2.1 7.7 2.4 0 4.6-7.7 8.7-7.7 8.7Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 48'%3E%3Cpath d='M3 24.8c.2 9 7.9 16.6 17.8 18.1v2.3c0 .9.8 1.6 1.7 1.6h7.6c1 0 1.8-.7 1.8-1.6v-2.4c9.6-1.7 16.9-9 17.2-18H3Z'/%3E%3Cpath fill='none' stroke='%23000' stroke-width='3.6' stroke-linecap='round' d='M2.8 20.3c10.8-3.3 34.7-3.3 46.1 0M13.3 14.3c4.8-3.1-2.4-6.7 1.1-10.2M37 13.5c4.5-3.2-1.9-6.6 1.3-10.2'/%3E%3Cpath d='M25.9 14.2s-7.7-4.1-7.7-8.7c0-4.4 5.2-5.8 7.7-2.4 2.8-3.4 7.7-2.1 7.7 2.4 0 4.6-7.7 8.7-7.7 8.7Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (prefers-color-scheme: dark) { header.bar > a:first-child::before { background: #ee8966; } }
header.bar > span { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 .35rem; margin-inline-start: auto; color: var(--sub); }
/* 右がログインの 1 つだけの時は、トップと同じ丸い枠のボタンにする */
header.bar > span > a:only-child {
  min-height: 44px; padding: .3rem 1rem; border: 1px solid var(--ink); border-radius: 50px; line-height: 1.3;
}
header.bar > span > a:only-child:hover { background: var(--ink); color: var(--bg); }

.nav { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem 1.4rem; margin-top: 2rem; padding-top: .4rem; border-top: 1px solid var(--line); font-size: .92rem; font-weight: 650; }
.nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--accent); }

/* 囲み: トップの手順の札と同じ、細い線と 12px の角 */
.card {
  margin: 1rem 0; padding: clamp(1.1rem, 4.5vw, 1.6rem);
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card > h2:first-child { font-size: clamp(1.18rem, 4.3vw, 1.4rem); }

/* お知らせと状態の札。注意書きはトップの「試験運用」の帯と同じ砂色に、朱の丸い印 */
.note, .err, .ok, .stale {
  margin: 1rem 0; padding: .75rem 1rem; border: 1px solid; border-radius: 10px;
  font-size: .9rem; line-height: 1.75;
}
.note {
  position: relative; padding-inline-start: 2.6rem;
  color: var(--note-ink); background: var(--sand); border-color: var(--sand-line);
}
.note::before {
  content: ""; position: absolute; left: .95rem; top: .95rem; width: 1.15rem; height: 1.15rem; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 11.8v4.7M12 7.7v.2'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 11.8v4.7M12 7.7v.2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.note strong { color: var(--note-strong); }
.ok { color: var(--green); background: var(--leaf); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.err { color: var(--red); background: var(--rose); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.stale { color: var(--sub); background: var(--sand); border-color: var(--sand-line); }
.lv, .status {
  display: inline-block; padding: .12em .75em; border-radius: 50px;
  font-size: .82rem; font-weight: 700; line-height: 1.6; vertical-align: middle; white-space: nowrap;
}
.lv { color: var(--gold); background: var(--sun); }
.lv.none { color: var(--sub); background: var(--sand); }
.status.pending { color: var(--gold); background: var(--sun); }
.status.done { color: var(--green); background: var(--leaf); }
.status.fail { color: var(--red); background: var(--rose); }

/* 操作: トップと同じ丸い朱のボタン、控えめなボタンは墨の細い枠 */
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: .6rem; width: 100%;
  min-height: 49px; margin: .45rem 0; padding: .8rem 1.4rem; border: 1px solid transparent;
  border-radius: 50px; background: var(--button); color: var(--on-button);
  font: inherit; font-size: .98rem; font-weight: 700; line-height: 1.4; text-align: center;
  text-decoration: none; cursor: pointer; transition: background-color .16s, transform .16s;
}
.btn:not(:disabled):hover { background: var(--button-hover); color: var(--on-button); }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn.sec { color: var(--ink); background: transparent; border-color: var(--ink); }
.btn.sec:not(:disabled):hover { color: var(--bg); background: var(--ink); }
.btn.danger { color: #fff; background: #a3312b; }
.btn.danger:not(:disabled):hover { background: #862521; color: #fff; }
.btn.sec.danger { color: var(--red); background: transparent; border-color: currentColor; }
.btn.sec.danger:not(:disabled):hover { color: #fff; background: #a3312b; border-color: #a3312b; }
.btn.small { width: auto; min-height: 44px; margin: .2rem 0; padding: .35rem 1rem; font-size: .88rem; }
.btn:disabled { color: var(--sub); background: var(--sand); border-color: var(--line); cursor: default; }
form.inline { display: inline-block; margin: 0 .35rem .35rem 0; }

/* 入力 */
.field { margin: 1.1rem 0; }
.field label { display: block; margin-bottom: .4rem; font-size: .93rem; font-weight: 700; }
input[type=text], input[type=number], .field input:not([type=radio]):not([type=checkbox]), select, textarea {
  width: 100%; min-height: 48px; padding: .6rem .8rem; border: 1px solid var(--edge);
  border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; font-size: max(16px, 1rem); line-height: 1.55;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 6rem; resize: vertical; }
/* iOS の日付の欄は既定の最小幅で枠から出るので、枠の幅に収める(同上) */
input[type=date] { min-width: 0; max-width: 100%; box-sizing: border-box; -webkit-appearance: none; appearance: none; }
input[type=checkbox], input[type=radio] { accent-color: var(--button); }
/* チェック欄は名札ごと指で押しやすい高さにする(iPhone の実機の確かめ 2026-11-22) */
.field label:has(> input[type=checkbox]) { display: flex; align-items: center; gap: .55rem; min-height: 44px; }
.field label > input[type=checkbox] { width: 22px; height: 22px; margin: 0; flex: none; }

/* 金額の選択肢: トップの見本の金額の札と同じ、選ぶと朱の枠と淡い朱の地 */
.amounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.amounts label {
  position: relative; display: flex; align-items: center; justify-content: center; gap: .3em;
  min-height: 50px; padding: .45rem .25rem; border: 1px solid var(--edge); border-radius: 9px;
  background: var(--paper); font-weight: 700; white-space: nowrap; cursor: pointer;
}
.amounts input { position: absolute; opacity: 0; width: 1px; height: 1px; } /* 標準の丸は暗い表示で見分けにくいので隠し、選んだ札の色と枠で示す */
.amounts label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.amounts label:has(input:checked) {
  color: var(--accent); background: var(--wash); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
}

/* 贈り物を選ぶ(仕様書 4.1【v1.4】): 絵・名前・値段の札を 2 列に並べ、選ぶと金額の札と同じ朱の枠と淡い朱の地 */
fieldset.gifts { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.gifts legend { margin-bottom: .55rem; padding: 0; font-size: .93rem; font-weight: 700; }
.gifts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
/* 贈り物の意味の一文は、札の並びの 1 列に入れず、横幅いっぱいに置く */
.gifts > p { grid-column: 1 / -1; margin: 0 0 .2rem; }
.gift {
  position: relative; display: grid; justify-items: center; align-content: start; gap: .15rem;
  padding: .8rem .4rem .7rem; border: 1px solid var(--edge); border-radius: 12px;
  background: var(--paper); text-align: center; cursor: pointer;
}
.gift input { position: absolute; opacity: 0; width: 1px; height: 1px; } /* 標準の丸は隠し、選んだ札の色と枠で示す */
.gift img, .gift .gift-pic { display: block; width: 4rem; height: 4rem; margin-bottom: .2rem; }
.gift .gift-pic { border-radius: 50%; background: var(--sun); }
.gift-name { font-weight: 700; line-height: 1.4; }
.gift-price { color: var(--sub); font-size: .88rem; font-variant-numeric: tabular-nums; }
.gift:hover { border-color: var(--accent); }
.gift:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.gift:has(input:checked) { background: var(--wash); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.gift:has(input:checked) .gift-name { color: var(--accent); }
.gift:has(input:checked)::after { /* 選んだ札の右上の印 */
  content: "✓"; position: absolute; top: .4rem; right: .55rem; color: var(--accent); font-weight: 700; line-height: 1;
}
.gift-custom { align-content: center; min-height: 7rem; }
.gift-qty select { max-width: 9rem; }
.gift-total { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; margin: .4rem 0 1rem; padding-top: .6rem; border-top: 1px solid var(--line); font-weight: 700; }
.gift-total[hidden] { display: none; }
/* 明細の中の「ビール × 2」と、小さく添える金額 */
.gift-label { font-weight: 700; }
.gift-yen { color: var(--sub); font-size: max(12px, .82em); font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 金額と明細、来店の一覧 */
.kv { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); margin: 1rem 0; }
.kv dt, .kv dd { margin: 0; padding: .6rem .2rem; border-top: 1px solid var(--line); }
.kv dt { color: var(--sub); font-size: .88rem; }
.kv dd { text-align: end; font-weight: 650; }
.kv.card { padding-block: .4rem; }
.kv > dt:first-of-type, .kv > dt:first-of-type + dd { border-top: 0; }
.kv dt, .kv dd { display: flex; align-items: center; }
.kv dd { justify-content: flex-end; flex-wrap: wrap; gap: 0 .3em; }
.money { font-size: 1.85rem; color: var(--accent); letter-spacing: .02em; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
td, th { padding: .65rem .35rem; border-bottom: 1px solid var(--line); text-align: start; font-size: .94rem; }
table.list th { color: var(--sub); background: var(--sand); font-weight: 700; }
table.list td, table.list th { font-size: .86rem; }
/* 携帯の幅で見出し・数字・役割・日時・小さいボタンが 1 語の途中で割れないように(iPhone の実機の確かめ 2026-11-22) */
table.list th, table.list .nw, table.list .btn.small, .gift-label { white-space: nowrap; }
/* 長い見出しだけは折り返してよい(携帯で表が画面の幅を超えて、右端の金額が見えなくならないように) */
table.list th.wrap { white-space: normal; }
/* 取引条件の表: 見出しは折り返し、携帯の幅では見出しの下に本文を置く(長い見出しで本文の列が細くならないように) */
table.list.terms th { white-space: normal; width: 30%; }
@media (max-width: 560px) { table.list.terms tr, table.list.terms th, table.list.terms td { display: block; width: auto; } table.list.terms th { border-bottom: 0; padding-bottom: .2rem; } }
/* 表示名は 5 文字分の幅までは割らず、それより長い英字の 1 語だけを割る(列を広げすぎて表が画面からはみ出さないように) */
table.list td.name { min-width: 5em; overflow-wrap: anywhere; }
a.tap { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }

/* スタッフの一覧: トップの見本のスタッフの札と同じ、角の丸い枠 */
ul.staff-list { display: grid; gap: .55rem; margin: 1rem 0; padding: 0; list-style: none; }
ul.staff-list > li > a.staff {
  display: flex; align-items: center; gap: .7rem; min-height: 56px; padding: .7rem 1rem;
  color: var(--ink); background: var(--paper); border: 1px solid var(--edge); border-radius: 9px;
}
ul.staff-list > li > a.staff:hover { border-color: var(--accent); background: var(--wash); }
.staff { font-weight: 700; text-decoration: none; }
.staff::after { content: "›"; margin-inline-start: auto; color: var(--accent); font-size: 1.4rem; line-height: 1; }
.visit {
  display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .7rem;
  min-height: 52px; padding: .7rem .2rem; border-bottom: 1px solid var(--line);
}
.visit .seat { padding: .1em .6em; border-radius: 6px; color: var(--green); background: var(--leaf); font-weight: 700; font-size: .9rem; }
.visit .name { font-weight: 700; }
.visit .sub { margin-inline-start: auto; }

/* 古い玄関の部品(今は使っていないが名前を残す) */
.welcome { padding: 1.5rem 0 1rem; border-bottom: 1px solid var(--line); }
.welcome h1 { margin: 0; }
.tea { width: 100%; max-height: 9rem; color: var(--accent); }
.guide ol { margin: 0; padding-inline-start: 2rem; }
.guide li { padding: .7rem 0 .7rem .35rem; border-bottom: 1px solid var(--line); }
.guide li::marker { color: var(--accent); font-family: var(--serif); font-weight: 700; }
.guide li:last-child { border: 0; padding-bottom: 0; }

@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
/* 会員の送信履歴(狭い画面で表の列が割れないよう、1 件ずつの囲みにする) */
ul.history { list-style: none; padding: 0; margin: .5rem 0; }
ul.history > li.card { margin: .5rem 0; padding: .8rem 1rem; }
ul.history > li.card p { margin: .2rem 0; }
/* 長い文(ひとことなど)は語の途中でも折り返し、1 字だけ次の行へ落ちにくくする */
.kv dd { overflow-wrap: anywhere; text-wrap: pretty; }
.account-guide ul { margin: .3rem 0; padding-inline-start: 1.2rem; }
.account-guide li { margin: .2rem 0; }
