/*
 * GENBA ONE by OWR（現場管理クラウド）
 * デザイン: 白地・丸みでやわらげる体裁（案F）。
 *   ・背景は白。面は白いカードを、細い罫とやわらかい影で浮かせる
 *   ・角は大きく丸め、押すものは端まで丸くする（手袋でも狙いやすい）
 *   ・数字と英字ラベルは Barlow Condensed、本文は Noto Sans JP
 *   ・屋外・老眼を前提に、本文17.5px／タップ領域は最小78px
 *   ・赤 #c62828 は「否」「要整備」だけに使う安全上の記号
 *   ・工程表の3色は主色と切り離して固定：予定=黒 / 変更=緑 / 実績=赤
 */
:root {
  --navy: #212a2c;          /* 濃い面（実施済み・お知らせ） */
  --accent: #387b6d;        /* 主色（良・進捗・主ボタン）／白文字との明暗差 5.0倍 */
  --accent-700: #2e6b5f;
  --accent-400: #7fc0b2;    /* 同期ランプ */
  --accent-100: #eef5f3;
  --red: #c62828;           /* 否・要整備／工程表の「実績」 */
  --green: #127a3c;         /* 工程表の「変更」（主色の緑とは別の色） */
  --plan: #1d1f20;          /* 工程表の「予定」 */
  --neutral-600: #7a7a7d;
  --neutral-700: #5d5d60;   /* 該当なし */
  --bg: #ffffff;
  --surface: #f3f6f5;
  --paper: #ffffff;
  --text: #212a2c;
  --muted: rgba(33, 42, 44, .66);
  --faint: rgba(33, 42, 44, .48);
  --divider: rgba(33, 42, 44, .16);
  --hairline: rgba(33, 42, 44, .11);

  /* 丸みと影 */
  --r: 18px;                /* カード・面 */
  --r-sm: 10px;             /* 入力欄・小さな面 */
  --r-btn: 999px;           /* 押すもの */
  --shadow: 0 2px 4px rgba(33, 60, 55, .05), 0 10px 26px rgba(33, 60, 55, .07);

  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --font-num: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17.5px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(56, 123, 109, .25); }

/* ---------- レジストレーションマーク付きの枠 ---------- */
.blueprint { position: relative; border: 1px solid var(--divider); background: transparent; }
.blueprint > .corner { position: absolute; width: 11px; height: 11px; color: rgba(29, 31, 32, .55); }
.blueprint > .corner::before,
.blueprint > .corner::after { content: ""; position: absolute; background: currentColor; }
.blueprint > .corner::before { left: 5px; top: 0; width: 1px; height: 100%; }
.blueprint > .corner::after { top: 5px; left: 0; width: 100%; height: 1px; }
.blueprint > .corner.tl { top: -6px; left: -6px; }
.blueprint > .corner.tr { top: -6px; right: -6px; }
.blueprint > .corner.bl { bottom: -6px; left: -6px; }
.blueprint > .corner.br { bottom: -6px; right: -6px; }

/* ---------- ヘッダー ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--paper);
  color: var(--text);
  border-bottom: 3px solid var(--accent);
}
.home-link { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.logo {
  display: inline-block;
  padding: 5px 7px 4px;
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  color: var(--accent);
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  letter-spacing: .14em;
}
.app-header .title { font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.app-header .tagline { font-size: 11px; color: var(--muted); white-space: nowrap; }
@media (max-width: 420px) { .app-header .tagline { display: none; } }
.app-header nav { display: flex; align-items: center; gap: 10px; }
.nav-btn {
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--divider);
  border-radius: var(--r-btn);
  padding: 7px 14px;
  font-size: 13px;
}
.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  white-space: nowrap;
}
.sync-chip::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--neutral-600);
  display: block;
}
.sync-chip.ok::before { background: var(--accent-400); }
.sync-chip.busy::before { background: #d8c26a; }
.sync-chip.error::before { background: #e06666; }
.sync-chip.off::before { background: var(--neutral-600); }

/* ---------- レイアウト ---------- */
main { max-width: 860px; margin: 0 auto; padding: 16px 14px 28px; }

/* 見出しは「英字キッカー ＋ 和文タイトル」を罫の上に並べる */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 10px;
  margin-bottom: 16px;
}
.page-head .kicker {
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--muted);
}
.page-head h1 { font-size: 19px; font-weight: 700; letter-spacing: .02em; margin: 0; text-align: right; }

h1 { font-size: 19px; margin: 4px 0 14px; }
h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  margin: 22px 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--divider);
}
h2 .kicker { font-family: var(--font-num); font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--accent); }
h3 { font-size: 14px; margin: 14px 0 6px; }
p { margin: 8px 0; }
.muted { color: var(--muted); font-size: 12.5px; }
.center { text-align: center; }
.num { font-family: var(--font-num); font-weight: 700; letter-spacing: .02em; }

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: -4px 0 6px -4px;
  padding: 4px 8px;
  color: var(--accent-700);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.back-link:active { background: var(--accent-100); }

.card {
  background: var(--paper);
  border: 1px solid var(--divider);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.card.tight { padding: 11px 12px; }
.card.plain { background: transparent; box-shadow: none; }

/* 本日の状況などの指標 */
.stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin: 0 0 18px;
  background: transparent;
}
.stat .figure { font-family: var(--font-num); font-size: 44px; font-weight: 700; line-height: .9; color: var(--accent-700); }
.stat .figure .of { font-size: 22px; color: var(--faint); }
.stat .note { font-size: 12.5px; line-height: 1.5; color: rgba(29, 31, 32, .7); }
.stat .note .ng { color: var(--red); font-weight: 700; }

