/* =====================================================================
   dm_layout.css — 第1段階: 画面の配置を湯浅版（DigiMaster）に寄せる
   m3.css の後に読み込み、配置・寸法・部品の見た目を上書きする。
   ロゴ・配色は当社（緑 #0a4d12 系）のまま。機能（JS）は v22 のまま。
   寸法の出どころ: reference/digimaster/styles.css（2026-09-18 抽出）
     受付ヘッダー 42px 緑帯／ツールバー 8px 16px 枠付きボタン／一覧は罫線入り
     カルテ: ヘッダー 46px／タブ 2段×31px／サブヘッダー 30px／
             左 clamp(400px,29vw,560px)・右 clamp(360px,20vw,390px)・中央 主訴3.5:処置5
   ===================================================================== */
:root {
  --dm-primary: #0a4d12;
  --dm-primary-dark: #073a0d;
  --dm-primary-mid: #146b28;
  --dm-grad: linear-gradient(180deg, #146b28 0%, #0a4d12 100%);
  --dm-line: #cbd9d5;
  --dm-gap: #c8d5d1;
  --dm-head: #fbfcfb;
  --dm-tab: #f9fbfa;
  --dm-tool: #f8f9fa;
  --dm-tool-line: #dee2e6;
  --dm-text: #111827;
  --dm-muted: #495057;
}
html, body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  font-size: 13px;
  color: var(--dm-text);
  background: #f5f5f5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- ログイン（湯浅版: 緑のグラデーション地＋白カード） ---------- */
#loginOverlay {
  background: linear-gradient(160deg, #e8f5e9 0%, #c8e6c9 50%, #a5d6a7 100%) !important;
}
#loginOverlay::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%230a4d12' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
}
.dm-login-card {
  position: relative; width: 420px; max-width: calc(100vw - 32px); box-sizing: border-box;
  padding: 48px 50px 40px; background: #fff; border-radius: 4px; text-align: center;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 20px 25px rgba(0,0,0,.1), 0 10px 10px rgba(0,0,0,.04);
}
.dm-login-logo { margin-bottom: 28px; }
.dm-login-logo svg { width: 40px; height: 56px; display: block; margin: 0 auto 14px; color: var(--dm-primary); filter: drop-shadow(0 2px 4px rgba(10,77,18,.3)); }
.dm-login-sub { display: block; font-size: 11px; font-weight: 500; color: #737373; letter-spacing: 6px; margin-bottom: 6px; }
.dm-login-title { margin: 0; font-size: 26px; font-weight: 700; color: var(--dm-primary); letter-spacing: 4px; }
.dm-login-facility {
  min-height: 64px; margin: 0 0 18px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; text-align: left;
  border: 1px solid #b7c8b8; border-radius: 4px; background: #f5faf5; color: #234b26;
}
.dm-login-facility .ic { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--dm-primary-dark); background: #dcebdc; }
.dm-login-facility .ic svg { width: 18px; height: 18px; }
.dm-login-facility .body { flex: 1; min-width: 0; }
.dm-login-facility .lbl { display: block; font-size: 11px; margin-bottom: 6px; }
.dm-login-facility .clinic-picker .clinic-pick { padding: 7px 2px; font-size: 12px; }
.dm-login-form .fg { margin-bottom: 16px; text-align: left; }
.dm-login-form input {
  width: 100%; padding: 14px 18px; box-sizing: border-box; border: 1px solid #d4d4d4; border-radius: 3px;
  font-size: 14px; font-family: inherit; color: #2d2d2d; background: #fafafa; transition: all .2s ease;
}
.dm-login-form input::placeholder { color: #a3a3a3; }
.dm-login-form input:focus { outline: none; border-color: var(--dm-primary); background: #fff; box-shadow: 0 0 0 3px rgba(10,77,18,.1); }
.dm-login-btn {
  width: 100%; padding: 15px; border: none; border-radius: 3px; cursor: pointer; font-family: inherit;
  background: var(--dm-grad); color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 2px;
  box-shadow: 0 4px 12px rgba(10,77,18,.3); transition: all .2s ease;
}
.dm-login-btn:hover { background: linear-gradient(180deg, #0a4d12 0%, #073a0d 100%); box-shadow: 0 6px 16px rgba(10,77,18,.4); }
.dm-login-btn:disabled { cursor: not-allowed; opacity: .55; }
.dm-login-or { margin: 16px 0 8px; display: flex; align-items: center; gap: 12px; font-size: 11px; color: #8a9692; }
.dm-login-or i { flex: 1; height: 1px; background: #d2dbd8; display: block; }
.dm-login-google {
  width: 100%; padding: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-family: inherit;
  background: #fff; color: #242927; border: 1px solid #d2dbd8; border-radius: 3px; font-size: 13px;
}
.dm-login-google:hover { background: #f4f6f5; }
.dm-login-sec { width: 100%; margin-top: 8px; padding: 9px; cursor: pointer; font-family: inherit; background: #fff; color: #242927; border: 1px solid #d2dbd8; border-radius: 3px; font-size: 12px; }
.dm-login-note { margin: 0 0 10px; font-size: 12px; color: #5e6b67; text-align: left; }
#loginError { margin-top: 12px; color: #d01111; font-size: 12px; text-align: center; min-height: 18px; }

/* ---------- 受付: ヘッダー（緑帯 42px） ---------- */
#screenList .m3-header {
  height: 42px; padding: 0 12px; gap: 8px; color: #fff;
  background: var(--dm-grad); border-bottom: none; box-shadow: 0 2px 8px rgba(0,0,0,.15); position: relative; z-index: 20;
}
#screenList .m3-logo { width: 36px; height: 36px; margin-right: 4px; color: #fff; background: rgba(255,255,255,.15); border-radius: 4px; }
#screenList .m3-logo:hover { background: rgba(255,255,255,.25); }
#screenList .m3-logo svg { width: 20px; height: 28px; }
#screenList .m3-title { font-size: 15px; font-weight: 600; letter-spacing: .5px; color: #fff; }
#screenList .m3-clock { color: rgba(255,255,255,.85); }
.dm-hicons { display: flex; align-items: center; gap: 2px; }
#screenList .m3-ibtn { width: 32px; height: 32px; color: #fff; border-radius: 3px; }
#screenList .m3-ibtn:hover { background: rgba(255,255,255,.18); }
#screenList .m3-ibtn svg { width: 18px; height: 18px; }
#screenList .m3-badge { top: 2px; right: 2px; }
.dm-hsearch {
  display: flex; align-items: center; gap: 6px; height: 28px; min-width: 190px; margin: 0 6px; padding: 0 10px;
  background: rgba(255,255,255,.16); border-radius: 3px; cursor: text;
}
.dm-hsearch:focus-within { background: #fff; }
.dm-hsearch svg { width: 14px; height: 14px; color: #fff; flex-shrink: 0; }
.dm-hsearch:focus-within svg { color: var(--dm-primary); }
.dm-hsearch input { flex: 1; min-width: 0; height: 26px; border: none; background: transparent; color: #fff; font-size: 12px; font-family: inherit; outline: none; }
.dm-hsearch input::placeholder { color: rgba(255,255,255,.8); }
.dm-hsearch:focus-within input { color: var(--dm-text); }
.dm-hsearch:focus-within input::placeholder { color: #a3a3a3; }
#screenList .m3-user { height: 32px; padding: 0 10px; border-radius: 4px; color: #fff; font-size: 12px; font-weight: 500; background: rgba(0,0,0,.18); }
#screenList .m3-user:hover { background: rgba(0,0,0,.3); }
#screenList .m3-user svg { color: #fff; width: 14px; height: 14px; }

/* ---------- 受付: ツールバー（枠付きボタン） ---------- */
#screenList .m3-toolbar { height: auto; min-height: 52px; padding: 8px 16px; gap: 8px; background: var(--dm-tool); border-bottom: 1px solid var(--dm-tool-line); }
.dm-tl { display: flex; align-items: center; gap: 8px; }
.dm-tr { display: flex; align-items: center; gap: 4px; }
.dm-navbtn {
  width: 28px; height: 28px; padding: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  border: 1px solid var(--dm-tool-line); background: #fff; border-radius: 4px; color: #495057; transition: all .2s;
}
.dm-navbtn svg { width: 14px; height: 14px; }
.dm-navbtn:hover { background: #e9ecef; border-color: #adb5bd; }
#screenList .m3-datebtn { height: auto; padding: 6px 14px; font-size: 14px; font-weight: 600; color: #212529; border: 1px solid var(--dm-tool-line); border-radius: 4px; }
#screenList .m3-datebtn:hover { border-color: var(--dm-primary); }
.dm-count { margin: 0; padding: 5px 12px; background: #fff; border: 1px solid var(--dm-tool-line); border-radius: 4px; font-size: 13px; font-weight: 500; color: #495057; white-space: nowrap; }
.dm-count b { font-weight: 500; font-size: 13px; }
.dm-tbtn {
  height: 32px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-family: inherit; white-space: nowrap;
  border: 1px solid #d4d4d4; background: #fff; border-radius: 4px; font-size: 12px; color: #404040; transition: all .2s;
}
.dm-tbtn svg { width: 14px; height: 14px; color: var(--dm-primary); }
.dm-tbtn:hover { background: #fafafa; border-color: #a3a3a3; }
#screenList .m3-toolbar .m3-tbtn { width: 32px; height: 32px; border: 1px solid #d4d4d4; border-radius: 4px; background: #fff; color: #404040; }
#screenList .m3-toolbar .m3-tbtn.flat { border: 1px solid #d4d4d4; background: #fff; color: #404040; }
#screenList .m3-toolbar .m3-tbtn:hover { background: #f5f5f5; }
#screenList .m3-toolbar .m3-tbtn.on { background: var(--dm-primary); color: #fff; border-color: var(--dm-primary); }
#screenList .m3-toolbar .m3-tbtn svg { width: 16px; height: 16px; }
.dm-tr .m3-tbtn { width: 36px !important; height: 36px !important; font-size: 16px; }
.dm-tr .m3-tbtn.txt { width: auto !important; padding: 0 12px; font-size: 12px; }
#screenList .m3-filter { top: 94px; }

/* ---------- 受付: 一覧（罫線入り・見出しはグラデーション） ---------- */
#screenList .m3-listwrap { padding: 0; background: #fff; }
#dbPatientResults { margin: 0 !important; border-radius: 0 !important; border-left: none !important; border-right: none !important; }
#screenList .m3-table { table-layout: auto; font-size: 12px; background: #fff; }
#screenList .m3-table th {
  position: sticky; top: 0; z-index: 10; height: auto; padding: 8px 6px; overflow: visible;
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%); border: 1px solid var(--dm-tool-line); border-left: none;
  text-align: center; font-weight: 600 !important; color: #495057; font-size: 12px; white-space: nowrap; user-select: none;
}
#screenList .m3-table th:first-child { border-left: 1px solid var(--dm-tool-line); }
#screenList .m3-table th:last-child { border-right: none; }
#screenList .m3-table th.sortable:hover { background: linear-gradient(180deg, #e9ecef 0%, #dee2e6 100%); }
#screenList .m3-table th .sort { color: #adb5bd; }
#screenList .m3-table td {
  height: auto; padding: 8px 6px; color: #212529; font-size: 13px; vertical-align: middle;
  border-bottom: 1px solid var(--dm-tool-line); border-right: 1px solid #f1f3f4; transition: background .15s;
}
#screenList .m3-table td:first-child { border-left: 1px solid #f1f3f4; }
#screenList .m3-table td:last-child { border-right: none; }
#screenList .m3-table tr.m3-row:hover td { background: #f7faf8; }
#screenList .m3-table .pt-kana { font-size: 11px; line-height: 1.25; color: #6c757d; }
#screenList .m3-table .pt-name { font-size: 15px; font-weight: 700; line-height: 1.3; color: #1565c0; }
#screenList .m3-table .pt-name.f { color: #d81b60; }
#screenList .m3-table .pt-name.na { color: #212529; }
#screenList .m3-table .m3-status { min-width: 65px; height: 26px; padding: 0 8px; justify-content: center; font-size: 11px; font-weight: 600; }
#screenList .m3-table .first-mark { width: 20px; height: 20px; line-height: 20px; }
#screenList .m3-table .row-acts { justify-content: center; }
#screenList .m3-table .row-acts button { border: 1px solid var(--dm-tool-line); box-shadow: none; border-radius: 3px; width: 28px; height: 28px; }
/* 列幅（湯浅版 .col-* の実測値） */
#screenList .m3-table th.col-num { width: 45px; }
#screenList .m3-table th.col-rsv, #screenList .m3-table th.col-time { width: 55px; }
#screenList .m3-table th.col-status { width: 80px; }
#screenList .m3-table th.col-pno { width: 75px; }
#screenList .m3-table th.col-name { min-width: 150px; text-align: left; }
#screenList .m3-table th.col-dob { width: 90px; }
#screenList .m3-table th.col-age { width: 40px; }
#screenList .m3-table th.col-ins { width: 110px; }
#screenList .m3-table th.col-dept { width: 100px; }
#screenList .m3-table th.col-rsvdept { width: 96px; }
#screenList .m3-table th.col-doctor { width: 92px; }
#screenList .m3-table th.col-prev { width: 90px; }
#screenList .m3-table th.col-memo, #screenList .m3-table th.col-rmemo { min-width: 160px; max-width: 240px; text-align: left; }
#screenList .m3-table th.col-first, #screenList .m3-table th.col-line, #screenList .m3-table th.col-pay,
#screenList .m3-table th.col-out, #screenList .m3-table th.col-erx, #screenList .m3-table th.col-warn { width: 28px; padding-left: 4px; padding-right: 4px; }
#screenList .m3-table th.col-kaikei { width: 50px; }
#screenList .m3-table th.col-fax { width: 70px; }
#screenList .m3-table th.col-ops { width: 140px; }
#screenList .m3-table td.wrap { white-space: normal; line-height: 1.3; }
/* 患者なし（湯浅版のセンター表示） */
#screenList .m3-table td.dm-empty-cell { padding: 0; border: none; }
.dm-no-patients { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 20px; text-align: center; color: #737373; }
.dm-no-patients svg { width: 48px; height: 48px; color: #d4d4d4; margin-bottom: 20px; }
.dm-no-patients p { margin: 0 0 20px; font-size: 14px; }
.dm-no-patients .btn-new {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; cursor: pointer; font-family: inherit;
  background: var(--dm-primary); color: #fff; border: none; border-radius: 3px; font-size: 13px; font-weight: 600;
}
.dm-no-patients .btn-new svg { width: 16px; height: 16px; color: #fff; margin: 0; }
.dm-no-patients .btn-new:hover { background: var(--dm-primary-dark); }

/* ---------- カルテ: ヘッダー（46px・患者情報を横並び） ---------- */
#screenKarte .m3-header { height: 46px; padding: 0 6px; gap: 8px; background: var(--dm-head); border-bottom: 1px solid #b8cac5; }
#screenKarte .m3-logo { width: 28px; height: 40px; margin: 0; color: #2f6f3f; }
#screenKarte .m3-logo:hover { background: #eaf4ec; }
#screenKarte .m3-logo svg { width: 20px; height: 28px; }
#screenKarte .m3-pt { gap: 8px; margin-left: 0; align-items: center; }
#screenKarte .m3-pt .no { font-size: 17px; font-weight: 500; color: var(--dm-text); }
#screenKarte .m3-pt ruby { font-size: 17px; font-weight: 500; color: var(--dm-text); }
#screenKarte .m3-pt rt { display: none; }
#screenKarte .m3-pt .kana-inline { display: inline !important; font-size: 16px; color: var(--dm-text); }
#screenKarte .m3-pt .age { font-size: 16px; color: var(--dm-text); }
#screenKarte .m3-pt .sex { width: 20px; height: 22px; line-height: 22px; padding: 0; border-radius: 0; text-align: center; font-size: 14px; background: var(--dm-primary); vertical-align: 0; }
#screenKarte .m3-pt .sex.f { background: #d33d4b; }
#screenKarte .m3-pt .ins { font-size: 13px; color: var(--dm-muted); }
#screenKarte .m3-ibtn { width: 27px; height: 30px; border-radius: 0; color: #0b5a2a; }
#screenKarte .m3-ibtn:hover { background: #e8f2ec; }
#screenKarte .m3-ibtn svg { width: 16px; height: 16px; }
#screenKarte .m3-header .m3-badge { top: 0; right: 0; min-width: 14px; height: 14px; line-height: 14px; padding: 0; font-size: 9px; }
#screenKarte .m3-header .m3-wbtn { height: 26px; padding: 0 9px; border: 1px solid var(--dm-line); border-radius: 2px; box-shadow: none; background: #fff; font-size: 13px; }
#screenKarte .m3-header .m3-wbtn.on { background: var(--dm-primary); color: #fff; border-color: var(--dm-primary); }
#screenKarte .m3-user { height: 32px; padding: 0 8px; color: #0b5a2a; font-weight: 500; }
#screenKarte .m3-user:hover { background: #e8f2ec; }
#screenKarte .m3-user svg { width: 14px; height: 14px; }
#screenKarte .m3-clock { color: var(--dm-muted); }

/* ---------- カルテ: 3列（左 29vw／右 20vw／中央 残り） ---------- */
#screenKarte .m3-karte-body { background: var(--dm-gap); gap: 1px; }
#screenKarte .m3-col { background: #fff; }
@media (min-width: 1180px) {
  #screenKarte .m3-col-left, #screenKarte .m3-col-left.open { width: clamp(400px, 29vw, 560px); }
  #screenKarte .m3-col-right, #screenKarte .m3-col-right.rail { width: clamp(360px, 20vw, 390px); }
  #screenKarte .m3-col-center { min-width: 420px; }
}
/* タブ（2段×7・31px） */
#screenKarte .m3-tabs li, #screenKarte .m3-rail li { height: 31px; background: var(--dm-tab); color: #17241c; border-color: var(--dm-line); font-size: 13px; }
#screenKarte .m3-tabs li:hover:not(.on), #screenKarte .m3-rail li:hover:not(.on) { background: #edf5ef; }
#screenKarte .m3-tabs li.on, #screenKarte .m3-rail li.on { background: var(--dm-primary); color: #fff; font-weight: 600; }
#screenKarte .m3-tabs.r6 { grid-template-columns: repeat(6, 1fr) 56px; }
#screenKarte .m3-tabs.r6 li:last-child { background: #fff; color: #495057; font-size: 12px; border-left: 1px solid var(--dm-line); }
#screenKarte .m3-tabs.r6 li:last-child.on { background: var(--dm-primary); color: #fff; }
/* 左: サブヘッダー（カルテ内検索） */
.dm-sub { display: flex; align-items: center; height: 30px; padding: 0 6px; gap: 4px; background: var(--dm-head); border-bottom: 1px solid var(--dm-line); flex-shrink: 0; }
.dm-sub input { flex: 1; min-width: 0; height: 24px; padding: 2px 6px; border: 1px solid var(--dm-line); border-radius: 0; background: #fff; font-size: 13px; font-family: inherit; }
.dm-sub input:focus { outline: 1px solid #0d8fd6; border-color: #0d8fd6; }
.dm-sub .m3-ibtn { width: 24px; height: 24px; }
.dm-sub .m3-ibtn svg { width: 14px; height: 14px; }
#screenKarte .m3-col-left:not(.open) .dm-sub { display: none; }
@media (min-width: 1180px) { #screenKarte .m3-col-left .dm-sub { display: flex !important; } }

/* 中央: 1行目（日付・タブ・操作）／2行目（診療科・医師・保険・承認・請求区分） */
#screenKarte .m3-cbar { height: 31px; padding: 0 8px; gap: 6px; background: #fff; border-bottom: 1px solid var(--dm-line); }
#screenKarte .m3-cbar .date { height: 26px; display: inline-flex; align-items: center; margin: 0; padding: 0 10px; border: 1px solid var(--dm-primary); background: #fff; color: var(--dm-primary); font-size: 14px; font-weight: 600; white-space: nowrap; }
#screenKarte .m3-ktab { height: 26px; padding: 0 6px 0 12px; margin-left: 5px; background: var(--dm-primary); font-size: 13px; }
#screenKarte .m3-cbar .plus { width: 26px; height: 26px; color: #475569; font-size: 16px; }
#screenKarte .m3-cbar .plus:hover { background: #edf5ef; color: var(--dm-primary); }
#screenKarte .m3-cbar .m3-tbtn.flat { width: 26px; height: 26px; color: #0b5a2a; }
#screenKarte .m3-cbar .m3-tbtn.flat svg { width: 14px; height: 14px; }
#screenKarte .m3-cbar .m3-wbtn { height: 26px; padding: 0 9px; border: 1px solid var(--dm-line); border-radius: 2px; box-shadow: none; background: #fff; font-size: 13px; color: var(--dm-text); }
#screenKarte .m3-cbar .m3-wbtn:hover { background: #edf5ef; }
#screenKarte .m3-cbar2 { height: 31px; padding: 0 8px; gap: 12px; background: #fff; border-bottom: 1px solid var(--dm-line); font-size: 14px; color: var(--dm-text); }
#screenKarte .m3-cbar2 .sel-plain { font-size: 14px; }
#screenKarte .m3-cbar2 #m3Approve { font-size: 14px !important; }
#screenKarte .m3-draft { height: 20px; line-height: 20px; font-size: 12px; }
#screenKarte .m3-cbar2 select#m3Claim { width: 148px; height: 26px; padding: 0 8px; border: 1px solid var(--dm-line); border-radius: 2px; font-size: 13px; }
#screenKarte .m3-cbar2 .m3-tbtn.flat { width: 26px; height: 26px; color: #0b5a2a; }
#screenKarte .m3-cbar2 .m3-wbtn { height: 26px; padding: 0 8px; border: 1px solid var(--dm-line); border-radius: 2px; box-shadow: none; background: #fff; font-size: 12px; }
.dm-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--dm-muted); white-space: nowrap; cursor: pointer; }
.dm-chk input { margin: 0; accent-color: var(--dm-primary); }
/* 労災・オンライン診療の詳細行は、チェックしたときだけ出す（dm_layout.js が .show を付ける） */
#screenKarte .m3-cbar3 { display: none; min-height: 26px; padding: 2px 12px; gap: 10px; background: #fbfcfb; border-bottom: 1px solid var(--dm-line); font-size: 12px; }
#screenKarte .m3-cbar3.show { display: flex; }
#screenKarte .m3-cbar3 .tmv-main { color: var(--dm-text); font-weight: 600; white-space: nowrap; }
/* 中央: 2ペイン（主訴・所見 3.5 : 処置・行為 5）とサブヘッダー 30px */
#screenKarte .m3-panes { background: var(--dm-gap); gap: 1px; }
#screenKarte .m3-pane { border-right: none; background: #fff; }
#screenKarte .m3-pane:first-child { flex: 3.5; }
#screenKarte .m3-pane:last-child { flex: 5; }
#screenKarte .m3-pane-head { height: 30px; padding: 0 7px; background: var(--dm-head); border-bottom: 1px solid var(--dm-line); font-size: 12px; font-weight: 600; color: #495057; }
#screenKarte .m3-pane-head .tb { width: 26px; height: 26px; color: #0b5a2a; font-size: 12px; font-weight: 600; }
#screenKarte .m3-pane-head .tb.on { background: #e8f2ec; }
#screenKarte .m3-pane-head .tb.red { color: #dc3545; } #screenKarte .m3-pane-head .tb.blue { color: #0d6efd; }
#screenKarte .m3-pane-head .tb svg { width: 14px; height: 14px; }
#screenKarte .m3-pane-head input.fs { width: 24px; height: 20px; border: none; background: transparent; font-size: 11px; color: #495057; }
#screenKarte .m3-cc { padding: 3px 8px; background: #fbfcfb; }
#screenKarte .m3-fold { height: 24px; }
#screenKarte #findingsEditor.richtext-editor { padding: 10px; font-size: 13px; line-height: 1.6; }
#screenKarte #findingsEditor.richtext-editor:focus { background: #fafffe; }
/* 中央: 下部バー（シェーマ追加／一包化／適応症追加） */
.dm-cfoot { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--dm-head); border-top: 1px solid var(--dm-line); flex-shrink: 0; font-size: 12px; color: var(--dm-text); }
.dm-cfoot .m3-wbtn { height: 28px; padding: 0 12px; border: 1px solid var(--dm-line); border-radius: 4px; box-shadow: none; background: #fff; font-size: 11px; font-weight: 500; color: #495057; }
.dm-cfoot .m3-wbtn:hover { background: #e9ecef; }
.dm-cfoot .m3-wbtn.primary { background: var(--dm-primary); color: #fff; border-color: var(--dm-primary); }
.dm-cfoot .m3-wbtn.primary:hover { background: var(--dm-primary-dark); }
.dm-cfoot label { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #495057; cursor: pointer; }
.dm-cfoot label input { margin: 0; accent-color: var(--dm-primary); }

/* 右: キーワード欄・一覧・下部ボタン（4＋3） */
#screenKarte .m3-kw { height: 30px; padding: 0 6px; background: var(--dm-head); border-bottom: 1px solid var(--dm-line); }
#screenKarte .m3-kw input { height: 24px; padding: 2px 6px; border: 1px solid var(--dm-line); background: #fff; font-size: 13px; }
#screenKarte .m3-kw input:focus { outline: 1px solid #0d8fd6; border-color: #0d8fd6; }
#screenKarte .m3-items { padding: 8px 12px 0; }
#screenKarte .m3-actions { padding: 8px 10px; gap: 4px; background: var(--dm-head); border-top: 1px solid var(--dm-line); }
.dm-fgroup { display: flex; gap: 4px; }
#screenKarte .m3-abtn { width: 40px; height: 38px; border-radius: 2px; background: var(--dm-primary); }
#screenKarte .m3-abtn:hover { background: var(--dm-primary-dark); }
#screenKarte .m3-abtn svg { width: 20px; height: 20px; }
#screenKarte .m3-col-right.rail .dm-fgroup { flex-direction: column; }
#screenKarte .m3-col-right.rail .m3-actions { padding: 8px 0 12px; }

/* 共通部品 */
.btn-primary { background: var(--dm-primary); border-color: var(--dm-primary); }
.btn-primary:hover { background: var(--dm-primary-dark); }
.modal { border-radius: 4px; }

/* ---------- 微調整（2026-09-19 静止画確認より） ---------- */
/* 一覧は幅が足りないときに横スクロール（湯浅版と同じ）。列を潰して縦に折り返さない */
#screenList .m3-table { min-width: 1440px; }
#screenList .m3-table td.wrap { white-space: nowrap; }
#screenList .m3-table td.wrap[title] { white-space: normal; }   /* 患者メモ・受付メモだけ折り返す */
/* カルテヘッダーの性別バッジ: 「不明」など2文字も収める */
#screenKarte .m3-pt .sex { width: auto; min-width: 20px; padding: 0 4px; }
/* 中央2行目: 折り返さない・各項目を潰さない */
#screenKarte .m3-cbar2 { gap: 10px; overflow: hidden; }
#screenKarte .m3-cbar2 > * { flex-shrink: 0; white-space: nowrap; }
#screenKarte .m3-cbar2 .m3-spacer { flex-shrink: 1; }
#screenKarte .m3-cbar2 #visitDoctor { max-width: 120px; }
/* ペイン見出し: 狭いときも1行 */
#screenKarte .m3-pane-head { white-space: nowrap; overflow: hidden; }
/* タブ文字: 1440px 未満は 12px（「副作用薬等」が収まる幅） */
@media (max-width: 1439px) {
  #screenKarte .m3-tabs li { font-size: 12px; letter-spacing: -.02em; }
}
/* 1440px 未満: 中央2行目は隠さず折り返す（項目が多いときは2段になる） */
@media (max-width: 1439px) {
  #screenKarte .m3-cbar2 { height: auto; min-height: 31px; flex-wrap: wrap; row-gap: 2px; padding: 2px 8px; overflow: visible; }
}
/* トースト: 隠れているときに右端へ1〜2pxはみ出していた分を消す */
.toast:not(.show) { visibility: hidden; }

/* ---------- 第2段階: レセプト摘要・症状詳記・特定器材（カルテの処置・行為ペイン） ---------- */
.rn-body { padding: 2px 0 4px 30px; }
.rn-sec { margin: 4px 0 6px; }
.rn-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dm-muted); padding: 2px 0; }
.rn-add { height: 20px; padding: 0 8px; border: 1px solid var(--dm-line); border-radius: 2px; background: #fff; font-size: 11px; color: var(--dm-primary); cursor: pointer; font-family: inherit; }
.rn-add:hover { background: #edf5ef; }
.rn-empty { font-size: 11px; color: #8a9692; padding: 1px 0 2px; }
.rn-row { display: flex; align-items: flex-start; gap: 4px; margin: 3px 0; }
.rn-row select, .rn-row input, .rn-row textarea { height: 24px; border: 1px solid var(--dm-line); border-radius: 2px; font-size: 12px; font-family: inherit; padding: 0 5px; background: #fff; box-sizing: border-box; }
.rn-row textarea { height: auto; flex: 1; padding: 3px 5px; resize: vertical; line-height: 1.4; }
.rn-row .rn-code { width: 96px; font-variant-numeric: tabular-nums; }
.rn-row .rn-text { flex: 1; min-width: 80px; }
.rn-row .rn-num { width: 64px; text-align: right; }
.rn-row .rn-unit { width: 64px; }
.rn-del { width: 22px; height: 24px; border: none; background: transparent; color: #a33; cursor: pointer; font-size: 14px; flex-shrink: 0; }
.rzm-allow { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #b45309; margin-right: auto; cursor: pointer; }
.rzm-allow input { margin: 0; accent-color: #b45309; }
/* 器材の行は狭いペインで折り返す（単価・削除が切れないように） */
.rn-row.rn-to { flex-wrap: wrap; }
.rn-row.rn-to .rn-text { flex: 1 1 140px; }

/* ---------- スマホ版（医療補助）からの報告 ---------- */
.mi-badge { display: inline-block; padding: 1px 6px; border-radius: 10px; background: #c9821f; color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.mi-badge.done { background: #e3f2ec; color: #0e7a5f; font-weight: 400; }
.mi-panel { margin: 4px 0 6px 30px; }
#mobileDocsPanel.mi-panel { margin-left: 0; margin-bottom: 10px; }
.mi-title { font-size: 12px; font-weight: 700; color: #b45309; margin: 2px 0 4px; }
.mi-card { background: #fff8ee; border: 1px solid #ecd9b8; border-left: 4px solid #c9821f; border-radius: 4px; padding: 6px 8px; margin: 4px 0; font-size: 12px; }
.mi-card.done { background: #f6f8f7; border-color: #d2dbd8; border-left-color: #9ab5ab; }
.mi-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.mi-meta { color: #5e6b67; font-size: 11px; font-weight: 400; }
.mi-new { margin-left: auto; padding: 1px 6px; background: #c9821f; color: #fff; font-size: 10px; border-radius: 2px; }
.mi-ok { margin-left: auto; padding: 1px 6px; background: #e3f2ec; color: #0e7a5f; font-size: 10px; border-radius: 2px; }
.mi-body { display: flex; gap: 8px; align-items: flex-start; }
.mi-thumb img { width: 96px; height: 72px; object-fit: cover; border: 1px solid #d2dbd8; border-radius: 3px; display: block; }
.mi-text { flex: 1; min-width: 0; }
.mi-memo { white-space: pre-wrap; line-height: 1.4; margin-bottom: 4px; }
.mi-memo.muted { color: #8a9692; }
.mi-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 2px 0; }
.mi-q { color: #5e6b67; font-size: 11px; margin-right: 4px; }
.mi-btn { height: 24px; padding: 0 8px; border: 1px solid #cbd9d5; border-radius: 3px; background: #fff; font-size: 11px; cursor: pointer; font-family: inherit; color: #111827; }
.mi-btn:hover { background: #edf5ef; }
.mi-btn.add { border-color: #0a4d12; color: #0a4d12; font-weight: 700; }
.mi-btn.add.on { background: #e3efe5; }
.mi-btn.ok { background: #0a4d12; color: #fff; border-color: #0a4d12; }
.mi-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
