:root {
  --ink: #1c2b3a; --muted: #5d6b78; --line: #dfe4e8; --bg: #f3f5f7; --card: #fff;
  --main: #1f6fb2; --main-d: #17598f;
  --green: #2e9d5b; --yellow: #e2a400; --red: #d64545; --done: #9aa5ae;
  --board: #1f4d3a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Hiragino Sans", "Noto Sans JP", sans-serif; color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 16px; -webkit-text-size-adjust: 100%; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--main); }

.top { position: sticky; top: 0; z-index: 10; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
.brand { display: flex; flex-direction: column; line-height: 1.25; }
.brand b { font-size: 16px; }
.brand small { font-size: 11px; opacity: .7; }
.who { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.who select { background: #fff; color: var(--ink); border: 0; border-radius: 8px; padding: 6px 8px; font-size: 14px; max-width: 46vw; }

main { max-width: 760px; margin: 0 auto; padding: 16px 16px 80px; }
h1 { font-size: 20px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 22px 0 10px; }
.muted { color: var(--muted); font-size: 13px; }
.back { display: inline-block; margin-bottom: 8px; font-size: 14px; text-decoration: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.site { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.site .bar { width: 8px; align-self: stretch; border-radius: 4px; }
.site .body { flex: 1; min-width: 0; }
.site .name { font-weight: 800; font-size: 18px; }
.site .sub { font-size: 13px; color: var(--muted); }
.site .now { margin-top: 4px; font-size: 15px; }
.go { font-size: 22px; color: var(--muted); }

.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; }
.c-green { background: var(--green); } .c-yellow { background: var(--yellow); } .c-red { background: var(--red); } .c-done { background: var(--done); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; color: #fff; }
.tag.c-yellow { color: #3a2c00; }

.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 16px; font-size: 18px; font-weight: 800; background: var(--main); color: #fff; text-align: center; text-decoration: none; }
.btn:active { background: var(--main-d); }
.btn.sub { background: #fff; color: var(--ink); border: 2px solid var(--line); font-weight: 700; font-size: 16px; padding: 12px; }
.btn.red { background: var(--red); }
.btn.small { display: inline-block; width: auto; font-size: 14px; padding: 8px 14px; border-radius: 10px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.steps { list-style: none; }
.step { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; padding: 10px 12px; }
.step .h { display: flex; align-items: center; gap: 8px; }
.step .h b { flex: 1; }
.step .h .d { font-size: 12px; color: var(--muted); white-space: nowrap; }
.step.done { opacity: .75; }
.step.cur { border: 2px solid var(--main); box-shadow: 0 2px 10px rgba(31,111,178,.15); }
.step.lock::after { content: "🔒 ここに入る前に、それまでの写真をそろえる"; display: block; font-size: 11px; color: var(--muted); margin: 2px 0 0 20px; }
.nw { display: inline-block; }
.step { scroll-margin-top: 70px; }
.skip { font-size: 12px; color: var(--red); margin-top: 4px; }

.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.shot { border: 2px dashed #b8c2cb; border-radius: 12px; min-height: 120px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 8px; background: #fafbfc; font-size: 14px; font-weight: 700; position: relative; overflow: hidden; }
.shot.take { border-color: var(--main); color: var(--main); background: #eef5fb; }
.shot.take .cam { font-size: 28px; line-height: 1; }
.shot.has { border-style: solid; border-color: var(--line); padding: 0; background: #000; }
.shot.has img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; display: block; }
.shot .lbl { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 3px 6px; text-align: left; }
.shot .st { position: absolute; top: 6px; right: 6px; }
.shot.redo { border: 3px solid var(--red); }
.redo-note { font-size: 12px; color: var(--red); font-weight: 700; }
.mini-shots { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.mini-shots img { width: 54px; height: 40px; object-fit: cover; border-radius: 4px; }

.delay { display: flex; gap: 8px; margin: 10px 0 14px; }
.delay button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 6px; font-size: 14px; font-weight: 700; }

/* office table */
.tbl-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
table.grid { border-collapse: collapse; font-size: 12px; width: 100%; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 6px 2px; text-align: center; white-space: nowrap; }
table.grid th:first-child, table.grid td:first-child { text-align: left; padding-left: 10px; position: sticky; left: 0; background: #fff; }
table.grid td .cell { display: block; width: 18px; height: 18px; border-radius: 6px; margin: 0 auto; }
.cell.c-none { background: #edf0f2; }
.cell.cur { outline: 3px solid var(--ink); outline-offset: 1px; }
.legend { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 10px; }

.review { display: grid; gap: 12px; }
.review img { width: 100%; border-radius: 10px; display: block; background: #000; }
.urgent { color: var(--red); font-weight: 800; font-size: 13px; }

.form label { display: block; font-size: 14px; font-weight: 700; margin: 12px 0 4px; }
.form input[type=text], .form input[type=date], .form select, .form textarea { width: 100%; padding: 12px; border: 1px solid #c7d0d8; border-radius: 10px; background: #fff; font-size: 16px; }
.checks label { font-weight: 400; display: flex; gap: 8px; align-items: center; margin: 6px 0; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(10,20,30,.55); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.sheet { background: #fff; width: min(560px, 100%); border-radius: 18px; padding: 18px; max-height: 88vh; overflow: auto; }
.sheet.alert { border-top: 10px solid var(--red); }
.sheet.warn { border-top: 10px solid var(--yellow); }
.sheet h3 { font-size: 19px; margin-bottom: 8px; }
.sheet ul { margin: 8px 0 12px 1.2em; }
.sheet .btns { display: grid; gap: 10px; margin-top: 14px; }
.sheet img { width: 100%; border-radius: 10px; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; z-index: 60; max-width: calc(100% - 32px); }
.toast[hidden] { display: none; }
.badge { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: 13px; font-weight: 800; text-align: center; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { text-decoration: none; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: 14px; }
.tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.note { background: #fff8e0; border: 1px solid #f0dc9a; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 10px 0; }
.foot { margin-top: 30px; font-size: 12px; color: var(--muted); text-align: center; }
.foot button { background: none; border: 0; color: var(--main); text-decoration: underline; font-size: 12px; }

/* ledger (写真台帳) */
.ledger { background: #fff; color: #000; }
.ledger .lh { border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 10px; }
.ledger .lh h1 { font-size: 18px; margin: 0; }
.ledger .lh p { font-size: 12px; }
.lrow { display: grid; grid-template-columns: 62% 38%; border: 1px solid #000; margin-bottom: 8px; page-break-inside: avoid; break-inside: avoid; }
.lrow img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; border-right: 1px solid #000; }
.lrow table { width: 100%; border-collapse: collapse; font-size: 12px; }
.lrow th, .lrow td { border-bottom: 1px solid #000; padding: 5px 6px; text-align: left; vertical-align: top; }
.lrow th { width: 4.5em; background: #f2f2f2; font-weight: 700; }
.lrow tr:last-child th, .lrow tr:last-child td { border-bottom: 0; }
.print-bar { display: flex; gap: 10px; margin-bottom: 12px; }
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .top, .print-bar, .back, .foot { display: none !important; }
  main { max-width: none; padding: 0; }
  .lrow { margin-bottom: 4mm; }
  .lrow img { height: 78mm; aspect-ratio: auto; }
}
