* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: -apple-system, "Hiragino Sans", "Meiryo UI", sans-serif; color: #1a2433; background: #f4f6f9; touch-action: manipulation; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 14px; }
button:disabled { opacity: .45; cursor: default; }
input { font: inherit; padding: 12px 14px; border: 1px solid #c5ccd6; border-radius: 10px; width: 100%; }
.hidden { display: none !important; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; padding: 24px; gap: 16px; }
.card { background: #fff; border-radius: 16px; padding: 24px; width: min(420px, 100%); box-shadow: 0 2px 10px rgba(0,0,0,.06); display: grid; gap: 14px; }
.primary { background: #203864; color: #fff; padding: 14px 18px; }
.ghost { background: #e6eaf0; color: #203864; padding: 10px 14px; }
.err { color: #c0392b; min-height: 1.2em; }

/* 利用ページ */
#use { display: grid; grid-template-rows: auto 1fr auto; height: 100%; }
.bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; font-size: 15px; color: #56627a; }
.bar b { color: #1a2433; }
.stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 8px; min-height: 0; }
#qr { background: #fff; padding: 18px; border-radius: 18px; box-shadow: 0 2px 14px rgba(0,0,0,.08); }
#qr svg { display: block; width: var(--qr, 60vmin); height: var(--qr, 60vmin); }
#url { font-size: 12px; color: #8a94a6; word-break: break-all; text-align: center; max-width: 90vw; }
.msg { font-size: 28px; font-weight: 700; text-align: center; }
.low { background: #fdecea; color: #c0392b; padding: 8px 16px; border-radius: 10px; font-weight: 700; }
.buttons { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; padding: 14px 18px 22px; }
.buttons button { min-height: 88px; font-size: 24px; font-weight: 700; }
#done { background: #203864; color: #fff; }
#skip { background: #fff; color: #c0392b; border: 2px solid #e3b5ae; font-size: 18px; }
#net { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); background: #c0392b; color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 700; }

/* 管理ページ */
.admin { max-width: 1000px; margin: 0 auto; padding: 20px; display: grid; gap: 18px; }
.admin h1 { font-size: 22px; margin: 0; }
.admin h2 { font-size: 17px; margin: 0 0 10px; }
.panel { background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tile { background: #f4f6f9; border-radius: 10px; padding: 12px; }
.tile .n { font-size: 28px; font-weight: 700; color: #203864; }
.tile.warn .n { color: #ED7D31; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid #e6eaf0; vertical-align: top; }
td.num, th.num { text-align: right; }
tr.soon td { background: #fff4ea; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.small { font-size: 12px; color: #8a94a6; word-break: break-all; }
.ok { color: #1e7e46; font-weight: 700; }
