:root {
  --bg: #F3FAF5;
  --bg-deep: #E7F3EB;
  --surface: #fff;
  --ink: #14382A;
  --muted: #3d5c4c;
  --line: #D5E8DC;
  --primary: #3E9B6A;
  --primary-press: #2E7D54;
  --text: #23704A;
  --done: #0B5434;
  --tint: #E8F5EC;
  --danger: #B42318;
  --danger-hot: #C2362F;
  --danger-bg: #FDECEA;
  --amber: #7A4E00;
  --amber-bg: #FFF6DE;
  --mark: #F6E7A2;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  --shadow: 0 1px 2px rgba(20, 56, 42, .04), 0 8px 24px rgba(20, 56, 42, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  color-scheme: light;
}
body.driver { background: var(--bg-deep); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--done); outline-offset: 2px; }
::selection { background: #CDEBD8; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabular { font-variant-numeric: tabular-nums; }

.envbar {
  background: repeating-linear-gradient(-45deg, #F5C400 0 12px, #FFD84A 12px 24px);
  color: #3a2c00;
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  padding: 6px 10px;
}
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 30; }
.skip:focus { left: 8px; }

.app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
body.driver .app { box-shadow: 0 0 0 1px var(--line); }
.pad { padding: 8px 18px 32px; }
.pad > * + * { margin-top: 14px; }

.brandbar, .subbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 6px;
}
.mark {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px; flex: none;
}
.brandbar strong, .subbar .co { font-size: 16px; }
.office { margin-left: auto; color: var(--muted); font-size: 14px; font-weight: 700; }
.back {
  width: 44px; height: 44px; margin-left: -8px;
  display: grid; place-items: center;
  color: var(--ink); text-decoration: none; border-radius: 12px;
}
h1 { font-size: 28px; font-weight: 800; letter-spacing: .01em; line-height: 1.3; }
.lede { color: var(--muted); font-size: 15px; }
.subbar h1 { font-size: 22px; }

.stephead { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; margin: 18px 0 8px; }
.stephead .n {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: 14px;
}
.stepper { display: flex; gap: 8px; align-items: center; font-weight: 800; color: #8aab96; font-size: 14px; }
.stepper .on { color: var(--text); }
.stepper .done { color: var(--primary); }
.savestate { color: var(--text); font-size: 13px; min-height: 1.2em; }
.savestate.ing { color: var(--amber); }
.savestate.fail { color: var(--danger); }

.combo {
  background: #fff; border: 2px solid var(--primary); border-radius: 14px;
  min-height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 12px;
}
.combo input {
  border: 0; flex: 1; min-width: 0; background: transparent;
  font-size: 18px; font-weight: 800; padding: 12px 0;
}
.combo input:focus { outline: none; }
.combo:focus-within { outline: 3px solid var(--done); outline-offset: 2px; }
.iconbtn {
  width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; border-radius: 10px;
}
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.hint.bad { color: var(--danger); }
.listbox {
  margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); max-height: 320px; overflow: auto; padding: 6px;
}
.listbox .count { color: var(--muted); font-size: 13px; padding: 8px 10px; }
.listbox [role="option"] {
  width: 100%; text-align: left; border: 0; background: transparent;
  display: block; padding: 12px 10px; border-radius: 10px;
  font-weight: 800; font-size: 18px; cursor: pointer;
}
.listbox [role="option"].is-on,
.listbox [role="option"][aria-selected="true"] { background: var(--tint); }
.listbox mark { background: var(--mark); color: inherit; border-radius: 3px; }

