/* =========================================================================
   リハ共通キット rehab-kit.css  v1
   rehab-kit.js が作る部品の見た目。すべて .rk-* に閉じてあるので
   各アプリの既存CSSとは衝突しない。色はアプリ側の変数を使い、
   無ければ品質指示書のパレットにフォールバックする。
   ========================================================================= */

/* ===== トースト ===== */
.rk-toast{
  position:fixed; left:50%; bottom:calc(84px + env(safe-area-inset-bottom,0px));
  transform:translate(-50%, 16px);
  max-width:86vw; padding:11px 18px; border-radius:999px;
  background:rgba(26,36,51,.94); color:#fff; font-size:14px; font-weight:600;
  line-height:1.4; text-align:center; z-index:9998;
  opacity:0; pointer-events:none; transition:opacity .18s, transform .18s;
}
.rk-toast.show{ opacity:1; transform:translate(-50%, 0); }

/* ===== 履歴の1件分のまとまり（既存の行＋共通ボタン列） ===== */
.rk-rec{
  border-bottom:1px solid var(--border, #dde4ee);
  padding-bottom:12px; margin-bottom:4px;
}
.rk-rec:last-of-type{ border-bottom:0; }
.rk-rec > *:first-child{ border-bottom:0 !important; margin-bottom:0; }

/* ===== 履歴カードの共通ボタン列 ===== */
.rk-acts{
  display:flex; flex-wrap:wrap; gap:6px; margin-top:10px;
}
.rk-act{
  flex:1 1 auto; min-width:82px; min-height:38px;
  padding:9px 10px; border-radius:10px;
  border:1px solid var(--border, #dde4ee);
  background:var(--card, #fff); color:var(--text, #1a2433);
  font-size:13.5px; font-weight:700; font-family:inherit;
  cursor:pointer; transition:background .12s, border-color .12s;
}
.rk-act:hover{ background:var(--accent-soft, #e8f1ff); border-color:var(--accent, #0e6fff); }
.rk-act:active{ background:var(--accent-soft, #e8f1ff); }
.rk-act-edit{
  border-color:var(--accent, #0e6fff);
  background:var(--accent-soft, #e8f1ff);
  color:var(--accent, #0e6fff);
}
.rk-act.rk-danger{ color:var(--danger, #d63333); }
.rk-act.rk-danger:hover{ background:#fdeaea; border-color:var(--danger, #d63333); }

/* ===== 内訳から「その採点項目へ飛ぶ」導線 ===== */
.rk-jump{ cursor:pointer; }
.rk-jump:hover{ background:var(--accent-soft, #e8f1ff); }

/* 表の行のとき: 右端のセルに矢印を出す */
tr.rk-jump > td:last-child::after{
  content:" ›"; color:var(--accent, #0e6fff); font-size:17px; font-weight:700;
}
/* ブロック要素のとき: 右端に絶対配置 */
div.rk-jump, li.rk-jump, button.rk-jump{ position:relative; padding-right:22px; }
div.rk-jump::after, li.rk-jump::after, button.rk-jump::after{
  content:"›"; position:absolute; right:8px; top:50%; transform:translateY(-50%);
  color:var(--accent, #0e6fff); font-size:19px; font-weight:700; line-height:1;
}
.rk-jump-hint{
  font-size:12.5px; color:var(--sub, #5b6b80); margin:6px 2px 10px;
}

/* ===== 「この記録を編集中」バナー ===== */
.rk-editbar{
  position:fixed; top:0; left:0; right:0; z-index:9997;
  display:flex; align-items:center; gap:9px;
  padding:calc(9px + env(safe-area-inset-top,0px)) 13px 9px;
  background:#fff6e8; border-bottom:1px solid #f4d9ae; color:#7a5200;
  font-size:13.5px; font-weight:700; line-height:1.35;
}
.rk-eb-dot{
  width:9px; height:9px; border-radius:50%; background:var(--warn, #e07f00);
  flex:none;
}
.rk-eb-t{ flex:1 1 auto; min-width:0; }
.rk-eb-x{
  flex:none; min-height:32px; padding:6px 11px; border-radius:9px;
  border:1px solid #e0bd80; background:#fff; color:#7a5200;
  font-size:12.5px; font-weight:700; font-family:inherit; cursor:pointer;
}
body.rk-has-editbar{ padding-top:46px; }

/* =========================================================================
   印刷 / PDF
   ========================================================================= */
#rk-print{ display:none; }

@media print{
  /* キットから印刷するときは、レポート以外をすべて隠す */
  body.rk-printing > *{ display:none !important; }
  body.rk-printing > #rk-print{ display:block !important; }
  body.rk-printing{
    padding:0 !important; margin:0 !important;
    background:#fff !important; overflow:visible !important;
  }
  .no-print{ display:none !important; }
  @page{ size:A4 portrait; margin:12mm; }
}

.rk-sheet{
  color:#111; background:#fff;
  font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Noto Sans JP",sans-serif;
  font-size:11pt; line-height:1.5;
}

/* 見出し */
.rk-sheet .rk-head{
  border-bottom:2px solid #111; padding-bottom:6px; margin-bottom:12px;
}
.rk-sheet .rk-title{ font-size:16pt; font-weight:800; letter-spacing:.01em; }
.rk-sheet .rk-meta{ font-size:10pt; color:#333; margin-top:3px; }

/* 合計 */
.rk-sheet .rk-headline{
  display:flex; align-items:baseline; gap:14px; flex-wrap:wrap;
  margin:0 0 12px;
}
.rk-sheet .rk-num{ font-size:34pt; font-weight:800; line-height:1; }
.rk-sheet .rk-unit{ font-size:13pt; color:#444; margin-left:4px; }
.rk-sheet .rk-caption{
  font-size:11pt; font-weight:700;
  border:1px solid #111; border-radius:999px; padding:3px 12px;
}

/* 付帯情報の帯 */
.rk-sheet .rk-facts{
  display:flex; flex-wrap:wrap; gap:0 18px;
  border:1px solid #bbb; border-radius:4px; padding:7px 11px; margin-bottom:12px;
}
.rk-sheet .rk-fact{ font-size:10pt; padding:1px 0; }
.rk-sheet .rk-fl{ color:#555; margin-right:6px; }
.rk-sheet .rk-fv{ font-weight:700; }

/* 項目内訳 */
.rk-sheet .rk-table{
  width:100%; border-collapse:collapse; margin-bottom:12px;
  font-size:10pt;
}
.rk-sheet .rk-table th,
.rk-sheet .rk-table td{
  border:1px solid #bbb; padding:5px 8px; vertical-align:top;
  page-break-inside:avoid; break-inside:avoid;
}
.rk-sheet .rk-table thead th{
  background:#eef1f5; font-weight:700; text-align:left; font-size:9.5pt;
}
.rk-sheet .rk-c2{ width:52px; text-align:center; font-weight:700; white-space:nowrap; }
.rk-sheet .rk-c3{ width:42%; color:#333; }
.rk-sheet .rk-no{
  display:inline-block; min-width:18px; color:#555; font-weight:700;
}

/* 追加セクション */
.rk-sheet .rk-section{ margin-bottom:11px; page-break-inside:avoid; break-inside:avoid; }
.rk-sheet .rk-sh{
  font-size:10pt; font-weight:800; border-left:3px solid #111;
  padding-left:7px; margin-bottom:5px;
}
.rk-sheet .rk-kv{ width:100%; border-collapse:collapse; font-size:10pt; }
.rk-sheet .rk-kv th,
.rk-sheet .rk-kv td{ border:1px solid #bbb; padding:4px 8px; text-align:left; }
.rk-sheet .rk-kv th{ width:30%; background:#f5f7fa; font-weight:600; color:#333; }
.rk-sheet .rk-note{
  border:1px solid #bbb; border-radius:4px; padding:7px 10px;
  font-size:10pt; min-height:34px; white-space:pre-wrap;
}

/* 署名欄 */
.rk-sheet .rk-sign{
  display:flex; align-items:flex-end; gap:8px; margin:16px 0 8px;
  font-size:10pt; color:#333;
}
.rk-sheet .rk-line{
  flex:1 1 auto; border-bottom:1px solid #666; height:15px; margin-right:12px;
}

/* 脚注 */
.rk-sheet .rk-foot{
  border-top:1px solid #bbb; padding-top:5px;
  font-size:8.5pt; color:#555; line-height:1.45;
}
