/* 訓練教材ラボ：購入者向けの道具（患者モード・タイマー・結果のメモ）。紙面＝白地・明朝・罫線・影なし */

/* 教材ページの入口 */
.rh-pro{margin:10px 0 4px;padding:8px 0 0;border-top:1px solid var(--line,#c9c7bd)}
.rh-pro-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.rh-pro-link{font-size:14px;color:var(--blue,#3f6185);margin-left:6px}
.rh-pro-msg{margin:6px 0 0;font-size:13px;color:var(--muted,#5f666b)}
.rh-pro-msg:empty{display:none}
.rh-pro-note{margin:6px 0 0;font-size:13px;color:var(--muted,#5f666b);line-height:1.6}
.rh-pro-note a{color:var(--blue,#3f6185)}

/* 患者モード */
html.rh-pm-on,html.rh-pm-on body{overflow:hidden!important;overscroll-behavior:none;touch-action:none;height:100%}
.rh-pm{position:fixed;inset:0;z-index:2000;background:#fff;color:#111;display:flex;flex-direction:column;
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;touch-action:none}
.rh-pm-bar{position:relative;flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;
  min-height:52px;padding:4px max(10px,env(safe-area-inset-right)) 4px max(10px,env(safe-area-inset-left));
  border-bottom:1px solid var(--line,#c9c7bd);background:#fff;font-family:var(--ui,sans-serif)}
.rh-pm-l,.rh-pm-r{display:flex;align-items:center;gap:28px}
.rh-pm-c{display:flex;align-items:center;gap:14px;font-variant-numeric:tabular-nums;font-size:15px;color:var(--muted,#5f666b)}
.rh-pm .btn{min-height:44px;min-width:64px;font-size:16px;padding:6px 14px}
.rh-pm-clock{min-width:84px!important;font-variant-numeric:tabular-nums;border-color:var(--line,#c9c7bd)}
.rh-pm-clock.paused{background:#f3efe2}
.rh-pm-pos{min-width:56px;text-align:center;color:#24282b}
.rh-pm-one{min-width:100px}
.rh-pm-next{min-width:96px!important}
.rh-pm-end{position:relative;overflow:hidden}
.rh-pm-endfill{position:absolute;left:0;top:0;bottom:0;width:0;background:#e6dfcb}
.rh-pm-end.hold .rh-pm-endfill{width:100%;transition:width 1s linear}
.rh-pm-endtx{position:relative}
.rh-pm-hint{position:absolute;left:12px;bottom:-18px;font-size:11px;color:var(--muted,#5f666b);pointer-events:none}
.rh-pm-stage{position:relative;flex:1;overflow:hidden;font-family:var(--paper,serif)}
.rh-pm-stage.rh-pm-scroll{overflow:auto;touch-action:pan-y}
.rh-pm-fit{position:absolute;left:0;top:0;transform-origin:0 0;font-size:20px;line-height:1.5;color:#111;text-align:center}
.rh-pm-fit *{max-width:none}
.rh-pm-fit .pcell{overflow:visible!important;padding:0!important;min-height:0!important}
.rh-pm-fit .pimg{width:30mm!important;height:30mm!important;flex:none!important;margin:0 auto!important}
.rh-pm-fit img{max-width:none}
.rh-pm-sum{max-width:720px;margin:28px auto;padding:0 20px;font-family:var(--paper,serif)}
.rh-pm-sum-h{font-size:24px;border-bottom:1px solid var(--line,#c9c7bd);padding-bottom:6px;margin-bottom:10px}
.rh-pm-sum-t{font-size:18px;margin:8px 0}
.rh-pm-sum-l{columns:2;font-size:15px;color:#24282b;margin:8px 0 16px 1.4em;padding:0}
.rh-pm-sum-b{display:flex;gap:16px;flex-wrap:wrap;margin:14px 0}
.rh-pm-sum-n{font-size:13px;color:var(--muted,#5f666b)}
@media (max-width:820px){
  .rh-pm-l,.rh-pm-r{gap:16px}
  .rh-pm-one{display:none}
}
/* スマホの縦（390px前後）でも「次へ」が画面の外に出ないように詰める */
@media (max-width:480px){
  .rh-pm-bar{gap:6px;padding-left:max(6px,env(safe-area-inset-left));padding-right:max(6px,env(safe-area-inset-right))}
  .rh-pm-l,.rh-pm-r{gap:6px}
  .rh-pm-c{gap:6px}
  .rh-pm .btn{min-width:48px;padding:6px 8px;font-size:15px}
  .rh-pm-clock{min-width:62px!important}
  .rh-pm-pos{min-width:40px}
  .rh-pm-next{min-width:62px!important}
}
/* 時計（針を描く）の時刻の文字は1行のまま大きくする（「ちょ／うど」で折れない） */
.rh-pm-fit .tk-lb{white-space:nowrap}

/* メモの入力 */
.rh-memo{position:fixed;inset:0;z-index:2100;background:rgba(36,40,43,.35);display:flex;align-items:flex-start;justify-content:center;
  overflow:auto;padding:24px 12px;-webkit-user-select:text;user-select:text;touch-action:auto}
.rh-memo-in{background:#fff;border:1px solid var(--line,#c9c7bd);width:min(680px,100%);padding:16px 18px;font-family:var(--ui,sans-serif);color:#24282b}
.rh-memo-h{font-family:var(--paper,serif);font-size:20px;border-bottom:1px solid var(--line,#c9c7bd);padding-bottom:6px;margin-bottom:10px}
.rh-memo-meta{display:grid;grid-template-columns:4em 1fr;gap:2px 8px;margin:0 0 10px;font-size:14px}
.rh-memo-meta dt{color:var(--muted,#5f666b)}
.rh-memo-meta dd{margin:0}
.rh-memo-lab{display:block;font-size:14px;margin-top:6px}
.rh-memo-code{font-size:16px;padding:6px 8px;border:1px solid var(--line,#c9c7bd);border-radius:2px;width:12em}
.rh-memo-warn{font-size:12px;color:#8a4b14;margin:4px 0 10px}
.rh-memo-tabs{display:flex;gap:6px;margin-bottom:6px}
.rh-memo-tabs .btn.on,.rh-t-tabs .btn.on{background:#24282b;color:#fff;border-color:#24282b}
.rh-ink-wrap{position:relative;height:240px;border:1px solid var(--line,#c9c7bd);background:#fff;
  background-image:repeating-linear-gradient(#fff 0 39px,#ece9df 39px 40px)}
.rh-ink-cv{position:absolute;left:0;top:0;touch-action:none;cursor:crosshair}
.rh-memo-inkbtns{display:flex;gap:8px;margin-top:6px}
.rh-memo-text{width:100%;box-sizing:border-box;font-size:16px;line-height:1.6;padding:8px;border:1px solid var(--line,#c9c7bd);border-radius:2px;font-family:inherit}
.rh-memo-small{font-size:12px;color:var(--muted,#5f666b);margin:6px 0 0}
.rh-store-note{font-size:12px;color:var(--muted,#5f666b);margin:6px 0;line-height:1.6}
.rh-store-note.bad{color:#8a2a1a}
.rh-memo-msg{font-size:14px;margin:6px 0 0}
.rh-memo-msg:empty{display:none}
.rh-memo-msg.bad{color:#8a2a1a}
.rh-memo-foot{display:flex;justify-content:space-between;gap:12px;margin-top:12px}
.rh-memo .btn{min-height:40px}
.rh-toast{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:2200;background:#fff;border:1px solid #24282b;padding:8px 14px;font-size:14px}
.rh-toast a{margin-left:10px;color:var(--blue,#3f6185)}

/* タイマー */
.rh-tool{max-width:860px;margin:0 auto}
.rh-t-tabs{display:flex;gap:8px;margin:8px 0 12px}
.rh-t-face{border:1px solid var(--line,#c9c7bd);background:#fff;text-align:center;padding:22px 10px 16px;cursor:default}
.rh-t-face.done{background:#f6e7c1;border-color:#b58a2a}
.rh-t-big{font-family:var(--paper,serif);font-size:clamp(72px,16vw,180px);line-height:1.05;font-variant-numeric:tabular-nums;letter-spacing:.02em}
.rh-t-sub{min-height:1.6em;font-size:18px;color:var(--muted,#5f666b)}
.rh-t-face.done .rh-t-sub{color:#6b4a0a;font-size:24px}
.rh-t-set{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:12px 0}
.rh-t-pre{display:inline-flex;flex-wrap:wrap;gap:6px;margin-left:12px}
.rh-t-ctl{display:flex;gap:16px;margin:12px 0}
.rh-t-ctl .btn{min-height:52px;min-width:110px;font-size:18px}
.rh-t-sound{display:inline-block;font-size:14px;margin:6px 0}

/* 記録の一覧 */
.rh-k-ptitle{display:none}
.rh-k-tools{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:8px 0}
.rh-k-flab{font-size:14px}
.rh-k-flab select{font-size:15px;padding:4px}
.rh-k-note{font-size:13px;color:var(--muted,#5f666b);margin:4px 0}
.rh-k-empty{color:var(--muted,#5f666b)}
.rh-k-grp{margin:16px 0}
.rh-k-code{font-family:var(--paper,serif);font-size:18px;border-bottom:2px solid #24282b;padding-bottom:3px;margin-bottom:6px}
.rh-k-item{border-bottom:1px solid var(--line,#c9c7bd);padding:8px 0;break-inside:avoid;page-break-inside:avoid}
.rh-k-hd{display:flex;flex-wrap:wrap;gap:12px;align-items:center;font-size:14px}
.rh-k-dt{font-variant-numeric:tabular-nums}
.rh-k-gen{font-weight:600}
.rh-k-sec{color:var(--muted,#5f666b)}
.rh-k-hd .btn{margin-left:auto}
.rh-k-cond,.rh-k-per{font-size:13px;color:var(--muted,#5f666b);margin-top:2px}
.rh-k-text{white-space:pre-wrap;margin-top:4px;font-size:15px;line-height:1.6}
.rh-k-ink{margin-top:4px;max-width:420px;border:1px solid var(--line2,#e2e0d8)}
.rh-ink{display:block;width:100%;height:auto}

@media print{
  #rh-pm,#rh-memo,.rh-pro,.rh-toast,.rh-t-ctl,.rh-t-set,.rh-t-tabs,.rh-t-sound,.rh-k-tools,.rh-k-note,.rh-store-note,.rh-pro-note{display:none!important}
  html.rh-pm-on,html.rh-pm-on body{overflow:visible!important;height:auto}
  .rh-k-ptitle{display:block;font-size:16pt;margin-bottom:4mm}
  .rh-k-item{padding:2.5mm 0}
  .rh-k-ink{max-width:90mm}
  .rh-k-code{font-size:13pt}
}
