/* ゼロエンドの画面。タブレットを主に（決定 9）。style 属性は使わない（CSP の style-src 'self'）。 */
:root { --bg: #f5f6f8; --fg: #1f2937; --muted: #6b7280; --line: #d1d5db; --pri: #1d4ed8; --bad: #b91c1c; --warn: #fef3c7; --card: #fff; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 12px 48px; }
header#bar { display: flex; align-items: center; gap: 12px; padding: 10px 0; position: sticky; top: 0; background: var(--bg); z-index: 5; }
header#bar h1 { font-size: 20px; margin: 0; flex: 1; }
h2 { font-size: 18px; margin: 20px 0 8px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.card-box { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; }
.card-box.warn { background: var(--warn); }
.lead, .muted { color: var(--muted); }
.who { color: var(--muted); margin: 4px 0; }
.msg { margin: 8px 0; }
.msg.error, .err { color: var(--bad); }
.err { display: block; font-style: normal; font-size: 13px; }
input, select, button, .btn { font: inherit; min-height: 44px; }
input[type="text"], input[type="email"], input[type="date"], select { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
input:disabled, select:disabled { background: #f3f4f6; color: var(--fg); }
button, .btn { display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--fg); text-decoration: none; cursor: pointer; }
button.primary, .btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; }
button:disabled { opacity: .5; cursor: default; }
.ghost { border: none; background: none; color: var(--pri); text-decoration: none; }
#login-form, #code-form { display: flex; gap: 8px; margin: 8px 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.li-link { display: block; color: var(--fg); text-decoration: none; }
.li-sub { color: var(--muted); font-size: 14px; }
.li-act { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 13px; padding: 0 8px; border-radius: 10px; background: #e5e7eb; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 12px; }
.fld { display: block; }
.fld > span { display: block; font-size: 13px; color: var(--muted); }
.fld.bad input, .fld.bad select { border-color: var(--bad); background: #fef2f2; }
.fld.small > span { font-size: 12px; }
.fld.small input, .fld.small select { min-height: 40px; padding: 4px 6px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 12px 0 4px; }
.tab { flex: 0 0 auto; flex-direction: column; min-width: 72px; }
.tab small { font-size: 12px; color: var(--muted); }
.tab.on { border-color: var(--pri); box-shadow: inset 0 -3px 0 var(--pri); }
.die { border: 2px solid var(--fg); border-radius: 8px; padding: 8px; margin: 12px 0; }
.dietitle { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.gridrow { display: grid; grid-template-columns: 44px 1fr 56px 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.pos { font-weight: bold; text-align: center; }
.block { height: 100%; min-height: 60px; border-left: 3px solid var(--fg); border-right: 3px solid var(--fg); }
.cell { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 4px; }
.front { text-align: center; font-weight: bold; margin-top: 4px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
table.procs { border-collapse: collapse; width: 100%; }
table.procs td, table.procs th { border-bottom: 1px solid var(--line); padding: 4px; text-align: left; }
table.procs input[type="checkbox"] { width: 24px; height: 24px; }
.loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .6); z-index: 10; }
.loading span { background: var(--fg); color: #fff; padding: 8px 16px; border-radius: 8px; }
@media (max-width: 600px) {
  .gridrow { grid-template-columns: 32px 1fr 24px 1fr; }
  #login-form, #code-form { flex-direction: column; }
}
/* 写真（段 6）: その列の写真を並べる・写真が無い列の注意 */
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.ph { margin: 0; width: 150px; display: flex; flex-direction: column; gap: 4px; }
.ph img { width: 150px; height: 112px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.msg.warn { background: var(--warn); border-radius: 6px; padding: 6px 8px; }
input[type="file"] { width: 100%; }
