:root {
  --navy: #0b2a3c; --sea: #1479b8; --sea-l: #e3f1fa; --sand: #f7f3ec; --line: #dfe5ea;
  --text: #1c2a33; --sub: #5d6d78; --ok: #158a4a; --ok-l: #e5f6ec; --bad: #c8382b; --bad-l: #fdecea; --warn-l: #fff5dc;
  --radius: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sand); color: var(--text); font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif; }
a { color: var(--sea); }
.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }
.wrap.narrow { max-width: 380px; }
.wrap.wide { max-width: 1100px; }
.card { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(11, 42, 60, .08); margin: 12px 0; }
.pad { padding: 16px 18px; }
.ok { background: var(--ok-l); color: #0e5a31; }
.warn { background: var(--warn-l); color: #6b4a00; }
.h2 { font-size: 20px; margin: 8px 0; }
.h3 { font-size: 16px; margin: 0 0 10px; }
.fine, small { color: var(--sub); font-size: 13px; }
code { font-family: ui-monospace, Menlo, monospace; background: var(--sea-l); padding: 1px 5px; border-radius: 4px; }

/* 見出し */
.brand { text-align: center; padding: 20px 0 6px; }
.brand-mark { display: inline-block; font-weight: 700; letter-spacing: .12em; font-size: 13px; color: var(--sea); border: 1.5px solid var(--sea); border-radius: 99px; padding: 2px 12px; }
.brand h1 { font-size: 24px; margin: 10px 0 4px; line-height: 1.4; }
.meta { color: var(--sub); margin: 0; }
.lead { text-align: center; font-weight: 600; }
.event-link { display: block; text-decoration: none; color: inherit; }
.event-link span { display: block; color: var(--sub); font-size: 14px; }

.price { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.price > div { background: #fff; border-radius: var(--radius); padding: 12px; text-align: center; }
.price strong { display: block; font-size: 22px; }
.price > div:first-child strong { color: var(--sea); }
.price p { grid-column: 1 / -1; margin: 0; text-align: center; font-size: 13px; color: var(--sub); }
.tag { display: inline-block; font-size: 12px; background: var(--line); border-radius: 99px; padding: 1px 10px; }
.tag.free { background: var(--sea); color: #fff; }

/* フォーム */
.form .field { display: block; margin: 0 0 16px; }
.form .field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.form em { font-style: normal; font-size: 11px; color: #fff; background: var(--bad); border-radius: 4px; padding: 0 5px; margin-left: 4px; vertical-align: 1px; }
input, select, textarea, button, .btn { font: inherit; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sea); }
.counts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.counts label { font-size: 13px; color: var(--sub); }
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kind { position: relative; display: block; text-align: center; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 4px; cursor: pointer; background: #fff; }
.kind input { position: absolute; opacity: 0; }
.kind b { display: block; font-size: 16px; }
.kind small { font-size: 12px; }
.kind:has(input:checked) { border-color: var(--sea); background: var(--sea-l); box-shadow: 0 0 0 1px var(--sea) inset; }
.kind:has(input:focus-visible) { outline: 2px solid var(--sea); outline-offset: 2px; }
.comp { display: grid; grid-template-columns: 1fr 40px; gap: 6px; margin: 10px 0; padding: 10px; background: var(--sand); border-radius: 10px; }
.comp input { grid-column: 1; }
.comp .comp-del { grid-column: 2; grid-row: 1 / span 2; padding: 0; font-size: 18px; color: var(--sub); }
.add { width: 100%; border-style: dashed; color: var(--sea); font-weight: 600; }
.flash { margin: 8px 0 0; }
.who.one { grid-template-columns: 2fr 1fr; }
.kind-tag { display: inline-block; font-size: 11px; border-radius: 4px; padding: 0 6px; background: var(--line); color: var(--sub); vertical-align: 1px; }
.kind-tag.k-family { background: var(--sea-l); color: var(--sea); }
.kind-tag.k-friends { background: #fdf0e3; color: #a35a12; }
.email-hint, .email-warn { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--warn-l); color: #6b4a00; font-size: 14px; font-weight: 400; }
.email-hint button { padding: 2px 10px; font-size: 13px; margin-left: 4px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 4px 0 18px; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.check small { display: block; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
button, .btn { display: inline-block; border: 1.5px solid var(--line); background: #fff; color: var(--text); border-radius: 10px; padding: 8px 14px; cursor: pointer; text-decoration: none; text-align: center; }
button.primary { background: var(--sea); border-color: var(--sea); color: #fff; font-weight: 700; }
.big { width: 100%; padding: 14px; font-size: 17px; }
.form.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.form.grid .full { grid-column: 1 / -1; }
.form.grid button { grid-column: 1 / -1; justify-self: start; }
.form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 10px; }
.form.inline .field { margin: 0; flex: 1 1 140px; }
.form.inline input[type=search] { flex: 1 1 220px; width: auto; }
.form.inline select { width: auto; }

/* チケット */
.done strong { display: block; font-size: 18px; }
.ticket { background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 6px 24px rgba(11, 42, 60, .12); margin: 14px 0; }
.ticket-head { background: var(--navy); color: #fff; text-align: center; padding: 18px 16px 16px; }
.ticket-head .brand-mark { color: #9fd3f5; border-color: #9fd3f5; }
.ticket-head h1 { font-size: 20px; margin: 8px 0 4px; line-height: 1.4; }
.ticket-head p { margin: 0; font-size: 14px; color: #c9dbe6; }
.ticket-body { position: relative; padding: 20px 16px 22px; text-align: center; border-top: 2px dashed var(--line); }
.qr img { width: min(72vw, 280px); height: auto; image-rendering: pixelated; display: block; margin: 0 auto; }
.qr.dim { opacity: .25; }
.code { font: 700 22px ui-monospace, Menlo, monospace; letter-spacing: .08em; margin: 8px 0 12px; }
.who { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 6px; margin: 0; }
.who div { background: var(--sand); border-radius: 10px; padding: 6px; }
.who dt { font-size: 12px; color: var(--sub); }
.who dd { margin: 0; font-weight: 700; }
.free-badge { margin-top: 14px; display: inline-block; background: var(--sea-l); color: var(--sea); font-weight: 700; padding: 4px 14px; border-radius: 99px; }
.used { position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%) rotate(-8deg); border: 4px solid var(--bad); color: var(--bad); font-size: 30px; font-weight: 800; padding: 4px 20px; border-radius: 10px; background: rgba(255,255,255,.9); line-height: 1.3; }
.used small { display: block; font-size: 14px; color: var(--bad); text-align: center; }
.tdays { list-style: none; padding: 0; margin: 14px 0 4px; display: flex; gap: 8px; justify-content: center; }
.tdays li { background: var(--sand); border-radius: 10px; padding: 6px 12px; font-size: 13px; color: var(--sub); }
.tdays li b { display: block; color: var(--text); font-size: 15px; }
.tdays li.in { background: var(--ok-l); color: var(--ok); }
.reentry { background: var(--sea-l); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }
.mailpref p { font-size: 14px; margin: 6px 0 10px; }
.mailpref button.primary { width: 100%; padding: 12px; }
.ask strong { display: block; font-size: 18px; margin: 4px 0; }
.ask .lead-in { color: var(--sub); }
.ask .plain { margin-top: 10px; background: #fff; }
.howto ol { padding-left: 1.3em; margin: 8px 0; }

/* 受付画面 */
.scan-page { background: var(--navy); color: #fff; min-height: 100vh; }
.scan-app { max-width: 520px; margin: 0 auto; }
.cam-pick { margin: 0 14px; }
.cam-pick select { background: rgba(255,255,255,.12); color: #fff; border: 0; font-size: 14px; padding: 8px 10px; }
.cam-pick option { color: #000; }
.scan-bar { position: sticky; top: 0; z-index: 5; background: var(--navy); padding: calc(10px + env(safe-area-inset-top)) 14px 8px; }
.scan-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.scan-title strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { background: rgba(255,255,255,.12); color: #fff; border: 0; padding: 4px 12px; border-radius: 99px; font-size: 14px; white-space: nowrap; }
.scan-day { margin-top: 4px; font-size: 18px; font-weight: 800; }
.scan-day.not-today { color: #ffcf6e; }
.day-note { display: inline-block; background: rgba(0,0,0,.18); border-radius: 10px; padding: 6px 12px; font-size: 15px; }
.days { display: flex; gap: 8px; flex-wrap: wrap; }
.days label { display: flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 14px; background: #fff; }
.days input { width: 18px; height: 18px; }
.day-tbl td, .day-tbl th { text-align: right; }
.day-tbl td:first-child, .day-tbl th:first-child { text-align: left; }
.scan-status { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pill { font-size: 12px; padding: 2px 10px; border-radius: 99px; background: rgba(255,255,255,.15); }
.pill.on { background: #1d7a46; }
.pill.off { background: #b3541e; }
.pill.light { background: rgba(255,255,255,.08); }
#pending { background: #c98a00; }
.banner { margin: 0 14px 8px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.camera { position: relative; margin: 6px 14px; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 1 / 1; max-height: 62vh; }
.camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame { position: absolute; inset: 10%; border: 3px solid rgba(255,255,255,.85); border-radius: 18px; pointer-events: none; box-shadow: 0 0 0 999px rgba(0,0,0,.25); }
.cam-msg { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-size: 14px; text-shadow: 0 1px 3px #000; padding: 0 12px; }
.cam-start { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: auto; padding: 16px 28px; }
.scan-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin: 10px 14px; }
.scan-actions button { background: rgba(255,255,255,.12); color: #fff; border: 0; }
.loaded { margin: 0 14px; font-size: 12px; color: #9fb4c2; }
.sheet { position: fixed; inset: 0; z-index: 20; background: var(--navy); color: #fff; overflow-y: auto; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet.good { background: var(--ok); }
.sheet.bad { background: var(--bad); }
.sheet-inner { max-width: 480px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.r-head { font-size: 40px; font-weight: 800; text-align: center; margin: 12px 0 4px; }
.r-body { text-align: center; font-size: 17px; }
.r-body .one { font-size: 44px; font-weight: 800; margin: 0; }
.who-big { font-size: 26px; font-weight: 700; margin: 4px 0; }
.hint { font-size: 14px; opacity: .9; }
.r-counts { background: rgba(0,0,0,.15); border-radius: 16px; padding: 12px; margin: 10px 0; }
.stepper { display: grid; grid-template-columns: 1fr 64px 64px 64px; align-items: center; gap: 8px; margin: 6px 0; font-size: 18px; }
.stepper b { text-align: center; font-size: 34px; }
.stepper button { height: 56px; font-size: 28px; font-weight: 700; border: 0; border-radius: 12px; }
.r-counts .hint { text-align: center; margin: 6px 0 0; }
.r-actions { margin-top: auto; display: grid; gap: 10px; padding-top: 16px; }
.r-actions .big { background: rgba(255,255,255,.18); color: #fff; border: 0; }
.go.huge { background: #fff; color: var(--ok); border: 0; font-size: 22px; font-weight: 800; padding: 20px; border-radius: 16px; }
#search input { margin: 8px 0; }
.hits { list-style: none; padding: 0; margin: 0; }
.hits button { width: 100%; text-align: left; margin: 0 0 8px; padding: 10px 12px; background: rgba(255,255,255,.1); color: #fff; border: 0; }
.hits small { display: block; color: #b9cbd6; }
.hits .none { color: #b9cbd6; padding: 8px; }
.menu-list { display: grid; gap: 10px; }
.menu-list .big { background: rgba(255,255,255,.12); color: #fff; border: 0; }
.sheet .fine { color: #b9cbd6; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; background: #fff; color: var(--text); padding: 10px 16px; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.3); font-size: 15px; width: max-content; max-width: calc(100vw - 32px); }

/* 管理画面 */
.admin-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 12px 0; }
.stat { background: #fff; border-radius: var(--radius); padding: 14px 16px; }
.stat span { font-size: 13px; color: var(--sub); }
.stat b { display: block; font-size: 32px; line-height: 1.3; }
.stat b small { font-size: 14px; margin-left: 2px; }
.stat em { font-style: normal; font-size: 13px; color: var(--sub); }
.stat.main { background: var(--navy); color: #fff; }
.stat.main span, .stat.main em, .stat.main small { color: #c9dbe6; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.two .card { margin: 0; }
.bars .bar { display: grid; grid-template-columns: 44px 1fr 56px; align-items: center; gap: 8px; font-size: 13px; margin: 4px 0; }
.bars .track { min-width: 0; }
.bars i { display: block; height: 16px; background: var(--sea); border-radius: 4px; min-width: 2px; }
.bars b { font-weight: 600; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { background: #f1f4f6; font-size: 12px; color: var(--sub); white-space: nowrap; }
.acts form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.acts button { padding: 4px 10px; font-size: 13px; }
.tbl input.num { width: 90px; padding: 6px 8px; text-align: right; }
.mini { padding: 2px 8px; font-size: 12px; margin-top: 2px; }
.day-tbl td:nth-child(4), .day-tbl td:nth-child(5) { text-align: right; }
.bars > b { display: block; margin-bottom: 4px; }
.danger { color: var(--bad); border-color: #f0c4bf; }
.mail-tag { display: inline-block; font-size: 11px; border-radius: 4px; padding: 0 6px; background: var(--ok-l); color: var(--ok); }
.mail-tag.all { background: var(--ok); color: #fff; }
.mail-tag.no { background: var(--line); color: var(--sub); }
.ok-text { color: var(--ok); }
.bad-text { color: var(--bad); }
