/* ============================================================
   kenshou-uat 共通スタイル
   ※ 横は100%幅で1pxも動かさない／上下バウンス禁止は mobile-guard.css 側
   ============================================================ */
:root {
  --ink:        #1f2430;
  --ink-soft:   #5c6472;
  --line:       #e3e6ec;
  --bg:         #f4f6f9;
  --card:       #ffffff;
  --brand:      #17509b;
  --brand-soft: #eaf1fb;
  --ok:         #1a7f45;
  --ok-soft:    #e6f5ec;
  --ng:         #c2334a;
  --ng-soft:    #fdeaee;
  --na:         #8a8f99;
  --na-soft:    #f0f1f3;
  --warn:       #b8760a;
  --warn-soft:  #fdf3e2;
  --radius:     10px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: 15px;
  padding-bottom: 40px;
}

a { color: var(--brand); }

/* ---------------------------------------------- ヘッダ */
.app-header {
  background: var(--brand);
  color: #fff;
  padding: 10px 0;
  margin-bottom: 18px;
}
.app-header a { color: #fff; text-decoration: none; }
.app-header .brand { font-weight: 700; font-size: 1.02rem; letter-spacing: .02em; }
.app-header .nav-link {
  color: rgba(255,255,255,.85); padding: 4px 10px; border-radius: 6px; font-size: .9rem;
}
.app-header .nav-link:hover, .app-header .nav-link.active {
  background: rgba(255,255,255,.16); color: #fff;
}

/* ---------------------------------------------- カード */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.card-header {
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: .95rem;
  padding: 10px 14px;
}

/* セクション見出し（section-band-and-autolink 規約） */
.section-band {
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  padding: 6px 12px;
  font-weight: 700;
  font-size: .92rem;
  border-radius: 0 6px 6px 0;
  margin: 18px 0 10px;
}
.section-body { padding-left: 14px; }

/* ---------------------------------------------- 統計タイル */
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; height: 100%;
}
.stat .label { font-size: .78rem; color: var(--ink-soft); }
.stat .value { font-size: 1.7rem; font-weight: 700; line-height: 1.15; }
.stat.ng .value { color: var(--ng); }
.stat.ok .value { color: var(--ok); }

