/* UAS飛行日誌 — iPad向けスタイル */
:root {
  --bg: #eef2f6; --card: #fff; --ink: #132235; --muted: #5b6b7f; --line: #d3dce6;
  --pri: #0b5cad; --pri-d: #08488a; --nav: #0b2f4f;
  --ok: #13814a; --ok-bg: #e5f5ec; --ng: #c62828; --ng-bg: #fdeeee; --warn: #94570a; --warn-bg: #fff5df;
  --r: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 10px; line-height: 1.35; }
h1 { font-size: 24px; } h2 { font-size: 19px; } h3 { font-size: 17px; } h4 { font-size: 15px; }
h1 small, h3 small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 10px; }
p { margin: 0 0 10px; }
code { font-size: 12px; background: #f1f4f8; padding: 1px 5px; border-radius: 4px; }
.boot { padding: 60px 16px; text-align: center; color: var(--muted); }
.boot.err { color: var(--ng); font-weight: 600; }
.muted { color: var(--muted); } .center { text-align: center; } .mt { margin-top: 10px; }
.ok-txt { color: var(--ok); font-weight: 600; } .ng-txt { color: var(--ng); font-weight: 700; } .warn-txt { color: var(--warn); font-weight: 600; }
.spacer { flex: 1; }

/* ヘッダー */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top) + 8px) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); background: var(--nav); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand b { display: block; font-size: 15px; line-height: 1.2; } .brand small { display: block; font-size: 11px; opacity: .75; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-btn { flex: none; background: transparent; border: 0; color: #c6d8ea; padding: 8px 12px; border-radius: 9px; min-height: 44px; font-size: 15px; cursor: pointer; }
.nav-btn.on { background: rgba(255, 255, 255, .17); color: #fff; font-weight: 700; }
.who { display: flex; align-items: center; gap: 10px; flex: none; font-size: 14px; }
.net { padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.net.on { background: #1f7a4d; } .net.off { background: #b06400; }
.me em { font-style: normal; font-size: 11px; background: rgba(255, 255, 255, .18); padding: 1px 6px; border-radius: 6px; margin-left: 6px; }
.topbar .lockbtn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
@media (max-width: 1000px) { .brand-t { display: none; } .me { display: none; } }

main { max-width: 1180px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-right)) 130px max(16px, env(safe-area-inset-left)); }
main.wide { max-width: none; }
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.page-head .sub { width: 100%; margin: 0; color: var(--muted); }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.primary:active { background: var(--pri-d); }
.btn.danger { background: var(--ng); border-color: var(--ng); color: #fff; }
.btn.danger-ghost { color: var(--ng); border-color: #efbcbc; background: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--pri); }
.btn.sm { min-height: 38px; padding: 4px 12px; font-size: 14px; }
.btn.big { min-height: 52px; font-size: 16px; padding: 10px 20px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--pri); text-align: left; cursor: pointer; text-decoration: underline; font-size: inherit; }
.chip-btn { min-height: 36px; padding: 4px 12px; border-radius: 99px; border: 1px dashed #9fb2c6; background: #f8fafc; font-size: 13px; cursor: pointer; }

/* カード */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; min-width: 0; }
.sub-card { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.warn-card { background: var(--warn-bg); border-color: #f1d49a; }
.amend-card { background: #eaf2fd; border-color: #a9c7ee; }
.void-card { background: #f1f1f1; border-color: #cfcfcf; }
.danger-zone { border-color: #efbcbc; }
.empty { text-align: center; padding: 34px 18px; }

/* フォーム */
.fld { display: flex; flex-direction: column; gap: 5px; margin: 0 0 14px; min-width: 0; }
.lbl { font-size: 13px; font-weight: 700; color: var(--muted); }
.req { font-size: 10px; background: var(--ng); color: #fff; border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; font-weight: 700; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.5; }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; -webkit-appearance: none; appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, #5b6b7f 50%), linear-gradient(135deg, #5b6b7f 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 32px; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(11, 92, 173, .25); border-color: var(--pri); }
input:disabled, select:disabled, textarea:disabled { background: #f4f6f9; color: var(--ink); -webkit-text-fill-color: var(--ink); opacity: 1; }
input[type=checkbox] { width: 24px; height: 24px; min-height: 0; padding: 0; flex: none; -webkit-appearance: checkbox; appearance: auto; accent-color: var(--pri); }
input[type=file] { padding: 8px; }
input[type=date], input[type=time] { min-width: 0; }
.grid2, .grid3, .grid4 { display: grid; gap: 0 16px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid2.gap { gap: 16px; }
@media (max-width: 900px) { .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }
.inline { display: flex; gap: 8px; align-items: center; min-width: 0; }
.inline input { flex: 1; min-width: 0; }
.inline.wrap { flex-wrap: wrap; }
.static { min-height: 46px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-weight: 700; }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; cursor: pointer; font-weight: 600; }
.sec { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.preview { background: #f3f7fb; border: 1px solid #dbe5ef; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.preview small { color: var(--muted); font-size: 12px; font-weight: 700; } .preview div { font-weight: 600; }
.errlist { margin: 0; padding-left: 20px; color: var(--ng); }
.save-state { font-size: 13px; color: var(--muted); }

/* 点検項目 */
.checks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.check-row { display: grid; grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.check-row.okr { border-color: #a6d8bb; background: #f5fcf8; }
.check-row.ng { border-color: #eea3a3; background: var(--ng-bg); }
.ci b { display: block; } .ci span { font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg.wide .seg-btn { min-width: 140px; }
.seg-btn { min-width: 78px; min-height: 50px; border: 0; background: #fff; font-weight: 700; font-size: 16px; padding: 0 14px; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.on.ok { background: var(--ok); color: #fff; }
.seg-btn.on.ng { background: var(--ng); color: #fff; }
.seg-btn:disabled { cursor: default; }
.seg-btn:disabled:not(.on) { color: #b5c0cc; }
@media (max-width: 720px) { .check-row { grid-template-columns: 1fr auto; } .check-row .remark { grid-column: 1 / -1; } }

/* チップ */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 42px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: #fff; font-size: 14px; }
.chip input:checked + span { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 600; }
.chip input:disabled + span { opacity: .75; }

/* 飛行時間 */
.calc { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: flex-end; background: #0b2f4f; color: #fff; border-radius: 12px; padding: 12px 18px; margin-bottom: 16px; }
.calc small { display: block; font-size: 12px; opacity: .8; } .calc b { font-size: 26px; font-variant-numeric: tabular-nums; }
.calc p { width: 100%; margin: 0; color: #ffd38a; }
.calc p:empty { display: none; }

/* 署名 */
.sig-wrap { display: flex; gap: 8px; align-items: flex-end; }
.sig { width: 100%; max-width: 520px; height: 140px; border: 1px dashed #93a7bd; border-radius: 10px; background: #fff; touch-action: none; display: block; }
.sig-img { max-height: 90px; max-width: 280px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* 編集バー */
.editor-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.bar-in { max-width: 1180px; margin: 0 auto; display: flex; gap: 10px; align-items: center; padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }

/* バッジ */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; white-space: nowrap; margin-right: 4px; }
.b-draft { background: var(--warn-bg); color: var(--warn); border: 1px solid #f0d08f; }
.b-final { background: var(--ok-bg); color: var(--ok); border: 1px solid #a6d8bb; }
.b-void { background: #eee; color: #666; border: 1px solid #d0d0d0; }
.b-amend { background: #eaf2fd; color: #23599b; border: 1px solid #a9c7ee; }
.ok-pill { font-size: 11px; background: var(--ok); color: #fff; padding: 1px 7px; border-radius: 99px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-right: 8px; color: #fff; }
.t-insp { background: #13814a; } .t-flight { background: #0b5cad; } .t-mx { background: #7a4bb0; }

/* ホーム */
.ac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 500px), 1fr)); gap: 16px; }
.ac-card header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.ac-card h2 { font-size: 22px; margin: 0; letter-spacing: .02em; } .ac-card header p { margin: 0; color: var(--muted); }
.total { text-align: right; } .total small { display: block; color: var(--muted); font-size: 12px; } .total b { font-size: 28px; font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.facts div { background: #f4f7fa; border-radius: 10px; padding: 8px 10px; } .facts dt { font-size: 12px; color: var(--muted); } .facts dd { margin: 0; font-weight: 700; }
.due { font-size: 14px; color: var(--muted); }
.issues { background: var(--ng-bg); border: 1px solid #f0b9b9; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.issues.soft { background: var(--warn-bg); border-color: #f0d08f; }
.issues ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.ac-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 600px) { .ac-actions, .facts { grid-template-columns: 1fr; } }
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.row-btn { width: 100%; text-align: left; background: #fff; border: 1px solid #f0d08f; border-radius: 10px; padding: 10px 12px; min-height: 48px; cursor: pointer; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.row-btn small { margin-left: auto; color: var(--muted); }

/* 一覧 */
.filters { display: flex; flex-wrap: wrap; gap: 0 14px; align-items: flex-end; padding-bottom: 4px; }
.filters .fld { flex: 1 1 180px; }
.filters .fld.btns { flex: 2 1 320px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 16px; -webkit-overflow-scrolling: touch; }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
.list th { background: #f3f6fa; text-align: left; font-size: 13px; color: var(--muted); padding: 10px; white-space: nowrap; }
.list td { padding: 12px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.list tr[data-act] { cursor: pointer; }
.list tr[data-act]:active { background: #eef4fb; }
.list tr.voided td { color: #999; text-decoration: line-through; }
.list.small { font-size: 13px; } .list.small td { padding: 8px 10px; }
.row-end { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab { min-height: 44px; padding: 8px 18px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 700; cursor: pointer; }
.tab.on { background: var(--nav); color: #fff; border-color: var(--nav); }
.items { display: flex; flex-direction: column; gap: 8px; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: 8px; align-items: center; }
.item-btns { display: flex; gap: 4px; }
@media (max-width: 720px) { .item-row { grid-template-columns: 1fr; border-bottom: 1px solid var(--line); padding-bottom: 8px; } }

/* 履歴 */
.history ul { margin: 0; padding-left: 18px; font-size: 14px; }
.history li { margin-bottom: 8px; }
.history details { margin-top: 4px; } .history summary { cursor: pointer; color: var(--pri); font-size: 13px; }
table.mini { border-collapse: collapse; font-size: 12px; margin-top: 4px; }
.mini th, .mini td { border: 1px solid var(--line); padding: 3px 6px; text-align: left; vertical-align: top; }
.mini th { background: #f3f6fa; white-space: nowrap; }
.seal { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

/* 認証画面 */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: calc(24px + env(safe-area-inset-top)) 16px 24px; background: linear-gradient(160deg, #0b2f4f, #0b5cad); }
.auth-card { width: 100%; max-width: 440px; padding: 26px; }
.setup { width: 100%; max-width: 960px; }
.setup .card { padding: 22px; }
.auth-head { text-align: center; margin-bottom: 18px; }
.setup > .auth-head { color: #fff; }
.auth-head .logo { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 8px; }
.auth-head p { opacity: .85; }
.err { color: var(--ng); font-weight: 700; min-height: 1.6em; font-size: 14px; }
.fine { font-size: 12px; color: var(--muted); text-align: center; margin: 14px 0 0; }
.setup > .fine { color: #d4e2f0; }

/* モーダル・トースト */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 20, 35, .5); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 16px; max-width: 560px; width: 100%; padding: 22px; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal-btns { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
#toast { position: fixed; top: calc(env(safe-area-inset-top) + 70px); left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 520px); pointer-events: none; }
#toast .t { background: #12324f; color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
#toast .t.err { background: var(--ng); }
.busy { position: fixed; inset: 0; background: rgba(255, 255, 255, .72); z-index: 80; display: flex; align-items: center; justify-content: center; }
.busy-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 24px; font-weight: 700; display: flex; align-items: center; gap: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .12); }
.spin { width: 20px; height: 20px; border: 3px solid #cfdbe8; border-top-color: var(--pri); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 帳票（様式１〜３） ===== */
.sheets { overflow-x: auto; padding-bottom: 16px; -webkit-overflow-scrolling: touch; }
.sheet { width: 277mm; min-height: 190mm; margin: 0 auto 18px; background: #fff; color: #000; padding: 8mm; box-shadow: 0 2px 12px rgba(0, 0, 0, .14); font-size: 9pt; line-height: 1.35; display: flex; flex-direction: column; }
.sh-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; margin-bottom: 6px; }
.sh-reg { border-collapse: collapse; }
.sh-reg th, .sh-reg td { border: 1px solid #000; padding: 4px 8px; font-size: 9pt; }
.sh-reg th { font-weight: 600; text-align: left; } .sh-reg th small { display: block; font-size: 6.5pt; font-weight: 400; }
.sh-reg td { min-width: 45mm; font-weight: 700; font-size: 11pt; letter-spacing: .03em; }
.sh-title { text-align: center; } .sh-title b { display: block; font-size: 14pt; letter-spacing: .12em; } .sh-title small { font-size: 8pt; letter-spacing: .05em; }
.sh-title.big { margin: 10mm 0 8mm; } .sh-title.big b { font-size: 20pt; }
.sh-nr { text-align: right; font-size: 10pt; }
table.sh { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 3mm; }
.sh th, .sh td { border: 1px solid #000; padding: 2px 4px; vertical-align: middle; word-break: break-all; font-size: 8.5pt; }
.sh th { font-weight: 600; background: #efefef; text-align: center; line-height: 1.25; }
.sh th small { display: block; font-size: 6pt; font-weight: 400; }
.sh td small { display: block; font-size: 7pt; }
.sh td.num { text-align: center; white-space: nowrap; }
.sh sup { font-size: 6pt; color: #000; margin-left: 1px; }
.sh tbody td { height: 8.2mm; }
.sh tr.init td { font-size: 8pt; }
.f1 tbody td { height: 6.6mm; font-size: 8pt; padding: 1px 3px; }
.rep td { height: 5.6mm; font-size: 8pt; }
.f1 { margin-top: 2mm; } .rep { margin-top: 2mm; }
.f1 td small { font-size: 6.5pt; }
.sh tr.sep td { text-align: center; height: 6mm; letter-spacing: 1em; }
.f2 tbody td { height: 8.6mm; } .f2 td.cat { font-weight: 600; } .f2 td.cat small { font-weight: 400; font-size: 6pt; }
.f2 td.res { text-align: center; font-weight: 700; } .f2 td.res.ng { text-decoration: underline; }
.f2 tr.notes td { height: 22mm; vertical-align: top; }
.f2foot td { height: 14mm; }
.rep .rep-h { width: 4%; writing-mode: vertical-rl; letter-spacing: .3em; }
.rep .rep-h small { display: inline; }
.cover { margin-top: 6mm; } .cover th { width: 30%; text-align: left; padding: 6px 10px; font-size: 10pt; } .cover td { font-size: 11pt; padding: 6px 10px; height: 10mm; }
.sh-note { font-size: 7.5pt; margin: 2mm 0 0; }
.sh-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 7pt; color: #444; margin-top: auto; padding-top: 3mm; }
.sig-print { display: block; max-height: 9mm; max-width: 40mm; }
col.w4 { width: 4%; } col.w6 { width: 6%; } col.w7 { width: 7%; } col.w8 { width: 8%; } col.w10 { width: 10%; } col.w11 { width: 11%; }
col.w14 { width: 14%; } col.w16 { width: 16%; } col.w19 { width: 19%; } col.w20 { width: 20%; } col.w30 { width: 30%; } col.w32 { width: 32%; }
col.w44 { width: 44%; } col.w55 { width: 5.5%; }

@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body { background: #fff; }
  .no-print, .topbar, .editor-bar, #toast, .busy { display: none !important; }
  main, main.wide { padding: 0; max-width: none; margin: 0; }
  .sheets { overflow: visible; padding: 0; }
  .sheet { box-shadow: none; margin: 0; padding: 0; width: auto; min-height: 0; height: 193mm; overflow: hidden; break-after: page; page-break-after: always; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
  .sh th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* デモモード */
.is-demo .topbar { border-bottom: 4px solid #e8710a; }
.demo-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: #fff1e0; border-bottom: 1px solid #f3c48a; color: #7a3d00; padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); font-size: 14px; }
.demo-banner b { background: #e8710a; color: #fff; padding: 2px 10px; border-radius: 99px; }
.demo-login { background: #fff1e0; border: 1px solid #f3c48a; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; line-height: 1.8; color: #7a3d00; }
.fine a { color: inherit; }
.sheets.demo .sheet { position: relative; }
.sheets.demo .sheet::after { content: "DEMO　記録として無効"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 44pt; font-weight: 800; color: rgba(210, 40, 20, .13); transform: rotate(-16deg); pointer-events: none; letter-spacing: .1em; }
.filters .btns .inline { flex-wrap: wrap; }

/* 作業完了証明書 */
.t-cert { background: #b4580c; }
.cert-items { display: flex; flex-direction: column; gap: 8px; }
.cert-item { display: grid; grid-template-columns: 28px minmax(0, 2fr) auto minmax(0, 1.3fr) auto; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.cert-item.okr { border-color: #a6d8bb; background: #f5fcf8; } .cert-item.ng { border-color: #eea3a3; background: var(--ng-bg); }
.cert-item .num { font-weight: 800; color: var(--muted); text-align: center; }
@media (max-width: 820px) { .cert-item { grid-template-columns: 28px 1fr auto; } .cert-item .note { grid-column: 2 / 3; } }
.signed-card { background: var(--ok-bg); border-color: #a6d8bb; }
.cert-preview .sheet { margin-top: 0; }
.sheets.offscreen { position: fixed; left: -5000px; top: 0; width: 900px; overflow: visible; }
.sheet.portrait { width: 190mm; min-height: 268mm; padding: 12mm; font-size: 10pt; }
.cert .ct-top { display: flex; justify-content: space-between; } .ct-no { text-align: right; font-size: 9pt; }
.ct-title { text-align: center; font-size: 22pt; letter-spacing: .35em; margin: 6mm 0 8mm; padding-bottom: 3mm; border-bottom: 2px solid #000; }
.ct-parties { display: flex; justify-content: space-between; align-items: flex-end; gap: 10mm; margin-bottom: 6mm; }
.ct-to { font-size: 14pt; font-weight: 700; border-bottom: 1px solid #000; padding: 0 4mm 1mm 0; }
.ct-from { font-size: 9pt; text-align: right; line-height: 1.5; } .ct-from b { font-size: 11pt; }
.ct-lead { margin: 0 0 4mm; }
.ct-h { font-size: 11pt; margin: 5mm 0 2mm; border-left: 4px solid #333; padding-left: 2mm; }
table.ct-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ct-tbl th, .ct-tbl td { border: 1px solid #000; padding: 2mm 3mm; font-size: 9.5pt; vertical-align: middle; word-break: break-all; }
.ct-tbl th { background: #efefef; width: 26mm; font-weight: 600; text-align: left; }
.ct-tbl.ct-items th { width: auto; text-align: center; } .ct-tbl td.c { text-align: center; } .ct-tbl td.ng { font-weight: 700; text-decoration: underline; }
.ct-ng { font-size: 9pt; margin: 2mm 0 0; font-weight: 600; }
.ct-box { border: 1px solid #000; padding: 2mm 3mm; font-size: 9.5pt; min-height: 9mm; }
.ct-sign { margin-top: 7mm; border: 2px solid #000; padding: 4mm; }
.ct-sign p { font-weight: 700; margin: 0 0 3mm; }
.ct-sign td.ct-sig { height: 22mm; } .ct-sign td.ct-sig img { max-height: 20mm; max-width: 90mm; display: block; }
.cert .sh-foot { margin-top: auto; padding-top: 6mm; }
.sheets.demo .sheet.portrait::after { font-size: 34pt; }
/* お客様署名画面（証明書そのままの見た目） */
body.signing { overflow: hidden; position: fixed; inset: 0; }
.sign-bg { position: fixed; inset: 0; z-index: 90; background: #5f6f82; display: flex; flex-direction: column; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: contain; }
.sign-bg * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.sign-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: calc(env(safe-area-inset-top) + 14px) 8px 20px; }
.sheets.sign-sheets { overflow: visible; padding: 0; }
.sign-sheets .sheet { margin: 0 auto; box-shadow: 0 6px 30px rgba(0, 0, 0, .35); }
.sign-bar { flex: none; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #fff; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(0, 0, 0, .15); }
.sign-guide { font-weight: 700; color: var(--pri); }
@media (max-width: 760px) { .sign-guide { display: none; } }
.ct-pad-wrap { position: relative; height: 34mm; border: 2px dashed #0b5cad; border-radius: 6px; background: #f5f9ff; animation: padpulse 2s ease-in-out infinite; }
.ct-pad { width: 100%; height: 100%; display: block; touch-action: none; -ms-touch-action: none; cursor: crosshair; }
.ct-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #7d98b8; font-size: 14pt; font-weight: 700; pointer-events: none; }
.ct-ph.hide { display: none; }
@keyframes padpulse { 50% { border-color: #7fb0e6; } }
.sign-panel { max-width: 640px; margin: 40px auto; background: #fff; border-radius: 18px; padding: 24px; box-shadow: 0 10px 40px rgba(0, 0, 0, .2); }
.sign-done { text-align: center; padding: 50px 10px; } .big-check { width: 96px; height: 96px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 56px; line-height: 96px; margin: 0 auto 20px; }
#toast { z-index: 95; }

/* 本人確認カメラ */
.cam { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cam video { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; background: #1d2a38; transform: scaleX(-1); flex: none; }
.cam.off video { display: none; }
.cam-t { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.35; min-width: 0; }
.cam-t b { color: #8a4b00; } .cam.on .cam-t b::before { content: "● "; color: #d32f2f; }
.cam-t .link { font-size: 12px; color: var(--muted); }
.ct-photo-note { font-size: 8pt; margin: 3mm 0 0; }
.evidence h3 small { font-size: 12px; }
.ev-grid { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.ev-photo { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; } .ev-photo img { width: 220px; border-radius: 10px; border: 1px solid var(--line); }
.ev-photo small { font-size: 12px; color: var(--muted); }
.ev-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 14px; } .ev-dl dt { color: var(--muted); font-weight: 700; } .ev-dl dd { margin: 0; }
@media (max-width: 640px) { .ev-grid { grid-template-columns: 1fr; } }

/* 署名画面：書類を画面に固定・カメラは小さく */
.sign-stage { flex: 1; min-height: 0; overflow: hidden; display: flex; justify-content: center; align-items: flex-start; padding: calc(env(safe-area-inset-top) + 8px) 8px 8px; }
.sign-fit { flex: none; overflow: hidden; }
.sign-fit > .sheets { transform-origin: 0 0; }
.sign-fit .sheet { margin: 0; }
.sign-bar { padding-top: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); flex-wrap: nowrap; }
.sign-bar .btn.big { min-height: 48px; }
.cam { flex: 1 1 auto; }
.cam video { width: 44px !important; height: 33px !important; max-width: 44px; max-height: 33px; border-radius: 6px; }
.cam-t { font-size: 12px; } .cam-t b { font-weight: 700; }
.landscape-hint .sign-stage::after { content: "iPadを縦向きにすると大きく表示されます"; position: absolute; top: calc(env(safe-area-inset-top) + 8px); right: 12px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 99px; }
@media (max-width: 700px) { .cam-t .cam-msg { font-size: 11px; } .sign-bar .btn { padding: 6px 10px; } }