/* ---------- 一覧 ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { margin-bottom: 10px; }
.row-link {
  display: flex;
  align-items: stretch;
  min-height: 90px;
  border: 1px solid var(--divider);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--paper);
  text-decoration: none;
  color: inherit;
}
.row-link:active { background: var(--accent-100); }
.row-link .count {
  width: 58px;
  flex: none;
  background: var(--accent);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-num);
}
.row-link .count.done { background: var(--navy); }
.row-link .count.idle { background: var(--neutral-600); }
.row-link .count .n { font-size: 26px; font-weight: 700; line-height: 1; }
.row-link .count .unit { font-size: 10px; letter-spacing: .1em; }
.row-link .body { flex: 1; padding: 11px 12px; display: flex; flex-direction: column; gap: 4px; justify-content: center; min-width: 0; }
.row-link .main { font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.row-link .sub { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.row-link .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.row-link .arrow {
  width: 34px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-num);
  font-size: 26px;
  color: var(--faint);
}

/* ---------- 小ラベル ---------- */
.badge, .tag {
  display: inline-flex;
  align-items: center;
  font: 700 10.5px/1 var(--font-body);
  padding: 6px 10px;
  border-radius: var(--r-btn);
  white-space: nowrap;
}
.badge.ok, .tag.ok { background: var(--accent); color: #fff; }
.badge.ng, .tag.ng { background: var(--red); color: #fff; }
.badge.none, .tag.none { background: var(--surface); color: var(--neutral-700); border: 1px solid var(--divider); }
.badge.done, .tag.done { background: var(--navy); color: #fff; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 62px;
  padding: 10px 22px;
  border: 1px solid var(--accent);
  border-radius: var(--r-btn);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
}
.btn:active { background: var(--accent-700); border-color: var(--accent-700); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--divider); }
.btn.secondary:active { background: rgba(29, 31, 32, .1); }
.btn.plain { background: transparent; color: var(--text); border-color: var(--divider); font-weight: 400; }
.btn.plain:active { background: rgba(29, 31, 32, .07); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.danger:active { background: rgba(198, 40, 40, .1); }
.btn.block { display: flex; width: 100%; }
.btn.small { min-height: 46px; padding: 6px 12px; font-size: 13px; }
.btn.lead { min-height: 72px; font-size: 17px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.btn-row .btn { flex: 1 1 auto; }

/* ---------- フォーム ---------- */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 5px; color: rgba(29, 31, 32, .75); }
input[type="text"], input[type="date"], input[type="time"], input[type="number"], input[type="url"], input[type="password"], input[type="month"], select, textarea {
  width: 100%;
  /* min-width を 0 にしないと、日付欄などが自前の幅を主張して隣の欄に重なる */
  min-width: 0;
  max-width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid rgba(33, 42, 44, .28);
  border-radius: var(--r-sm);
  font-size: 16.5px;
  font-family: inherit;
  background: var(--paper);
  color: var(--text);
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); outline-offset: 0; }
textarea { min-height: 84px; resize: vertical; }
/* 横に並べる欄。幅が足りないときは、重ならずに下へ折り返す */
.field-row { display: flex; flex-wrap: wrap; gap: 10px; }
.field-row > label.field { flex: 1 1 152px; min-width: 0; }
/* 日付の欄は、iPhone などで中の日付が切れないだけの幅を確保する。
   2つ並ばない幅（スマートフォン）では、重ならずに上下に分かれる */
.field-row > label.field:has(input[type="date"]) { flex-basis: 190px; }
.required { color: var(--red); font-size: 11px; margin-left: 5px; }

/* ---------- 点検フォーム ---------- */
.insp-head {
  padding: 13px 16px;
  border: 1px solid var(--divider);
  border-radius: var(--r);
  background: var(--surface);
  margin-bottom: 12px;
}
.insp-head .m-name { font-size: 15px; font-weight: 700; }
.insp-head .m-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* 進捗は画面上部に貼り付けて、残り件数を常に見せる */
.progress-bar {
  position: sticky;
  top: 52px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -14px 4px;
  padding: 10px 14px;
  background: var(--bg);
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}
.progress-bar .figure { font-family: var(--font-num); font-size: 30px; font-weight: 700; line-height: 1; color: var(--navy); }
.progress-bar .figure .of { font-size: 16px; color: var(--faint); }
.progress-bar .meter { flex: 1; }
.progress-bar .track { height: 9px; border-radius: 999px; background: rgba(33, 42, 44, .12); }
.progress-bar .fill { height: 9px; border-radius: 999px; background: var(--accent); width: 0; transition: width .15s linear; }
.progress-bar .left { font-size: 11px; color: var(--muted); margin-top: 4px; }
.progress-bar .left .ng { color: var(--red); font-weight: 700; }

.section-note { font-size: 11.5px; line-height: 1.55; color: var(--muted); margin: 6px 0 2px; }
.check-item { padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.check-item:last-child { border-bottom: none; }
.check-item .head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 9px; }
.check-item .no { font-family: var(--font-num); font-size: 13px; font-weight: 700; color: var(--faint); min-width: 18px; }
.check-item .label { font-size: 15.5px; line-height: 1.45; font-weight: 500; }
.check-item .hint { display: block; font-size: 11.5px; font-weight: 700; color: var(--red); margin-top: 3px; }

.choices { display: flex; gap: 8px; }
.choices label { flex: 1; position: relative; }
.choices input { position: absolute; opacity: 0; width: 0; height: 0; }
.choices span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 78px;
  border: 2px solid rgba(33, 42, 44, .18);
  border-radius: var(--r-btn);
  background: var(--paper);
  color: rgba(33, 42, 44, .66);
  font-weight: 700;
  font-size: 18px;
}
.choices span.c-na { font-size: 13.5px; }
.choices input:checked + span.c-ok { background: var(--accent); border-color: var(--accent); color: #fff; }
.choices input:checked + span.c-ng { background: var(--red); border-color: var(--red); color: #fff; }
.choices input:checked + span.c-na { background: var(--neutral-700); border-color: var(--neutral-700); color: #fff; }
.choices input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.sticky-actions {
  position: sticky;
  bottom: 0;
  margin: 0 -14px;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--bg) 26%);
  border-top: 1px solid var(--hairline);
}
/* 未選択が残っている間は、押せない状態を面で示す */
.btn.submit { width: 100%; min-height: 78px; font-size: 19px; border: none; box-shadow: 0 6px 16px rgba(56, 123, 109, .3); }
.btn.submit.wait { background: rgba(33, 42, 44, .18); color: rgba(33, 42, 44, .55); box-shadow: none; }
.btn.submit.ng { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(198, 40, 40, .28); }

/* ---------- 補助表示 ---------- */
.sql-box { margin-top: 10px; border-top: 1px solid var(--divider); padding-top: 10px; }
.sql-box summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--accent-700); }
.sql-box pre {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  padding: 10px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
  -webkit-user-select: all;
  user-select: all;
}

.alert { padding: 13px 15px; font-size: 13.5px; margin: 12px 0; border: 1px solid var(--divider); border-radius: var(--r); }
.alert.warn { background: rgba(216, 194, 106, .12); border-color: #d8c26a; }
.alert.error { background: rgba(198, 40, 40, .06); border: 2px solid var(--red); }
.alert.error strong { color: var(--red); }
.alert.info { background: var(--accent-100); border-color: rgba(56, 123, 109, .38); }

/* ---------- QR ---------- */
.qr-box { text-align: center; }
.qr-box svg { width: 100%; max-width: 260px; height: auto; }
.qr-url { font-size: 10.5px; color: var(--muted); word-break: break-all; margin-top: 8px; }

/* ---------- QRの読み取り画面 ---------- */
.scan-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 60vh;
  background: #000;
  border: 1px solid var(--divider);
  border-radius: var(--r);
  overflow: hidden;
}
.scan-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 四隅のトンボで読み取り範囲を示す */
.scan-guide { position: absolute; inset: 12%; pointer-events: none; }
.scan-guide i { position: absolute; width: 28px; height: 28px; border: 3px solid rgba(242,242,243,.9); }
.scan-guide i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.scan-guide i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.scan-guide i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.scan-guide i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.scan-status {
  margin: 12px 0;
  padding: 11px 14px;
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 13.5px;
  line-height: 1.6;
}
.scan-status.error { border: 2px solid var(--red); background: rgba(198,40,40,.06); }

/* ---------- 安全確認（Turnstile）の表示 ---------- */
.ts-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(33, 42, 44, .5);
}
.ts-box {
  background: var(--paper);
  border: 1px solid var(--divider);
  border-radius: var(--r);
  padding: 20px 18px;
  max-width: 340px;
  width: 100%;
  text-align: center;
}
.ts-box .ts-title { font-weight: 700; font-size: 15px; }
.ts-box .ts-note { font-size: 12px; color: var(--muted); margin: 6px 0 12px; }
.ts-box iframe { max-width: 100%; }

/* ---------- 表 ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { border: 1px solid var(--divider); padding: 6px 8px; text-align: left; vertical-align: top; }
table.data th { background: var(--surface); font-weight: 700; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

/* ---------- トースト ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--navy);
  color: #f2f2f3;
  padding: 12px 20px;
  border-radius: var(--r-btn);
  font-size: 13.5px;
  z-index: 50;
  box-shadow: 0 6px 20px rgba(33, 60, 55, .22);
}

/* ---------- フッター ---------- */
.app-footer {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 18px 14px calc(20px + env(safe-area-inset-bottom));
  letter-spacing: .04em;
}

/* ---------- 印刷 ---------- */
/* 余白だけを指定し、用紙サイズと向きは印刷ダイアログの設定に従わせる。
   size を指定すると、ブラウザによっては「向き」の選択が無効になり、
   縦を選んでも反映されなくなるため。レイアウトは幅に対する相対指定で、
   A4縦（印刷可能幅190mm）を基準に組んである。 */
@page { margin: 10mm; }