/* ---------------------------------------------- バッジ */
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; white-space: nowrap;
}
.pill-ok   { background: var(--ok-soft);   color: var(--ok); }
.pill-ng   { background: var(--ng-soft);   color: var(--ng); }
.pill-na   { background: var(--na-soft);   color: var(--na); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-info { background: var(--brand-soft); color: var(--brand); }
.pill-gray { background: #eef0f4; color: var(--ink-soft); }

.progress { height: 8px; background: #e9edf3; border-radius: 999px; }
.progress-bar { background: var(--brand); }

/* ---------------------------------------------- テーブル */
.table-wrap { overflow-x: auto; max-width: 100%; }
/* 狭い画面では列を潰さず、この枠の中だけ横スクロールさせる（本文は横に動かさない） */
.table-wrap > table.tbl { min-width: 700px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tbl th, table.tbl td {
  border-bottom: 1px solid var(--line); padding: 9px 10px; vertical-align: middle;
}
table.tbl th {
  background: #f8fafc; font-weight: 700; font-size: .82rem; color: var(--ink-soft);
  text-align: left; white-space: nowrap;
}
table.tbl tr:hover td { background: #fafcff; }

/* ---------------------------------------------- モーダル（共通クラス） */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,25,35,.45);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 1000; padding: 24px 12px; overflow-y: auto;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: #fff; border-radius: 12px; width: 100%; max-width: 680px;
  box-shadow: 0 20px 50px rgba(16,24,40,.25);
}
.modal-box .mb-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  font-weight: 700; display: flex; justify-content: space-between; align-items: center;
}
.modal-box .mb-body { padding: 16px 18px; }
.modal-box .mb-foot {
  padding: 12px 18px; border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
}
.mb-close { border: 0; background: none; font-size: 1.3rem; line-height: 1; color: var(--ink-soft); }

/* ---------------------------------------------- フォーム */
.form-label { font-size: .82rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 3px; }
.form-control, .form-select { font-size: .92rem; }
.form-row-single { flex: 1 1 100%; }   /* flex-form-layout 規約: 入力欄は単独行 */
.help { font-size: .78rem; color: var(--ink-soft); }

/* ---------------------------------------------- URLチップ */
.url-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  background: #fff; font-size: .85rem; text-decoration: none; color: var(--ink);
  max-width: 100%; overflow-wrap: anywhere;
}
.url-chip:hover { border-color: var(--brand); background: var(--brand-soft); }

/* ---------------------------------------------- 印刷書類 */
@media screen {
  .sheet {
    background: #fff; width: 210mm; max-width: 100%;
    margin: 0 auto 18px; padding: 16mm 15mm;
    box-shadow: 0 2px 12px rgba(16,24,40,.12); border-radius: 4px;
  }
  .print-bar {
    position: sticky; top: 0; z-index: 20; background: #23303f; color: #fff;
    padding: 10px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin-bottom: 18px;
  }
}
@media print {
  body { background: #fff; padding: 0; }
  .no-print, .app-header, .print-bar { display: none !important; }
  .sheet { width: auto; margin: 0; padding: 0; box-shadow: none; }
  .page-break { page-break-before: always; }
  table.doc { page-break-inside: auto; }
  table.doc tr { page-break-inside: avoid; }
}
@page { size: A4; margin: 14mm 12mm; }

.sheet { color: #000; font-size: 10.5pt; line-height: 1.6; }
.doc-title {
  text-align: center; font-size: 17pt; font-weight: 700; letter-spacing: .18em;
  margin-bottom: 4px;
}
.doc-sub { text-align: center; font-size: 9pt; color: #555; margin-bottom: 16px; }
.doc-meta { width: 100%; border-collapse: collapse; font-size: 9.5pt; margin-bottom: 14px; }
.doc-meta th, .doc-meta td { border: 1px solid #999; padding: 5px 8px; }
.doc-meta th { background: #f2f4f7; width: 22%; text-align: left; font-weight: 700; }
table.doc { width: 100%; border-collapse: collapse; font-size: 9pt; }
table.doc th, table.doc td { border: 1px solid #999; padding: 5px 6px; vertical-align: top; }
table.doc th { background: #f2f4f7; font-weight: 700; text-align: left; }
.sig-box { border: 1px solid #999; padding: 10px 12px; margin-top: 14px; }
.sig-img { max-height: 70px; }
.doc-note { font-size: 8.5pt; color: #444; line-height: 1.7; }

/* ---------------------------------------------- テスター画面 */
.tester-wrap { max-width: 860px; margin: 0 auto; }
.check-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px;
}
.check-card.answered-ok { border-left: 5px solid var(--ok); }
.check-card.answered-ng { border-left: 5px solid var(--ng); }
.check-card.answered-na { border-left: 5px solid var(--na); }
.check-card .q-no { font-size: .75rem; color: var(--ink-soft); font-weight: 700; }
.check-card .q-title { font-weight: 700; font-size: 1.02rem; margin: 2px 0 8px; }
.step-box {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; font-size: .9rem; margin-bottom: 8px;
}
.step-box .lb {
  font-size: .74rem; font-weight: 700; color: var(--brand);
  display: block; margin-bottom: 2px;
}
.ans-group { display: flex; gap: 8px; flex-wrap: wrap; }
.ans-btn {
  flex: 1 1 140px; border: 2px solid var(--line); background: #fff; border-radius: 10px;
  padding: 11px 8px; font-weight: 700; font-size: .95rem; cursor: pointer;
  transition: .12s; text-align: center; min-width: 0;
}
.ans-btn:hover { border-color: var(--ink-soft); }
.ans-btn.sel-OK { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.ans-btn.sel-NG { background: var(--ng-soft); border-color: var(--ng); color: var(--ng); }
.ans-btn.sel-NA { background: var(--na-soft); border-color: var(--na); color: var(--na); }

.sticky-progress {
  position: sticky; top: 0; z-index: 30; background: #fff;
  border-bottom: 1px solid var(--line); padding: 8px 12px; margin-bottom: 14px;
}
.att-thumb {
  width: 72px; height: 72px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line);
}
.att-item { position: relative; display: inline-block; margin: 0 6px 6px 0; }
.att-item .del {
  position: absolute; top: -6px; right: -6px; background: var(--ng); color: #fff;
  border: 0; border-radius: 50%; width: 20px; height: 20px; font-size: .7rem; line-height: 1;
}
#sigCanvas {
  border: 2px dashed #b9c0cc; border-radius: 8px; background: #fff;
  width: 100%; height: 180px; touch-action: none;   /* サイン描画用（body には付けない） */
}
.toast-ok {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: #23303f; color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: .85rem; z-index: 2000; opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.toast-ok.show { opacity: 1; }