.field { display: block; }
.field .label, .label {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; margin-bottom: 6px;
}
.req, .opt {
  font-size: 11px; font-weight: 800; border-radius: 4px; padding: 1px 6px; color: #fff;
}
.req { background: var(--danger-hot); }
.opt { background: var(--text); }
.field input, .field select, .field textarea, .suffix input, .input, select.input, textarea.input {
  width: 100%; min-height: 52px;
  border: 2px solid var(--line); border-radius: 14px;
  padding: 12px 14px; background: #fff; font-size: 18px;
}
textarea.input, .field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .suffix input:focus, .input:focus {
  border-color: var(--primary); outline: 3px solid var(--done); outline-offset: 1px;
}
.reg { font-size: 28px; font-weight: 800; letter-spacing: .04em; }
.suffix { position: relative; }
.suffix span.unit {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 800; pointer-events: none;
}
.suffix input { padding-right: 64px; }
.pair {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 8px;
  align-items: end;
}
.pair > .field { min-width: 0; }
.pair input, .pair select {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  font-size: 15px;
  padding: 10px 6px;
}
.help, .card, .strip, .note, .panel {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px;
}
.help { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 14px; }
.help b, .note b { color: var(--ink); display: block; }
.idcard { width: 72px; height: 54px; flex: none; }
.ex {
  display: inline-block; background: #F5C400; color: #3a2c00;
  font-size: 12px; font-weight: 800; border-radius: 4px; padding: 1px 6px; vertical-align: middle;
}
.pins { display: flex; gap: 10px; }
.pinbox {
  width: 64px; height: 64px; text-align: center; font-size: 28px;
  border-radius: 14px; border: 2px solid var(--line); background: #fff;
}
.pinbox.filled { border-color: var(--primary); }
.textlink {
  background: none; border: 0; padding: 8px 0; color: var(--text);
  font-weight: 800; text-decoration: underline; text-underline-offset: 3px;
}
.remember { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.remember input { width: 22px; height: 22px; accent-color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; border: 0; border-radius: 14px;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 20px;
  text-decoration: none; padding: 0 16px;
}
.btn:hover { background: #348a5d; }
.btn:active { background: var(--primary-press); }
.btn:disabled { background: #B7D4C4; }
.btn.ghost {
  width: auto; min-height: 44px; background: #fff; color: var(--text);
  border: 2px solid var(--primary); font-size: 15px;
}
.btn.ghost.block { width: 100%; }
.btn.small, .row-actions .btn { width: auto; min-height: 40px; font-size: 14px; padding: 0 12px; }
.center { text-align: center; }
.veh-strong { font-weight: 800; font-size: 18px; }
.iconbtn.up { transform: rotate(180deg); }
.cam-top .iconbtn { color: #fff; }
.tablehead { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 12px 14px; }
form.stack > .btn { margin-top: 4px; }

.error, .dangerbox {
  background: var(--danger-bg); color: var(--danger);
  border-radius: 14px; padding: 12px 14px; font-weight: 700;
}
.amber, .due-amber {
  background: var(--amber-bg); color: var(--amber); border-radius: 14px; padding: 14px;
}
.note { background: var(--tint); color: var(--text); }
.paycard p + p { margin-top: 6px; }
.paycard b { font-size: 22px; }
.action.record { min-height: 76px; }
.action.record .t { font-size: 20px; }
.action.record .icon:last-child { margin-left: auto; width: 22px; height: 22px; color: var(--muted); }
.tag.new { background: #5c4d9a; color: #fff; vertical-align: 2px; }
.monthnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 800; }
.monthnav a, .monthnav .is-off {
  min-width: 64px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 10px;
}
.monthnav .is-off { color: #8aab96; }
.monthnav strong { font-size: 18px; }
.stats { display: grid; grid-template-columns: 1.15fr 1fr .72fr; gap: 8px; }
.stats p { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-width: 0; }
.stats span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.stats b { display: block; margin-top: 4px; color: var(--text); font-size: 18px; line-height: 1.2; }
.stats small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.record {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  text-decoration: none; color: inherit;
}
.record .meta { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.record .nums { text-align: right; font-size: 12px; color: var(--muted); font-weight: 700; }
.record .nums b { display: block; color: var(--text); font-size: 16px; }
.record > .icon { width: 20px; height: 20px; color: var(--muted); }
.payhero { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.payhero .big { margin: 4px 0; font-size: 36px; font-weight: 800; color: var(--text); line-height: 1.1; }
.note b { margin-bottom: 4px; }
.strip { background: var(--tint); border-color: transparent; }
.strip b { font-size: 16px; }
.done {
  background: var(--tint); border-radius: 16px; padding: 16px;
  display: flex; gap: 12px; align-items: center;
}
.tick {
  width: 36px; height: 36px; border-radius: 50%; background: var(--done); color: #fff;
  display: grid; place-items: center; flex: none;
}
.who { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.who .name { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 800; }
.who .date { color: var(--muted); margin-top: 2px; }
.section-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 800; font-size: 14px; }
.notice {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; text-decoration: none; color: inherit;
}
.notice .meta { color: var(--muted); font-size: 13px; font-weight: 700; }
.notice b { display: block; }
.tag, .pill {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 800; white-space: nowrap;
}
.tag.red, .pill.alert { background: var(--danger-bg); color: var(--danger); }
.tag.amber, .pill.wait { background: var(--amber-bg); color: var(--amber); }
.tag.ok, .pill.ok { background: var(--done); color: #fff; }
.pill.muted { background: #E7EEEA; color: var(--muted); }
.draftbar {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--amber-bg); color: var(--amber); border-radius: 12px;
  padding: 12px 14px; text-decoration: none; font-weight: 800;
}
.action {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 84px; border-radius: 16px; padding: 16px 18px;
  text-decoration: none; color: #fff; background: var(--primary); border: 0; text-align: left;
}
.action .t { display: block; font-size: 22px; font-weight: 800; }
.action .s { display: block; font-size: 14px; opacity: .92; }
.action.locked { background: #E4EEE8; color: #6d8578; }
.action.quiet { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.action .badge { margin-left: auto; background: var(--tint); color: var(--text); border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 800; }

.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shots.two { grid-template-columns: 1fr 1fr; }
.shots.one { grid-template-columns: 140px; }
.shot {
  aspect-ratio: 1; border-radius: 12px; background: #1d3b2c; color: #fff;
  border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; font-weight: 800; position: relative; overflow: hidden; padding: 8px;
}
.shot .icon { width: 28px; height: 28px; }
.shot.filled { padding: 0; }
.shot.filled img { width: 100%; height: 100%; object-fit: cover; }
.shot-label, .shot-actions {
  position: absolute; left: 6px; right: 6px;
}
.shot-label { bottom: 6px; background: rgba(0, 0, 0, .55); border-radius: 6px; padding: 2px 6px; font-size: 12px; width: max-content; }
.shot-actions { top: 6px; display: flex; gap: 4px; }
.shot-actions button {
  border: 0; background: rgba(255, 255, 255, .92); color: var(--ink);
  border-radius: 8px; padding: 4px 6px; font-size: 12px; font-weight: 800;
}
.payline, .sumline {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.payline input { width: 140px; text-align: right; }
.sumline { border-bottom: 0; font-size: 20px; font-weight: 800; color: var(--text); }
.kv { display: grid; grid-template-columns: 8.5em 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 800; }
.prose { white-space: pre-wrap; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs figure { margin: 0; width: 96px; }
.thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; background: #1d3b2c; }
.thumbs figcaption { font-size: 12px; color: var(--muted); }

.cam {
  position: fixed; inset: 0; z-index: 40; background: #0c1a12; color: #fff;
  display: flex; flex-direction: column; padding: 12px; gap: 12px;
}
.cam-top, .cam-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cam-stage { position: relative; flex: 1; min-height: 0; display: flex; }
.cam video, .cam img { width: 100%; height: 100%; object-fit: contain; background: #000; border-radius: 12px; }
#stampLive {
  position: absolute; left: 12px; bottom: 12px; margin: 0;
  background: rgba(11, 40, 24, .72); color: #fff; padding: 8px 10px;
  border-radius: 8px; font-size: 12px; white-space: pre-wrap;
}
#shutter {
  width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff;
  background: var(--primary); color: #fff; font-weight: 800; margin: 0 auto 8px;
}

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: var(--bg); border-right: 1px solid var(--line);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 12px;
  position: sticky; top: 0; height: 100vh;
}
.side .brand { display: flex; gap: 8px; align-items: center; padding: 4px 8px 8px; }
.side .brand small { display: block; color: var(--muted); font-size: 12px; }
.sidenav { display: flex; flex-direction: column; gap: 4px; }
.sidenav a {
  display: flex; gap: 8px; align-items: center;
  text-decoration: none; color: var(--ink); border-radius: 12px; padding: 10px 12px; font-weight: 800;
}
.sidenav a small { display: block; font-weight: 600; color: var(--muted); font-size: 12px; }
.sidenav a[aria-current="page"] { background: var(--done); color: #fff; }
.sidenav a[aria-current="page"] small { color: rgba(255, 255, 255, .8); }
.sidefoot { margin-top: auto; color: var(--muted); font-size: 13px; padding: 8px; }
.main { padding: 16px 20px 40px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.topbar h1 { font-size: 26px; }
.topbar .lead { color: var(--muted); font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.samplechip, .avatar {
  background: #F5C400; color: #3a2c00; font-weight: 800; border-radius: 999px; padding: 4px 10px; font-size: 13px;
}
.adminwho { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; background: var(--tint); color: var(--done); }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.kpi .k { color: var(--muted); font-size: 13px; font-weight: 800; }
.kpi .v { font-size: 32px; font-weight: 800; margin-top: 4px; line-height: 1.1; }
.kpi .v em { font-style: normal; font-size: 16px; margin-left: 2px; }
.kpi .sub { color: var(--muted); font-size: 12px; }
.kpi.hot .v { color: var(--danger-hot); }
.toolbar, .tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tabs button {
  border: 0; background: transparent; font-weight: 800; color: var(--muted);
  border-bottom: 3px solid transparent; padding: 8px 10px; border-radius: 0;
}
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--primary); }
.tablewrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
table.data { border-collapse: collapse; width: 100%; font-size: 13px; }
table.data.wide { min-width: 1280px; }
table.data th, table.data td { padding: 10px; text-align: left; white-space: nowrap; }
table.data th { background: var(--tint); color: var(--text); font-weight: 800; position: sticky; top: 0; }
table.data td { border-top: 1px solid #E5F2EA; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tfoot td { font-weight: 800; background: var(--tint); }
table.data tr.is-open td { background: #F7FCF8; }
table.data tr.row-red td { background: #FFF6F5; }
table.data tr.row-amber td { background: #FFFCF3; }
table.data a { font-weight: 800; }
.dash { color: #8aab96; }
.due { border: 1px solid transparent; }
.due-red { background: var(--danger-bg); color: var(--danger); }
.due h2 { display: flex; align-items: center; gap: 6px; font-size: 16px; margin-bottom: 8px; }
.due ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.due li { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.due a { color: inherit; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.flash { border-radius: 12px; padding: 10px 12px; background: var(--tint); color: var(--done); font-weight: 800; }
.flash.bad { background: var(--danger-bg); color: var(--danger); }
.modal {
  position: fixed; inset: 0; background: rgba(12, 26, 18, .45);
  display: grid; place-items: center; z-index: 30; padding: 18px;
}
.modal-card { background: #fff; border-radius: 16px; max-width: 860px; width: min(860px, 100%); max-height: 90vh; overflow: auto; padding: 16px; }
.modal-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.checkline { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.checkline input { width: 20px; height: 20px; accent-color: var(--primary); }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; z-index: 5; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .sidenav { flex-direction: row; overflow-x: auto; }
  .sidenav a small, .sidefoot, .side .brand small { display: none; }
  .sidenav a { white-space: nowrap; }
  .grid2 { grid-template-columns: 1fr; }
  .main { padding: 12px; }
}
@media (max-width: 380px) {
  .pins { gap: 6px; }
  .pinbox { width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* v0.02: 日付と時刻を1行に、バージョン表示 */
.kv dd.nowrap { white-space: nowrap; }
.kv:has(dd.nowrap) { grid-template-columns: 7em minmax(0, 1fr); }
@media (max-width: 374px) { .kv dd.nowrap { font-size: 14px; } }
.appver { margin: auto 0 0; padding: 8px 18px 14px; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sidefoot .appver, .verline { padding: 0; margin: 4px 0 0; text-align: left; font-size: 12px; color: var(--muted); }

/* v0.02: 24時間の時刻入力、帰庫写真の案内 */
.time24 { display: flex; align-items: center; gap: 4px; }
.field .time24 select { flex: 1 1 0; min-width: 0; width: auto; padding: 12px 6px; text-align: center; text-align-last: center; font-variant-numeric: tabular-nums; }
.time24 .colon { font-weight: 800; font-size: 20px; }
.photo-remind { margin: 0 0 8px; padding: 10px 12px; border-radius: 12px; background: #E8F5EC; border: 2px solid #3E9B6A; font-weight: 800; color: #0F3D25; }