.print-only { display: none; }
.print-sheet { background: #fff; padding: 12px; }

.label-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.qr-label {
  border: 1px dashed #999;
  padding: 8px;
  text-align: center;
  background: #fff;
  break-inside: avoid;
  page-break-inside: avoid;
}
.qr-label svg { width: 100%; max-width: 150px; height: auto; }
.qr-label .m-name { font-weight: 700; font-size: 14px; margin-top: 4px; word-break: break-all; }
.qr-label .m-sub { font-size: 11px; color: #444; word-break: break-all; }
.qr-label .m-guide { font-size: 10px; color: #222; margin-top: 3px; border-top: 1px solid #ccc; padding-top: 3px; }

/* 帳票は提出書類のため、画面の配色には寄せず黒罫のままにする */
.record-doc { background: #fff; color: #000; }
.record-doc .doc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 10px; }
.record-doc .doc-title { font-size: 18px; font-weight: 700; }
.record-doc .doc-sub { font-size: 13px; }
.record-doc .meta { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.record-doc .meta th, .record-doc .meta td { border: 1px solid #666; padding: 4px 8px; text-align: left; }
.record-doc .meta th { background: #eee; white-space: nowrap; width: 90px; }
.record-doc h3 { font-size: 14px; margin: 14px 0 6px; }
.record-doc table.data th, .record-doc table.data td { border-color: #666; }
.record-doc table.data th { background: #eee; }

.record-doc .approval { border-collapse: collapse; font-size: 11px; flex: none; }
.record-doc .approval th, .record-doc .approval td { border: 1px solid #666; text-align: center; padding: 2px 4px; }
.record-doc .approval th { background: #eee; font-weight: 400; white-space: nowrap; }
.record-doc .approval td { width: 26mm; height: 16mm; vertical-align: middle; }
.record-doc .approval .ap-name { display: block; font-size: 12px; }
.record-doc .approval .ap-date { display: block; font-size: 10px; color: #444; }

.record-page { page-break-after: always; break-after: page; }
.record-page:last-child { page-break-after: auto; break-after: auto; }

/* 点検項目の表。印刷時は2項目を横に並べて1ページに収める */
table.data.items .i-res { width: 4.2em; text-align: center; white-space: nowrap; }
table.data.two-up { table-layout: fixed; }
table.data.two-up .i-label { width: 32%; word-break: break-word; }
table.data.two-up .i-res { width: 18%; }

/* 確認の入力欄（画面用） */
.approve-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.approve-row:last-child { border-bottom: none; }
.approve-role { font-weight: 700; font-size: 13px; width: 6.5em; flex: none; }
.approve-row input[type="text"] { flex: 1; min-width: 8em; width: auto; }
.approve-done { flex: 1; font-size: 13.5px; }
.approve-done .muted { font-size: 11.5px; }

/* ------------------------------------------------------------------ *
 * 月間点検表（1台・1か月＝1枚）
 * 縦＝点検項目／横＝1日〜末日のマス目。
 * 用紙の向きは指定していない。A4の縦・横どちらでも収まる寸法にしてある。
 * ------------------------------------------------------------------ */
.month-doc { background: #fff; color: #000; }
.month-doc .doc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 8px; }
.month-doc .doc-title { font-size: 18px; font-weight: 700; }
.month-doc .doc-sub { font-size: 13px; }
.month-doc .meta { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 8px; }
.month-doc .meta th, .month-doc .meta td { border: 1px solid #666; padding: 3px 6px; text-align: left; }
.month-doc .meta th { background: #eee; white-space: nowrap; width: 84px; }
.month-doc .approval { border-collapse: collapse; font-size: 11px; flex: none; }
.month-doc .approval th, .month-doc .approval td { border: 1px solid #666; text-align: center; padding: 2px 4px; }
.month-doc .approval th { background: #eee; font-weight: 400; white-space: nowrap; }
.month-doc .approval td { width: 26mm; height: 16mm; vertical-align: middle; }
.month-doc .approval .ap-name { display: block; font-size: 12px; }
.month-doc .approval .ap-date { display: block; font-size: 10px; color: #444; }

.month-grid { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.month-grid th, .month-grid td { border: 1px solid #666; padding: 0; text-align: center; vertical-align: middle; }
.month-grid th.i-label { width: 30%; text-align: left; padding: 2px 5px; font-weight: 400; line-height: 1.25; background: #fff; }
.month-grid thead th { background: #eee; font-weight: 700; }
.month-grid thead th.i-label { font-weight: 700; background: #eee; }
.month-grid .sec-row th { background: #dde4ec; text-align: left; padding: 2px 5px; font-weight: 700; }
.month-grid th.sat, .month-grid td.sat { background: #eef3f8; }
.month-grid th.sun, .month-grid td.sun { background: #faeeee; }
.month-grid .mk { font-size: 12px; line-height: 1.4; }
.month-grid .mk.ng { color: #c62828; font-weight: 700; }
.month-grid .mk.na { color: #666; }
/* 点検者名・元請確認の氏名は横幅に入らないため縦書きにする */
.month-grid td.vtext { writing-mode: vertical-rl; text-orientation: upright; font-size: 9px; padding: 2px 0; white-space: nowrap; overflow: hidden; }
.month-grid td.vtext.who { height: 26mm; }   /* 点検者が交代した日は氏名が2つ入る */

.month-doc .legend { font-size: 11px; margin: 5px 0 0; color: #333; }
.month-doc h3 { font-size: 13px; margin: 10px 0 4px; }
.month-doc .note-list { margin: 0; padding-left: 1.3em; font-size: 12px; line-height: 1.6; }
.month-doc .note-empty { font-size: 12px; border: 1px solid #666; padding: 4px 6px; }

.month-page { page-break-after: always; break-after: page; }
.month-page:last-child { page-break-after: auto; break-after: auto; }

@media print {
  .no-print, .app-header, .toast { display: none !important; }
  body { background: #fff; font-size: 11pt; color: #000; }
  main { max-width: none; padding: 0; }
  .print-only { display: block; }
  .card { border: none; padding: 0; }
  .print-sheet { padding: 0; }
  .label-grid { grid-template-columns: repeat(2, 1fr); gap: 6mm; }
  .qr-label { border: 1px dashed #666; }
  table.data th,
  .record-doc .approval th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .record-doc .approval { font-size: 9pt; }
  a { color: #000; text-decoration: none; }
  .table-scroll { overflow: visible; }

  /* 点検記録表を1件＝A4・1ページに収めるための詰め */
  .record-doc.compact .doc-title { font-size: 15pt; }
  .record-doc.compact .doc-head { padding-bottom: 4px; margin-bottom: 6px; }
  .record-doc.compact .meta { margin-bottom: 6px; }
  .record-doc.compact .meta th,
  .record-doc.compact .meta td { padding: 2px 6px; }
  .record-doc.compact h3 { font-size: 10pt; margin: 7px 0 2px; }
  .record-doc.compact table.data th,
  .record-doc.compact table.data td { padding: 2px 5px; line-height: 1.35; }
  .record-doc.compact .approval td { height: 13mm; width: 24mm; }
  .record-doc.compact { page-break-inside: avoid; break-inside: avoid; }

  /* 月間点検表：1台＝A4・1ページに収めるための詰め */
  .month-doc .doc-title { font-size: 14pt; }
  .month-doc .doc-head { padding-bottom: 4px; margin-bottom: 5px; }
  .month-doc .meta { font-size: 8pt; margin-bottom: 5px; }
  .month-doc .meta th, .month-doc .meta td { padding: 1.5px 4px; }
  .month-doc .approval { font-size: 8pt; }
  .month-doc .approval td { width: 22mm; height: 12mm; }
  .month-doc .approval th,
  .month-grid thead th,
  .month-grid .sec-row th,
  .month-grid th.sat, .month-grid td.sat,
  .month-grid th.sun, .month-grid td.sun {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .month-grid { font-size: 6pt; }
  .month-grid thead th { font-size: 5.5pt; }
  .month-grid th.i-label { padding: 0.8px 3px; line-height: 1.2; }
  .month-grid .sec-row th { padding: 0.8px 3px; font-size: 6pt; }
  .month-grid .mk { font-size: 7pt; line-height: 1.2; }
  .month-grid td.vtext { font-size: 5.5pt; }
  .month-grid td.vtext.who { height: 20mm; }
  .month-doc .legend { font-size: 7pt; }
  .month-doc h3 { font-size: 8.5pt; margin: 6px 0 2px; }
  .month-doc .note-list, .month-doc .note-empty { font-size: 7.5pt; line-height: 1.4; }
  .month-page { page-break-inside: avoid; break-inside: avoid; }

  @page { margin: 10mm; }
}

@media (min-width: 700px) {
  .label-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ------------------------------------------------------------------ *
 * 足場の点検で使う部分（旧・足場点検アプリから）
 * ------------------------------------------------------------------ */

/* ---------- 良否の4択（良／即時改善／否／該当なし） ----------
 * 元の .choices span は「ボタンの面」を作る指定なので、
 * 中に入れた記号と文字（.mk / .lb）には当たらないよう打ち消しておく。 */
.choices.four { gap: 6px; }
.choices.four > label > span {
  flex-direction: column;
  gap: 1px;
  height: 64px;
  font-size: 11px;
  line-height: 1.2;
  padding: 0 2px;
  text-align: center;
}
.choices .mk, .choices .lb {
  display: block;
  height: auto;
  min-height: 0;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
}
.choices .mk { font-size: 20px; line-height: 1.1; font-weight: 400; }
.choices .lb { font-size: 10.5px; font-weight: 700; }
.choices input:checked + span.c-fix { background: #b8860b; border-color: #b8860b; color: #fff; }

/* ---------- 是正内容（否・即時改善のときだけ開く） ---------- */
.fix-box {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--divider);
  background: rgba(216, 194, 106, .10);
}
.fix-box[hidden] { display: none; }
.fix-box .fix-label { font-size: 11.5px; font-weight: 700; color: var(--accent-700); margin-bottom: 6px; }
.fix-box input[type="text"], .fix-box input[type="date"] { margin-bottom: 6px; }
.fix-box .field-row { margin-bottom: 0; }

/* ---------- 選択肢のチップ（点検時期・点検資格） ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; width: 0; height: 0; }
.chips span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 2px solid rgba(29, 31, 32, .18);
  background: var(--paper);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
.chips input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips.wrapy span { display: block; padding: 10px 12px; }

/* ---------- 立場の選び分け（元請／使用業者） ---------- */
.role-pick { display: grid; grid-template-columns: 1fr; gap: 10px; }
.role-pick .btn { display: block; text-align: left; padding: 14px; height: auto; min-height: 0; }
.role-pick .btn .r-name { display: block; font-size: 16px; font-weight: 700; }
.role-pick .btn .r-sub { display: block; font-size: 11.5px; font-weight: 400; opacity: .82; margin-top: 3px; }

/* ---------- 点検表（印刷用・A4縦1枚） ---------- *
 * 提出書類のため、画面の配色には寄せず黒罫のままにする。 */
.sheet-doc { background: #fff; color: #000; }
.sheet-doc .doc-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 12px; border-bottom: 2px solid #000; padding-bottom: 5px; margin-bottom: 7px;
}
.sheet-doc .doc-title { font-size: 17px; font-weight: 700; }
.sheet-doc .doc-sub { font-size: 12px; }
.sheet-doc .meta { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 7px; }
.sheet-doc .meta th, .sheet-doc .meta td { border: 1px solid #666; padding: 3px 6px; text-align: left; vertical-align: top; }
.sheet-doc .meta th { background: #eee; white-space: nowrap; width: 76px; font-weight: 400; }
.sheet-doc .legend { font-size: 11px; margin: 0 0 4px; }

.sheet-grid { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
/* スマートフォンでは横スクロールで読ませる。印刷時は下の @media print で解除する */
.table-scroll > .sheet-grid { min-width: 620px; }
.sheet-grid th, .sheet-grid td { border: 1px solid #666; padding: 2px 4px; vertical-align: middle; }
.sheet-grid thead th { background: #eee; text-align: center; font-weight: 700; }
.sheet-grid td.g-cat { font-size: 10px; line-height: 1.25; vertical-align: middle; }
.sheet-grid td.g-no { text-align: center; width: 5%; font-family: var(--font-num); }
.sheet-grid td.g-item { line-height: 1.3; }
.sheet-grid td.g-res { text-align: center; width: 7%; font-size: 13px; }
.sheet-grid td.g-res.ng { color: #c62828; font-weight: 700; }
.sheet-grid td.g-fix { width: 24%; font-size: 10px; line-height: 1.25; }
.sheet-grid td.g-day { width: 9%; text-align: center; font-size: 10px; }
.sheet-grid td.g-who { width: 10%; text-align: center; font-size: 10px; }
.sheet-grid col.c-cat { width: 15%; }

.sheet-doc .foot { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; }
.sheet-doc .foot .notes { flex: 1; font-size: 11px; }
.sheet-doc .approval { border-collapse: collapse; font-size: 11px; flex: none; }
.sheet-doc .approval th, .sheet-doc .approval td { border: 1px solid #666; text-align: center; padding: 2px 4px; }
.sheet-doc .approval th { background: #eee; font-weight: 400; white-space: nowrap; }
.sheet-doc .approval td { width: 26mm; height: 16mm; vertical-align: middle; }
.sheet-doc .approval .ap-name { display: block; font-size: 12px; }
.sheet-doc .approval .ap-date { display: block; font-size: 10px; color: #444; }

.sheet-page { page-break-after: always; break-after: page; }
.sheet-page:last-child { page-break-after: auto; break-after: auto; }

/* 使用業者の点検表は、1日1ブロックを縦に並べる */
.user-block { margin-bottom: 8px; }
.user-block .b-head {
  font-size: 11px; font-weight: 700; background: #eee; border: 1px solid #666;
  border-bottom: none; padding: 2px 5px;
}

@media print {
  .ky-doc { font-size: 8.4pt; }
  .ky-doc th, .ky-doc td { padding: 2px 4px; }
  .ky-title-row .ky-title { font-size: 15pt; }
  .ky-doc th, .ky-mem .ky-mem-th, .ky-mem .ky-count, .ky-top th, .ky-goal th, .ky-risk thead th {
    background: #eee !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .en-doc { font-size: 8.2pt; }
  .en-doc th, .en-doc td { padding: 2px 4px; }
  .en-title { font-size: 14pt; }
  .en-table th, .en-table .en-side {
    background: #eee !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .en-table .en-q { background: #fff !important; }
  .sheet-doc .doc-title { font-size: 14pt; }
  .sheet-doc .doc-head { padding-bottom: 3px; margin-bottom: 5px; }
  .sheet-doc .doc-sub { font-size: 8.5pt; }
  .sheet-doc .meta { font-size: 8pt; margin-bottom: 5px; }
  .sheet-doc .meta th, .sheet-doc .meta td { padding: 1.5px 4px; }
  .sheet-doc .legend { font-size: 7.5pt; }
  .table-scroll > .sheet-grid { min-width: 0; }
  .sheet-grid { font-size: 7pt; }
  .sheet-grid th, .sheet-grid td { padding: 1px 3px; }
  .sheet-grid td.g-cat, .sheet-grid td.g-fix { font-size: 6.5pt; }
  .sheet-grid td.g-day, .sheet-grid td.g-who { font-size: 6.5pt; }
  .sheet-grid td.g-res { font-size: 8.5pt; }
  .sheet-doc .approval { font-size: 8pt; }
  .sheet-doc .approval td { width: 22mm; height: 12mm; }
  .sheet-doc .foot .notes { font-size: 7.5pt; }
  .sheet-grid thead th,
  .sheet-doc .approval th,
  .user-block .b-head {
    background: #eee !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .sheet-page { page-break-inside: avoid; break-inside: avoid; }
}

@media (min-width: 560px) {
  .role-pick { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------------------------------ *
 * 現場管理クラウドで追加した部分
 * （事務所のナビ・タブ・指標・注意事項・工程表・配置表・資材・工具・帳票）
 * ------------------------------------------------------------------ */
:root { --amber: #b8860b; --amber-bg: rgba(216, 194, 106, .16); }

/* ---------- 事務所のナビ ---------- */
.main-nav {
  display: flex;
  gap: 0;
  overflow-x: auto;
  background: var(--paper);
  border-bottom: 1px solid var(--divider);
  -webkit-overflow-scrolling: touch;
}
.main-nav[hidden] { display: none; }
.main-nav a {
  flex: 1 0 auto;
  min-width: 64px;
  text-align: center;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.main-nav a.on { color: var(--text); border-bottom-color: var(--accent); }
.app-header .nav-btn { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.printing .main-nav, body.printing .app-footer { display: none; }

/* ---------- タブ ---------- */
.tabs {
  display: flex;
  overflow-x: auto;
  gap: 0;
  margin: 4px 0 14px;
  border-bottom: 1px solid var(--divider);
  -webkit-overflow-scrolling: touch;
}
.tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 11px 13px 9px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.tab.on { color: var(--navy); border-bottom-color: var(--accent); }
.tab-badge {
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 700;
  padding: 1px 5px;
  background: var(--surface);
  color: var(--neutral-700);
  border: 1px solid var(--divider);
}

/* ---------- 現場名の見出し ---------- */
.site-title { border-bottom: 1px solid var(--divider); padding-bottom: 8px; margin-bottom: 4px; }
.site-title .st-name { font-size: 19px; font-weight: 700; line-height: 1.35; }
.site-title .st-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
h2 .h2-right { margin-left: auto; font-size: 12px; font-weight: 400; }
.meta-lines { font-size: 12.5px; line-height: 1.7; }
.hint-text { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; font-weight: 400; }
.gap { height: 10px; }

/* ---------- 指標のタイル ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 14px; }
@media (min-width: 640px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  min-height: 88px;
  padding: 12px 14px;
  background: var(--accent-100);
  border: 1px solid var(--divider);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.kpi.alarm { background: rgba(198, 40, 40, .06); border-color: rgba(198, 40, 40, .35); }
.kpi-fig { font-family: var(--font-num); font-size: 34px; font-weight: 700; line-height: 1; color: var(--navy); }
.kpi.alarm .kpi-fig { color: var(--red); }
.kpi-fig .of, .kpi-unit { font-size: 16px; color: var(--faint); margin-left: 2px; }
.kpi-fig.small { font-family: var(--font-body); font-size: 17px; }
.kpi-label { font-size: 11.5px; color: var(--muted); line-height: 1.35; }

/* ---------- 注意すべきこと ---------- */
.alert-list { list-style: none; margin: 0 0 12px; padding: 0; }
.alert-list li { margin-bottom: 6px; }
.alert-list a {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--divider);
  text-decoration: none;
  color: inherit;
}
.alert-list .al-mark {
  flex: none;
  width: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--amber);
}
.alert-list li.lv2 .al-mark { background: var(--red); }
.alert-list .al-body { padding: 9px 11px; font-size: 13px; line-height: 1.5; }
.alert-list .al-site { display: block; font-size: 11px; color: var(--muted); }

/* ---------- 小ラベル（黄色） ---------- */
.badge.warn, .tag.warn { background: var(--amber-bg); color: #6d5100; border: 1px solid #d8c26a; }

/* ---------- 進み具合の細いバー ---------- */
.meter-line { display: inline-block; width: 90px; height: 6px; background: rgba(29, 31, 32, .12); vertical-align: middle; }
.meter-line > span { display: block; height: 6px; background: var(--accent); }
.mini-progress { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 11px; }

/* ---------- 表（項目：値） ---------- */
table.kv { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.kv th, table.kv td { text-align: left; vertical-align: top; padding: 5px 0; border-bottom: 1px solid var(--hairline); }
table.kv tr:last-child th, table.kv tr:last-child td { border-bottom: none; }
table.kv th { width: 8.5em; color: var(--muted); font-weight: 700; font-size: 12.5px; padding-right: 10px; }
table.kv a { color: var(--accent-700); }

table.data.compact-table { font-size: 12.5px; margin-top: 10px; }
table.data.compact-table th, table.data.compact-table td { padding: 5px 6px; }
.r { text-align: right !important; }
.nowrap { white-space: nowrap; }
tr.unsent td { background: var(--amber-bg); }
.link-btn { background: none; border: none; color: var(--red); font-size: 11.5px; cursor: pointer; padding: 0 2px; text-decoration: underline; }

/* ---------- チェックボックス1行 ---------- */
.check-line { display: flex; align-items: center; gap: 10px; min-height: 48px; font-size: 14px; }
.check-line input { width: 22px; height: 22px; accent-color: var(--accent); }

/* ---------- 点検：区分のボタン ---------- */
.btn.phase-btn { flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.btn.phase-btn .pb-name { font-size: 16px; }
.btn.phase-btn .pb-sub { font-size: 11.5px; font-weight: 400; opacity: .85; }

/* ---------- 点検：良否の3択（記号＋文字） ---------- */
.choices.three > label > span { flex-direction: column; gap: 1px; height: 68px; line-height: 1.2; }
.check-item.missing { outline: 2px solid var(--red); outline-offset: 2px; }

.record-doc .note-box { border: 1px solid #666; padding: 5px 8px; font-size: 13px; min-height: 2em; }
.ng-text { color: var(--red); }

/* ---------- その場の入力欄 ---------- */
.inline-form { margin-top: 10px; padding: 14px; border: 2px solid var(--accent); border-radius: var(--r); background: var(--accent-100); }
.inline-title { font-weight: 700; margin-bottom: 8px; color: var(--accent-700); }
.stock-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.stock-buttons .btn { min-height: 56px; }

/* ---------- アカウント ---------- */
.user-head { font-size: 15px; }
.user-row .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--hairline); }
.plain-list li:last-child { border-bottom: none; }
.source-list { margin: 4px 0 8px; padding-left: 1.2em; font-size: 12px; line-height: 1.6; }
.fold { margin: 10px 0; }
.fold summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--accent-700); padding: 6px 0; }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.month-nav strong { font-size: 16px; }
.toast.error { background: var(--red); }
.ts-widget { display: flex; justify-content: center; min-height: 20px; }

/* ---------- たたんで見せる案内 ---------- */
.help { margin: 14px 0 0; border-top: 1px solid var(--hairline); padding-top: 10px; }
.help > summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--accent-700);
  padding: 6px 0;
  list-style: none;
}
.help > summary::before { content: '＋ '; font-family: var(--font-num); }
.help[open] > summary::before { content: '－ '; }
.help > summary::-webkit-details-marker { display: none; }
.help p { font-size: 12.5px; line-height: 1.75; margin: 8px 0 0; }
.help p.muted { font-size: 12px; }

/* ---------- 凡例（画面） ---------- */
.legend { font-size: 11.5px; color: var(--muted); margin: 6px 0 0; line-height: 1.6; }

/* ---------- 工程表・配置表（横棒） ---------- */
.gantt { font-size: 12px; }
.g-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--hairline); }
.g-row.g-head { border-bottom: 1px solid var(--divider); color: var(--muted); }
.g-name { flex: none; width: 34%; max-width: 190px; padding: 5px 6px 5px 0; line-height: 1.35; word-break: break-all; }
.g-pct { display: block; font-family: var(--font-num); font-size: 12px; color: var(--muted); }
.g-track { position: relative; flex: 1; min-height: 30px; background-image: linear-gradient(to right, var(--hairline) 1px, transparent 1px); background-size: 25% 100%; }
.g-track.tall { min-height: 34px; }
.g-head .g-track { min-height: 22px; background: none; }
.g-tick { position: absolute; top: 3px; font-family: var(--font-num); font-size: 11px; white-space: nowrap; transform: translateX(2px); }
/* 今日の線は、予定・変更・実績の3色とまぎれないよう破線の灰にする */
.g-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed rgba(33, 42, 44, .6); }
.g-bar { position: absolute; top: 9px; height: 12px; background: rgba(29, 31, 32, .1); border: 1.5px solid var(--plan); }
.g-bar.late { background: rgba(198, 40, 40, .16); }
.g-bar.half { top: 6px; height: 7px; }
.g-bar.rev { top: 15px; height: 7px; border-color: var(--green); background: rgba(18, 122, 60, .2); }
.g-done { display: block; height: 100%; background: var(--red); }
.g-bar.late .g-done { background: var(--red); }
.g-row.empty .g-name { color: var(--amber); }

/* ---------- 工程表（ドラッグで編集する） ---------- */
.ge {
  display: flex;
  align-items: flex-start;
  border: 1px solid var(--divider);
  background: var(--paper);
  user-select: none;
  -webkit-user-select: none;
}
/* min-width:0 が無いと、下の入力欄の分だけ勝手に広がってしまう */
.ge-side { flex: 0 0 226px; min-width: 0; border-right: 1px solid var(--divider); }
@media (max-width: 480px) { .ge-side { flex-basis: 176px; } }
.ge-side-head {
  height: var(--head-h, 24px);
  display: flex;
  align-items: flex-end;
  padding: 0 6px 3px;
  font-size: 11.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--divider);
}
.ge-name {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  border-bottom: 1px solid var(--hairline);
  font-size: 12.5px;
}
.ge-nm { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.ge-g {
  font-size: 10.5px;
  line-height: 1.2;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ge-g.cont { color: var(--faint); }   /* 上の行と同じ工種 */
.ge-name a { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ge-name b { flex: none; font-family: var(--font-num); font-weight: 700; color: var(--muted); }
.ge-ord { flex: none; display: flex; flex-direction: column; gap: 2px; }
.ge-mv {
  width: 22px;
  height: 20px;
  padding: 0;
  font-size: 9px;
  line-height: 1;
  border: 1px solid var(--divider);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
.ge-mv:disabled { color: rgba(33, 42, 44, .2); cursor: default; }
.ge-mv:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.ge-rev {
  flex: none;
  width: 21px;
  height: 21px;
  padding: 0;
  font-size: 10.5px;
  line-height: 1;
  border: 1px solid var(--divider);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
.ge-rev.on { background: var(--green); border-color: var(--green); color: #fff; }
.ge-name b.ok { color: var(--accent); }
.ge-name.new { height: 68px; }
.ge-name.new input {
  width: 100%;
  min-width: 0;
  min-height: 26px;
  padding: 3px 6px;
  font-size: 12px;
  border: 1px solid var(--divider);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
}
.ge-name.new .ge-nm { gap: 4px; }
.ge-add {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.ge-scroll { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; }
.ge-body { position: relative; }
.ge-head { position: relative; border-bottom: 1px solid var(--divider); }
.ge-m {
  position: absolute;
  top: 3px;
  padding-left: 4px;
  border-left: 1px solid var(--hairline);
  font-family: var(--font-num);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}
.ge-d {
  position: absolute;
  bottom: 2px;
  font-family: var(--font-num);
  font-size: 9.5px;
  line-height: 1;
  color: var(--faint);
  text-align: center;
}
.ge-d.sun { color: var(--red); }
.ge-d.sat { color: #3a6ea5; }
.ge-lines { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none; }
.ge-line { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--hairline); }
.ge-today { position: absolute; top: 0; bottom: 0; border-left: 2px dashed rgba(33, 42, 44, .6); }
.ge-track {
  position: relative;
  height: 46px;
  border-bottom: 1px solid var(--hairline);
  cursor: crosshair;
  touch-action: pan-y;
}
.ge-track.new { height: 68px; background: repeating-linear-gradient(135deg, rgba(89, 128, 166, .06) 0 6px, transparent 6px 12px); }
.ge-hint {
  position: absolute;
  left: 8px;
  top: 26px;
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  pointer-events: none;
}
.ge-bar {
  position: absolute;
  top: 8px;
  height: 30px;
  background: rgba(29, 31, 32, .08);
  border: 2px solid var(--plan);
  cursor: grab;
}
.ge-bar.late { background: rgba(198, 40, 40, .14); }
.ge-bar.half { top: 5px; height: 17px; }
.ge-bar.rev { top: 24px; height: 17px; background: rgba(18, 122, 60, .16); border-color: var(--green); }
.ge-bar.rev .ge-cap { color: var(--green); text-shadow: none; }
.ge-bar.temp { border-style: dashed; }
.ge-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--red); opacity: .85; pointer-events: none; }
.ge-bar.late .ge-fill { background: var(--red); }
.ge-cap {
  position: absolute;
  left: 5px;
  top: 0;
  line-height: 27px;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
  pointer-events: none;
}
.ge-cap.dark { color: var(--text); text-shadow: none; }
.ge-h { position: absolute; top: 0; bottom: 0; width: 9px; z-index: 2; }
.ge-h.h-l { left: -4px; cursor: ew-resize; }
.ge-h.h-r { right: -4px; cursor: ew-resize; }
.ge-h.h-p { width: 14px; margin-left: -7px; cursor: col-resize; }
.ge-h.h-p::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -5px;
  background: #fff;
  border: 2px solid var(--red);
}
.ge-bar.rev .ge-h.h-p::after { border-color: var(--green); }
.ge-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.ge-zoom { font-size: 12px; color: var(--muted); }
.ge-z {
  min-width: 36px;
  height: 28px;
  margin-left: 3px;
  font-family: var(--font-num);
  font-size: 13px;
  border: 1px solid var(--divider);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.ge-z.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ge-tools .legend { margin: 0; }

.s-bar {
  position: absolute;
  height: 14px;
  font-size: 9.5px;
  line-height: 14px;
  color: #fff;
  padding: 0 3px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.c0 { background: #5980a6; } .c1 { background: #2f7d62; } .c2 { background: #b8860b; } .c3 { background: #7a4e9c; }
.c4 { background: #b5533c; } .c5 { background: #1d2d3d; } .c6 { background: #4f8a2b; } .c7 { background: #8a6d3b; }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.s-legend { font-size: 11px; color: #fff; padding: 2px 6px; }

/* ---------- KY活動表（画面） ---------- */
.ky-row { padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.ky-row:last-child { border-bottom: none; }
.ky-row-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 8px;
}
.ky-grade { font-weight: 400; font-size: 12px; color: var(--muted); }
.ky-grade.ok { color: var(--accent-700); font-weight: 700; }
.ky-grade.warn { color: #8a6a00; font-weight: 700; }
.ky-grade.ng { color: var(--red); font-weight: 700; }

/* ---------- KY活動表（印刷・A4横） ---------- */
.ky-doc { background: #fff; color: #000; font-size: 11px; }
.ky-doc table { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
.ky-doc th, .ky-doc td { border: 1px solid #000; padding: 3px 5px; vertical-align: middle; }
.ky-title-row { margin-bottom: 8px; }
.ky-title-row .ky-title {
  border: none;
  font-size: 19px;
  font-weight: 700;
  text-align: center;
  letter-spacing: .2em;
}
.ky-title-row .ky-th { width: 88px; text-align: center; background: #eee; }
.ky-title-row .ky-name { width: 130px; }
.ky-top th { width: 92px; background: #eee; white-space: nowrap; text-align: left; }
.ky-top td { height: 22px; }
.ky-risk thead th { background: #eee; text-align: center; }
.ky-risk .ky-haz { width: 24%; vertical-align: top; }
.ky-risk .ky-mea { width: 26%; vertical-align: top; }
.ky-risk .ky-lv { width: 11%; white-space: nowrap; }
.ky-risk .ky-plus { width: 3%; text-align: center; }
.ky-risk .ky-ev { width: 16%; white-space: nowrap; }
.ky-pick { border: 1.5px solid #000; border-radius: 999px; padding: 0 5px; font-weight: 700; }
.ky-goal th { width: 120px; background: #eee; white-space: nowrap; }
.ky-goal td { height: 26px; }
.ky-mem .ky-mem-th { width: 80px; background: #eee; text-align: center; }
.ky-mem td { height: 40px; padding: 2px 4px; text-align: center; }
.ky-mem .ky-count { width: 84px; background: #eee; text-align: center; white-space: nowrap; }

/* ---------- 新規入場者調査票（画面） ---------- */
.lic-group { padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.lic-group:last-child { border-bottom: none; }
.lic-name { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.lic-note { font-weight: 400; font-size: 11.5px; color: var(--muted); margin-left: 8px; }
.lic-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0 16px;
  margin-bottom: 8px;
}
.lic-items .check-line { min-height: 44px; font-size: 13.5px; }
.em-row { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.em-row:last-child { border-bottom: none; }
ul.pledge { margin: 0 0 14px; padding-left: 1.2em; font-size: 13.5px; line-height: 1.8; }

/* ---------- 新規入場者調査票（印刷・A4縦） ---------- */
.en-doc { font-size: 11px; }
.en-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.en-form { font-size: 11px; }
.en-title { font-size: 18px; font-weight: 700; letter-spacing: .14em; }
.en-day { font-size: 12px; white-space: nowrap; }
.en-note { font-size: 10px; line-height: 1.5; margin: 4px 0 6px; }
.en-table { margin-bottom: 6px; }
.en-table th { background: #eee; white-space: nowrap; }
.en-table .en-side { width: 22px; background: #eee; }
.en-table .en-q { width: 52%; font-weight: 400; text-align: left; background: #fff; white-space: normal; }
.en-box { display: inline-block; margin-right: 12px; white-space: nowrap; }
.en-sec { font-weight: 700; margin: 8px 0 4px; }
.en-lic th { width: 21%; white-space: normal; }
.en-lic td { line-height: 1.8; }
.en-lic .en-none { color: #444; }
.en-sub { font-weight: 400; font-size: 10px; margin-left: 8px; }
ul.en-pledge { margin: 0 0 8px; padding-left: 1.2em; font-size: 10.5px; line-height: 1.6; }

/* ---------- 出来高曲線 ---------- */
.curve { width: 100%; height: auto; display: block; }
.curve .c-grid { stroke: rgba(29, 31, 32, .12); stroke-width: 1; }
.curve .c-label { font-family: var(--font-num); font-size: 11px; fill: #666; }
.curve .c-plan { fill: none; stroke: var(--plan); stroke-width: 1.8; }
.curve .c-actual { fill: none; stroke: var(--red); stroke-width: 2.2; }
.curve .c-dot { fill: var(--red); }
.curve .c-today { stroke: rgba(33, 42, 44, .6); stroke-width: 1.5; stroke-dasharray: 4 3; }
.curve .c-rev { fill: none; stroke: var(--green); stroke-width: 2; }
.lg-rev { color: var(--green); font-weight: 700; }
.lg-plan { color: var(--plan); font-weight: 700; }
.lg-actual { color: var(--red); font-weight: 700; }
.progress-table .pct-input { width: 5.5em; min-height: 42px; padding: 6px 8px; text-align: right; }

/* ---------- 汎用の帳票（受払簿・貸出簿・工程表・配置表） ---------- */
.doc { background: #fff; color: #000; }
.doc .doc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 8px; }
.doc .doc-title { font-size: 18px; font-weight: 700; }
.doc .doc-sub { font-size: 12.5px; }
.doc .meta { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 8px; }
.doc .meta th, .doc .meta td { border: 1px solid #666; padding: 3px 6px; text-align: left; }
.doc .meta th { background: #eee; white-space: nowrap; width: 76px; }
.doc .legend { font-size: 11px; color: #333; margin: 4px 0 8px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 10px; }
.doc-table th, .doc-table td { border: 1px solid #666; padding: 3px 5px; text-align: left; vertical-align: top; }
.doc-table thead th { background: #eee; text-align: center; }
.doc-table tr.carry td, .doc-table tr.total td { background: #f4f4f4; font-weight: 700; }
.doc-table .muted-cell { text-align: center; color: #666; }
/* ------------------------------------------------------------------ *
 * 出面表（協力会社の作業員）
 * ------------------------------------------------------------------ */
.at-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 10px; }
.at-grid { border-collapse: collapse; font-size: 12.5px; background: var(--paper); }
.at-grid th, .at-grid td { border: 1px solid var(--divider); padding: 0; text-align: center; }
.at-grid .at-name {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 132px;
  max-width: 200px;
  padding: 5px 8px;
  text-align: left;
  font-weight: 500;
  background: var(--paper);
}
.at-grid thead .at-name, .at-grid .at-co .at-name, .at-grid .at-sub .at-name, .at-grid .at-total .at-name { z-index: 3; }
.at-grid .at-job { display: block; font-size: 11px; color: var(--faint); }
.at-grid .at-day { width: 30px; min-width: 30px; }
.at-grid thead .at-day { padding: 3px 0; cursor: pointer; background: var(--accent-100); }
.at-grid thead .at-day:hover { background: #dcebe6; }
.at-grid .at-d { display: block; font-weight: 700; line-height: 1.1; }
.at-grid .at-w { display: block; font-size: 10px; color: var(--faint); line-height: 1.2; }
.at-grid .at-day.sun { background: #fdf0f0; }
.at-grid .at-day.sat { background: #eff3fa; }
.at-grid thead .at-day.sun .at-w, .at-grid td.at-day.sun { color: #a32626; }
.at-grid thead .at-day.sat .at-w, .at-grid td.at-day.sat { color: #2b5896; }
.at-grid .at-day.now { box-shadow: inset 0 0 0 2px var(--accent); }
.at-b {
  width: 100%;
  min-height: 34px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}
.at-b.on { background: var(--accent-100); color: var(--accent-700); }
.at-b:active { background: var(--divider); }
.at-grid .at-sum, .at-grid .at-rate, .at-grid .at-amt { padding: 5px 8px; white-space: nowrap; }
.at-grid .at-sum { min-width: 54px; font-weight: 700; }
.at-grid .at-rate { min-width: 74px; text-align: right; color: var(--muted); }
.at-grid .at-amt { min-width: 88px; text-align: right; font-weight: 700; }
.at-grid thead th { background: var(--accent-100); font-size: 11.5px; }
.at-grid thead .at-name { background: var(--accent-100); }
.at-co th { background: #f3f6f5; text-align: left; font-weight: 700; }
.at-co .at-name { background: #f3f6f5; }
.at-co-rate { margin-left: 10px; font-weight: 500; font-size: 11.5px; color: var(--accent-700); }
.at-co-rate.none { color: var(--faint); }
.at-sub td, .at-sub th { background: #fafbfb; font-weight: 700; color: var(--muted); }
.at-sub .at-name { background: #fafbfb; }
.at-none td { color: var(--faint); text-align: left; padding: 6px 8px; }
.at-total td, .at-total th { background: var(--accent-100); font-weight: 700; }
.at-total .at-name { background: var(--accent-100); }

/* 印刷の出面表 */
.doc .at-wrap { overflow: visible; }
.doc .at-grid { width: 100%; font-size: 9px; color: #000; }
.doc .at-grid th, .doc .at-grid td { border: 1px solid #666; padding: 2px 1px; }
.doc .at-grid .at-name { position: static; min-width: 0; max-width: none; padding: 2px 4px; background: #fff; }
.doc .at-grid thead th, .doc .at-grid .at-co th, .doc .at-grid .at-sub th,
.doc .at-grid .at-sub td, .doc .at-grid .at-total th, .doc .at-grid .at-total td { background: #eee; }
.doc .at-grid .at-day { width: auto; min-width: 0; }
.doc .at-grid .at-w { font-size: 7px; }
.doc-note { font-size: 12px; text-align: right; margin: 4px 0 0; }

.ledger { margin-bottom: 14px; break-inside: avoid; page-break-inside: avoid; }
.ledger-head { font-size: 13px; margin: 6px 0 3px; }
.doc .gantt { margin-bottom: 8px; }
.curve-print { max-width: 560px; margin-top: 6px; }

/* ---------- 現場QRコード（掲示用ポスター） ---------- */
.poster { text-align: center; padding: 10mm 6mm; border: 2px solid #000; background: #fff; color: #000; }
.poster-kicker { font-family: var(--font-num); letter-spacing: .2em; font-size: 14px; font-weight: 700; }
.poster-title { font-size: 34px; font-weight: 700; margin: 4px 0; }
.poster-site { font-size: 22px; font-weight: 700; margin: 6px 0 12px; }
.poster-qr svg { width: 100%; max-width: 110mm; height: auto; }
.poster-steps { text-align: left; display: inline-block; font-size: 18px; line-height: 1.8; margin: 10px auto; }
.poster-foot { font-size: 12px; margin-top: 8px; }
.qr-label .m-badge { display: inline-block; font-size: 10px; font-weight: 700; color: #fff; background: #1d2d3d; padding: 1px 6px; margin-bottom: 2px; }

@media print {
  .main-nav, .tabs { display: none !important; }
  .doc .doc-title { font-size: 14pt; }
  .doc .meta, .doc-table { font-size: 8.5pt; }
  .doc .meta th, .doc-table thead th, .doc-table tr.carry td, .doc-table tr.total td {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .gantt.print { font-size: 8pt; }
  .gantt.print .g-bar, .gantt.print .g-done, .gantt.print .s-bar, .legend-row .s-legend, .g-today {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .doc .at-grid { font-size: 6.5pt; }
  .doc .at-grid thead th, .doc .at-grid .at-co th, .doc .at-grid .at-sub th,
  .doc .at-grid .at-sub td, .doc .at-grid .at-total th, .doc .at-grid .at-total td {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .poster { border: 2px solid #000; }
  .poster-title { font-size: 30pt; }
  .poster-site { font-size: 18pt; }
  .poster-steps { font-size: 15pt; }
}

/* ------------------------------------------------------------------ *
 * 自筆サイン（KY活動表の参加者・新規入場者調査票の自署）
 * ------------------------------------------------------------------ */
/* ---------- 欄（画面） ---------- */
.sign-box { display: flex; align-items: stretch; gap: 8px; }
.sign-open {
  flex: 1;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px dashed rgba(33, 42, 44, .38);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sign-open:active { background: var(--accent-100); }
.sign-open .sign-slot { display: block; width: 100%; height: 62px; }
.sign-ph { display: block; line-height: 62px; font-size: 13.5px; color: var(--muted); text-align: center; }
.sign-ink { display: block; width: 100%; height: 100%; }
.sign-clear {
  flex: none;
  min-width: 62px;
  border: 1px solid rgba(33, 42, 44, .28);
  border-radius: var(--r-btn);
  background: var(--paper);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* ---------- 記入台（全画面） ---------- */
.sign-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  padding: 10px;
  padding-top: calc(10px + env(safe-area-inset-top));
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: rgba(33, 42, 44, .55);
}
.sign-sheet {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow);
}
/* 縦に持ったスマホでは、記入台ごと横向きにする（端末を横にして書く） */
.sign-overlay.turn { padding: 0; }
.sign-overlay.turn .sign-sheet {
  position: absolute;
  top: 50%;
  left: 50%;
  flex: none;
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center center;
}
.sign-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sign-title { font-weight: 700; font-size: 15px; }
.sign-x {
  flex: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--divider);
  border-radius: var(--r-btn);
  background: var(--paper);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.sign-area {
  position: relative;
  flex: 1;
  min-height: 150px;
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  background: #fff;
  overflow: hidden;
}
.sign-area canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;   /* 指で書いている間、画面が動かないようにする */
}
/* 書く位置の目安になる線 */
.sign-base {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 30%;
  border-bottom: 1px dashed rgba(33, 42, 44, .26);
  pointer-events: none;
}
.sign-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30%;
  padding-bottom: 8px;
  text-align: center;
  font-size: 13.5px;
  color: var(--faint);
  pointer-events: none;
}
.sign-hint small { display: block; font-size: 11.5px; }
.sign-actions { display: flex; gap: 8px; }
.sign-actions .btn { flex: 1; min-height: 62px; padding: 6px 8px; white-space: nowrap; }
.sign-actions .btn.lead { flex: 1.5; font-size: 16px; }

/* ---------- 参加者の欄（KY活動表の入力・表示） ---------- */
.mem-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.mem-row:last-child { border-bottom: none; }
.mem-no {
  flex: none;
  width: 26px;
  padding-top: 14px;
  font-family: var(--font-num);
  font-size: 18px;
  color: var(--faint);
  text-align: center;
}
.mem-body { flex: 1; min-width: 0; }
.mem-body input[type="text"] { margin-bottom: 6px; }
.mem-view { display: flex; flex-wrap: wrap; gap: 8px; }
.mem-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 96px;
  padding: 6px 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
}
.mem-sig { display: block; width: 88px; height: 30px; }
.mem-nm { font-size: 13px; }
.mem-nm.unsigned { color: var(--muted); }

/* ---------- 帳票のサイン欄（印刷） ---------- */
.sign-cell { display: block; width: 100%; height: 100%; min-height: 30px; }
.ky-mem .sign-cell { height: 34px; }
.en-sign td { height: 46px; }
.en-sign .sign-cell { height: 40px; }
.sign-view { height: 90px; }

/* 決まった選択肢＋「その他」の自由記入 */
.pick-other > input[type="text"] { margin-top: 6px; }

/* ---------- 人員配置：帯を押すと出る明細 ---------- */
.s-bar {
  border: 0;
  border-radius: 3px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.s-bar.on { outline: 2px solid var(--navy); outline-offset: 1px; }
.s-name {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}
.s-detail {
  margin: 0 0 6px;
  padding: 8px 10px;
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.s-detail-head { font-size: 12.5px; font-weight: 700; margin-bottom: 4px; }
.s-detail-list { list-style: none; margin: 0; padding: 0; }
.s-detail-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 4px;
  border-top: 1px solid var(--hairline);
}
.s-detail-list li:first-child { border-top: none; }
.s-detail-list li.on { background: var(--accent-100); border-radius: 6px; }
.s-chip { flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: 3px; }
.s-d-body { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.5; }
.s-d-role { margin-left: 8px; font-size: 12px; color: var(--muted); }
.s-d-term { display: block; font-size: 13px; }
.s-d-note { display: block; font-size: 12px; color: var(--muted); }
.s-d-edit { flex: none; align-self: center; font-size: 12.5px; }

/* ---------- 工程表：画面いっぱいに広げる ---------- */
.ge-wrap.big {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  padding: 10px;
  padding-top: calc(10px + env(safe-area-inset-top));
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: var(--paper);
}
.ge-wrap.big .ge-tools { order: -1; margin: 0 0 8px; }
.ge-wrap.big .ge { flex: 1; min-height: 0; overflow-y: auto; align-items: stretch; }
.ge-wrap.big .ge-side { position: sticky; left: 0; z-index: 1; background: var(--paper); }
.ge-big { min-width: 96px; padding: 0 10px; }

/* ---------- 内訳書の読み込み ---------- */
.warn-text { color: #8a6a00; font-weight: 700; }
table.data td.c, table.data th.c { text-align: center; }
table.data tr.off td { color: var(--faint); }
table.data tfoot th { background: var(--surface); text-align: right; }
table.data tfoot th:first-child { text-align: left; }
#f-xlsx { display: block; width: 100%; min-height: 52px; padding: 10px 12px; border: 1px dashed rgba(33,42,44,.35); border-radius: var(--r-sm); background: var(--paper); font-family: inherit; font-size: 15px; }
table.data tr.add td { background: var(--accent-100); }
table.data tr.add td.c { font-weight: 700; color: var(--accent-700); }
input[readonly] { background: var(--surface); color: var(--muted); }

/* 新規入場者調査票の元請確認欄（印刷） */
.en-check { line-height: 1.3; }
.en-check-name { display: block; }
.en-check-at { display: block; font-size: 9px; color: #444; }
