:root {
  --bg: #f3f6f2;
  --surface: #ffffff;
  --surface-2: #f8faf7;
  --ink: #18261d;
  --muted: #5b6a60;
  --line: #d9e2da;
  --brand: #2c6a43;
  --brand-dark: #1f4f31;
  --brand-soft: #e3efe6;
  --amber: #b9741d;
  --amber-soft: #fbefdc;
  --blue: #2b5f8c;
  --blue-soft: #e3edf6;
  --red: #b03a2e;
  --red-soft: #f8e4e1;
  --gray-soft: #eceeec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 40, 28, .06), 0 4px 16px rgba(20, 40, 28, .06);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); font-size: 16px; line-height: 1.55; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; background: var(--brand); color: #fff;
}
.topbar .title { font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.topbar .sub { opacity: .85; font-size: 14px; }
.topbar .spacer { flex: 1; }
.topbar .pill { background: rgba(255,255,255,.16); border-radius: 999px; padding: 3px 12px; font-size: 13px; }
.topbar a, .topbar button.link { color: #fff; opacity: .9; font-size: 13px; background: none; border: 0; cursor: pointer; text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 10px; padding: 10px 16px; font-weight: 600; cursor: pointer;
  min-height: 44px; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.amber { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger { color: var(--red); border-color: #e7c3bd; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.lg { min-height: 64px; font-size: 20px; border-radius: 14px; padding: 14px 24px; }
.btn.sm { min-height: 34px; padding: 5px 12px; font-size: 14px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; color: var(--muted); font-weight: 600; }
.input, select.input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; min-height: 44px;
}
.input:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }

.chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.st-received { background: var(--gray-soft); color: #4a524c; }
.st-requested { background: #f3e3f5; color: #7a2f86; }
.st-reviewing { background: var(--brand-soft); color: var(--brand-dark); }
.st-calling { background: var(--amber-soft); color: #8a5310; }
.st-in_call { background: var(--blue-soft); color: var(--blue); }
.st-checkout { background: #fff3c4; color: #6f5600; }
.st-face { background: var(--red-soft); color: var(--red); }
.st-done, .st-cancelled, .st-closed { background: var(--gray-soft); color: #8a928c; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #b9c2bb; }
.dot.on { background: #34c26b; box-shadow: 0 0 0 3px rgba(52,194,107,.2); }
.dot.busy { background: var(--amber); box-shadow: 0 0 0 3px rgba(185,116,29,.2); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

#toast {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%);
  width: max-content; text-align: center;
  background: #1d2a22; color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,.25); z-index: 1000; opacity: 0; pointer-events: none; transition: opacity .2s;
  max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; }
#toast.error { background: var(--red); }

.unlock {
  position: fixed; inset: 0; z-index: 900; display: grid; place-items: center;
  background: rgba(24, 38, 29, .88); color: #fff; text-align: center; cursor: pointer; padding: 24px;
}
.unlock .big { font-size: 34px; font-weight: 800; margin-bottom: 8px; }

video { background: #0e1511; border-radius: 12px; display: block; width: 100%; height: 100%; object-fit: cover; }
video.mirror { transform: scaleX(-1); }

/* 写真ビューア */
.viewer { position: fixed; inset: 0; z-index: 950; background: rgba(10,16,12,.92); display: grid; grid-template-rows: auto 1fr; }
.viewer .vbar { display: flex; gap: 8px; align-items: center; padding: 10px 14px; color: #fff; flex-wrap: wrap; }
.viewer .vbar .sp { flex: 1; }
.viewer .vbody { overflow: auto; display: grid; place-items: center; padding: 10px; }
.viewer img { max-width: 100%; max-height: 100%; transform-origin: center; transition: transform .15s; background: #fff; }
.viewer img.zoom { max-width: none; max-height: none; width: 180%; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs .th { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; padding: 0; }
.thumbs .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .th .x { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 14px; line-height: 24px; cursor: pointer; }
