/*
  医療入院カルテ・指示書 v1.0.3
  全ページ共通UI改善
  2026-07-05 JST

  目的：
  見やすさ、入力しやすさ、押しやすさを優先。
*/


:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --sub: #5f6b7a;
  --line: #d8dee9;
  --line-strong: #b9c3d1;
  --brand: #1f6feb;
  --brand-dark: #1557ba;
  --danger: #c62828;
  --ok: #1b7f3a;
  --warn: #8a5a00;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 1px 4px rgba(15, 23, 42, 0.06);
}


* {
  box-sizing: border-box;
}


html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}


body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Hiragino Sans",
    "Yu Gothic",
    "Meiryo",
    sans-serif;
  line-height: 1.75;
}


body,
input,
select,
textarea,
button {
  font-size: 16px;
}


a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}


a:hover {
  text-decoration: underline;
}


h1,
h2,
h3 {
  line-height: 1.35;
  margin: 0 0 14px;
  color: #111827;
}


h1 {
  font-size: 1.55rem;
  padding-bottom: 8px;
}


h2 {
  font-size: 1.25rem;
}


h3 {
  font-size: 1.1rem;
}


hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}


/* 上部ヘッダー */

header,
.header,
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}


body > h1,
body > .container,
main,
.page,
.content {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}


main,
.page,
.content {
  padding: 18px;
}


.user {
  background: #eef4ff;
  border: 1px solid #c9dcff;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 12px 18px;
  color: #163b72;
  font-weight: 700;
}


/* ナビゲーション */

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}


nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #1f2937;
  box-shadow: var(--shadow-soft);
}


nav a:hover {
  background: #eef4ff;
  border-color: #b9d1ff;
  text-decoration: none;
}


/* カード */

.card,
section,
fieldset {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 16px 18px;
}


.card + .card {
  margin-top: 20px;
}


.muted {
  color: var(--sub);
  font-size: 0.95rem;
}


/* フォーム */

form {
  margin: 0;
}


label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 700;
  color: #273244;
}


input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  outline: none;
}


textarea {
  min-height: 120px;
  resize: vertical;
}


input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.16);
}


input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: auto;
  transform: scale(1.2);
  margin-right: 8px;
}


input[type="date"],
input[type="number"] {
  max-width: 260px;
}


.formgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px 18px;
}


/* ボタン */

button,
.button,
a.button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 16px;
  margin: 4px 4px 4px 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: #1f2937;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}


button:hover,
.button:hover,
a.button:hover,
input[type="submit"]:hover {
  background: #f2f6ff;
  text-decoration: none;
}


button.primary,
.primary,
input[type="submit"].primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}


button.primary:hover,
.primary:hover {
  background: var(--brand-dark);
}


button[type="submit"] {
  touch-action: manipulation;
}


button:focus,
.button:focus,
a:focus {
  outline: 3px solid rgba(31, 111, 235, 0.25);
  outline-offset: 2px;
}


/* 削除ボタン */

button[onclick*="削除"],
form[id^="delete-"] button,
form[id^="delete-nurse-"] + button {
  border-color: #efb4b4;
  background: #fff7f7;
  color: var(--danger);
}


button[onclick*="削除"]:hover {
  background: #ffecec;
}


/* テーブル */

table {
  width: calc(100% - 36px);
  margin: 16px 18px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}


table.list {
  display: block;
  overflow-x: auto;
  white-space: normal;
}


table.list thead,
table.list tbody,
table.list tr {
  width: 100%;
}


th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}


th {
  background: #eef2f7;
  color: #1f2937;
  font-weight: 800;
  white-space: nowrap;
}


tr:nth-child(even) td {
  background: #fbfcff;
}


tr:hover td {
  background: #f3f7ff;
}


td strong {
  font-size: 1.05rem;
}


.pre,
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}


/* 看護師ドラッグ並び替え */

#nurse-sort-body tr {
  transition: background 0.15s ease;
}


#nurse-sort-body tr.dragging {
  opacity: 0.55;
  background: #eaf2ff;
}


#nurse-sort-body td:first-child {
  width: 60px;
  text-align: center;
  font-weight: 800;
  color: var(--brand);
}


#nurse-sort-body td:nth-child(2) {
  width: 80px;
  text-align: center;
  font-size: 1.2rem;
  color: var(--sub);
  user-select: none;
}


/* メッセージ */

.flash,
.alert,
.success,
.error,
.notice {
  margin: 14px 18px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}


.success {
  border-color: #b7e2c2;
  background: #f0fff4;
  color: var(--ok);
}


.error {
  border-color: #f1b5b5;
  background: #fff5f5;
  color: var(--danger);
}


/* ログイン画面 */

form[action*="login"],
.login,
.login-card {
  max-width: 520px;
  margin: 32px auto;
}


form[action*="login"] input {
  font-size: 1.05rem;
}


/* 印刷時 */

@media print {
  nav,
  .user,
  button,
  .button,
  a.button {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .card,
  table {
    box-shadow: none;
    border-color: #999;
  }

  main,
  .page,
  .content {
    padding: 0;
  }
}


/* 小さい画面 */

@media (max-width: 900px) {
  body {
    font-size: 16px;
  }

  nav {
    position: static;
    padding: 10px;
  }

  nav a {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
    min-height: 46px;
  }

  .card,
  section,
  fieldset,
  table,
  .flash,
  .alert,
  .success,
  .error,
  .notice {
    margin-left: 10px;
    margin-right: 10px;
  }

  .card,
  section,
  fieldset {
    padding: 14px;
  }

  th,
  td {
    padding: 10px;
  }

  button,
  .button,
  a.button {
    width: 100%;
    margin-top: 6px;
  }

  input[type="date"],
  input[type="number"] {
    max-width: 100%;
  }
}


/* 横幅が広いPC */

@media (min-width: 1200px) {
  main,
  .page,
  .content {
    padding-left: 28px;
    padding-right: 28px;
  }

  .card,
  table {
    margin-left: 28px;
    margin-right: 28px;
  }

  table {
    width: calc(100% - 56px);
  }
}

/* ===== instruction-table-fix-202607050354 START ===== */

/*
  今日の指示などで、
  症状経過の長文により
  右側の操作欄が崩れる問題を修正。
*/

table.list {
  display: table;
  table-layout: fixed;
  width: calc(100% - 36px);
  max-width: calc(100% - 36px);
}

table.list thead {
  display: table-header-group;
  width: auto;
}

table.list tbody {
  display: table-row-group;
  width: auto;
}

table.list tr {
  display: table-row;
  width: auto;
}

table.list th,
table.list td {
  display: table-cell;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 入力欄が列幅を押し広げないようにする */
table.list input,
table.list select,
table.list textarea {
  max-width: 100%;
}

/* ボタンが極端に縦長にならないようにする */
table.list button,
table.list .button,
table.list a.button {
  white-space: nowrap;
  min-width: 72px;
}

/* 最後の操作列は必ず幅を確保 */
table.list th:last-child,
table.list td:last-child {
  width: 120px;
  min-width: 120px;
  white-space: normal;
}

/* 操作列のリンクとボタン */
table.list td:last-child a,
table.list td:last-child button {
  margin: 3px 3px 3px 0;
}

/*
  6列の指示一覧用。
  患者 / 症状経過 / 分類 / 指示 /
  看護師サイン / 操作
*/
@supports selector(table:has(th:nth-child(6))) {
  table.list:has(th:nth-child(6)) th:nth-child(1),
  table.list:has(th:nth-child(6)) td:nth-child(1) {
    width: 11%;
  }

  table.list:has(th:nth-child(6)) th:nth-child(2),
  table.list:has(th:nth-child(6)) td:nth-child(2) {
    width: 25%;
  }

  table.list:has(th:nth-child(6)) th:nth-child(3),
  table.list:has(th:nth-child(6)) td:nth-child(3) {
    width: 8%;
  }

  table.list:has(th:nth-child(6)) th:nth-child(4),
  table.list:has(th:nth-child(6)) td:nth-child(4) {
    width: 30%;
  }

  table.list:has(th:nth-child(6)) th:nth-child(5),
  table.list:has(th:nth-child(6)) td:nth-child(5) {
    width: 16%;
    min-width: 150px;
  }

  table.list:has(th:nth-child(6)) th:nth-child(6),
  table.list:has(th:nth-child(6)) td:nth-child(6) {
    width: 10%;
    min-width: 120px;
  }
}

/* 看護師サインのプルダウンを押しやすくする */
table.list td:nth-last-child(2) select {
  min-width: 130px;
}

/* スマホ・狭い画面では横スクロールを許可 */
@media (max-width: 900px) {
  table.list {
    display: block;
    overflow-x: auto;
    table-layout: auto;
    min-width: 900px;
    max-width: none;
  }
}

/* ===== instruction-table-fix-202607050354 END ===== */

/* ===== instruction-overflow-fix-202607050356 START ===== */

/*
  今日の指示テーブルの崩れ対策。
  症状経過が長文でも、
  右側の看護師サイン・操作欄を
  表の中に収める。
*/


/* まず表全体を画面内に収める */
table.list {
  width: calc(100vw - 80px) !important;
  max-width: 1180px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  table-layout: fixed !important;
  overflow: hidden !important;
}


/* セル内で必ず折り返す */
table.list th,
table.list td {
  box-sizing: border-box !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  white-space: normal !important;
}


/* 今日の指示：6列テーブル用 */
table.list th:nth-child(1),
table.list td:nth-child(1) {
  width: 11% !important;
}

table.list th:nth-child(2),
table.list td:nth-child(2) {
  width: 25% !important;
}

table.list th:nth-child(3),
table.list td:nth-child(3) {
  width: 8% !important;
}

table.list th:nth-child(4),
table.list td:nth-child(4) {
  width: 30% !important;
}

table.list th:nth-child(5),
table.list td:nth-child(5) {
  width: 16% !important;
  min-width: 150px !important;
}

table.list th:nth-child(6),
table.list td:nth-child(6) {
  width: 10% !important;
  min-width: 110px !important;
}


/* 操作列が右に飛び出さないようにする */
table.list td:nth-child(6) {
  text-align: center !important;
}

table.list td:nth-child(6) a,
table.list td:nth-child(6) button {
  display: block !important;
  width: 100% !important;
  max-width: 96px !important;
  margin: 4px auto !important;
  white-space: normal !important;
  line-height: 1.35 !important;
}


/* 看護師サイン列のフォームを安定させる */
table.list td:nth-child(5) form {
  display: block !important;
  width: 100% !important;
}

table.list td:nth-child(5) select,
table.list td:nth-child(5) button {
  width: 100% !important;
  max-width: 150px !important;
  margin: 4px auto !important;
  display: block !important;
}


/* 症状経過・指示は読みやすく折り返す */
table.list td:nth-child(2),
table.list td:nth-child(4) {
  line-height: 1.75 !important;
}


/* 長文入力欄が表を横に押し広げないようにする */
table.list textarea,
table.list input,
table.list select {
  max-width: 100% !important;
}


/* 狭い画面では横スクロールに逃がす */
@media (max-width: 1050px) {
  table.list {
    width: 1050px !important;
    max-width: none !important;
    overflow-x: auto !important;
  }

  body {
    overflow-x: auto !important;
  }
}

/* ===== instruction-overflow-fix-202607050356 END ===== */

/* ===== instruction-table-final-fix-202607050357 START ===== */

/*
  今日の指示専用。
  長い症状経過で右側の
  看護師サイン・操作欄が崩れる問題を修正。
*/

table.instruction-list {
  display: table !important;
  table-layout: fixed !important;
  width: calc(100vw - 110px) !important;
  max-width: 1280px !important;
  min-width: 1120px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  border-collapse: separate !important;
  overflow: visible !important;
}

/* 列幅を固定 */
table.instruction-list col.col-patient {
  width: 120px !important;
}

table.instruction-list col.col-symptom {
  width: 340px !important;
}

table.instruction-list col.col-category {
  width: 80px !important;
}

table.instruction-list col.col-order {
  width: 400px !important;
}

table.instruction-list col.col-sign {
  width: 190px !important;
}

table.instruction-list col.col-action {
  width: 150px !important;
}

/* セル内で折り返す */
table.instruction-list th,
table.instruction-list td {
  display: table-cell !important;
  box-sizing: border-box !important;
  vertical-align: top !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  white-space: normal !important;
}

/* 症状経過と指示は読みやすく */
table.instruction-list td:nth-child(2),
table.instruction-list td:nth-child(4) {
  line-height: 1.8 !important;
}

/* 分類は細くても読めるように中央寄せしない */
table.instruction-list td:nth-child(3) {
  text-align: left !important;
}

/* 看護師サイン列 */
table.instruction-list td:nth-child(5) {
  width: 190px !important;
  min-width: 190px !important;
}

table.instruction-list td:nth-child(5) form {
  display: block !important;
  width: 100% !important;
}

table.instruction-list td:nth-child(5) select,
table.instruction-list td:nth-child(5) button {
  display: block !important;
  width: 100% !important;
  max-width: 160px !important;
  margin: 5px auto !important;
}

/* 操作列 */
table.instruction-list th:nth-child(6),
table.instruction-list td:nth-child(6) {
  width: 150px !important;
  min-width: 150px !important;
  text-align: center !important;
  overflow: visible !important;
}

/* 操作列の編集・非表示を表内に収める */
table.instruction-list td:nth-child(6) a,
table.instruction-list td:nth-child(6) button,
table.instruction-list td:nth-child(6) .button {
  display: block !important;
  width: 96px !important;
  max-width: 96px !important;
  min-width: 96px !important;
  margin: 6px auto !important;
  white-space: normal !important;
  line-height: 1.35 !important;
  text-align: center !important;
}

/* 画面が狭い場合は横スクロールで崩れを防ぐ */
@media (max-width: 1250px) {
  table.instruction-list {
    width: 1120px !important;
    max-width: none !important;
  }

  body {
    overflow-x: auto !important;
  }
}

/* ===== instruction-table-final-fix-202607050357 END ===== */

/* ===== instruction-js-class-fix-202607050402 START ===== */

/*
  JSで instruction-list を付けた後に効く最終調整。
  右側の看護師サイン・操作欄を表内に収める。
*/

table.instruction-list {
  width: 1180px !important;
  max-width: 1180px !important;
  min-width: 1180px !important;
  table-layout: fixed !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

table.instruction-list col.col-patient {
  width: 120px !important;
}

table.instruction-list col.col-symptom {
  width: 300px !important;
}

table.instruction-list col.col-category {
  width: 80px !important;
}

table.instruction-list col.col-order {
  width: 360px !important;
}

table.instruction-list col.col-sign {
  width: 180px !important;
}

table.instruction-list col.col-action {
  width: 140px !important;
}

table.instruction-list th,
table.instruction-list td {
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  white-space: normal !important;
  vertical-align: top !important;
}

table.instruction-list td:nth-child(5) select,
table.instruction-list td:nth-child(5) button {
  width: 150px !important;
  max-width: 150px !important;
  margin: 5px auto !important;
  display: block !important;
}

table.instruction-list td:nth-child(6) {
  width: 140px !important;
  min-width: 140px !important;
  text-align: center !important;
}

table.instruction-list td:nth-child(6) a,
table.instruction-list td:nth-child(6) button {
  display: block !important;
  width: 92px !important;
  max-width: 92px !important;
  min-width: 92px !important;
  margin: 6px auto !important;
  white-space: normal !important;
  text-align: center !important;
}

body {
  overflow-x: auto !important;
}

/* ===== instruction-js-class-fix-202607050402 END ===== */

/* ===== instruction-card-layout-202607050410 START ===== */

/*
  今日の指示をカード型に近い表示へ変更。
  症状経過が長くても、
  看護師サイン・操作欄が崩れないようにする。
*/

table.instruction-card-list {
  display: block !important;
  width: min(1280px, calc(100vw - 72px)) !important;
  min-width: 0 !important;
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

table.instruction-card-list tbody {
  display: block !important;
  width: 100% !important;
}

table.instruction-card-list .instruction-card-header {
  display: none !important;
}

table.instruction-card-list .instruction-card-row {
  display: grid !important;
  grid-template-columns:
    150px
    minmax(260px, 1fr)
    minmax(320px, 1.15fr)
    210px
    130px;
  grid-template-areas:
    "patient symptom symptom sign action"
    "patient category order   sign action";
  width: 100% !important;
  margin: 14px 0 !important;
  border: 1px solid #d8dee9 !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08) !important;
  overflow: hidden !important;
}

table.instruction-card-list .instruction-card-row > td {
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  border: 0 !important;
  border-right: 1px solid #d8dee9 !important;
  border-bottom: 1px solid #d8dee9 !important;
  padding: 14px !important;
  background: #ffffff !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  vertical-align: top !important;
}

table.instruction-card-list .instruction-card-row > td::before {
  display: block;
  content: attr(data-label);
  margin-bottom: 6px;
  color: #5f6b7a;
  font-size: 0.86rem;
  font-weight: 800;
}

table.instruction-card-list .cell-patient {
  grid-area: patient;
  font-weight: 700;
  background: #fbfcff !important;
}

table.instruction-card-list .cell-symptom {
  grid-area: symptom;
  line-height: 1.85 !important;
}

table.instruction-card-list .cell-category {
  grid-area: category;
  background: #fbfcff !important;
}

table.instruction-card-list .cell-order {
  grid-area: order;
  line-height: 1.85 !important;
  background: #fbfcff !important;
}

table.instruction-card-list .cell-sign {
  grid-area: sign;
  background: #ffffff !important;
}

table.instruction-card-list .cell-action {
  grid-area: action;
  text-align: center !important;
  background: #fbfcff !important;
  border-right: 0 !important;
}

table.instruction-card-list .cell-sign form {
  display: block !important;
  width: 100% !important;
}

table.instruction-card-list .cell-sign select,
table.instruction-card-list .cell-sign button {
  display: block !important;
  width: 100% !important;
  max-width: 180px !important;
  margin: 7px auto !important;
}

table.instruction-card-list .cell-action a,
table.instruction-card-list .cell-action button,
table.instruction-card-list .cell-action .button {
  display: block !important;
  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;
  margin: 8px auto !important;
  text-align: center !important;
  white-space: normal !important;
  line-height: 1.35 !important;
}

table.instruction-card-list input,
table.instruction-card-list select,
table.instruction-card-list textarea {
  max-width: 100% !important;
}

/* 画面幅が狭い場合 */
@media (max-width: 1100px) {
  table.instruction-card-list {
    width: calc(100vw - 28px) !important;
  }

  table.instruction-card-list .instruction-card-row {
    grid-template-columns: 140px 1fr 200px 120px;
    grid-template-areas:
      "patient symptom sign action"
      "patient category sign action"
      "patient order   sign action";
  }
}

/* iPad・スマホは縦積みにして崩れ防止 */
@media (max-width: 820px) {
  table.instruction-card-list .instruction-card-row {
    display: block !important;
  }

  table.instruction-card-list .instruction-card-row > td {
    border-right: 0 !important;
  }

  table.instruction-card-list .cell-action a,
  table.instruction-card-list .cell-action button,
  table.instruction-card-list .cell-action .button,
  table.instruction-card-list .cell-sign select,
  table.instruction-card-list .cell-sign button {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ===== instruction-card-layout-202607050410 END ===== */

/* ===== instruction-real-card-202607050413 START ===== */

/*
  今日の指示を table ではなく
  実カード表示に変換した後のCSS。
*/

.instruction-cards {
  width: min(1280px, calc(100vw - 72px));
  margin: 18px auto;
}

.instruction-real-card {
  display: grid;
  grid-template-columns: 150px minmax(280px, 1fr) minmax(320px, 1.1fr) 210px 140px;
  grid-template-areas:
    "patient symptom symptom sign action"
    "patient category order   sign action";
  background: #ffffff;
  border: 1px solid #d8dee9;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  margin: 14px 0;
  overflow: hidden;
}

.instruction-card-section {
  padding: 14px;
  border-right: 1px solid #d8dee9;
  border-bottom: 1px solid #d8dee9;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  background: #ffffff;
}

.instruction-card-label {
  color: #5f6b7a;
  font-size: 0.86rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.instruction-card-body {
  line-height: 1.8;
}

.section-patient {
  grid-area: patient;
  background: #fbfcff;
  font-weight: 700;
}

.section-symptom {
  grid-area: symptom;
}

.section-category {
  grid-area: category;
  background: #fbfcff;
}

.section-order {
  grid-area: order;
  background: #fbfcff;
}

.section-sign {
  grid-area: sign;
}

.section-action {
  grid-area: action;
  background: #fbfcff;
  border-right: 0;
  text-align: center;
}

.section-sign form {
  display: block;
  width: 100%;
}

.section-sign select,
.section-sign button {
  display: block !important;
  width: 100% !important;
  max-width: 180px !important;
  margin: 7px auto !important;
}

.section-action a,
.section-action button,
.section-action .button {
  display: block !important;
  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;
  margin: 8px auto !important;
  text-align: center !important;
  white-space: normal !important;
  line-height: 1.35 !important;
}

.section-action form {
  display: block !important;
  margin: 0 !important;
}

.instruction-real-card input,
.instruction-real-card select,
.instruction-real-card textarea {
  max-width: 100% !important;
}

/* 中くらいの画面 */
@media (max-width: 1150px) {
  .instruction-cards {
    width: calc(100vw - 28px);
  }

  .instruction-real-card {
    grid-template-columns: 135px minmax(240px, 1fr) 190px 130px;
    grid-template-areas:
      "patient symptom sign action"
      "patient category sign action"
      "patient order   sign action";
  }
}

/* iPad・スマホ */
@media (max-width: 820px) {
  .instruction-real-card {
    display: block;
  }

  .instruction-card-section {
    border-right: 0;
  }

  .section-sign select,
  .section-sign button,
  .section-action a,
  .section-action button,
  .section-action .button {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ===== instruction-real-card-202607050413 END ===== */

/* ===== instruction-card-polish-202607050415 START ===== */

/*
  今日の指示カードの最終調整。
  右側の看護師サイン・操作欄の
  縦長空白を減らし、操作しやすくする。
*/

.instruction-cards {
  width: min(1260px, calc(100vw - 64px)) !important;
}

.instruction-real-card {
  grid-template-columns:
    130px
    minmax(300px, 1.15fr)
    minmax(300px, 1fr)
    175px
    118px !important;

  grid-template-areas:
    "patient symptom symptom sign action"
    "patient category order   sign action" !important;

  align-items: start !important;
  margin: 12px 0 !important;
}

.instruction-card-section {
  padding: 12px 14px !important;
}

.instruction-card-label {
  margin-bottom: 4px !important;
}

/* 患者欄 */
.section-patient {
  min-height: 148px !important;
}

/* 症状経過 */
.section-symptom {
  min-height: 90px !important;
  max-height: none !important;
}

/* 分類・指示 */
.section-category,
.section-order {
  min-height: 86px !important;
}

/* 看護師サイン欄 */
.section-sign {
  min-height: 148px !important;
}

.section-sign .instruction-card-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  align-items: stretch !important;
}

.section-sign select,
.section-sign button {
  max-width: 150px !important;
  min-height: 42px !important;
  margin: 4px auto !important;
}

/* 操作欄 */
.section-action {
  min-height: 148px !important;
}

.section-action .instruction-card-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  align-items: center !important;
}

.section-action a,
.section-action button,
.section-action .button {
  width: 88px !important;
  min-width: 88px !important;
  max-width: 88px !important;
  min-height: 42px !important;
  margin: 3px auto !important;
  padding: 8px 10px !important;
}

/* 文字の密度を少し上げる */
.section-symptom .instruction-card-body,
.section-order .instruction-card-body {
  line-height: 1.7 !important;
}

/* 空の症状経過欄は高さを抑える */
.section-symptom .instruction-card-body:empty::after {
  content: " ";
  display: block;
  min-height: 24px;
}

/* 中くらいの画面 */
@media (max-width: 1150px) {
  .instruction-real-card {
    grid-template-columns:
      125px
      minmax(260px, 1fr)
      170px
      112px !important;

    grid-template-areas:
      "patient symptom sign action"
      "patient category sign action"
      "patient order   sign action" !important;
  }

  .section-sign,
  .section-action,
  .section-patient {
    min-height: 140px !important;
  }
}

/* ===== instruction-card-polish-202607050415 END ===== */

/* ===== instruction-patient-group-202607050424 START ===== */

/*
  今日の指示：
  同じ患者の複数指示を
  1つの患者カード内にまとめる。
*/

.instruction-patient-cards {
  width: min(1280px, calc(100vw - 64px));
  margin: 18px auto;
}

.instruction-patient-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  grid-template-areas:
    "patient symptom"
    "patient items";
  gap: 14px;
  background: #ffffff;
  border: 1px solid #d8dee9;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  margin: 16px 0;
  padding: 16px;
}

.group-patient {
  grid-area: patient;
  background: #fbfcff;
}

.group-symptom {
  grid-area: symptom;
}

.group-instructions {
  grid-area: items;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.instruction-item {
  display: grid;
  grid-template-columns: 120px minmax(280px, 1fr) 180px 120px;
  grid-template-areas:
    "category order sign action";
  gap: 12px;
  padding: 12px;
  border: 1px solid #d8dee9;
  border-radius: 14px;
  background: #fbfcff;
}

.instruction-card-section {
  min-width: 0;
  padding: 12px;
  border: 1px solid #d8dee9;
  border-radius: 12px;
  background: #ffffff;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.instruction-card-label {
  color: #5f6b7a;
  font-size: 0.86rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.instruction-card-body {
  line-height: 1.75;
}

.item-category {
  grid-area: category;
}

.item-order {
  grid-area: order;
}

.item-sign {
  grid-area: sign;
}

.item-action {
  grid-area: action;
  text-align: center;
}

.item-sign select,
.item-sign button,
.item-action select,
.item-action button,
.item-action a,
.item-action .button {
  display: block !important;
  width: 100% !important;
  max-width: 110px !important;
  min-height: 42px !important;
  margin: 6px auto !important;
  text-align: center !important;
  white-space: normal !important;
}

.item-action form,
.item-sign form {
  display: block !important;
  margin: 0 !important;
}

.item-action .danger,
button.danger {
  border-color: #efb4b4 !important;
  background: #fff7f7 !important;
  color: #c62828 !important;
}

.item-action .danger:hover,
button.danger:hover {
  background: #ffecec !important;
}

@media (max-width: 1100px) {
  .instruction-patient-card {
    grid-template-columns: 135px 1fr;
  }

  .instruction-item {
    grid-template-columns: 110px 1fr 165px 115px;
  }
}

@media (max-width: 820px) {
  .instruction-patient-card {
    display: block;
  }

  .instruction-item {
    display: block;
  }

  .instruction-card-section {
    margin: 10px 0;
  }

  .item-sign select,
  .item-sign button,
  .item-action select,
  .item-action button,
  .item-action a,
  .item-action .button {
    max-width: 100% !important;
  }
}

/* ===== instruction-patient-group-202607050424 END ===== */


/* ===== patient-soft-delete-202607050830 START ===== */

.patient-list td:last-child {
  white-space: nowrap !important;
}

.patient-delete-inline {
  display: inline-block !important;
  margin-left: 10px !important;
}

.patient-delete-inline button.danger {
  display: inline-block !important;
  padding: 6px 12px !important;
  border: 1px solid #d33 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #c00 !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

.patient-delete-inline button.danger:hover {
  background: #fff1f1 !important;
}

/* ===== patient-soft-delete-202607050830 END ===== */

/* ===== patient-action-button-size-202607050840 START ===== */

/* 患者管理：操作欄を中央寄せ */
table.patient-list td:last-child {
  text-align: center !important;
  white-space: nowrap !important;
  min-width: 150px !important;
}

/* 編集ボタンを大きめに表示 */
table.patient-list td:last-child > a[href*="route=patients"][href*="edit_id"] {
  display: inline-block !important;
  width: 96px !important;
  min-width: 96px !important;
  padding: 10px 0 !important;
  margin: 0 auto 8px auto !important;
  border: 1px solid #2563eb !important;
  border-radius: 10px !important;
  background: #2563eb !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  text-align: center !important;
  text-decoration: none !important;
  line-height: 1.2 !important;
}

/* 編集ボタン hover */
table.patient-list td:last-child > a[href*="route=patients"][href*="edit_id"]:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}

/* 削除フォームは小さく */
.patient-delete-inline {
  display: block !important;
  margin: 0 auto !important;
  text-align: center !important;
}

/* 削除ボタンを小さめにする */
.patient-delete-inline button.danger {
  display: inline-block !important;
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  padding: 5px 0 !important;
  margin: 0 auto !important;
  border: 1px solid #f0a0a0 !important;
  border-radius: 8px !important;
  background: #fffafa !important;
  color: #d00000 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  cursor: pointer !important;
}

/* 削除ボタン hover */
.patient-delete-inline button.danger:hover {
  background: #ffecec !important;
  border-color: #e06666 !important;
}

/* ===== patient-action-button-size-202607050840 END ===== */



/* ===== patient-discharge-hard-delete-202607050848 START ===== */

table.patient-list td.patient-actions {
  text-align: center !important;
  white-space: nowrap !important;
  min-width: 150px !important;
}

.patient-main-action {
  display: block !important;
  width: 96px !important;
  min-width: 96px !important;
  padding: 10px 0 !important;
  margin: 0 auto 8px auto !important;
  border: 1px solid #2563eb !important;
  border-radius: 10px !important;
  background: #2563eb !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  text-align: center !important;
  text-decoration: none !important;
  line-height: 1.2 !important;
  cursor: pointer !important;
}

.patient-main-action:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}

button.patient-main-action {
  font-family: inherit !important;
  font-size: inherit !important;
}

.patient-discharge-panel {
  display: block !important;
  width: 230px !important;
  margin: 8px auto 10px auto !important;
  padding: 10px !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 10px !important;
  background: #eff6ff !important;
  text-align: left !important;
  white-space: normal !important;
}

.patient-discharge-panel[hidden] {
  display: none !important;
}

.patient-discharge-date {
  display: block !important;
  font-weight: 700 !important;
  margin-bottom: 8px !important;
}

.patient-discharge-date input {
  display: block !important;
  width: 100% !important;
  margin-top: 4px !important;
  padding: 7px !important;
  box-sizing: border-box !important;
}

.patient-discharge-buttons {
  display: flex !important;
  gap: 6px !important;
  justify-content: center !important;
}

.patient-discharge-buttons button {
  padding: 6px 8px !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
}

.patient-delete-inline {
  display: block !important;
  margin: 0 auto !important;
  text-align: center !important;
}

.patient-delete-inline button.danger {
  display: inline-block !important;
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  padding: 5px 0 !important;
  margin: 0 auto !important;
  border: 1px solid #f0a0a0 !important;
  border-radius: 8px !important;
  background: #fffafa !important;
  color: #d00000 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  cursor: pointer !important;
}

.patient-delete-inline button.danger:hover {
  background: #ffecec !important;
  border-color: #e06666 !important;
}

/* ===== patient-discharge-hard-delete-202607050848 END ===== */

/* ===== patient-discharge-panel-center-202607050850 START ===== */

/* 患者管理：操作列の幅を固定して中央寄せ */
table.patient-list th:last-child,
table.patient-list td.patient-actions {
  width: 190px !important;
  min-width: 190px !important;
  max-width: 190px !important;
  text-align: center !important;
  vertical-align: top !important;
  overflow: visible !important;
}

/* 編集・退院ボタンを操作列の中央に配置 */
table.patient-list td.patient-actions .patient-main-action {
  display: block !important;
  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 退院日の入力パネルを中央に固定 */
table.patient-list td.patient-actions .patient-discharge-panel {
  display: block !important;
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;
  margin: 8px auto 10px auto !important;
  padding: 10px !important;
  box-sizing: border-box !important;
  text-align: left !important;
  white-space: normal !important;
}

/* hidden時は必ず非表示 */
table.patient-list td.patient-actions .patient-discharge-panel[hidden] {
  display: none !important;
}

/* 退院日入力欄 */
table.patient-list td.patient-actions .patient-discharge-date input {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* 本日・入力日ボタンは横幅内に収める */
table.patient-list td.patient-actions .patient-discharge-buttons {
  display: flex !important;
  gap: 6px !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
}

table.patient-list td.patient-actions .patient-discharge-buttons button {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  padding: 7px 4px !important;
  font-size: 13px !important;
  white-space: nowrap !important;
}

/* 削除ボタンは小さく中央 */
table.patient-list td.patient-actions .patient-delete-inline {
  display: block !important;
  margin: 8px auto 0 auto !important;
  text-align: center !important;
}

table.patient-list td.patient-actions .patient-delete-inline button.danger {
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  padding: 5px 0 !important;
  margin: 0 auto !important;
}

/* ===== patient-discharge-panel-center-202607050850 END ===== */


/* ===== discharge-button-stack-202607050853 START ===== */

/* 退院日パネル内のボタンを縦並びにする */
table.patient-list td.patient-actions .patient-discharge-buttons {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* 本日・入力日で退院ボタンを枠内いっぱいに収める */
table.patient-list td.patient-actions .patient-discharge-buttons button {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 8px 6px !important;
  margin: 0 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  text-align: center !important;
}

/* 退院日パネルを少しだけ広げる */
table.patient-list td.patient-actions .patient-discharge-panel {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  box-sizing: border-box !important;
}

/* 操作欄も少しだけ広げて中央寄せ */
table.patient-list th:last-child,
table.patient-list td.patient-actions {
  width: 210px !important;
  min-width: 210px !important;
  max-width: 210px !important;
  text-align: center !important;
}

/* ===== discharge-button-stack-202607050853 END ===== */





















/* ===== patient-sort-hard-rebuild-202607050924 START ===== */

#patient-sort-body tr {
  cursor: move !important;
}

#patient-sort-body tr.dragging {
  opacity: 0.55 !important;
  background: #eff6ff !important;
}

#patient-sort-body td:first-child {
  text-align: center !important;
  color: #2563eb !important;
  font-weight: 800 !important;
  width: 56px !important;
}

#patient-sort-body td:nth-child(2) {
  text-align: center !important;
  width: 90px !important;
  user-select: none !important;
}

#patient-sort-body td.patient-actions {
  cursor: default !important;
}

#patient-sort-body td.patient-actions a,
#patient-sort-body td.patient-actions button,
#patient-sort-body td.patient-actions input,
#patient-sort-body td.patient-actions label,
#patient-sort-body td.patient-actions form {
  cursor: pointer !important;
}

/* ===== patient-sort-hard-rebuild-202607050924 END ===== */

/* ===== patient-column-width-202607050930 START ===== */

/* 患者管理テーブルの列幅を安定させる */
table.patient-list {
  table-layout: fixed !important;
  width: 100% !important;
}

/* 順 */
table.patient-list th:nth-child(1),
#patient-sort-body td:nth-child(1) {
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  text-align: center !important;
}

/* 移動 */
table.patient-list th:nth-child(2),
#patient-sort-body td:nth-child(2) {
  width: 82px !important;
  min-width: 82px !important;
  max-width: 82px !important;
  text-align: center !important;
}

/* 名前：10文字程度を1行で表示できる幅 */
table.patient-list th:nth-child(3),
#patient-sort-body td:nth-child(3) {
  width: 11em !important;
  min-width: 11em !important;
  max-width: 11em !important;
  text-align: left !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.8 !important;
}

/* 名前の太字部分 */
#patient-sort-body td:nth-child(3) strong {
  display: inline !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
}

/* ID欄を左寄せにする */
table.patient-list th:nth-child(4),
#patient-sort-body td:nth-child(4) {
  width: 88px !important;
  min-width: 88px !important;
  max-width: 88px !important;
  text-align: left !important;
  padding-left: 6px !important;
  white-space: nowrap !important;
}

/* 入退院 */
table.patient-list th:nth-child(5),
#patient-sort-body td:nth-child(5) {
  width: 150px !important;
  text-align: center !important;
}

/* 状態 */
table.patient-list th:nth-child(6),
#patient-sort-body td:nth-child(6) {
  width: 90px !important;
  text-align: center !important;
}

/* 操作 */
table.patient-list th:nth-child(7),
#patient-sort-body td:nth-child(7) {
  width: 150px !important;
  text-align: center !important;
}

/* ===== patient-column-width-202607050930 END ===== */



/* ===== patient-list-gender-note-cleanup-202607050941 START ===== */

/* 患者管理：状態列削除後の列幅調整 */
table.patient-list {
  table-layout: fixed !important;
  width: 100% !important;
}

/* 順 */
table.patient-list th:nth-child(1),
#patient-sort-body td:nth-child(1) {
  width: 52px !important;
  text-align: center !important;
}

/* 移動 */
table.patient-list th:nth-child(2),
#patient-sort-body td:nth-child(2) {
  width: 70px !important;
  text-align: center !important;
}

/* 名前：10文字程度を1行で表示 */
table.patient-list th:nth-child(3),
#patient-sort-body td.patient-name-cell {
  width: 14em !important;
  min-width: 14em !important;
  max-width: 14em !important;
  text-align: left !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.7 !important;
}

/* 性別 */
table.patient-list th:nth-child(4),
#patient-sort-body td.patient-gender-cell {
  width: 70px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

/* ID：左寄せ */
table.patient-list th:nth-child(5),
#patient-sort-body td.patient-id-cell {
  width: 110px !important;
  text-align: left !important;
  padding-left: 8px !important;
  white-space: nowrap !important;
}

/* 入院日 */
table.patient-list th:nth-child(6),
#patient-sort-body td.patient-admission-cell {
  width: 120px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

/* 備考 */
table.patient-list th:nth-child(7),
#patient-sort-body td.patient-note-cell {
  width: auto !important;
  text-align: left !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  line-height: 1.6 !important;
}

/* 操作 */
table.patient-list th:nth-child(8),
#patient-sort-body td.patient-actions {
  width: 150px !important;
  text-align: center !important;
}

/* ===== patient-list-gender-note-cleanup-202607050941 END ===== */


/* ===== safe-patient-list-cleanup-202607050943 START ===== */

/* 患者管理：性別・備考追加後の列幅 */
table.patient-list {
  table-layout: fixed !important;
  width: 100% !important;
}

/* 順 */
table.patient-list th:nth-child(1),
#patient-sort-body td:nth-child(1) {
  width: 52px !important;
  text-align: center !important;
}

/* 移動 */
table.patient-list th:nth-child(2),
#patient-sort-body td:nth-child(2) {
  width: 70px !important;
  text-align: center !important;
}

/* 名前：10文字程度を1行で表示しやすく */
table.patient-list th:nth-child(3),
#patient-sort-body td.patient-name-cell {
  width: 14em !important;
  min-width: 14em !important;
  max-width: 14em !important;
  text-align: left !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.7 !important;
}

/* 性別 */
table.patient-list th:nth-child(4),
#patient-sort-body td.patient-gender-cell {
  width: 70px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

/* ID */
table.patient-list th:nth-child(5),
#patient-sort-body td.patient-id-cell {
  width: 110px !important;
  text-align: left !important;
  padding-left: 8px !important;
  white-space: nowrap !important;
}

/* 入院日 */
table.patient-list th:nth-child(6),
#patient-sort-body td.patient-admission-cell {
  width: 120px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

/* 備考 */
table.patient-list th:nth-child(7),
#patient-sort-body td.patient-note-cell {
  width: auto !important;
  text-align: left !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  line-height: 1.6 !important;
}

/* 操作 */
table.patient-list th:nth-child(8),
#patient-sort-body td.patient-actions {
  width: 150px !important;
  text-align: center !important;
}

/* ===== safe-patient-list-cleanup-202607050943 END ===== */



/* ===== discharged-patients-readmit-202607050948 START ===== */

.discharged-patient-list {
  table-layout: fixed !important;
  width: 100% !important;
}

.discharged-patient-list th,
.discharged-patient-list td {
  vertical-align: top !important;
}

.discharged-patient-list th:nth-child(1),
.discharged-patient-list td:nth-child(1) {
  width: 14em !important;
}

.discharged-patient-list th:nth-child(2),
.discharged-patient-list td:nth-child(2) {
  width: 70px !important;
  text-align: center !important;
}

.discharged-patient-list th:nth-child(3),
.discharged-patient-list td:nth-child(3) {
  width: 110px !important;
  text-align: left !important;
}

.discharged-patient-list th:nth-child(4),
.discharged-patient-list td:nth-child(4),
.discharged-patient-list th:nth-child(5),
.discharged-patient-list td:nth-child(5) {
  width: 120px !important;
  text-align: center !important;
}

.discharged-note-cell {
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  line-height: 1.6 !important;
}

.discharged-actions {
  width: 220px !important;
  text-align: center !important;
}

.readmit-date-label {
  display: block !important;
  font-weight: 700 !important;
  text-align: left !important;
  margin-bottom: 8px !important;
}

.readmit-date-label input {
  display: block !important;
  width: 100% !important;
  margin-top: 4px !important;
  box-sizing: border-box !important;
}

.readmit-buttons {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.readmit-buttons button {
  width: 100% !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
}

/* ===== discharged-patients-readmit-202607050948 END ===== */


/* ===== patient-action-button-layout-fix-202607050955 START ===== */

/*
  患者管理の操作欄が狭くなり、
  編集・退院・削除ボタンや退院日入力が
  はみ出す問題を防ぐ
*/

table td:last-child,
table th:last-child {
  min-width: 150px !important;
  width: 150px !important;
  max-width: 170px !important;
  overflow: visible !important;
  vertical-align: top !important;
}

table td:last-child form {
  display: block !important;
  width: 132px !important;
  max-width: 132px !important;
  margin: 8px auto !important;
  overflow: visible !important;
}

table td:last-child a,
table td:last-child button {
  display: block !important;
  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;
  margin: 6px auto !important;
  white-space: normal !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

table td:last-child input[type="date"] {
  display: block !important;
  width: 126px !important;
  max-width: 126px !important;
  box-sizing: border-box !important;
  margin: 6px auto !important;
}

table td:last-child label,
table td:last-child .form-label {
  display: block !important;
  width: 126px !important;
  max-width: 126px !important;
  margin: 4px auto !important;
}

body {
  overflow-x: auto !important;
}

/* ===== patient-action-button-layout-fix-202607050955 END ===== */


/* ===== patient-list-final-layout-fix-202607051000 START ===== */

/*
  患者管理一覧の操作列を固定して、
  編集・退院・削除・退院日入力が崩れないようにする
*/

table.patient-list {
  width: 1180px !important;
  min-width: 1180px !important;
  table-layout: fixed !important;
}

table.patient-list th:nth-child(1),
table.patient-list td:nth-child(1) {
  width: 55px !important;
}

table.patient-list th:nth-child(2),
table.patient-list td:nth-child(2) {
  width: 65px !important;
}

table.patient-list th:nth-child(3),
table.patient-list td:nth-child(3) {
  width: 230px !important;
}

table.patient-list th:nth-child(4),
table.patient-list td:nth-child(4) {
  width: 70px !important;
}

table.patient-list th:nth-child(5),
table.patient-list td:nth-child(5) {
  width: 120px !important;
}

table.patient-list th:nth-child(6),
table.patient-list td:nth-child(6) {
  width: 130px !important;
}

table.patient-list th:nth-child(7),
table.patient-list td:nth-child(7) {
  width: 280px !important;
}

table.patient-list th:nth-child(8),
table.patient-list td:nth-child(8),
table.patient-list td.patient-actions {
  width: 210px !important;
  min-width: 210px !important;
  max-width: 210px !important;
  overflow: visible !important;
  vertical-align: top !important;
  text-align: center !important;
}

table.patient-list td.patient-actions a,
table.patient-list td.patient-actions button,
table.patient-list td.patient-actions .button,
table.patient-list td.patient-actions .patient-main-action {
  display: block !important;
  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;
  margin: 7px auto !important;
  box-sizing: border-box !important;
  white-space: normal !important;
  text-align: center !important;
}

table.patient-list td.patient-actions form {
  display: block !important;
  width: 150px !important;
  max-width: 150px !important;
  margin: 8px auto !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

table.patient-list td.patient-actions input[type="date"] {
  display: block !important;
  width: 136px !important;
  max-width: 136px !important;
  margin: 6px auto !important;
  box-sizing: border-box !important;
}

table.patient-list td.patient-actions .patient-discharge-panel,
table.patient-list td.patient-actions .patient-discharge-form,
table.patient-list td.patient-actions .patient-discharge-box {
  width: 158px !important;
  max-width: 158px !important;
  margin: 8px auto !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

table.patient-list td.patient-actions .patient-discharge-buttons,
table.patient-list td.patient-actions .patient-discharge-buttons button {
  display: block !important;
  width: 136px !important;
  max-width: 136px !important;
  margin: 7px auto !important;
  box-sizing: border-box !important;
}

.card,
.table-wrap,
.table-responsive {
  overflow-x: auto !important;
}

body {
  overflow-x: auto !important;
}

/* ===== patient-list-final-layout-fix-202607051000 END ===== */


/* ===== discharged-patient-list-layout-fix-202607051006 START ===== */

/*
  退院患者一覧の表示調整

  ・患者名は患者管理と同じように
    約10文字で折り返す

  ・備考欄を広げる

  ・再入院ボタン欄を広げて、
    ボタンが崩れないようにする
*/

table.discharged-patient-list {
  width: 1120px !important;
  min-width: 1120px !important;
  table-layout: fixed !important;
}

table.discharged-patient-list th,
table.discharged-patient-list td {
  vertical-align: top !important;
  box-sizing: border-box !important;
}

/* 患者名 */
table.discharged-patient-list th:nth-child(1),
table.discharged-patient-list td:nth-child(1) {
  width: 200px !important;
  max-width: 200px !important;
  white-space: normal !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
  line-height: 1.75 !important;
}

/* 性別 */
table.discharged-patient-list th:nth-child(2),
table.discharged-patient-list td:nth-child(2) {
  width: 70px !important;
  text-align: center !important;
}

/* ID */
table.discharged-patient-list th:nth-child(3),
table.discharged-patient-list td:nth-child(3) {
  width: 120px !important;
}

/* 前回入院日 */
table.discharged-patient-list th:nth-child(4),
table.discharged-patient-list td:nth-child(4) {
  width: 130px !important;
}

/* 退院日 */
table.discharged-patient-list th:nth-child(5),
table.discharged-patient-list td:nth-child(5) {
  width: 130px !important;
}

/* 備考 */
table.discharged-patient-list th:nth-child(6),
table.discharged-patient-list td:nth-child(6),
table.discharged-patient-list .discharged-note-cell {
  width: 210px !important;
  max-width: 210px !important;
  white-space: normal !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
  line-height: 1.7 !important;
}

/* 再入院 */
table.discharged-patient-list th:nth-child(7),
table.discharged-patient-list td:nth-child(7) {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  text-align: center !important;
  overflow: visible !important;
}

table.discharged-patient-list .discharged-actions,
table.discharged-patient-list td:nth-child(7) form {
  display: block !important;
  width: 150px !important;
  max-width: 150px !important;
  margin: 0 auto !important;
  overflow: visible !important;
}

table.discharged-patient-list td:nth-child(7) input[type="date"] {
  display: block !important;
  width: 132px !important;
  max-width: 132px !important;
  margin: 6px auto 10px auto !important;
  box-sizing: border-box !important;
}

table.discharged-patient-list .readmit-buttons {
  display: block !important;
  width: 132px !important;
  max-width: 132px !important;
  margin: 0 auto !important;
}

table.discharged-patient-list .readmit-buttons button,
table.discharged-patient-list td:nth-child(7) button {
  display: block !important;
  width: 108px !important;
  min-width: 108px !important;
  max-width: 108px !important;
  margin: 8px auto !important;
  box-sizing: border-box !important;
  white-space: normal !important;
  text-align: center !important;
  line-height: 1.35 !important;
}

.card,
.table-wrap,
.table-responsive {
  overflow-x: auto !important;
}

/* ===== discharged-patient-list-layout-fix-202607051006 END ===== */


/* ===== discharged-search-short-202607051013 START ===== */

.discharged-search-card {
  max-width: 1120px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.discharged-search-form {
  display: grid !important;
  grid-template-columns: 1fr 180px 180px !important;
  gap: 16px !important;
  align-items: end !important;
}

.discharged-search-form label {
  font-weight: 700 !important;
}

.discharged-search-form input {
  width: 100% !important;
  margin-top: 6px !important;
  box-sizing: border-box !important;
}

.discharged-search-buttons {
  display: flex !important;
  gap: 8px !important;
}

.discharged-search-buttons button,
.discharged-search-buttons .button {
  width: 78px !important;
  min-width: 78px !important;
  max-width: 78px !important;
  text-align: center !important;
}

table.discharged-patient-list .discharged-name-cell,
table.discharged-patient-list td:nth-child(1) {
  width: 180px !important;
  max-width: 180px !important;
  white-space: normal !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
  line-height: 1.8 !important;
}

table.discharged-patient-list .discharged-note-cell,
table.discharged-patient-list td:nth-child(6) {
  width: 240px !important;
  max-width: 240px !important;
  white-space: normal !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
}

table.discharged-patient-list td:nth-child(7),
table.discharged-patient-list .discharged-actions {
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
  text-align: center !important;
  overflow: visible !important;
}

table.discharged-patient-list .discharged-actions form {
  width: 150px !important;
  max-width: 150px !important;
  margin: 0 auto !important;
}

table.discharged-patient-list .readmit-buttons button {
  display: block !important;
  width: 116px !important;
  min-width: 116px !important;
  max-width: 116px !important;
  margin: 8px auto !important;
  white-space: normal !important;
  line-height: 1.35 !important;
}

@media (max-width: 800px) {
  .discharged-search-form {
    grid-template-columns: 1fr !important;
  }
}

/* ===== discharged-search-short-202607051013 END ===== */


/* ===== discharged-clear-button-fix-202607051015 START ===== */

/*
  退院患者一覧の検索フォームで、
  「クリア」ボタンの文字が縦に崩れる問題を修正
*/

.discharged-search-buttons {
  display: flex !important;
  gap: 12px !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-width: 190px !important;
}

.discharged-search-buttons button,
.discharged-search-buttons .button,
.discharged-search-buttons a.button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 88px !important;
  min-width: 88px !important;
  max-width: 88px !important;

  height: 48px !important;
  min-height: 48px !important;

  padding: 0 10px !important;
  box-sizing: border-box !important;

  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;

  line-height: 1.2 !important;
  text-align: center !important;
}

/* 検索フォーム全体も少し余裕を持たせる */
.discharged-search-form {
  grid-template-columns: 1fr 180px 200px !important;
  align-items: end !important;
}

/* ===== discharged-clear-button-fix-202607051015 END ===== */


/* ===== nurse-button-match-patient-202607051017 START ===== */

/*
  看護師管理の編集・削除ボタンを、
  患者管理のボタンデザインに合わせる
*/

a[href^="index.php?route=nurses"][href*="edit_id"] {
  display: block !important;

  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;

  height: 42px !important;
  line-height: 42px !important;

  margin: 7px auto !important;
  padding: 0 !important;

  box-sizing: border-box !important;

  border-radius: 10px !important;
  border: 1px solid #2563eb !important;

  background: #2563eb !important;
  color: #ffffff !important;

  text-align: center !important;
  text-decoration: none !important;
  font-weight: 700 !important;

  white-space: nowrap !important;
}

a[href^="index.php?route=nurses"][href*="edit_id"]:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

button[form^="delete-nurse-"] {
  display: block !important;

  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;

  height: 42px !important;
  line-height: 1.2 !important;

  margin: 10px auto 0 auto !important;
  padding: 0 !important;

  box-sizing: border-box !important;

  border-radius: 10px !important;
  border: 1px solid #ff8a8a !important;

  background: #ffffff !important;
  color: #ef4444 !important;

  text-align: center !important;
  font-weight: 700 !important;

  white-space: nowrap !important;
}

button[form^="delete-nurse-"]:hover {
  background: #fff1f1 !important;
  border-color: #ef4444 !important;
  color: #dc2626 !important;
}

/* 看護師管理の操作列を中央寄せ */
table.list td:has(a[href^="index.php?route=nurses"][href*="edit_id"]) {
  text-align: center !important;
  vertical-align: top !important;
}

/* ===== nurse-button-match-patient-202607051017 END ===== */


/* ===== nurse-delete-button-same-as-patient-202607051019 START ===== */

/*
  看護師管理の削除ボタンを、
  患者管理の削除ボタンと同じ小さめサイズへ調整
*/

button[form^="delete-nurse-"] {
  display: block !important;

  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;

  height: 42px !important;
  min-height: 42px !important;

  margin: 8px auto 0 auto !important;
  padding: 0 !important;

  box-sizing: border-box !important;

  border-radius: 8px !important;
  border: 1px solid #ff8a8a !important;

  background: #ffffff !important;
  color: #ef4444 !important;

  text-align: center !important;
  font-weight: 700 !important;

  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;

  line-height: 40px !important;
}

button[form^="delete-nurse-"]:hover {
  background: #fff1f1 !important;
  border-color: #ef4444 !important;
  color: #dc2626 !important;
}

/* ===== nurse-delete-button-same-as-patient-202607051019 END ===== */


/* ===== nurse-delete-inline-size-202607051020 START ===== */

.nurse-delete-small-button {
  display: block !important;
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 8px auto 0 auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  border-radius: 8px !important;
  border: 1px solid #ff8a8a !important;
  background: #ffffff !important;
  color: #ef4444 !important;
  text-align: center !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  line-height: 40px !important;
}

.nurse-delete-small-button:hover {
  background: #fff1f1 !important;
  border-color: #ef4444 !important;
  color: #dc2626 !important;
}

/* ===== nurse-delete-inline-size-202607051020 END ===== */



/* ===== template-import-ui-202607051116 START ===== */

.template-import-actions {
  display: flex !important;
  gap: 16px !important;
  align-items: center !important;
  flex-wrap: wrap !important;
}

.template-import-table-wrap {
  overflow-x: auto !important;
}

table.template-import-table {
  min-width: 1180px !important;
  table-layout: fixed !important;
}

table.template-import-table th:nth-child(1),
table.template-import-table td:nth-child(1) {
  width: 58px !important;
  text-align: center !important;
}

table.template-import-table th:nth-child(2),
table.template-import-table td:nth-child(2) {
  width: 90px !important;
}

table.template-import-table th:nth-child(3),
table.template-import-table td:nth-child(3) {
  width: 180px !important;
  word-break: break-all !important;
}

table.template-import-table th:nth-child(4),
table.template-import-table td:nth-child(4) {
  width: 280px !important;
  word-break: break-all !important;
}

table.template-import-table th:nth-child(5),
table.template-import-table td:nth-child(5) {
  width: 210px !important;
  word-break: break-all !important;
}

table.template-import-table th:nth-child(6),
table.template-import-table td:nth-child(6) {
  width: 70px !important;
  text-align: center !important;
}

table.template-import-table th:nth-child(7),
table.template-import-table td:nth-child(7) {
  width: 190px !important;
}

table.template-import-table th:nth-child(8),
table.template-import-table td:nth-child(8) {
  width: 90px !important;
  text-align: center !important;
}

#templateFilter {
  margin-bottom: 8px !important;
}

#templateSelect {
  min-height: 44px !important;
}

/* ===== template-import-ui-202607051116 END ===== */

/* ===== template-category-filter-ui-202607051126 START ===== */

/*
  患者別入力の定型文検索を
  分類選択方式にする
*/

#templateFilter {
  width: 100% !important;
  min-height: 44px !important;
  box-sizing: border-box !important;
}

#templateSelect {
  width: 100% !important;
  min-height: 44px !important;
  box-sizing: border-box !important;
}

/* ===== template-category-filter-ui-202607051126 END ===== */


/* ===== template-candidate-list-ui-202607051129 START ===== */

/*
  患者別入力：
  分類を選んだら定型文候補を自動表示する
*/

.template-candidate-list {
  margin-top: 12px !important;
  padding: 12px !important;

  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;

  background: #f8fafc !important;

  max-height: 320px !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

.template-candidate-title {
  font-weight: 700 !important;
  margin-bottom: 10px !important;
}

.template-candidate-button-wrap {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 8px !important;
}

.template-candidate-button {
  display: block !important;

  width: 100% !important;
  min-height: 44px !important;

  padding: 10px 12px !important;

  box-sizing: border-box !important;

  border: 1px solid #bfdbfe !important;
  border-radius: 10px !important;

  background: #ffffff !important;
  color: #0f172a !important;

  text-align: left !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;

  white-space: normal !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
}

.template-candidate-button:hover {
  background: #eff6ff !important;
  border-color: #2563eb !important;
}

.template-candidate-empty {
  margin: 0 !important;
  color: #64748b !important;
  line-height: 1.7 !important;
}

/* ===== template-candidate-list-ui-202607051129 END ===== */


/* ===== today-left-patient-panel-fix-202607051131 START ===== */

/*
  今日の指示画面で、
  左側の患者情報欄が細くなりすぎて
  患者名やIDが縦に崩れる問題を修正
*/

/* 今日の指示カード全体 */
.instruction-card-list,
.instruction-card,
.instruction-item,
.instruction-row-card {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* 左側の患者欄 */
.instruction-card-list .cell-patient,
.instruction-card-list td:first-child,
.section-patient,
.item-patient,
.patient-summary,
.patient-card-left {
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;

  vertical-align: top !important;
  box-sizing: border-box !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
  line-height: 1.7 !important;
}

/* 患者名を縦割れさせない */
.instruction-card-list .cell-patient strong,
.instruction-card-list td:first-child strong,
.section-patient strong,
.item-patient strong,
.patient-summary strong,
.patient-card-left strong {
  display: block !important;

  width: 9em !important;
  max-width: 9em !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;

  line-height: 1.7 !important;
  font-weight: 700 !important;
}

/* 「患者」「ID」などのラベルも縦割れ防止 */
.instruction-card-list .cell-patient,
.section-patient,
.item-patient,
.patient-summary,
.patient-card-left {
  font-size: 14px !important;
}

/* 指示内容側を圧迫しすぎない */
.instruction-card-list .cell-body,
.section-body,
.item-body,
.instruction-body-cell {
  min-width: 360px !important;
}

/* 看護師サイン欄と操作欄は今の形を維持 */
.instruction-card-list .cell-sign,
.section-sign,
.item-sign {
  width: 140px !important;
  min-width: 140px !important;
  max-width: 150px !important;
}

.instruction-card-list .cell-action,
.section-action,
.item-action {
  width: 100px !important;
  min-width: 100px !important;
  max-width: 110px !important;
}

/* 横幅が足りない場合は横スクロールで逃がす */
.card,
.table-wrap,
.table-responsive,
.instruction-card-wrap {
  overflow-x: auto !important;
}

body {
  overflow-x: auto !important;
}

/* ===== today-left-patient-panel-fix-202607051131 END ===== */


/* ===== today-patient-card-final-fix-202607051133 START ===== */

/*
  今日の指示画面

  左側の患者情報欄で、
  ふりがな・患者名・IDが
  縦に崩れる問題を最終調整
*/

/* 今日の指示カード全体を安定させる */
.instruction-card-list,
.instruction-card,
.instruction-row-card,
.instruction-item,
.section-instruction {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* 左側の患者情報欄 */
.instruction-card-list td:first-child,
.instruction-card-list .cell-patient,
.item-patient,
.section-patient,
.patient-summary,
.patient-card-left {
  width: 190px !important;
  min-width: 190px !important;
  max-width: 190px !important;

  padding: 16px 14px !important;
  box-sizing: border-box !important;

  vertical-align: top !important;
  text-align: left !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;

  line-height: 1.75 !important;
}

/* 患者名・ふりがなを縦割れさせない */
.instruction-card-list td:first-child *,
.instruction-card-list .cell-patient *,
.item-patient *,
.section-patient *,
.patient-summary *,
.patient-card-left * {
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
  line-height: 1.75 !important;
}

/* 患者名を読みやすく */
.instruction-card-list td:first-child strong,
.instruction-card-list .cell-patient strong,
.item-patient strong,
.section-patient strong,
.patient-summary strong,
.patient-card-left strong {
  display: block !important;

  width: 100% !important;
  max-width: 150px !important;

  margin-top: 6px !important;
  margin-bottom: 8px !important;

  font-size: 16px !important;
  font-weight: 700 !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

/* ふりがな */
.instruction-card-list td:first-child small,
.instruction-card-list .cell-patient small,
.item-patient small,
.section-patient small,
.patient-summary small,
.patient-card-left small {
  display: block !important;
  width: 100% !important;
  max-width: 150px !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

/* ID行が潰れないようにする */
.instruction-card-list td:first-child div,
.instruction-card-list .cell-patient div,
.item-patient div,
.section-patient div,
.patient-summary div,
.patient-card-left div {
  max-width: 150px !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

/* 右側の指示エリア */
.instruction-card-list .cell-body,
.item-body,
.section-body,
.instruction-body-cell {
  min-width: 420px !important;
}

/* 分類欄 */
.instruction-card-list .cell-category,
.item-category,
.section-category {
  width: 110px !important;
  min-width: 110px !important;
  max-width: 120px !important;
}

/* 看護師サイン欄 */
.instruction-card-list .cell-sign,
.item-sign,
.section-sign {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 160px !important;
}

/* 操作欄 */
.instruction-card-list .cell-action,
.item-action,
.section-action {
  width: 110px !important;
  min-width: 110px !important;
  max-width: 120px !important;
}

/* 横幅が足りない時は横スクロール */
.card,
.table-wrap,
.table-responsive,
.instruction-card-wrap {
  overflow-x: auto !important;
}

body {
  overflow-x: auto !important;
}

/* ===== today-patient-card-final-fix-202607051133 END ===== */


/* ===== today-card-horizontal-patient-202607051136 START ===== */

/*
  今日の指示画面

  左側に細長く出ている患者情報欄をやめて、
  患者情報をカード上部に横長表示する。

  これにより、
  患者名・ふりがな・ID が縦に崩れる問題を防ぐ。
*/

.instruction-patient-cards {
  width: min(1280px, calc(100vw - 64px)) !important;
  margin: 18px auto !important;
}

/* 患者カード全体を1列構成へ変更 */
.instruction-patient-card {
  display: grid !important;

  grid-template-columns: 1fr !important;
  grid-template-areas:
    "patient"
    "symptom"
    "items" !important;

  gap: 14px !important;

  padding: 16px !important;
  box-sizing: border-box !important;

  overflow-x: auto !important;
}

/* 患者情報を上部の横長カードにする */
.instruction-patient-card .group-patient {
  grid-area: patient !important;

  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;

  min-height: auto !important;

  padding: 14px 16px !important;
  box-sizing: border-box !important;

  background: #fbfcff !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

/* 患者情報の中身を横に広く使う */
.instruction-patient-card .group-patient .instruction-card-body {
  display: block !important;

  width: 100% !important;
  max-width: none !important;

  line-height: 1.8 !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

/* 患者名を縦割れさせない */
.instruction-patient-card .group-patient strong {
  display: inline-block !important;

  width: auto !important;
  max-width: none !important;

  margin: 0 12px 0 0 !important;

  font-size: 17px !important;
  font-weight: 700 !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

/* 症状経過も横長にする */
.instruction-patient-card .group-symptom {
  grid-area: symptom !important;

  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;

  padding: 14px 16px !important;
  box-sizing: border-box !important;
}

/* 指示一覧エリア */
.instruction-patient-card .group-instructions {
  grid-area: items !important;

  width: 100% !important;
  min-width: 0 !important;

  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}

/* 1件ごとの指示カード */
.instruction-patient-card .instruction-item {
  display: grid !important;

  grid-template-columns:
    110px
    minmax(360px, 1fr)
    150px
    110px !important;

  grid-template-areas:
    "category order sign action" !important;

  gap: 14px !important;

  width: 100% !important;
  box-sizing: border-box !important;
}

/* 分類 */
.instruction-patient-card .item-category {
  grid-area: category !important;
  width: auto !important;
  min-width: 0 !important;
}

/* 指示 */
.instruction-patient-card .item-order {
  grid-area: order !important;
  min-width: 360px !important;
}

/* 看護師サイン */
.instruction-patient-card .item-sign {
  grid-area: sign !important;
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
}

/* 操作 */
.instruction-patient-card .item-action {
  grid-area: action !important;
  width: 110px !important;
  min-width: 110px !important;
  max-width: 110px !important;
}

/* ボタン類 */
.instruction-patient-card .item-sign select,
.instruction-patient-card .item-sign button,
.instruction-patient-card .item-action select,
.instruction-patient-card .item-action button,
.instruction-patient-card .item-action a,
.instruction-patient-card .item-action .button {
  display: block !important;

  width: 92px !important;
  max-width: 92px !important;

  margin: 7px auto !important;

  text-align: center !important;
  white-space: normal !important;
  box-sizing: border-box !important;
}

/* 画面幅が狭い場合は、指示カードだけ縦並びへ */
@media (max-width: 950px) {
  .instruction-patient-card .instruction-item {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "category"
      "order"
      "sign"
      "action" !important;
  }

  .instruction-patient-card .item-order,
  .instruction-patient-card .item-sign,
  .instruction-patient-card .item-action {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

/* ===== today-card-horizontal-patient-202607051136 END ===== */


/* ===== today-patient-header-format-202607051138 START ===== */

/*
  今日の指示：
  患者情報を横並びで表示し、
  患者名・ふりがな・ID の縦崩れを防ぐ
*/

.instruction-patient-card .group-patient {
  min-height: auto !important;
  height: auto !important;

  padding: 12px 16px !important;
  box-sizing: border-box !important;
}

.instruction-patient-card .group-patient .instruction-card-label {
  display: block !important;

  margin: 0 0 8px 0 !important;

  font-weight: 800 !important;
  color: #475569 !important;
}

.instruction-patient-card
.group-patient
.instruction-card-body.patient-inline-body {
  display: flex !important;

  flex-direction: row !important;
  flex-wrap: wrap !important;

  align-items: center !important;
  gap: 8px 18px !important;

  width: 100% !important;
  max-width: none !important;

  min-height: 28px !important;

  line-height: 1.6 !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

.patient-inline-name {
  display: inline-block !important;

  font-size: 17px !important;
  font-weight: 800 !important;

  color: #0f172a !important;

  white-space: nowrap !important;
  word-break: keep-all !important;
}

.patient-inline-kana,
.patient-inline-id {
  display: inline-block !important;

  font-size: 14px !important;
  color: #475569 !important;

  white-space: nowrap !important;
  word-break: keep-all !important;
}

/* 古い縦長指定を上書き */
.instruction-patient-card .group-patient strong,
.instruction-patient-card .group-patient small,
.instruction-patient-card .group-patient span {
  max-width: none !important;
  width: auto !important;
}

/* ===== today-patient-header-format-202607051138 END ===== */


/* ===== template-list-layout-fix-202607051141 START ===== */

/*
  定型文管理一覧
  ・操作欄を非表示
  ・本文欄を編集リンク手前まで広げる
*/

body.page-templates-master table.list {
  width: 100% !important;
  table-layout: fixed !important;
}

body.page-templates-master table.list th,
body.page-templates-master table.list td {
  box-sizing: border-box !important;
  vertical-align: top !important;
}

/* 4列目の「操作」欄を削除 */
body.page-templates-master table.list th:nth-child(4),
body.page-templates-master table.list td:nth-child(4) {
  display: none !important;
}

/* 1列目：分類 */
body.page-templates-master table.list th:nth-child(1),
body.page-templates-master table.list td:nth-child(1) {
  width: 110px !important;
  min-width: 110px !important;
  max-width: 110px !important;
}

/* 2列目：タイトル */
body.page-templates-master table.list th:nth-child(2),
body.page-templates-master table.list td:nth-child(2) {
  width: 280px !important;
  min-width: 280px !important;
  max-width: 280px !important;

  white-space: normal !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
}

/* 3列目：本文を広げる */
body.page-templates-master table.list th:nth-child(3),
body.page-templates-master table.list td:nth-child(3) {
  width: auto !important;
  min-width: 520px !important;

  white-space: normal !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
  line-height: 1.8 !important;
}

/* 本文の内側要素が狭くならないようにする */
body.page-templates-master table.list td:nth-child(3) * {
  width: auto !important;
  max-width: none !important;

  white-space: normal !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
  line-height: 1.8 !important;
}

/* 最後の列：編集 */
body.page-templates-master table.list th:last-child,
body.page-templates-master table.list td:last-child {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  text-align: center !important;
}

/* 編集リンクを見やすくする */
body.page-templates-master table.list td:last-child a {
  display: inline-block !important;
  min-width: 52px !important;
  text-align: center !important;
}

/* ===== template-list-layout-fix-202607051141 END ===== */


/* ===== template-list-wider-fix-202607051143 START ===== */

/*
  定型文管理一覧

  本文欄をさらに広げる。
  編集欄は最小限にする。
*/

body.page-templates-master table.list {
  width: 100% !important;
  min-width: 1180px !important;
  table-layout: fixed !important;
}

/* 分類 */
body.page-templates-master table.list th:nth-child(1),
body.page-templates-master table.list td:nth-child(1) {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
}

/* タイトル */
body.page-templates-master table.list th:nth-child(2),
body.page-templates-master table.list td:nth-child(2) {
  width: 270px !important;
  min-width: 270px !important;
  max-width: 270px !important;

  white-space: normal !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
}

/* 本文：さらに広げる */
body.page-templates-master table.list th:nth-child(3),
body.page-templates-master table.list td:nth-child(3) {
  width: auto !important;
  min-width: 680px !important;

  white-space: normal !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;

  line-height: 1.8 !important;
}

/* 本文内の枠も横に広げる */
body.page-templates-master table.list td:nth-child(3) .pre,
body.page-templates-master table.list td:nth-child(3) div,
body.page-templates-master table.list td:nth-child(3) span,
body.page-templates-master table.list td:nth-child(3) * {
  width: 100% !important;
  max-width: none !important;

  white-space: normal !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;

  line-height: 1.8 !important;
}

/* 操作欄は引き続き非表示 */
body.page-templates-master table.list th:nth-child(4),
body.page-templates-master table.list td:nth-child(4) {
  display: none !important;
}

/* 編集欄を小さくする */
body.page-templates-master table.list th:last-child,
body.page-templates-master table.list td:last-child {
  width: 70px !important;
  min-width: 70px !important;
  max-width: 70px !important;

  text-align: center !important;
}

/* 編集リンク */
body.page-templates-master table.list td:last-child a {
  display: inline-block !important;
  width: 54px !important;
  min-width: 54px !important;
  max-width: 54px !important;

  text-align: center !important;
  white-space: nowrap !important;
}

/* 外枠は横スクロール許可 */
.card,
.table-wrap,
.table-responsive {
  overflow-x: auto !important;
}

/* ===== template-list-wider-fix-202607051143 END ===== */


/* ===== template-list-balance-fix-202607051145 START ===== */

/*
  定型文管理一覧の最終調整

  ・タイトル欄を広げる
  ・本文欄も十分に確保
  ・編集欄は右端に小さく固定
  ・操作欄は非表示のまま
*/

body.page-templates-master .card {
  overflow-x: auto !important;
}

body.page-templates-master table.list {
  width: 100% !important;
  min-width: 1260px !important;
  table-layout: fixed !important;
}

body.page-templates-master table.list th,
body.page-templates-master table.list td {
  box-sizing: border-box !important;
  vertical-align: top !important;
  padding: 14px 14px !important;
  line-height: 1.75 !important;
}

/* 分類 */
body.page-templates-master table.list th:nth-child(1),
body.page-templates-master table.list td:nth-child(1) {
  width: 95px !important;
  min-width: 95px !important;
  max-width: 95px !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

/* タイトル：広げる */
body.page-templates-master table.list th:nth-child(2),
body.page-templates-master table.list td:nth-child(2) {
  width: 360px !important;
  min-width: 360px !important;
  max-width: 360px !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;

  line-height: 1.8 !important;
}

/* 本文：広めに確保 */
body.page-templates-master table.list th:nth-child(3),
body.page-templates-master table.list td:nth-child(3) {
  width: auto !important;
  min-width: 660px !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;

  line-height: 1.8 !important;
}

/* 本文の内側の枠 */
body.page-templates-master table.list td:nth-child(3) .pre,
body.page-templates-master table.list td:nth-child(3) div,
body.page-templates-master table.list td:nth-child(3) span,
body.page-templates-master table.list td:nth-child(3) * {
  width: 100% !important;
  max-width: none !important;

  box-sizing: border-box !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;

  line-height: 1.8 !important;
}

/* 操作欄は非表示 */
body.page-templates-master table.list th:nth-child(4),
body.page-templates-master table.list td:nth-child(4) {
  display: none !important;
}

/* 編集欄 */
body.page-templates-master table.list th:last-child,
body.page-templates-master table.list td:last-child {
  width: 70px !important;
  min-width: 70px !important;
  max-width: 70px !important;

  text-align: center !important;
  vertical-align: middle !important;
}

/* 編集リンク */
body.page-templates-master table.list td:last-child a {
  display: inline-block !important;

  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;

  text-align: center !important;
  white-space: nowrap !important;
  font-weight: 700 !important;
}

/* 行の高さを少し整える */
body.page-templates-master table.list tr {
  min-height: 64px !important;
}

/* ===== template-list-balance-fix-202607051145 END ===== */


/* ===== template-title-one-line-fix-202607051148 START ===== */

/*
  定型文管理一覧

  タイトル欄をさらに広げ、
  点滴などの長いタイトルを
  できるだけ1行で表示する。
*/

body.page-templates-master .card {
  overflow-x: auto !important;
}

body.page-templates-master table.list {
  width: 100% !important;
  min-width: 1450px !important;
  table-layout: fixed !important;
}

body.page-templates-master table.list th,
body.page-templates-master table.list td {
  box-sizing: border-box !important;
  vertical-align: top !important;
  padding: 14px 14px !important;
  line-height: 1.75 !important;
}

/* 分類 */
body.page-templates-master table.list th:nth-child(1),
body.page-templates-master table.list td:nth-child(1) {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
}

/* タイトル：1行表示を優先 */
body.page-templates-master table.list th:nth-child(2),
body.page-templates-master table.list td:nth-child(2) {
  width: 520px !important;
  min-width: 520px !important;
  max-width: 520px !important;

  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;

  overflow: visible !important;

  font-size: 15px !important;
  line-height: 1.8 !important;
}

/* 本文：少し狭めるが読みやすさは維持 */
body.page-templates-master table.list th:nth-child(3),
body.page-templates-master table.list td:nth-child(3) {
  width: auto !important;
  min-width: 680px !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;

  line-height: 1.8 !important;
}

/* 本文内の枠 */
body.page-templates-master table.list td:nth-child(3) .pre,
body.page-templates-master table.list td:nth-child(3) div,
body.page-templates-master table.list td:nth-child(3) span,
body.page-templates-master table.list td:nth-child(3) * {
  width: 100% !important;
  max-width: none !important;

  box-sizing: border-box !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;

  line-height: 1.8 !important;
}

/* 操作欄は非表示 */
body.page-templates-master table.list th:nth-child(4),
body.page-templates-master table.list td:nth-child(4) {
  display: none !important;
}

/* 編集欄 */
body.page-templates-master table.list th:last-child,
body.page-templates-master table.list td:last-child {
  width: 70px !important;
  min-width: 70px !important;
  max-width: 70px !important;

  text-align: center !important;
  vertical-align: middle !important;
}

/* 編集リンク */
body.page-templates-master table.list td:last-child a {
  display: inline-block !important;

  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;

  text-align: center !important;
  white-space: nowrap !important;
  font-weight: 700 !important;
}

/* ===== template-title-one-line-fix-202607051148 END ===== */


/* ===== template-overlap-fix-202607051149 START ===== */

/*
  定型文管理一覧

  前回の1行表示指定で、
  タイトルが本文欄に重なる問題を修正。

  方針：
  ・タイトル欄は広め
  ・ただし本文欄にはみ出さない
  ・長い時だけ自然に折り返す
*/

body.page-templates-master .card {
  overflow-x: auto !important;
}

body.page-templates-master table.list {
  width: 100% !important;
  min-width: 1420px !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

body.page-templates-master table.list th,
body.page-templates-master table.list td {
  box-sizing: border-box !important;
  vertical-align: top !important;
  padding: 14px 16px !important;
  line-height: 1.75 !important;
}

/* 分類 */
body.page-templates-master table.list th:nth-child(1),
body.page-templates-master table.list td:nth-child(1) {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

/* タイトル：
   広めにするが、本文欄へはみ出さない */
body.page-templates-master table.list th:nth-child(2),
body.page-templates-master table.list td:nth-child(2) {
  width: 470px !important;
  min-width: 470px !important;
  max-width: 470px !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;

  overflow: hidden !important;

  line-height: 1.75 !important;
  font-size: 15px !important;
}

/* 本文 */
body.page-templates-master table.list th:nth-child(3),
body.page-templates-master table.list td:nth-child(3) {
  width: auto !important;
  min-width: 720px !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;

  overflow: hidden !important;

  line-height: 1.75 !important;
}

/* 本文内の枠 */
body.page-templates-master table.list td:nth-child(3) .pre,
body.page-templates-master table.list td:nth-child(3) div,
body.page-templates-master table.list td:nth-child(3) span,
body.page-templates-master table.list td:nth-child(3) * {
  width: 100% !important;
  max-width: 100% !important;

  box-sizing: border-box !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;

  overflow: hidden !important;

  line-height: 1.75 !important;
}

/* 操作欄は非表示のまま */
body.page-templates-master table.list th:nth-child(4),
body.page-templates-master table.list td:nth-child(4) {
  display: none !important;
}

/* 編集欄 */
body.page-templates-master table.list th:last-child,
body.page-templates-master table.list td:last-child {
  width: 70px !important;
  min-width: 70px !important;
  max-width: 70px !important;

  text-align: center !important;
  vertical-align: middle !important;
}

/* 編集リンク */
body.page-templates-master table.list td:last-child a {
  display: inline-block !important;

  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;

  text-align: center !important;
  white-space: nowrap !important;
  font-weight: 700 !important;
}

/* ===== template-overlap-fix-202607051149 END ===== */


/* ===== template-body-only-ui-202607051157 START ===== */

/*
  定型文管理を本文中心にする。

  ・上部フォームのタイトル欄を非表示
  ・下部一覧のタイトル列を非表示
  ・本文欄を広げる
  ・編集欄は右端に残す
*/

/* 上部フォームのタイトル欄 */
body.page-templates-body-only .template-title-hidden-field {
  display: none !important;
}

/* 定型文管理一覧 */
body.page-templates-body-only table.list {
  width: 100% !important;
  min-width: 1180px !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

body.page-templates-body-only table.list th,
body.page-templates-body-only table.list td {
  box-sizing: border-box !important;
  vertical-align: top !important;
  padding: 14px 16px !important;
  line-height: 1.8 !important;
}

/* 1列目：分類 */
body.page-templates-body-only table.list th:nth-child(1),
body.page-templates-body-only table.list td:nth-child(1) {
  width: 100px !important;
  min-width: 100px !important;
  max-width: 100px !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

/* 2列目：タイトル列を非表示 */
body.page-templates-body-only table.list th:nth-child(2),
body.page-templates-body-only table.list td:nth-child(2) {
  display: none !important;
}

/* 3列目：本文を広く表示 */
body.page-templates-body-only table.list th:nth-child(3),
body.page-templates-body-only table.list td:nth-child(3) {
  width: auto !important;
  min-width: 930px !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;

  overflow: hidden !important;
  line-height: 1.8 !important;
}

/* 本文内の枠 */
body.page-templates-body-only table.list td:nth-child(3) .pre,
body.page-templates-body-only table.list td:nth-child(3) div,
body.page-templates-body-only table.list td:nth-child(3) span,
body.page-templates-body-only table.list td:nth-child(3) * {
  width: 100% !important;
  max-width: 100% !important;

  box-sizing: border-box !important;

  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;

  overflow: hidden !important;
  line-height: 1.8 !important;
}

/* 4列目：操作欄は非表示 */
body.page-templates-body-only table.list th:nth-child(4),
body.page-templates-body-only table.list td:nth-child(4) {
  display: none !important;
}

/* 最後の列：編集 */
body.page-templates-body-only table.list th:last-child,
body.page-templates-body-only table.list td:last-child {
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;

  text-align: center !important;
  vertical-align: middle !important;
}

/* 編集リンク */
body.page-templates-body-only table.list td:last-child a {
  display: inline-block !important;

  width: 54px !important;
  min-width: 54px !important;
  max-width: 54px !important;

  text-align: center !important;
  white-space: nowrap !important;
  font-weight: 700 !important;
}

/* 横幅不足時は横スクロール */
body.page-templates-body-only .card {
  overflow-x: auto !important;
}

/* ===== template-body-only-ui-202607051157 END ===== */

/* ===== today-two-day-excel-layout-202607051744 START ===== */

.today-excel-wrap {
  width: 100% !important;
  overflow-x: auto !important;
  padding: 0 0 14px 0 !important;
}

.today-excel-table {
  min-width: 1500px !important;
  width: 1500px !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

.today-excel-table th,
.today-excel-table td {
  vertical-align: top !important;
  border: 1px solid #d8e2f0 !important;
  padding: 8px 10px !important;
  line-height: 1.55 !important;
}

.today-excel-table th {
  background: #f3f7fc !important;
  font-weight: 700 !important;
  text-align: center !important;
}

.today-date-head {
  font-size: 16px !important;
  background: #eaf2ff !important;
}

.today-patient-head td {
  background: #f8fbff !important;
  border-top: 2px solid #9fb7d6 !important;
  font-size: 15px !important;
}

.today-patient-edit {
  float: right !important;
  font-size: 14px !important;
}

.today-patient-note {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  margin-top: 8px !important;
  font-weight: 400 !important;
}

.today-excel-patient-col {
  width: 120px !important;
}

.today-excel-category-col,
.today-excel-category {
  width: 90px !important;
  text-align: center !important;
  font-weight: 700 !important;
}

.today-excel-id {
  width: 56px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.today-excel-body {
  width: 330px !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
}

.today-excel-note {
  width: 190px !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
}

.today-excel-sign {
  width: 150px !important;
}

.today-sign-form {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center !important;
}

.today-sign-form select {
  max-width: 105px !important;
}

.today-sign-form button {
  min-width: 52px !important;
}

.today-hide-form {
  margin-top: 6px !important;
}

.today-empty {
  background: #fbfdff !important;
}

.today-excel-patient-blank {
  background: #ffffff !important;
}

/* ===== today-two-day-excel-layout-202607051744 END ===== */

/* ===== today-two-day-excel-layout-visual-fix-202607051748 START ===== */

.today-excel-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  padding: 0 0 18px 0 !important;
  margin-top: 16px !important;
}

.today-excel-table {
  width: 1760px !important;
  min-width: 1760px !important;
  max-width: none !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  background: #ffffff !important;
}

.today-excel-table col.today-col-patient {
  width: 160px !important;
}

.today-excel-table col.today-col-category {
  width: 90px !important;
}

.today-excel-table col.today-col-id {
  width: 64px !important;
}

.today-excel-table col.today-col-body {
  width: 360px !important;
}

.today-excel-table col.today-col-note {
  width: 210px !important;
}

.today-excel-table col.today-col-sign {
  width: 160px !important;
}

.today-excel-table th,
.today-excel-table td {
  box-sizing: border-box !important;
  border: 1px solid #d8e2f0 !important;
  padding: 8px 10px !important;
  line-height: 1.45 !important;
  vertical-align: top !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}

.today-excel-table thead th {
  height: auto !important;
  min-height: 0 !important;
  background: #f3f7fc !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

.today-excel-table thead tr:first-child th {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

.today-date-head {
  background: #eaf2ff !important;
  font-size: 16px !important;
  letter-spacing: 0.02em !important;
}

.today-excel-patient-col,
.today-excel-category-col,
.today-excel-id {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

.today-excel-id {
  text-align: center !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

.today-excel-category {
  text-align: center !important;
  font-weight: 700 !important;
  white-space: normal !important;
  word-break: keep-all !important;
}

.today-excel-body,
.today-excel-note {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

.today-excel-sign {
  white-space: normal !important;
  word-break: keep-all !important;
}

.today-patient-head td {
  background: #f8fbff !important;
  border-top: 2px solid #8fb2e8 !important;
  border-bottom: 1px solid #cfdcf0 !important;
  padding: 12px 12px !important;
  font-size: 15px !important;
}

.today-patient-edit {
  float: none !important;
  display: inline-block !important;
  margin-left: 18px !important;
  font-size: 14px !important;
}

.today-patient-note {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  margin-top: 8px !important;
  font-weight: 400 !important;
}

.today-sign-form {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center !important;
  margin: 0 !important;
}

.today-sign-form select {
  width: 100px !important;
  max-width: 100px !important;
  min-width: 100px !important;
}

.today-sign-form button {
  width: 52px !important;
  min-width: 52px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center !important;
}

.today-hide-form {
  display: block !important;
  margin-top: 8px !important;
}

.today-empty {
  background: #fbfdff !important;
}

.today-excel-patient-blank {
  background: #ffffff !important;
}

/* ===== today-two-day-excel-layout-visual-fix-202607051748 END ===== */

/* ===== today-excel-rowspan-fix-202607051752 START ===== */

.today-excel-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  margin-top: 16px !important;
  padding-bottom: 18px !important;
}

.today-excel-table {
  width: 1760px !important;
  min-width: 1760px !important;
  max-width: none !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  background: #ffffff !important;
}

.today-excel-table col.today-col-patient {
  width: 170px !important;
}

.today-excel-table col.today-col-category {
  width: 90px !important;
}

.today-excel-table col.today-col-id {
  width: 64px !important;
}

.today-excel-table col.today-col-body {
  width: 360px !important;
}

.today-excel-table col.today-col-note {
  width: 210px !important;
}

.today-excel-table col.today-col-sign {
  width: 160px !important;
}

.today-excel-table th,
.today-excel-table td {
  box-sizing: border-box !important;
  border: 1px solid #d8e2f0 !important;
  padding: 8px 10px !important;
  line-height: 1.45 !important;
  vertical-align: top !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}

.today-excel-table thead th {
  background: #f3f7fc !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  height: auto !important;
  min-height: 0 !important;
}

.today-date-head {
  background: #eaf2ff !important;
  font-size: 16px !important;
}

.today-patient-start td {
  border-top: 2px solid #8fb2e8 !important;
}

.today-patient-cell {
  background: #f8fbff !important;
  font-size: 15px !important;
  white-space: normal !important;
  word-break: break-word !important;
}

.today-patient-edit {
  display: block !important;
  margin-top: 10px !important;
  font-size: 13px !important;
}

.today-patient-edit a {
  display: inline-block !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 8px 6px 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  text-align: left !important;
}

.today-patient-note {
  display: block !important;
  margin-top: 8px !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  white-space: pre-wrap !important;
}

.today-excel-category {
  text-align: center !important;
  font-weight: 700 !important;
  background: #ffffff !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

.today-excel-id {
  text-align: center !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

.today-excel-body,
.today-excel-note {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

.today-excel-sign {
  white-space: normal !important;
  word-break: keep-all !important;
}

.today-sign-form {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center !important;
  margin: 0 !important;
}

.today-sign-form select {
  width: 100px !important;
  max-width: 100px !important;
  min-width: 100px !important;
}

.today-sign-form button {
  width: 52px !important;
  min-width: 52px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center !important;
}

.today-hide-form {
  display: block !important;
  margin-top: 8px !important;
}

.today-empty {
  background: #fbfdff !important;
}

/* 前回の患者ヘッダー行用CSSが残っても効かせない */
.today-patient-head,
.today-excel-patient-blank {
  display: none !important;
}

/* ===== today-excel-rowspan-fix-202607051752 END ===== */

/* ===== today-excel-remove-id-next-visible-202607051755 START ===== */

.today-excel-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  margin-top: 16px !important;
  padding-bottom: 18px !important;
}

.today-no-id-table {
  width: 100% !important;
  min-width: 1180px !important;
  max-width: none !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  background: #ffffff !important;
}

.today-no-id-table col.today-col-patient {
  width: 12% !important;
}

.today-no-id-table col.today-col-category {
  width: 6% !important;
}

.today-no-id-table col.today-col-body {
  width: 23% !important;
}

.today-no-id-table col.today-col-note {
  width: 12% !important;
}

.today-no-id-table col.today-col-sign {
  width: 12% !important;
}

.today-no-id-table th,
.today-no-id-table td {
  box-sizing: border-box !important;
  border: 1px solid #d8e2f0 !important;
  padding: 8px 10px !important;
  line-height: 1.45 !important;
  vertical-align: top !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}

.today-no-id-table thead th {
  background: #f3f7fc !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  height: auto !important;
  min-height: 0 !important;
}

.today-no-id-table .today-date-head {
  background: #eaf2ff !important;
  font-size: 16px !important;
}

.today-no-id-table .today-next-date-head {
  background: #eef8ff !important;
}

.today-no-id-table .today-patient-start td {
  border-top: 2px solid #8fb2e8 !important;
}

.today-no-id-table .today-patient-cell {
  background: #f8fbff !important;
  font-size: 15px !important;
  white-space: normal !important;
  word-break: break-word !important;
}

.today-no-id-table .today-patient-edit {
  display: block !important;
  margin-top: 10px !important;
  font-size: 13px !important;
}

.today-no-id-table .today-patient-edit a {
  display: inline-block !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 8px 6px 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  text-align: left !important;
}

.today-no-id-table .today-patient-note {
  display: block !important;
  margin-top: 8px !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  white-space: pre-wrap !important;
}

.today-no-id-table .today-excel-category {
  text-align: center !important;
  font-weight: 700 !important;
  background: #ffffff !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

.today-no-id-table .today-excel-body,
.today-no-id-table .today-excel-note {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

.today-no-id-table .today-excel-sign {
  white-space: normal !important;
  word-break: keep-all !important;
}

.today-no-id-table .today-sign-form {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center !important;
  margin: 0 !important;
}

.today-no-id-table .today-sign-form select {
  width: 100px !important;
  max-width: 100px !important;
  min-width: 100px !important;
}

.today-no-id-table .today-sign-form button {
  width: 52px !important;
  min-width: 52px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center !important;
}

.today-no-id-table .today-hide-form {
  display: block !important;
  margin-top: 8px !important;
}

.today-no-id-table .today-empty {
  background: #fbfdff !important;
}

/* ID列はWeb画面では非表示仕様 */
.today-no-id-table .today-excel-id,
.today-no-id-table col.today-col-id {
  display: none !important;
  width: 0 !important;
}

/* ===== today-excel-remove-id-next-visible-202607051755 END ===== */

/* ===== today-excel-width-final-fix-202607051757 START ===== */

.today-excel-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  margin-top: 16px !important;
  padding-bottom: 18px !important;
}

table.today-no-id-table {
  width: 1145px !important;
  min-width: 1145px !important;
  max-width: 1145px !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  background: #ffffff !important;
}

table.today-no-id-table col.today-col-patient {
  width: 105px !important;
}

table.today-no-id-table col.today-col-category {
  width: 70px !important;
}

table.today-no-id-table col.today-col-body {
  width: 260px !important;
}

table.today-no-id-table col.today-col-note {
  width: 110px !important;
}

table.today-no-id-table col.today-col-sign {
  width: 115px !important;
}

table.today-no-id-table th,
table.today-no-id-table td {
  box-sizing: border-box !important;
  border: 1px solid #d8e2f0 !important;
  padding: 8px 9px !important;
  line-height: 1.45 !important;
  vertical-align: top !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}

table.today-no-id-table thead th {
  background: #f3f7fc !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.25 !important;
}

table.today-no-id-table .today-date-head {
  background: #eaf2ff !important;
  font-size: 16px !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

table.today-no-id-table .today-note-head,
table.today-no-id-table .today-sign-head {
  white-space: normal !important;
  line-height: 1.25 !important;
  font-size: 14px !important;
}

table.today-no-id-table .today-patient-cell {
  background: #f8fbff !important;
  font-size: 14px !important;
  white-space: normal !important;
  word-break: break-word !important;
  padding: 8px 8px !important;
}

table.today-no-id-table .today-patient-cell strong {
  font-size: 15px !important;
}

table.today-no-id-table .today-patient-edit {
  display: block !important;
  margin-top: 8px !important;
  font-size: 12px !important;
}

table.today-no-id-table .today-patient-edit a {
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 0 5px 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  text-align: left !important;
}

table.today-no-id-table .today-excel-category {
  text-align: center !important;
  font-weight: 700 !important;
  background: #ffffff !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  padding-left: 4px !important;
  padding-right: 4px !important;
}

table.today-no-id-table .today-excel-body {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  font-size: 14px !important;
}

table.today-no-id-table .today-excel-note {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  font-size: 14px !important;
}

table.today-no-id-table .today-excel-sign {
  white-space: normal !important;
  word-break: keep-all !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

table.today-no-id-table .today-sign-form {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  align-items: center !important;
  justify-content: flex-start !important;
  margin: 0 !important;
}

table.today-no-id-table .today-sign-form select {
  width: 96px !important;
  max-width: 96px !important;
  min-width: 96px !important;
  height: 42px !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

table.today-no-id-table .today-sign-form button {
  width: 76px !important;
  min-width: 76px !important;
  height: 42px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center !important;
}

table.today-no-id-table .today-hide-form {
  display: block !important;
  margin-top: 8px !important;
  text-align: center !important;
}

table.today-no-id-table .today-hide-form button {
  width: 76px !important;
  min-width: 76px !important;
  height: 42px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center !important;
}

table.today-no-id-table .today-patient-start td {
  border-top: 2px solid #8fb2e8 !important;
}

table.today-no-id-table .today-empty {
  background: #fbfdff !important;
}

/* 以前の幅指定を打ち消す */
.today-excel-table {
  width: 1145px !important;
  min-width: 1145px !important;
  max-width: 1145px !important;
}

.today-excel-id,
.today-col-id {
  display: none !important;
  width: 0 !important;
}

/* ===== today-excel-width-final-fix-202607051757 END ===== */

/* ===== today-excel-right-edge-polish-202607051800 START ===== */

.today-excel-wrap {
  width: 100% !important;
  max-width: 1120px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  margin: 16px auto 0 auto !important;
  padding: 0 18px 18px 0 !important;
  box-sizing: border-box !important;
}

table.today-no-id-table,
.today-excel-table {
  width: 1094px !important;
  min-width: 1094px !important;
  max-width: 1094px !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  background: #ffffff !important;
}

table.today-no-id-table col.today-col-patient {
  width: 105px !important;
}

table.today-no-id-table col.today-col-category {
  width: 60px !important;
}

table.today-no-id-table col.today-col-body {
  width: 255px !important;
}

table.today-no-id-table col.today-col-note {
  width: 100px !important;
}

table.today-no-id-table col.today-col-sign {
  width: 109px !important;
}

table.today-no-id-table th,
table.today-no-id-table td {
  padding: 8px 8px !important;
  box-sizing: border-box !important;
}

table.today-no-id-table thead th {
  font-size: 14px !important;
  line-height: 1.25 !important;
  white-space: normal !important;
}

table.today-no-id-table .today-date-head {
  font-size: 16px !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

table.today-no-id-table .today-patient-cell {
  font-size: 13px !important;
  padding: 8px 7px !important;
}

table.today-no-id-table .today-patient-cell strong {
  font-size: 15px !important;
}

table.today-no-id-table .today-patient-edit {
  margin-top: 8px !important;
  font-size: 12px !important;
}

table.today-no-id-table .today-patient-edit a {
  display: block !important;
  margin: 0 0 5px 0 !important;
  white-space: nowrap !important;
}

table.today-no-id-table .today-excel-category {
  padding-left: 3px !important;
  padding-right: 3px !important;
  text-align: center !important;
  font-size: 14px !important;
}

table.today-no-id-table .today-excel-body {
  font-size: 14px !important;
  line-height: 1.45 !important;
}

table.today-no-id-table .today-excel-note {
  font-size: 14px !important;
  line-height: 1.45 !important;
}

table.today-no-id-table .today-excel-sign {
  padding-left: 6px !important;
  padding-right: 6px !important;
  overflow: visible !important;
}

table.today-no-id-table .today-sign-form {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
}

table.today-no-id-table .today-sign-form select {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 40px !important;
  padding-left: 6px !important;
  padding-right: 6px !important;
}

table.today-no-id-table .today-sign-form button {
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  height: 40px !important;
  padding: 0 !important;
  text-align: center !important;
}

table.today-no-id-table .today-hide-form {
  display: block !important;
  margin-top: 8px !important;
  text-align: center !important;
}

table.today-no-id-table .today-hide-form button {
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  height: 40px !important;
  padding: 0 !important;
  text-align: center !important;
}

.today-excel-id,
.today-col-id {
  display: none !important;
  width: 0 !important;
}

/* ===== today-excel-right-edge-polish-202607051800 END ===== */

/* ===== today-excel-sign-width-fix-202607051803 START ===== */

.today-excel-wrap {
  max-width: 1160px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  overflow-x: auto !important;
  padding-right: 32px !important;
  box-sizing: border-box !important;
}

table.today-no-id-table,
.today-excel-table {
  width: 1088px !important;
  min-width: 1088px !important;
  max-width: 1088px !important;
  table-layout: fixed !important;
}

table.today-no-id-table col.today-col-patient {
  width: 105px !important;
}

table.today-no-id-table col.today-col-category {
  width: 60px !important;
}

table.today-no-id-table col.today-col-body {
  width: 236px !important;
}

table.today-no-id-table col.today-col-note {
  width: 95px !important;
}

table.today-no-id-table col.today-col-sign {
  width: 128px !important;
}

table.today-no-id-table .today-excel-sign {
  width: 128px !important;
  min-width: 128px !important;
  max-width: 128px !important;
  padding-left: 7px !important;
  padding-right: 7px !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

table.today-no-id-table .today-sign-form {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
}

table.today-no-id-table .today-sign-form select {
  width: 98px !important;
  min-width: 98px !important;
  max-width: 98px !important;
  height: 40px !important;
  box-sizing: border-box !important;
}

table.today-no-id-table .today-sign-form button {
  width: 78px !important;
  min-width: 78px !important;
  max-width: 78px !important;
  height: 40px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

table.today-no-id-table .today-hide-form {
  width: 100% !important;
  text-align: center !important;
  margin-top: 8px !important;
}

table.today-no-id-table .today-hide-form button {
  width: 78px !important;
  min-width: 78px !important;
  max-width: 78px !important;
  height: 40px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

table.today-no-id-table .today-excel-body {
  font-size: 14px !important;
  line-height: 1.45 !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

table.today-no-id-table .today-excel-note {
  font-size: 14px !important;
  line-height: 1.45 !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

table.today-no-id-table thead th {
  overflow: visible !important;
}

/* ===== today-excel-sign-width-fix-202607051803 END ===== */

/* ===== today-force-remove-edit-hide-202607051807 START ===== */

/* 今日の指示では編集リンクと非表示ボタンを完全非表示 */
.today-no-id-table .today-patient-edit,
.today-no-id-table .today-hide-form,
.today-no-id-table button.danger,
.today-no-id-table .danger.small {
  display: none !important;
}

/* 非表示ボタン削除後のサイン欄を少し低くする */
table.today-no-id-table .today-sign-form {
  gap: 8px !important;
}

table.today-no-id-table .today-excel-sign {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

/* ===== today-force-remove-edit-hide-202607051807 END ===== */

/* ===== today-sign-button-match-202607051810 START ===== */

/* 7/4側・7/5側の看護師サイン欄を完全に同じ幅にする */
table.today-no-id-table col.today-col-sign {
  width: 128px !important;
}

table.today-no-id-table .today-excel-sign {
  width: 128px !important;
  min-width: 128px !important;
  max-width: 128px !important;
  padding: 10px 7px !important;
  box-sizing: border-box !important;
  text-align: center !important;
  vertical-align: top !important;
}

/* サイン欄の中身を左右同じ見た目に固定 */
table.today-no-id-table .today-sign-form {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

table.today-no-id-table .today-sign-form select {
  width: 98px !important;
  min-width: 98px !important;
  max-width: 98px !important;
  height: 40px !important;
  box-sizing: border-box !important;
  margin: 0 auto !important;
  text-align: center !important;
}

/* 患者管理の保存ボタンに近い青ボタン */
table.today-no-id-table .today-sign-save,
table.today-no-id-table .today-sign-form button.primary {
  display: inline-block !important;
  width: 78px !important;
  min-width: 78px !important;
  max-width: 78px !important;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  border-radius: 8px !important;
  border: 1px solid #2563eb !important;
  background: #2563eb !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  text-align: center !important;
  line-height: 38px !important;
  box-shadow: none !important;
  white-space: nowrap !important;
}

table.today-no-id-table .today-sign-save:hover,
table.today-no-id-table .today-sign-form button.primary:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

/* 非表示ボタンは今日の指示では不要 */
table.today-no-id-table .today-hide-form,
table.today-no-id-table button.danger,
table.today-no-id-table .danger.small {
  display: none !important;
}

/* 7/4側と7/5側で本文・補足・サインの高さが揃いやすいようにする */
table.today-no-id-table td {
  vertical-align: top !important;
}

table.today-no-id-table .today-excel-body,
table.today-no-id-table .today-excel-note {
  padding-top: 10px !important;
}

/* ===== today-sign-button-match-202607051810 END ===== */

/* ===== today-patient-label-remove-202607051813 START ===== */

table.today-no-id-table .today-patient-sub {
  display: block !important;
  margin-top: 4px !important;
  line-height: 1.35 !important;
  word-break: break-word !important;
}

table.today-no-id-table .today-patient-cell strong {
  display: block !important;
  margin-bottom: 4px !important;
}

/* ===== today-patient-label-remove-202607051813 END ===== */
\n

/* ===== today-sign-column-final-fix-202607060948 START ===== */

/*
  今日の指示表の
  看護師サイン列だけを対象にする。

  全体 select
  全体 table
  全体 td

  には触らない。
*/

table.today-excel-table.today-no-id-table col.today-col-sign {
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;
}

table.today-excel-table.today-no-id-table th.today-sign-head {
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;
}

table.today-excel-table.today-no-id-table td.today-excel-sign {
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;

  padding-left: 6px !important;
  padding-right: 6px !important;

  box-sizing: border-box !important;
  overflow: hidden !important;
  text-align: center !important;
}

table.today-excel-table.today-no-id-table td.today-excel-sign form.today-sign-form {
  width: 118px !important;
  min-width: 118px !important;
  max-width: 118px !important;

  margin: 0 auto !important;
  padding: 0 !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

table.today-excel-table.today-no-id-table td.today-excel-sign form.today-sign-form select.today-nurse-select[name="nurse_id"] {
  width: 118px !important;
  min-width: 118px !important;
  max-width: 118px !important;

  height: 44px !important;
  min-height: 44px !important;

  box-sizing: border-box !important;

  font-size: 14px !important;
  line-height: 1.2 !important;

  padding-left: 6px !important;
  padding-right: 22px !important;

  text-align: left !important;
  text-align-last: left !important;

  white-space: nowrap !important;
  overflow: hidden !important;

  letter-spacing: -0.02em !important;

  appearance: auto !important;
  -webkit-appearance: menulist !important;

  background-image: none !important;
}

table.today-excel-table.today-no-id-table td.today-excel-sign form.today-sign-form button.today-sign-save {
  width: 78px !important;
  min-width: 78px !important;
  max-width: 78px !important;

  height: 40px !important;
  min-height: 40px !important;

  margin: 0 auto !important;
  padding: 0 !important;

  box-sizing: border-box !important;
  display: block !important;
}

/* ===== today-sign-column-final-fix-202607060948 END ===== */

/* ===== patient-quick-info-202607061115 START ===== */

/*
  患者別入力の患者情報表示だけを対象にする。
  指示表、今日の指示表、全体 table/select/td は触らない。
*/

.patient-quick-info {
  font-size: 16px !important;
  line-height: 1.7 !important;
  margin-bottom: 6px !important;
}

.patient-quick-note-display {
  font-size: 16px !important;
  line-height: 1.7 !important;
  margin: 0 0 12px 0 !important;
  padding: 0 !important;
  color: #111827 !important;
}

.patient-quick-form {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
  gap: 10px 12px !important;

  margin: 10px 0 18px 0 !important;
  padding: 12px !important;

  border: 1px solid #d6e1f0 !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
  box-sizing: border-box !important;
}

.patient-quick-form label {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;

  font-size: 14px !important;
  font-weight: 700 !important;
}

.patient-quick-form input,
.patient-quick-form select,
.patient-quick-form textarea {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.patient-quick-note-input {
  grid-column: span 2 !important;
}

.patient-quick-save {
  align-self: end !important;

  min-width: 150px !important;
  height: 42px !important;

  padding-left: 14px !important;
  padding-right: 14px !important;

  border-radius: 8px !important;
  font-weight: 700 !important;
}

/* ===== patient-quick-info-202607061115 END ===== */


/* ===== patient-list-align-fix-202607061815 START ===== */

/*
  患者管理一覧だけを対象にする。
  患者別入力、今日の指示表、看護師サインは触らない。
*/

table.patient-list {
  width: 100% !important;
  table-layout: fixed !important;
}

table.patient-list th,
table.patient-list td {
  box-sizing: border-box !important;
  vertical-align: middle !important;
}

table.patient-list th:nth-child(1),
table.patient-list td:nth-child(1) {
  width: 54px !important;
  text-align: center !important;
}

table.patient-list th:nth-child(2),
table.patient-list td:nth-child(2) {
  width: 54px !important;
  text-align: center !important;
}

table.patient-list th:nth-child(3),
table.patient-list td:nth-child(3) {
  width: 220px !important;
  text-align: left !important;
}

table.patient-list th:nth-child(4),
table.patient-list td:nth-child(4) {
  width: 90px !important;
  text-align: center !important;
}

table.patient-list th:nth-child(5),
table.patient-list td:nth-child(5) {
  width: 120px !important;
  text-align: center !important;
}

table.patient-list th:nth-child(6),
table.patient-list td:nth-child(6) {
  width: 135px !important;
  text-align: center !important;
}

table.patient-list th:nth-child(7),
table.patient-list td:nth-child(7) {
  width: 135px !important;
  text-align: center !important;
}

table.patient-list th:nth-child(8),
table.patient-list td:nth-child(8) {
  text-align: left !important;
}

table.patient-list th:nth-child(9),
table.patient-list td:nth-child(9) {
  width: 150px !important;
  text-align: center !important;
}

/* ===== patient-list-align-fix-202607061815 END ===== */


/* ===== patient-list-header-align-fix-202607061822 START ===== */

/*
  患者管理一覧だけを対象にする。

  修正内容：
  ・移動が縦書きになる問題を防ぐ
  ・備考、操作の見出し位置を中央に戻す
  ・患者別入力、今日の指示画面は触らない
*/

table.patient-list {
  width: 100% !important;
  table-layout: fixed !important;
}

table.patient-list thead tr {
  height: 58px !important;
}

table.patient-list thead th {
  height: 58px !important;
  padding: 10px 8px !important;

  text-align: center !important;
  vertical-align: middle !important;

  line-height: 1.25 !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;

  writing-mode: horizontal-tb !important;
}

table.patient-list tbody td {
  vertical-align: middle !important;
}

/* 順 */
table.patient-list th:nth-child(1),
table.patient-list td:nth-child(1) {
  width: 56px !important;
  text-align: center !important;
}

/* 移動 */
table.patient-list th:nth-child(2),
table.patient-list td:nth-child(2) {
  width: 82px !important;
  min-width: 82px !important;

  text-align: center !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  writing-mode: horizontal-tb !important;
}

/* 名前 */
table.patient-list th:nth-child(3),
table.patient-list td:nth-child(3) {
  width: 220px !important;
  text-align: left !important;
}

/* 性別 */
table.patient-list th:nth-child(4),
table.patient-list td:nth-child(4) {
  width: 90px !important;
  text-align: center !important;
}

/* ID */
table.patient-list th:nth-child(5),
table.patient-list td:nth-child(5) {
  width: 120px !important;
  text-align: center !important;
}

/* 生年月日 */
table.patient-list th:nth-child(6),
table.patient-list td:nth-child(6) {
  width: 135px !important;
  text-align: center !important;
}

/* 入院日 */
table.patient-list th:nth-child(7),
table.patient-list td:nth-child(7) {
  width: 135px !important;
  text-align: center !important;
}

/* 備考 */
table.patient-list th:nth-child(8),
table.patient-list td:nth-child(8) {
  text-align: left !important;
  vertical-align: middle !important;
}

/* 備考の見出しだけ中央 */
table.patient-list th:nth-child(8) {
  text-align: center !important;
  vertical-align: middle !important;
}

/* 操作 */
table.patient-list th:nth-child(9),
table.patient-list td:nth-child(9) {
  width: 150px !important;
  text-align: center !important;
  vertical-align: middle !important;
}

table.patient-list th:nth-child(9) {
  text-align: center !important;
  vertical-align: middle !important;
}

/* ===== patient-list-header-align-fix-202607061822 END ===== */


/* ===== patient-action-button-center-fix-202607061830 START ===== */

/*
  患者管理一覧だけを対象にする。

  修正内容：
  ・削除ボタンを操作列の中央へ戻す
  ・編集、退院、削除を縦に中央揃えする
  ・移動見出しを横表示で固定する

  患者別入力、
  今日の指示画面、
  看護師サイン、
  治療内容プルダウン
  には触らない。
*/

table.patient-list thead th:nth-child(2) {
  width: 82px !important;
  min-width: 82px !important;
  max-width: 82px !important;

  text-align: center !important;
  vertical-align: middle !important;

  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;

  font-size: 0 !important;
}

table.patient-list thead th:nth-child(2)::before {
  content: "移動";
  display: inline-block !important;

  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1 !important;

  white-space: nowrap !important;
  word-break: keep-all !important;
  writing-mode: horizontal-tb !important;
}

table.patient-list td:nth-child(2) {
  width: 82px !important;
  min-width: 82px !important;
  max-width: 82px !important;

  text-align: center !important;
  vertical-align: middle !important;

  white-space: nowrap !important;
  word-break: keep-all !important;
}

/* 操作列 */
table.patient-list th:nth-child(9),
table.patient-list td:nth-child(9),
table.patient-list td.patient-actions {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;

  text-align: center !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
}

/* 操作列内の全体配置 */
table.patient-list td.patient-actions {
  padding-left: 8px !important;
  padding-right: 8px !important;
}

/* 編集・退院ボタン */
table.patient-list td.patient-actions a,
table.patient-list td.patient-actions > button {
  display: block !important;

  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;

  margin: 8px auto !important;

  text-align: center !important;
  box-sizing: border-box !important;
}

/* 削除フォーム */
table.patient-list td.patient-actions form.patient-delete-inline {
  display: block !important;

  width: 100% !important;
  max-width: 100% !important;

  margin: 8px auto 0 auto !important;
  padding: 0 !important;

  text-align: center !important;
  box-sizing: border-box !important;
}

/* 削除ボタン */
table.patient-list td.patient-actions form.patient-delete-inline button,
table.patient-list td.patient-actions button.danger {
  display: block !important;

  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;

  margin: 0 auto !important;

  text-align: center !important;
  box-sizing: border-box !important;
}

/* 備考・操作の見出し位置 */
table.patient-list thead th:nth-child(8),
table.patient-list thead th:nth-child(9) {
  text-align: center !important;
  vertical-align: middle !important;
  line-height: 1.25 !important;
}

/* ===== patient-action-button-center-fix-202607061830 END ===== */


/* ===== patient-discharge-panel-contained-202607070233 START ===== */

/* 患者管理の操作欄を固定幅にして、退院フォームのはみ出しを防ぐ */
table.patient-list td.patient-actions,
#patient-sort-body td.patient-actions {
  width: 128px !important;
  min-width: 128px !important;
  max-width: 128px !important;
  padding-left: 6px !important;
  padding-right: 6px !important;
  text-align: center !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
}

/* 編集・退院・削除ボタンを操作欄内に収める */
table.patient-list td.patient-actions a,
table.patient-list td.patient-actions button,
table.patient-list td.patient-actions .button,
table.patient-list td.patient-actions .patient-main-action,
#patient-sort-body td.patient-actions a,
#patient-sort-body td.patient-actions button,
#patient-sort-body td.patient-actions .button,
#patient-sort-body td.patient-actions .patient-main-action {
  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;
  box-sizing: border-box !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 退院日入力パネルを操作欄の中に固定する */
table.patient-list td.patient-actions .patient-discharge-panel,
#patient-sort-body td.patient-actions .patient-discharge-panel {
  display: block !important;
  position: static !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  width: 112px !important;
  min-width: 112px !important;
  max-width: 112px !important;
  margin: 8px auto 8px auto !important;
  padding: 8px 6px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* hidden の時は確実に非表示 */
table.patient-list td.patient-actions .patient-discharge-panel[hidden],
#patient-sort-body td.patient-actions .patient-discharge-panel[hidden] {
  display: none !important;
}

/* 退院日ラベルと日付入力を縦に収める */
table.patient-list td.patient-actions .patient-discharge-date,
#patient-sort-body td.patient-actions .patient-discharge-date {
  display: block !important;
  width: 100% !important;
  margin: 0 0 6px 0 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  box-sizing: border-box !important;
}

/* 日付入力欄を横にはみ出さない幅にする */
table.patient-list td.patient-actions .patient-discharge-date input[type="date"],
table.patient-list td.patient-actions input[type="date"],
#patient-sort-body td.patient-actions .patient-discharge-date input[type="date"],
#patient-sort-body td.patient-actions input[type="date"] {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 38px !important;
  padding: 5px 3px !important;
  font-size: 13px !important;
  box-sizing: border-box !important;
}

/* 本日・入力日で退院ボタンを縦並びで収める */
table.patient-list td.patient-actions .patient-discharge-buttons,
#patient-sort-body td.patient-actions .patient-discharge-buttons {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  width: 100% !important;
  margin: 6px 0 0 0 !important;
  box-sizing: border-box !important;
}

table.patient-list td.patient-actions .patient-discharge-buttons button,
#patient-sort-body td.patient-actions .patient-discharge-buttons button {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding-left: 4px !important;
  padding-right: 4px !important;
  white-space: normal !important;
  box-sizing: border-box !important;
}

/* ===== patient-discharge-panel-contained-202607070233 END ===== */


/* ===== discharged-patient-gender-nowrap-202607070338 START ===== */

/*
 * 退院患者一覧の性別欄が
 * 「未設 / 定」のように縦割れしないようにする。
 */
table.list th:nth-child(2),
table.list td:nth-child(2) {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  min-width: 72px !important;
}

/* ===== discharged-patient-gender-nowrap-202607070338 END ===== */

/* ===== discharged-page-balance-tune-202607070417 START ===== */

form:has(#discharge-month-input) {
  display: grid !important;
  grid-template-columns: minmax(360px, 1fr) 180px auto auto !important;
  gap: 14px 16px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) label {
  margin-bottom: 6px !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  width: 100% !important;
  min-width: 0 !important;
}

form:has(#discharge-month-input) .discharge-month-browserlike-wrap {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 180px !important;
  max-width: 180px !important;
}

form:has(#discharge-month-input) #discharge-month-input {
  width: 126px !important;
  min-width: 126px !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) #discharge-month-open {
  width: 46px !important;
  min-width: 46px !important;
  height: 46px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) button[type="reset"],
form:has(#discharge-month-input) a {
  min-width: 96px !important;
  height: 48px !important;
  padding: 0 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

body:has(#discharge-month-input) table {
  width: 100% !important;
  table-layout: fixed !important;
}

body:has(#discharge-month-input) table th,
body:has(#discharge-month-input) table td {
  vertical-align: top !important;
  word-break: break-word !important;
}

body:has(#discharge-month-input) table th:nth-child(1),
body:has(#discharge-month-input) table td:nth-child(1) {
  width: 18% !important;
}

body:has(#discharge-month-input) table th:nth-child(2),
body:has(#discharge-month-input) table td:nth-child(2) {
  width: 8% !important;
}

body:has(#discharge-month-input) table th:nth-child(3),
body:has(#discharge-month-input) table td:nth-child(3) {
  width: 10% !important;
}

body:has(#discharge-month-input) table th:nth-child(4),
body:has(#discharge-month-input) table td:nth-child(4) {
  width: 12% !important;
}

body:has(#discharge-month-input) table th:nth-child(5),
body:has(#discharge-month-input) table td:nth-child(5) {
  width: 12% !important;
}

body:has(#discharge-month-input) table th:nth-child(6),
body:has(#discharge-month-input) table td:nth-child(6) {
  width: 18% !important;
}

body:has(#discharge-month-input) table th:nth-child(7),
body:has(#discharge-month-input) table td:nth-child(7) {
  width: 22% !important;
  text-align: center !important;
}

body:has(#discharge-month-input) table td:nth-child(7) input[type="date"] {
  width: 140px !important;
  max-width: 100% !important;
  margin: 6px auto 10px !important;
  display: block !important;
}

body:has(#discharge-month-input) table td:nth-child(7) button,
body:has(#discharge-month-input) table td:nth-child(7) input[type="submit"] {
  min-width: 120px !important;
  margin: 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

@media (max-width: 980px) {
  form:has(#discharge-month-input) {
    grid-template-columns: 1fr 180px !important;
  }

  form:has(#discharge-month-input) button[type="submit"],
  form:has(#discharge-month-input) button[type="reset"],
  form:has(#discharge-month-input) a {
    width: 100% !important;
  }
}

@media (max-width: 700px) {
  form:has(#discharge-month-input) {
    grid-template-columns: 1fr !important;
  }

  form:has(#discharge-month-input) .discharge-month-browserlike-wrap {
    width: 100% !important;
    max-width: 100% !important;
  }

  form:has(#discharge-month-input) #discharge-month-input {
    width: calc(100% - 54px) !important;
  }
}

/* ===== discharged-page-balance-tune-202607070417 END ===== */


/* ===== discharged-page-balance-tune-v2-202607070420 START ===== */

body:has(#discharge-month-input) .card,
body:has(#discharge-month-input) .panel,
body:has(#discharge-month-input) section {
  box-sizing: border-box !important;
}

body:has(#discharge-month-input) form {
  align-items: end !important;
  row-gap: 8px !important;
  column-gap: 14px !important;
}

form:has(#discharge-month-input) {
  grid-template-columns:
    minmax(440px, 1fr)
    210px
    90px
    90px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) h1,
form:has(#discharge-month-input) h2,
form:has(#discharge-month-input) h3,
form:has(#discharge-month-input) legend {
  grid-column: 1 / -1 !important;
  margin: 0 0 8px 0 !important;
}

form:has(#discharge-month-input) label {
  margin: 0 0 5px 0 !important;
  line-height: 1.35 !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  height: 46px !important;
}

.discharge-month-browserlike-wrap {
  display: inline-grid !important;
  grid-template-columns: 150px 52px !important;
  gap: 8px !important;
  align-items: center !important;
  width: 210px !important;
  max-width: 210px !important;
  vertical-align: bottom !important;
}

#discharge-month-input {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  height: 46px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

#discharge-month-open {
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  height: 46px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) button[type="submit"] {
  width: 90px !important;
  min-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
}

form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  width: 90px !important;
  min-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 検索カードの間延びを少し圧縮 */
body:has(#discharge-month-input) form {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* 一覧表の上端を少し近づける */
body:has(#discharge-month-input) table {
  margin-top: 16px !important;
}

/* 再入院欄の見た目を少しコンパクトにする */
body:has(#discharge-month-input) table td:nth-child(7) {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

body:has(#discharge-month-input) table td:nth-child(7) input[type="date"] {
  width: 136px !important;
  height: 42px !important;
  margin: 4px auto 8px !important;
}

body:has(#discharge-month-input) table td:nth-child(7) button,
body:has(#discharge-month-input) table td:nth-child(7) input[type="submit"] {
  min-width: 112px !important;
  height: 42px !important;
}

/* ===== discharged-page-balance-tune-v2-202607070420 END ===== */


/* ===== discharged-month-inline-balance-v3-202607070423 START ===== */

.discharge-month-browserlike-wrap {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  width: 218px !important;
  min-width: 218px !important;
  max-width: 218px !important;
  white-space: nowrap !important;
  vertical-align: bottom !important;
}

.discharge-month-browserlike-wrap > #discharge-month-input {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  height: 46px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  display: inline-block !important;
  flex: 0 0 150px !important;
}

.discharge-month-browserlike-wrap > #discharge-month-open {
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  height: 46px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  flex: 0 0 52px !important;
}

form:has(#discharge-month-input) {
  grid-template-columns:
    minmax(440px, 1fr)
    218px
    90px
    90px !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  height: 48px !important;
  align-self: end !important;
}

/* ===== discharged-month-inline-balance-v3-202607070423 END ===== */


/* ===== discharge-month-simple-balance-202607070425 START ===== */

/* 退院年月は手入力だけにして、崩れを止める */
.discharge-month-simple-wrap {
  display: inline-block !important;
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  vertical-align: bottom !important;
  white-space: nowrap !important;
}

#discharge-month-input.discharge-month-simple-input {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  height: 46px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  display: inline-block !important;
}

#discharge-month-open[aria-hidden="true"],
#discharge-month-browserlike-panel[aria-hidden="true"] {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* 検索フォーム全体の横並びを安定化 */
form:has(#discharge-month-input) {
  display: grid !important;
  grid-template-columns:
    minmax(520px, 1fr)
    150px
    90px
    90px !important;
  gap: 12px 16px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  width: 100% !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* 検索カードの余白を少し整える */
body:has(#discharge-month-input) form {
  row-gap: 10px !important;
}

/* 画面幅が狭い場合だけ折り返す */
@media (max-width: 900px) {
  form:has(#discharge-month-input) {
    grid-template-columns: 1fr 150px !important;
  }

  form:has(#discharge-month-input) button[type="submit"],
  form:has(#discharge-month-input) a,
  form:has(#discharge-month-input) button[type="reset"] {
    width: 100% !important;
    max-width: none !important;
  }
}

/* ===== discharge-month-simple-balance-202607070425 END ===== */


/* ===== discharge-month-custom-restore-balance-202607070428 START ===== */

/* 退院年月：自作カレンダーを横並び固定で戻す */
.custom-restored-month-wrap {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
  white-space: nowrap !important;
  vertical-align: bottom !important;
  box-sizing: border-box !important;
}

.custom-restored-month-input {
  width: 156px !important;
  min-width: 156px !important;
  max-width: 156px !important;
  height: 46px !important;
  margin: 0 !important;
  padding-left: 12px !important;
  box-sizing: border-box !important;
  display: inline-block !important;
  flex: 0 0 156px !important;
}

.custom-restored-month-open {
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  height: 46px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  flex: 0 0 50px !important;
}

/* 前回の非表示指定を上書き */
#discharge-month-open.custom-restored-month-open {
  display: inline-flex !important;
  width: 50px !important;
  height: 46px !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: visible !important;
}

/* 検索フォームの列幅を、自作カレンダー用に再調整 */
form:has(#discharge-month-input) {
  display: grid !important;
  grid-template-columns:
    minmax(520px, 1fr)
    220px
    90px
    90px !important;
  gap: 12px 16px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  width: 100% !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* 自作カレンダーパネルは必要時だけ開く */
.custom-restored-month-panel {
  z-index: 9999 !important;
}

/* 画面幅が狭い時だけ折り返す */
@media (max-width: 980px) {
  form:has(#discharge-month-input) {
    grid-template-columns: 1fr 220px !important;
  }

  form:has(#discharge-month-input) button[type="submit"],
  form:has(#discharge-month-input) a,
  form:has(#discharge-month-input) button[type="reset"] {
    width: 100% !important;
    max-width: none !important;
  }
}

/* ===== discharge-month-custom-restore-balance-202607070428 END ===== */


/* ===== discharge-month-icon-inside-input-202607070430 START ===== */

/* 退院年月の枠内右端に📅を入れる */
.custom-restored-month-wrap,
.discharge-month-browserlike-wrap {
  position: relative !important;
  display: inline-block !important;
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  vertical-align: bottom !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* 入力欄の右側にアイコン分の余白を確保 */
.custom-restored-month-input,
.discharge-month-browserlike-input,
#discharge-month-input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 46px !important;
  padding: 0 42px 0 12px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  display: inline-block !important;
}

/* 📅ボタンを枠内右端へ配置 */
.custom-restored-month-open,
.discharge-month-browserlike-open,
#discharge-month-open {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  height: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  z-index: 2 !important;
  cursor: pointer !important;
  flex: none !important;
}

/* 検索フォーム幅も少し整える */
form:has(#discharge-month-input) {
  display: grid !important;
  grid-template-columns:
    minmax(520px, 1fr)
    180px
    90px
    90px !important;
  gap: 12px 16px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  width: 100% !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* ===== discharge-month-icon-inside-input-202607070430 END ===== */


/* ===== discharge-month-inside-icon-final-202607070436 START ===== */

/* 退院年月：入力欄の枠内右端に📅を固定 */
.discharge-month-inside-final-wrap {
  position: relative !important;
  display: inline-block !important;
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  vertical-align: bottom !important;
  box-sizing: border-box !important;
}

.discharge-month-inside-final-input {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  padding-right: 40px !important;
  box-sizing: border-box !important;
}

.discharge-month-inside-final-open {
  position: absolute !important;
  right: 9px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 24px !important;
  height: 24px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* 検索フォームの横幅 */
form:has(#discharge-month-input) {
  display: grid !important;
  grid-template-columns:
    minmax(520px, 1fr)
    180px
    90px
    90px !important;
  gap: 12px 16px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  width: 100% !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* ===== discharge-month-inside-icon-final-202607070436 END ===== */


/* ===== discharge-month-jp-display-202607070431 START ===== */

.discharge-month-inside-final-wrap {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
}

#discharge-month-input.discharge-month-inside-final-input {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  padding-right: 40px !important;
  box-sizing: border-box !important;
}

#discharge-month-open.discharge-month-inside-final-open {
  right: 9px !important;
}

/* ===== discharge-month-jp-display-202607070431 END ===== */


/* ===== discharge-month-fixed-labels-202607070444 START ===== */

/* 退院年月：年・月を削除できない固定表示にする */
.discharge-month-fixed-label-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  padding: 0 40px 0 12px !important;
  border: 1px solid #b8c7dc !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-sizing: border-box !important;
  vertical-align: bottom !important;
  white-space: nowrap !important;
}

.discharge-month-fixed-display {
  display: inline-block !important;
  line-height: 46px !important;
  font-size: 16px !important;
  color: #0f172a !important;
  user-select: none !important;
  pointer-events: none !important;
}

.discharge-month-fixed-open {
  position: absolute !important;
  right: 9px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  height: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  cursor: pointer !important;
  z-index: 3 !important;
}

#discharge-month-input[type="hidden"] {
  display: none !important;
}

form:has(#discharge-month-input) {
  display: grid !important;
  grid-template-columns:
    minmax(520px, 1fr)
    180px
    90px
    90px !important;
  gap: 12px 16px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  width: 100% !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* ===== discharge-month-fixed-labels-202607070444 END ===== */


/* ===== discharge-month-readonly-onebox-202607070448 START ===== */

.discharge-month-readonly-onebox {
  position: relative !important;
  display: inline-block !important;
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  vertical-align: bottom !important;
  box-sizing: border-box !important;
}

#discharge-month-input.discharge-month-readonly-onebox-input {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  margin: 0 !important;
  padding: 0 40px 0 12px !important;
  box-sizing: border-box !important;
  display: block !important;
  background: #fff !important;
  cursor: pointer !important;
}

#discharge-month-open.discharge-month-readonly-onebox-open {
  position: absolute !important;
  right: 9px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  height: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  cursor: pointer !important;
  z-index: 3 !important;
}

form:has(#discharge-month-input) {
  display: grid !important;
  grid-template-columns:
    minmax(520px, 1fr)
    180px
    90px
    90px !important;
  gap: 12px 16px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  width: 100% !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* ===== discharge-month-readonly-onebox-202607070448 END ===== */


/* ===== discharge-month-year-month-select-202607070453 START ===== */

/* 退院年月：日付なし。年と月だけ選択 */
.discharge-month-ym-select-label {
  display: block !important;
}

.discharge-month-ym-select-wrap {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  width: 210px !important;
  min-width: 210px !important;
  max-width: 210px !important;
  height: 46px !important;
  box-sizing: border-box !important;
  vertical-align: bottom !important;
  white-space: nowrap !important;
}

.discharge-year-select {
  width: 86px !important;
  min-width: 86px !important;
  max-width: 86px !important;
  height: 46px !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
}

.discharge-month-select {
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  height: 46px !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
}

.discharge-month-ym-fixed-text {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 46px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  white-space: nowrap !important;
}

#discharge-month-input[type="hidden"] {
  display: none !important;
}

/* 古い自作カレンダー・ブラウザカレンダー部品を非表示 */
#discharge-month-open,
#discharge-month-browserlike-panel,
#discharge-month-fixed-v2-panel,
#discharge-month-display-button,
#discharge-month-value,
.discharge-month-fixed-label-wrap,
.discharge-month-fixed-v2-wrap,
.discharge-month-inside-final-wrap,
.discharge-month-browserlike-wrap,
.custom-restored-month-wrap,
.discharge-month-native-browser-input {
  display: none !important;
}

/* 検索フォームの横並び */
form:has(#discharge-month-input) {
  display: grid !important;
  grid-template-columns:
    minmax(520px, 1fr)
    210px
    90px
    90px !important;
  gap: 12px 16px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  width: 100% !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* ===== discharge-month-year-month-select-202607070453 END ===== */


/* ===== restore-native-month-clean-202607070455 START ===== */

/* 退院年月をブラウザ標準の1枠に戻す */
.discharge-month-native-clean-label {
  display: block !important;
}

#discharge-month-input.discharge-month-native-clean-input {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  box-sizing: border-box !important;
  display: block !important;
  background: #fff !important;
  cursor: pointer !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
}

/* 直近の年・月プルダウンと自作部品を完全に非表示 */
#discharge-year-select,
#discharge-month-select,
.discharge-month-ym-select-wrap,
.discharge-month-ym-fixed-text,
#discharge-month-open,
#discharge-month-browserlike-panel,
#discharge-month-fixed-v2-panel,
#discharge-month-display-button,
#discharge-month-value,
.discharge-month-fixed-label-wrap,
.discharge-month-fixed-v2-wrap,
.discharge-month-inside-final-wrap,
.discharge-month-browserlike-wrap,
.custom-restored-month-wrap,
.discharge-month-fixed-v2-panel {
  display: none !important;
}

/* 検索フォームの横並びを整える */
form:has(#discharge-month-input) {
  display: grid !important;
  grid-template-columns:
    minmax(520px, 1fr)
    180px
    90px
    90px !important;
  gap: 12px 16px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  width: 100% !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* ===== restore-native-month-clean-202607070455 END ===== */


/* ===== native-month-calendar-icon-fix-202607070456 START ===== */

/* ブラウザ標準の年月カレンダーアイコンを表示しやすくする */
#discharge-month-input[type="month"],
#discharge-month-input.discharge-month-native-clean-input {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  padding-left: 10px !important;
  padding-right: 8px !important;
  box-sizing: border-box !important;
  display: block !important;
  background-color: #fff !important;
  color: #0f172a !important;
  cursor: pointer !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
  color-scheme: light !important;
}

/* Chrome / Edge 系のカレンダーアイコン */
#discharge-month-input[type="month"]::-webkit-calendar-picker-indicator {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  cursor: pointer !important;
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 古い自作カレンダー部品は非表示のまま */
#discharge-month-open,
#discharge-month-browserlike-panel,
#discharge-month-fixed-v2-panel,
#discharge-month-display-button,
#discharge-month-value,
#discharge-year-select,
#discharge-month-select,
.discharge-month-ym-select-wrap,
.discharge-month-fixed-label-wrap,
.discharge-month-fixed-v2-wrap,
.discharge-month-inside-final-wrap,
.discharge-month-browserlike-wrap,
.custom-restored-month-wrap {
  display: none !important;
}

/* ===== native-month-calendar-icon-fix-202607070456 END ===== */


/* ===== native-month-visible-button-202607070457 START ===== */

/* 退院年月：ブラウザ標準month入力＋見える📅ボタン */
.native-month-visible-label {
  display: block !important;
}

.native-month-visible-wrap {
  position: relative !important;
  display: inline-block !important;
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  vertical-align: bottom !important;
  box-sizing: border-box !important;
}

#discharge-month-input.native-month-visible-input {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  margin: 0 !important;
  padding: 0 42px 0 10px !important;
  box-sizing: border-box !important;
  display: block !important;
  background: #fff !important;
  color: #0f172a !important;
  cursor: pointer !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
  color-scheme: light !important;
}

/* 標準アイコンは環境差が大きいため、右端の見えるボタンを使う */
#discharge-month-input.native-month-visible-input::-webkit-calendar-picker-indicator {
  opacity: 0 !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

#native-month-picker-open.native-month-picker-open {
  position: absolute !important;
  right: 9px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  height: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  cursor: pointer !important;
  z-index: 5 !important;
}

/* 古い自作カレンダー・年/月セレクト部品は非表示 */
#discharge-month-open,
#discharge-month-browserlike-panel,
#discharge-month-fixed-v2-panel,
#discharge-month-display-button,
#discharge-month-value,
#discharge-year-select,
#discharge-month-select,
.discharge-month-ym-select-wrap,
.discharge-month-fixed-label-wrap,
.discharge-month-fixed-v2-wrap,
.discharge-month-inside-final-wrap,
.discharge-month-browserlike-wrap,
.custom-restored-month-wrap {
  display: none !important;
}

/* 検索フォームの横並び */
form:has(#discharge-month-input) {
  display: grid !important;
  grid-template-columns:
    minmax(520px, 1fr)
    180px
    90px
    90px !important;
  gap: 12px 16px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  width: 100% !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* ===== native-month-visible-button-202607070457 END ===== */


/* ===== native-month-no-fake-button-202607070500 START ===== */

/* 退院年月：外付け📅ボタンをやめて、ブラウザ標準monthだけにする */
.native-month-no-fake-label {
  display: block !important;
}

#discharge-month-input.native-month-no-fake-input {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  box-sizing: border-box !important;
  display: block !important;
  background: #fff !important;
  color: #0f172a !important;
  cursor: pointer !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
  color-scheme: light !important;
}

/* Chrome / Edge の標準アイコンを隠さない */
#discharge-month-input.native-month-no-fake-input::-webkit-calendar-picker-indicator {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  cursor: pointer !important;
}

/* 左上表示の原因になった外付けボタンと過去部品を消す */
#native-month-picker-open,
#discharge-month-open,
#discharge-month-browserlike-panel,
#discharge-month-fixed-v2-panel,
#discharge-month-display-button,
#discharge-month-value,
#discharge-year-select,
#discharge-month-select,
.discharge-month-ym-select-wrap,
.discharge-month-fixed-label-wrap,
.discharge-month-fixed-v2-wrap,
.discharge-month-inside-final-wrap,
.discharge-month-browserlike-wrap,
.custom-restored-month-wrap,
.native-month-visible-wrap {
  display: none !important;
}

/* 検索フォームの横並び */
form:has(#discharge-month-input) {
  display: grid !important;
  grid-template-columns:
    minmax(520px, 1fr)
    180px
    90px
    90px !important;
  gap: 12px 16px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  width: 100% !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* ===== native-month-no-fake-button-202607070500 END ===== */


/* ===== native-month-inner-icon-202607070501 START ===== */

/* 退院年月：ブラウザ標準month + 枠内の見える📅 */
.native-month-inner-icon-label {
  display: block !important;
}

.native-month-inner-icon-wrap {
  position: relative !important;
  display: inline-block !important;
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  vertical-align: bottom !important;
  box-sizing: border-box !important;
}

#discharge-month-input.native-month-inner-icon-input {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  margin: 0 !important;
  padding: 0 38px 0 10px !important;
  box-sizing: border-box !important;
  display: block !important;
  background: #fff !important;
  color: #0f172a !important;
  cursor: pointer !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
  color-scheme: light !important;
}

/* 標準アイコンは環境差があるので見えない前提にする */
#discharge-month-input.native-month-inner-icon-input::-webkit-calendar-picker-indicator {
  opacity: 0 !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 見た目だけの📅。クリックは下の input が受ける */
.native-month-inner-icon-mark {
  position: absolute !important;
  right: 11px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 22px !important;
  height: 22px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  pointer-events: none !important;
  z-index: 3 !important;
}

/* 外付けボタンや過去の自作部品は消す */
#native-month-picker-open,
#discharge-month-open,
#discharge-month-browserlike-panel,
#discharge-month-fixed-v2-panel,
#discharge-month-display-button,
#discharge-month-value,
#discharge-year-select,
#discharge-month-select,
.discharge-month-ym-select-wrap,
.discharge-month-fixed-label-wrap,
.discharge-month-fixed-v2-wrap,
.discharge-month-inside-final-wrap,
.discharge-month-browserlike-wrap,
.custom-restored-month-wrap,
.native-month-visible-wrap {
  display: none !important;
}

/* 検索フォームの横並び */
form:has(#discharge-month-input) {
  display: grid !important;
  grid-template-columns:
    minmax(520px, 1fr)
    180px
    90px
    90px !important;
  gap: 12px 16px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  width: 100% !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* ===== native-month-inner-icon-202607070501 END ===== */


/* ===== force-restore-native-month-clean-202607070505 START ===== */

/* 退院年月は type=month の1枠だけに戻す */
#discharge-month-input[type="month"] {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  box-sizing: border-box !important;
  display: block !important;
  background: #fff !important;
  color: #0f172a !important;
  cursor: pointer !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
  color-scheme: light !important;
}

/* 後から追加した自作・疑似カレンダー部品は全部消す */
#native-month-picker-open,
.native-month-inner-icon-mark,
.native-month-visible-wrap,
.native-month-inner-icon-wrap > .native-month-inner-icon-mark,
#discharge-month-open,
#discharge-month-browserlike-panel,
#discharge-month-fixed-v2-panel,
#discharge-month-display-button,
#discharge-month-value,
#discharge-year-select,
#discharge-month-select,
.discharge-month-ym-select-wrap,
.discharge-month-fixed-label-wrap,
.discharge-month-fixed-v2-wrap,
.discharge-month-inside-final-wrap,
.discharge-month-browserlike-wrap,
.custom-restored-month-wrap {
  display: none !important;
}

/* 検索フォームを横並びに戻す */
form:has(#discharge-month-input) {
  display: grid !important;
  grid-template-columns:
    minmax(520px, 1fr)
    180px
    90px
    90px !important;
  gap: 12px 16px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  width: 100% !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* ===== force-restore-native-month-clean-202607070505 END ===== */


/* ===== discharge-month-icon-inside-like-readmission-202607070508 START ===== */

/* 退院年月を、再入院日みたいに枠内📅表示へ */
.discharge-month-native-like-date-wrap {
  position: relative !important;
  display: inline-block !important;
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  vertical-align: bottom !important;
  box-sizing: border-box !important;
}

#discharge-month-input.discharge-month-native-like-date-input {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  margin: 0 !important;
  padding: 0 38px 0 10px !important;
  box-sizing: border-box !important;
  display: block !important;
  background: #fff !important;
  color: #0f172a !important;
  cursor: pointer !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
  color-scheme: light !important;
}

/* 見た目の📅は枠内右端へ */
.discharge-month-native-like-date-icon {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 20px !important;
  height: 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  pointer-events: none !important;
  z-index: 2 !important;
}

/* 既定の picker indicator は見えなくして二重表示防止 */
#discharge-month-input.discharge-month-native-like-date-input::-webkit-calendar-picker-indicator {
  opacity: 0 !important;
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
}

/* 検索フォームの並びを維持 */
form:has(#discharge-month-input) {
  display: grid !important;
  grid-template-columns:
    minmax(520px, 1fr)
    180px
    90px
    90px !important;
  gap: 12px 16px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  width: 100% !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* 過去の外付け部品は非表示のまま */
#native-month-picker-open,
#discharge-month-open,
#discharge-month-browserlike-panel,
#discharge-month-fixed-v2-panel,
#discharge-month-display-button,
#discharge-month-value,
#discharge-year-select,
#discharge-month-select,
.discharge-month-ym-select-wrap,
.discharge-month-fixed-label-wrap,
.discharge-month-fixed-v2-wrap,
.discharge-month-inside-final-wrap,
.discharge-month-browserlike-wrap,
.custom-restored-month-wrap,
.native-month-visible-wrap {
  display: none !important;
}

/* ===== discharge-month-icon-inside-like-readmission-202607070508 END ===== */



/* ===== month-native-restore-final-202607071026 START ===== */

.native-month-no-fake-label {
  display: block !important;
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.2 !important;
}

#discharge-month-input[type="month"],
#discharge-month-input.native-month-no-fake-input {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 46px !important;
  margin: 6px 0 0 0 !important;
  padding: 0 10px !important;
  box-sizing: border-box !important;
  display: block !important;
  background: #fff !important;
  color: #0f172a !important;
  cursor: pointer !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
  color-scheme: light !important;
  line-height: 46px !important;
}

#discharge-month-input[type="month"]::-webkit-calendar-picker-indicator,
#discharge-month-input.native-month-no-fake-input::-webkit-calendar-picker-indicator {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  cursor: pointer !important;
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
  pointer-events: auto !important;
}

.discharge-month-native-like-date-wrap,
.discharge-month-native-like-date-icon,
#native-month-picker-open,
#discharge-month-open,
#discharge-month-browserlike-panel,
#discharge-year-select,
#discharge-month-select,
.discharge-month-ym-select-wrap,
.discharge-month-fixed-label-wrap,
.discharge-month-fixed-v2-wrap,
.discharge-month-inside-final-wrap,
.discharge-month-browserlike-wrap,
.custom-restored-month-wrap,
.native-month-visible-wrap {
  display: none !important;
}

form:has(#discharge-month-input) {
  display: grid !important;
  grid-template-columns:
    minmax(520px, 1fr)
    180px
    90px
    90px !important;
  gap: 12px 16px !important;
  align-items: end !important;
}

form:has(#discharge-month-input) input[name="patient_name"] {
  width: 100% !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

form:has(#discharge-month-input) button[type="submit"],
form:has(#discharge-month-input) a,
form:has(#discharge-month-input) button[type="reset"] {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* ===== month-native-restore-final-202607071026 END ===== */


/* ===== readmission-column-restore-202607071036 START ===== */

/* 退院患者一覧の再入院列を固定して戻す */
body:has(#discharge-month-input)
table th:nth-child(7),
body:has(#discharge-month-input)
table td:nth-child(7) {
  width: 190px !important;
  min-width: 190px !important;
  max-width: 190px !important;
  text-align: center !important;
  vertical-align: top !important;
  box-sizing: border-box !important;
}

/* 再入院欄の中身を縦並びで中央寄せ */
body:has(#discharge-month-input)
table td:nth-child(7) form,
body:has(#discharge-month-input)
table td:nth-child(7) div {
  width: 100% !important;
  max-width: 190px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* 再入院日の見出し */
body:has(#discharge-month-input)
table td:nth-child(7) label,
body:has(#discharge-month-input)
table td:nth-child(7) strong {
  display: block !important;
  width: 150px !important;
  margin: 0 auto 6px auto !important;
  text-align: center !important;
  white-space: nowrap !important;
  line-height: 1.3 !important;
}

/* 再入院日の入力欄 */
body:has(#discharge-month-input)
table td:nth-child(7) input[type="date"] {
  display: block !important;

  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;

  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;

  margin: 0 auto 10px auto !important;
  padding: 0 10px !important;

  box-sizing: border-box !important;
  line-height: 46px !important;
}

/* 本日再入院・入力日で再入院ボタン */
body:has(#discharge-month-input)
table td:nth-child(7) button,
body:has(#discharge-month-input)
table td:nth-child(7) input[type="submit"],
body:has(#discharge-month-input)
table td:nth-child(7) a.button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;

  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;

  margin: 6px auto !important;
  padding: 0 10px !important;

  box-sizing: border-box !important;

  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;

  line-height: 1.2 !important;
  text-align: center !important;
  font-size: 16px !important;
}

/* 青い本日再入院ボタンも1行固定 */
body:has(#discharge-month-input)
table td:nth-child(7) button.primary,
body:has(#discharge-month-input)
table td:nth-child(7) .primary {
  white-space: nowrap !important;
  word-break: keep-all !important;
}

/* ===== readmission-column-restore-202607071036 END ===== */


/* ===== discharged-table-align-202607071039 START ===== */

/* 退院患者一覧テーブル全体の列ズレ防止 */
body:has(#discharge-month-input) table {
  width: 100% !important;
  table-layout: fixed !important;
  border-spacing: 0 !important;
}

/* 各列幅を固定 */
body:has(#discharge-month-input) table th:nth-child(1),
body:has(#discharge-month-input) table td:nth-child(1) {
  width: 210px !important;
}

body:has(#discharge-month-input) table th:nth-child(2),
body:has(#discharge-month-input) table td:nth-child(2) {
  width: 90px !important;
}

body:has(#discharge-month-input) table th:nth-child(3),
body:has(#discharge-month-input) table td:nth-child(3) {
  width: 90px !important;
}

body:has(#discharge-month-input) table th:nth-child(4),
body:has(#discharge-month-input) table td:nth-child(4) {
  width: 150px !important;
}

body:has(#discharge-month-input) table th:nth-child(5),
body:has(#discharge-month-input) table td:nth-child(5) {
  width: 140px !important;
}

body:has(#discharge-month-input) table th:nth-child(6),
body:has(#discharge-month-input) table td:nth-child(6) {
  width: auto !important;
}

body:has(#discharge-month-input) table th:nth-child(7),
body:has(#discharge-month-input) table td:nth-child(7) {
  width: 190px !important;
  min-width: 190px !important;
  max-width: 190px !important;
  text-align: center !important;
  vertical-align: top !important;
  box-sizing: border-box !important;
}

/* 再入院列の中身を列中央へ固定 */
body:has(#discharge-month-input) table td:nth-child(7) form {
  width: 160px !important;
  min-width: 160px !important;
  max-width: 160px !important;

  margin: 0 auto !important;
  padding: 0 !important;

  display: block !important;
  box-sizing: border-box !important;
}

/* 再入院日の見出し */
body:has(#discharge-month-input) table td:nth-child(7) label,
body:has(#discharge-month-input) table td:nth-child(7) strong {
  display: block !important;

  width: 160px !important;
  min-width: 160px !important;
  max-width: 160px !important;

  margin: 0 auto 6px auto !important;

  text-align: center !important;
  white-space: nowrap !important;
  line-height: 1.3 !important;
  box-sizing: border-box !important;
}

/* 再入院日の入力欄 */
body:has(#discharge-month-input) table td:nth-child(7) input[type="date"] {
  display: block !important;

  width: 160px !important;
  min-width: 160px !important;
  max-width: 160px !important;

  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;

  margin: 0 auto 10px auto !important;
  padding: 0 10px !important;

  box-sizing: border-box !important;
  line-height: 46px !important;
}

/* 再入院ボタン */
body:has(#discharge-month-input) table td:nth-child(7) button,
body:has(#discharge-month-input) table td:nth-child(7) input[type="submit"],
body:has(#discharge-month-input) table td:nth-child(7) a.button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 160px !important;
  min-width: 160px !important;
  max-width: 160px !important;

  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;

  margin: 6px auto !important;
  padding: 0 10px !important;

  box-sizing: border-box !important;

  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;

  line-height: 1.2 !important;
  text-align: center !important;
  font-size: 16px !important;
}

/* 行のズレを減らす */
body:has(#discharge-month-input) table th,
body:has(#discharge-month-input) table td {
  box-sizing: border-box !important;
  vertical-align: top !important;
}

/* ===== discharged-table-align-202607071039 END ===== */


/* ===== discharged-search-form-fix-202607071041 START ===== */

/* 退院患者一覧の検索欄だけを整える */
.discharged-patients-search-form {
  display: grid !important;
  grid-template-columns:
    minmax(520px, 1fr)
    128px
    90px
    90px !important;

  gap: 12px 16px !important;
  align-items: end !important;

  width: 100% !important;
  box-sizing: border-box !important;
}

/* 名前欄 */
.discharged-patients-search-form
label:first-child {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.discharged-patients-search-form
input[name="patient_name"] {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 46px !important;
  box-sizing: border-box !important;
}

/* 退院年月欄 */
.discharged-patients-search-form
.native-month-no-fake-label {
  display: block !important;
  width: 128px !important;
  min-width: 128px !important;
  max-width: 128px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.discharged-patients-search-form
#discharge-month-input {
  display: block !important;
  width: 128px !important;
  min-width: 128px !important;
  max-width: 128px !important;

  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;

  margin: 6px 0 0 0 !important;
  padding: 0 10px !important;

  box-sizing: border-box !important;
  line-height: 46px !important;
}

/* 検索・クリアボタンを横に並べる */
.discharged-patients-search-form
.discharged-search-buttons {
  display: contents !important;
}

.discharged-patients-search-form
.discharged-search-buttons
button[type="submit"],
.discharged-patients-search-form
.discharged-search-buttons
a.button {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;

  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;

  margin: 0 !important;
  padding: 0 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* 以前の疑似カレンダーボタンは検索欄では無効化 */
.discharged-patients-search-form
.month-real-button-wrap,
.discharged-patients-search-form
.month-real-button-open,
.discharged-patients-search-form
.discharge-month-native-like-date-wrap,
.discharged-patients-search-form
.discharge-month-native-like-date-icon {
  display: none !important;
}

/* ===== discharged-search-form-fix-202607071041 END ===== */


/* ===== month-input-bg-icon-202607071045 START ===== */

/* 退院年月だけ。buttonは作らない */
.discharged-patients-search-form
#discharge-month-input.month-input-bg-icon {
  display: block !important;

  width: 128px !important;
  min-width: 128px !important;
  max-width: 128px !important;

  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;

  margin: 6px 0 0 0 !important;
  padding: 0 34px 0 10px !important;

  box-sizing: border-box !important;
  line-height: 46px !important;

  background-color: #fff !important;

  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;

  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 18px 18px !important;

  cursor: pointer !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
  color-scheme: light !important;
}

/* 標準アイコンは透明にして、クリック領域だけ残す */
.discharged-patients-search-form
#discharge-month-input.month-input-bg-icon::-webkit-calendar-picker-indicator {
  display: block !important;
  opacity: 0 !important;
  visibility: visible !important;

  width: 28px !important;
  height: 28px !important;

  margin: 0 !important;
  padding: 0 !important;

  cursor: pointer !important;
  pointer-events: auto !important;
}

/* 過去の疑似アイコン・ボタンは検索欄では無効 */
.discharged-patients-search-form
.month-real-button-wrap,
.discharged-patients-search-form
.month-real-button-open,
.discharged-patients-search-form
.discharge-month-native-like-date-wrap,
.discharged-patients-search-form
.discharge-month-native-like-date-icon {
  display: none !important;
}

/* ===== month-input-bg-icon-202607071045 END ===== */


/* ===== month-native-like-readmission-202607071052 START ===== */

/*
  退院年月は、再入院日と同じく
  ブラウザ標準の入力アイコンを使う。
  背景画像・疑似ボタンは使わない。
*/

.discharged-patients-search-form
#discharge-month-input[type="month"] {
  display: block !important;

  width: 128px !important;
  min-width: 128px !important;
  max-width: 128px !important;

  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;

  margin: 6px 0 0 0 !important;
  padding: 0 10px !important;

  box-sizing: border-box !important;
  line-height: 46px !important;

  background-color: #fff !important;
  background-image: none !important;

  color: #0f172a !important;
  cursor: pointer !important;

  appearance: auto !important;
  -webkit-appearance: auto !important;
  color-scheme: light !important;

  caret-color: auto !important;
  user-select: auto !important;
}

/* 本物の標準カレンダーアイコンを表示 */
.discharged-patients-search-form
#discharge-month-input[type="month"]::-webkit-calendar-picker-indicator {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;

  width: 18px !important;
  height: 18px !important;

  margin: 0 !important;
  padding: 0 !important;

  cursor: pointer !important;
  pointer-events: auto !important;

  position: static !important;
}

/* 過去の飾りアイコン・疑似ボタンを停止 */
.discharged-patients-search-form
.month-real-button-wrap,
.discharged-patients-search-form
.month-real-button-open,
.discharged-patients-search-form
.discharge-month-native-like-date-wrap,
.discharged-patients-search-form
.discharge-month-native-like-date-icon {
  display: none !important;
}

/* ===== month-native-like-readmission-202607071052 END ===== */


/* ===== month-native-no-js-final-202607071054 START ===== */

/*
  退院年月は、再入院日と同じ思想で
  ブラウザ標準の picker indicator だけを使う。
  背景画像・疑似ボタン・showPicker JS は使わない。
*/

.discharged-patients-search-form
#discharge-month-input[type="month"] {
  display: block !important;

  width: 128px !important;
  min-width: 128px !important;
  max-width: 128px !important;

  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;

  margin: 6px 0 0 0 !important;
  padding: 0 10px !important;

  box-sizing: border-box !important;
  line-height: 46px !important;

  background-color: #fff !important;
  background-image: none !important;

  color: #0f172a !important;
  cursor: pointer !important;

  appearance: auto !important;
  -webkit-appearance: auto !important;
  color-scheme: light !important;

  caret-color: auto !important;
  user-select: auto !important;
}

.discharged-patients-search-form
#discharge-month-input[type="month"]::-webkit-calendar-picker-indicator {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;

  width: auto !important;
  height: auto !important;

  margin: 0 !important;
  padding: 0 !important;

  cursor: pointer !important;
  pointer-events: auto !important;

  position: static !important;
}

/* 過去の退院年月用の飾り・疑似ボタンは停止 */
.discharged-patients-search-form
.month-real-button-wrap,
.discharged-patients-search-form
.month-real-button-open,
.discharged-patients-search-form
.discharge-month-native-like-date-wrap,
.discharged-patients-search-form
.discharge-month-native-like-date-icon {
  display: none !important;
}

/* ===== month-native-no-js-final-202607071054 END ===== */


/* ===== month-date-proxy-native-open-202607071057 START ===== */

/*
  退院年月は YYYY-MM のまま送信する。
  右端の📅だけ、開ける type="date" を透明で重ねる。
  再入院欄の button には触らない。
*/

.discharged-patients-search-form
.native-month-no-fake-label {
  display: block !important;
  width: 128px !important;
  min-width: 128px !important;
  max-width: 128px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.discharged-patients-search-form
.discharge-month-date-proxy-wrap {
  position: relative !important;
  display: block !important;

  width: 128px !important;
  min-width: 128px !important;
  max-width: 128px !important;

  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;

  margin: 6px 0 0 0 !important;
  padding: 0 !important;

  box-sizing: border-box !important;
}

.discharged-patients-search-form
#discharge-month-input.month-date-proxy-visible {
  display: block !important;

  width: 128px !important;
  min-width: 128px !important;
  max-width: 128px !important;

  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;

  margin: 0 !important;
  padding: 0 34px 0 10px !important;

  box-sizing: border-box !important;
  line-height: 46px !important;

  background-color: #fff !important;

  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;

  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 18px 18px !important;

  color: #0f172a !important;
  cursor: text !important;

  appearance: auto !important;
  -webkit-appearance: auto !important;
  color-scheme: light !important;
}

/* month 自体の標準アイコンは隠す */
.discharged-patients-search-form
#discharge-month-input.month-date-proxy-visible::-webkit-calendar-picker-indicator {
  opacity: 0 !important;
  visibility: hidden !important;
  display: none !important;
  pointer-events: none !important;
}

/* 右端だけ、透明な date input を置く */
.discharged-patients-search-form
#discharge-month-date-proxy.discharge-month-date-proxy {
  position: absolute !important;

  right: 4px !important;
  top: 6px !important;

  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;

  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;

  margin: 0 !important;
  padding: 0 !important;

  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;

  opacity: 0 !important;

  cursor: pointer !important;
  pointer-events: auto !important;

  z-index: 20 !important;

  appearance: auto !important;
  -webkit-appearance: auto !important;
  color-scheme: light !important;
}

.discharged-patients-search-form
#discharge-month-date-proxy.discharge-month-date-proxy::-webkit-calendar-picker-indicator {
  display: block !important;

  width: 34px !important;
  height: 34px !important;

  margin: 0 !important;
  padding: 0 !important;

  opacity: 1 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* 過去の疑似ボタン・spanは無効 */
.discharged-patients-search-form
.month-real-button-wrap,
.discharged-patients-search-form
.month-real-button-open,
.discharged-patients-search-form
.discharge-month-native-like-date-wrap,
.discharged-patients-search-form
.discharge-month-native-like-date-icon {
  display: none !important;
}

/* ===== month-date-proxy-native-open-202607071057 END ===== */


/* ===== month-date-proxy-click-fix-202607071100 START ===== */

/*
  透明 input 全体ではなく、
  右端の標準 date アイコンをクリックさせる。
  showPicker JS は使わない。
*/

.discharged-patients-search-form
#discharge-month-date-proxy.discharge-month-date-proxy {
  position: absolute !important;

  right: 4px !important;
  top: 6px !important;

  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;

  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;

  margin: 0 !important;
  padding: 0 !important;

  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;

  color: transparent !important;
  font-size: 0 !important;

  opacity: 1 !important;

  cursor: pointer !important;
  pointer-events: auto !important;

  z-index: 20 !important;

  appearance: auto !important;
  -webkit-appearance: auto !important;
  color-scheme: light !important;
}

.discharged-patients-search-form
#discharge-month-date-proxy.discharge-month-date-proxy::-webkit-calendar-picker-indicator {
  display: block !important;

  width: 34px !important;
  height: 34px !important;

  margin: 0 !important;
  padding: 0 !important;

  opacity: 0.01 !important;

  cursor: pointer !important;
  pointer-events: auto !important;
}

/* ===== month-date-proxy-click-fix-202607071100 END ===== */


/* ===== month-custom-panel-final-202607071102 START ===== */

/* 退院年月：自作年月パネル方式 */
.discharged-patients-search-form
#discharge-month-input.month-custom-panel-input {
  display: block !important;

  width: 128px !important;
  min-width: 128px !important;
  max-width: 128px !important;

  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;

  margin: 6px 0 0 0 !important;
  padding: 0 34px 0 10px !important;

  box-sizing: border-box !important;
  line-height: 46px !important;

  background-color: #fff !important;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 18px 18px !important;

  color: #0f172a !important;

  cursor: pointer !important;
  caret-color: transparent !important;
  user-select: none !important;
}

/* 古い透明date proxyは完全停止 */
.discharged-patients-search-form
#discharge-month-date-proxy,
.discharged-patients-search-form
.discharge-month-date-proxy,
.discharged-patients-search-form
.discharge-month-date-proxy-wrap,
.discharged-patients-search-form
.month-real-button-wrap,
.discharged-patients-search-form
.month-real-button-open,
.discharged-patients-search-form
.discharge-month-native-like-date-wrap,
.discharged-patients-search-form
.discharge-month-native-like-date-icon {
  display: none !important;
}

/* 自作年月パネル */
.discharge-month-panel-final {
  position: fixed !important;
  z-index: 99999 !important;

  width: 236px !important;
  padding: 12px !important;

  background: #fff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18) !important;

  box-sizing: border-box !important;

  color: #0f172a !important;
  font-size: 14px !important;
}

.discharge-month-panel-final * {
  box-sizing: border-box !important;
}

.discharge-month-panel-head-final {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin-bottom: 10px !important;
}

.discharge-month-panel-year-final {
  width: 132px !important;
  height: 36px !important;
  padding: 0 8px !important;

  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #fff !important;

  color: #0f172a !important;
  font-size: 14px !important;
}

.discharge-month-panel-close-final {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 34px !important;
  height: 34px !important;

  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #fff !important;

  cursor: pointer !important;
  user-select: none !important;
  line-height: 1 !important;
}

.discharge-month-panel-grid-final {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px !important;
}

.discharge-month-panel-month-final {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  height: 34px !important;

  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #fff !important;

  cursor: pointer !important;
  user-select: none !important;
  white-space: nowrap !important;

  font-size: 14px !important;
  line-height: 1 !important;
}

.discharge-month-panel-month-final:hover,
.discharge-month-panel-month-final.is-selected {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 700 !important;
}

/* ===== month-custom-panel-final-202607071102 END ===== */


/* ===== month-inline-panel-pointer-fix-202607071103 START ===== */

.discharged-patients-search-form
#discharge-month-input.month-custom-panel-input {
  pointer-events: auto !important;
  position: relative !important;
  z-index: 5 !important;
  cursor: pointer !important;
}

/* 自作年月パネルのボタンを必ずクリック可能にする */
.discharge-month-panel-final,
.discharge-month-panel-final * {
  pointer-events: auto !important;
}

.discharge-month-panel-close-final,
.discharge-month-panel-month-final,
.discharge-month-panel-year-final {
  cursor: pointer !important;
}

/* ===== month-inline-panel-pointer-fix-202607071103 END ===== */


/* ===== search-card-width-202607071106 START ===== */

/*
  退院患者一覧の中央検索カードだけを、
  上下のカード幅に合わせる。
  入力欄・再入院欄・年月pickerには触らない。
*/

.card.discharged-search-card {
  width: 100% !important;
  max-width: 100% !important;

  margin-left: 0 !important;
  margin-right: 0 !important;

  box-sizing: border-box !important;
}

/* 検索カード内のフォームはカード幅に合わせる */
.card.discharged-search-card
.discharged-patients-search-form {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* ===== search-card-width-202607071106 END ===== */


/* ===== search-card-overflow-fix-202607071108 START ===== */

/*
  直前の width:100% 指定で検索カードが
  右へはみ出したため、中央寄せ幅へ戻す。
  退院年月picker・再入院欄には触らない。
*/

.card.discharged-search-card {
  width: auto !important;
  max-width: 1180px !important;

  margin-left: auto !important;
  margin-right: auto !important;

  box-sizing: border-box !important;
}

/* 検索カード内だけはカード内幅いっぱいにする */
.card.discharged-search-card
.discharged-patients-search-form {
  width: 100% !important;
  max-width: 100% !important;

  box-sizing: border-box !important;
}

/* 入力欄とボタンがカード外へ出ないようにする */
.card.discharged-search-card
.discharged-patients-search-form {
  grid-template-columns:
    minmax(360px, 1fr)
    128px
    90px
    90px !important;

  gap: 12px 16px !important;
}

/* 小さい画面では折り返してはみ出し防止 */
@media (max-width: 900px) {
  .card.discharged-search-card
  .discharged-patients-search-form {
    grid-template-columns: 1fr !important;
  }

  .card.discharged-search-card
  .native-month-no-fake-label,
  .card.discharged-search-card
  #discharge-month-input {
    width: 100% !important;
    max-width: 100% !important;
  }

  .card.discharged-search-card
  .discharged-search-buttons {
    display: flex !important;
    gap: 12px !important;
  }
}

/* ===== search-card-overflow-fix-202607071108 END ===== */

/* ===== discharge-month-manual-input-202607080350 START ===== */

.discharge-month-manual-wrap {
  position: relative !important;
  display: inline-block !important;
  width: 126px !important;
  min-width: 126px !important;
  max-width: 126px !important;
}

#discharge-month-input.discharge-month-manual-input {
  width: 126px !important;
  min-width: 126px !important;
  max-width: 126px !important;
  height: 46px !important;
  box-sizing: border-box !important;
  padding: 0 38px 0 12px !important;
  font-size: 16px !important;
  line-height: 46px !important;
  border: 1px solid #b9c8dc !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #001a3a !important;
  pointer-events: auto !important;
  user-select: text !important;
  cursor: text !important;
}

.discharge-month-panel-button {
  position: absolute !important;
  right: 6px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 30px !important;
  height: 30px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #001a3a !important;
  font-size: 17px !important;
  line-height: 30px !important;
  text-align: center !important;
  cursor: pointer !important;
  box-shadow: none !important;
}

.discharge-month-panel-button:hover,
.discharge-month-panel-button:focus {
  background: #eef4ff !important;
  border-radius: 6px !important;
  outline: none !important;
}

/* ===== discharge-month-manual-input-202607080350 END ===== */

/* ===== discharge-month-true-manual-v2-202607080353 START ===== */

.discharge-month-typed-wrap {
  position: relative !important;
  display: inline-block !important;
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;
}

#discharge-month-typed-input.discharge-month-typed-input {
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;
  height: 46px !important;
  box-sizing: border-box !important;
  padding: 0 40px 0 12px !important;
  font-size: 16px !important;
  line-height: 46px !important;
  border: 1px solid #b9c8dc !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #001a3a !important;
  pointer-events: auto !important;
  user-select: text !important;
  cursor: text !important;
  ime-mode: disabled !important;
}

#discharge-month-typed-input.discharge-month-typed-input:focus {
  outline: 2px solid #2f7cff !important;
  outline-offset: 2px !important;
  border-color: #2f7cff !important;
}

.discharge-month-typed-button {
  position: absolute !important;
  right: 6px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 30px !important;
  height: 30px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #001a3a !important;
  font-size: 17px !important;
  line-height: 30px !important;
  text-align: center !important;
  cursor: pointer !important;
  box-shadow: none !important;
}

.discharge-month-typed-button:hover,
.discharge-month-typed-button:focus {
  background: #eef4ff !important;
  border-radius: 6px !important;
  outline: none !important;
}

.discharge-month-v2-panel {
  position: absolute !important;
  z-index: 999999 !important;
  background: #fff !important;
  border: 1px solid #b9c8dc !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.18) !important;
  padding: 10px !important;
  width: 230px !important;
}

.discharge-month-v2-panel-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px !important;
  font-weight: 700 !important;
}

.discharge-month-v2-panel button {
  cursor: pointer !important;
}

.discharge-month-v2-nav {
  width: 34px !important;
  height: 30px !important;
  border: 1px solid #b9c8dc !important;
  border-radius: 8px !important;
  background: #fff !important;
}

.discharge-month-v2-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
}

.discharge-month-v2-month {
  height: 34px !important;
  border: 1px solid #b9c8dc !important;
  border-radius: 8px !important;
  background: #fff !important;
  font-weight: 700 !important;
}

.discharge-month-v2-month:hover {
  background: #eef4ff !important;
}

/* ===== discharge-month-true-manual-v2-202607080353 END ===== */

/* ===== discharge-month-final-one-input-202607080358 START ===== */

/* 古い退院年月UIは念のため非表示 */
.discharge-month-manual-wrap,
.discharge-month-typed-wrap {
  display: none !important;
}

.discharge-month-final-wrap {
  position: relative !important;
  display: inline-block !important;
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;
  height: 46px !important;
  vertical-align: bottom !important;
}

#discharge-month-final-input.discharge-month-final-input {
  display: block !important;
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;
  height: 46px !important;
  box-sizing: border-box !important;
  padding: 0 40px 0 12px !important;
  font-size: 16px !important;
  line-height: 46px !important;
  border: 1px solid #b9c8dc !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #001a3a !important;
  pointer-events: auto !important;
  user-select: text !important;
  cursor: text !important;
}

#discharge-month-final-input.discharge-month-final-input:focus {
  outline: 2px solid #2f7cff !important;
  outline-offset: 2px !important;
  border-color: #2f7cff !important;
}

.discharge-month-final-button {
  position: absolute !important;
  right: 6px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 30px !important;
  height: 30px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #001a3a !important;
  font-size: 17px !important;
  line-height: 30px !important;
  text-align: center !important;
  cursor: pointer !important;
  box-shadow: none !important;
}

.discharge-month-final-button:hover,
.discharge-month-final-button:focus {
  background: #eef4ff !important;
  border-radius: 6px !important;
  outline: none !important;
}

.discharge-month-final-panel {
  position: absolute !important;
  left: 0 !important;
  top: 54px !important;
  z-index: 999999 !important;
  width: 230px !important;
  padding: 10px !important;
  background: #fff !important;
  border: 1px solid #b9c8dc !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.18) !important;
}

.discharge-month-final-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px !important;
  font-weight: 700 !important;
}

.discharge-month-final-nav {
  width: 34px !important;
  height: 30px !important;
  border: 1px solid #b9c8dc !important;
  border-radius: 8px !important;
  background: #fff !important;
  cursor: pointer !important;
}

.discharge-month-final-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
}

.discharge-month-final-month {
  height: 34px !important;
  border: 1px solid #b9c8dc !important;
  border-radius: 8px !important;
  background: #fff !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

.discharge-month-final-month:hover {
  background: #eef4ff !important;
}

/* ===== discharge-month-final-one-input-202607080358 END ===== */

/* ===== discharge-month-clean-split-202607080400 START ===== */

/* 旧退院年月UIは非表示 */
.discharge-month-manual-wrap,
.discharge-month-typed-wrap,
.discharge-month-final-wrap {
  display: none !important;
}

/* 検索カードの縦スクロール崩れ対策 */
.card:has(#discharge-month-clean-hidden),
form:has(#discharge-month-clean-hidden),
label:has(#discharge-month-clean-hidden) {
  overflow: visible !important;
  max-height: none !important;
}

/* 退院年月の外枠 */
.discharge-month-clean-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;
  height: 46px !important;
  box-sizing: border-box !important;
  padding: 0 38px 0 12px !important;
  border: 1px solid #b9c8dc !important;
  border-radius: 10px !important;
  background: #fff !important;
  vertical-align: bottom !important;
  overflow: visible !important;
}

/* 年入力 */
.discharge-month-clean-year {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 42px !important;
  padding: 0 !important;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  color: #001a3a !important;
  font-size: 16px !important;
  line-height: 42px !important;
  text-align: left !important;
  box-shadow: none !important;
}

/* 固定スラッシュ */
.discharge-month-clean-slash {
  display: inline-block !important;
  width: 8px !important;
  min-width: 8px !important;
  max-width: 8px !important;
  height: 42px !important;
  line-height: 42px !important;
  color: #001a3a !important;
  font-size: 16px !important;
  text-align: center !important;
  user-select: none !important;
  pointer-events: none !important;
}

/* 月入力 */
.discharge-month-clean-month {
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  height: 42px !important;
  padding: 0 !important;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  color: #001a3a !important;
  font-size: 16px !important;
  line-height: 42px !important;
  text-align: left !important;
  box-shadow: none !important;
}

/* フォーカス時 */
.discharge-month-clean-wrap:focus-within {
  outline: 2px solid #2f7cff !important;
  outline-offset: 2px !important;
  border-color: #2f7cff !important;
}

/* カレンダーボタン */
.discharge-month-clean-button {
  position: absolute !important;
  right: 6px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 28px !important;
  height: 30px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #001a3a !important;
  font-size: 17px !important;
  line-height: 30px !important;
  text-align: center !important;
  cursor: pointer !important;
  box-shadow: none !important;
}

.discharge-month-clean-button:hover,
.discharge-month-clean-button:focus {
  background: #eef4ff !important;
  border-radius: 6px !important;
  outline: none !important;
}

/* 年月パネルは body 直下に固定表示 */
.discharge-month-clean-panel {
  position: fixed !important;
  z-index: 999999 !important;
  width: 230px !important;
  padding: 10px !important;
  background: #fff !important;
  border: 1px solid #b9c8dc !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.18) !important;
}

.discharge-month-clean-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px !important;
  font-weight: 700 !important;
}

.discharge-month-clean-nav {
  width: 34px !important;
  height: 30px !important;
  border: 1px solid #b9c8dc !important;
  border-radius: 8px !important;
  background: #fff !important;
  cursor: pointer !important;
}

.discharge-month-clean-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
}

.discharge-month-clean-month-btn {
  height: 34px !important;
  border: 1px solid #b9c8dc !important;
  border-radius: 8px !important;
  background: #fff !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

.discharge-month-clean-month-btn:hover {
  background: #eef4ff !important;
}

/* ===== discharge-month-clean-split-202607080400 END ===== */

/* ===== discharge-month-clean-layout-fix-202607080404 START ===== */

/* 退院患者一覧ページ全体の横幅をそろえる */
body:has(#discharge-month-clean-hidden) main {
  width: 100% !important;
  max-width: 1180px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}

/* 上の説明カード、検索カード、一覧表の幅をそろえる */
body:has(#discharge-month-clean-hidden) main > .card,
body:has(#discharge-month-clean-hidden) main > form,
body:has(#discharge-month-clean-hidden) main > .table-wrap,
body:has(#discharge-month-clean-hidden) main > .table-card,
body:has(#discharge-month-clean-hidden) main > table {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

/* 検索カードは横並びを固定 */
body:has(#discharge-month-clean-hidden) form:has(#discharge-month-clean-hidden) {
  display: grid !important;
  grid-template-columns:
    minmax(0, 1fr)
    132px
    92px
    92px !important;
  column-gap: 14px !important;
  row-gap: 12px !important;
  align-items: end !important;
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
  box-sizing: border-box !important;
}

/* 検索タイトル */
body:has(#discharge-month-clean-hidden) form:has(#discharge-month-clean-hidden) h2,
body:has(#discharge-month-clean-hidden) form:has(#discharge-month-clean-hidden) h3 {
  grid-column: 1 / -1 !important;
  margin-bottom: 4px !important;
}

/* 名前欄 */
body:has(#discharge-month-clean-hidden) form:has(#discharge-month-clean-hidden) label:first-of-type {
  grid-column: 1 / 2 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* 名前入力欄 */
body:has(#discharge-month-clean-hidden) form:has(#discharge-month-clean-hidden) label:first-of-type input {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

/* 退院年月欄 */
body:has(#discharge-month-clean-hidden) .native-month-no-fake-label {
  grid-column: 2 / 3 !important;
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;
  overflow: visible !important;
}

/* 検索・クリアボタン */
body:has(#discharge-month-clean-hidden) .discharged-search-buttons {
  grid-column: 3 / 5 !important;
  display: flex !important;
  gap: 12px !important;
  align-items: end !important;
  justify-content: flex-start !important;
  width: auto !important;
  overflow: visible !important;
}

/* ボタン幅を固定 */
body:has(#discharge-month-clean-hidden) .discharged-search-buttons button,
body:has(#discharge-month-clean-hidden) .discharged-search-buttons .button {
  width: 92px !important;
  min-width: 92px !important;
  max-width: 92px !important;
  height: 48px !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

/* 検索カード周辺の縦スクロール崩れを止める */
body:has(#discharge-month-clean-hidden) form:has(#discharge-month-clean-hidden),
body:has(#discharge-month-clean-hidden) form:has(#discharge-month-clean-hidden) *,
body:has(#discharge-month-clean-hidden) .card:has(#discharge-month-clean-hidden) {
  overflow: visible !important;
}

/* 退院年月入力欄 */
body:has(#discharge-month-clean-hidden) .discharge-month-clean-wrap {
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;
  height: 46px !important;
  overflow: visible !important;
  flex-wrap: nowrap !important;
}

/* 年・月の中身がずれないようにする */
body:has(#discharge-month-clean-hidden) .discharge-month-clean-year {
  width: 45px !important;
  min-width: 45px !important;
  max-width: 45px !important;
  text-align: left !important;
}

body:has(#discharge-month-clean-hidden) .discharge-month-clean-slash {
  width: 9px !important;
  min-width: 9px !important;
  max-width: 9px !important;
  text-align: center !important;
}

body:has(#discharge-month-clean-hidden) .discharge-month-clean-month {
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  text-align: left !important;
}

/* カレンダーパネル本体 */
body:has(#discharge-month-clean-hidden) .discharge-month-clean-panel {
  position: fixed !important;
  z-index: 999999 !important;
  width: 230px !important;
  min-width: 230px !important;
  max-width: 230px !important;
  padding: 10px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

/* カレンダーのヘッダー */
body:has(#discharge-month-clean-hidden) .discharge-month-clean-head {
  display: grid !important;
  grid-template-columns: 34px 1fr 34px !important;
  gap: 8px !important;
  align-items: center !important;
}

/* 前年・翌年ボタン */
body:has(#discharge-month-clean-hidden) .discharge-month-clean-nav {
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* 月ボタンのグリッド */
body:has(#discharge-month-clean-hidden) .discharge-month-clean-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

/* 月ボタンがはみ出さないようにする */
body:has(#discharge-month-clean-hidden) .discharge-month-clean-grid > button.discharge-month-clean-month-btn {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 42px !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: normal !important;
  line-height: 1.15 !important;
  text-align: center !important;
}

/* 旧パネルが残っても出ないようにする */
body:has(#discharge-month-clean-hidden) .discharge-month-final-panel,
body:has(#discharge-month-clean-hidden) .discharge-month-v2-panel {
  display: none !important;
}

/* ===== discharge-month-clean-layout-fix-202607080404 END ===== */

/* ===== discharged-sort-save-safe-202607091341 START ===== */

body:has(#discharge-month-clean-hidden) .discharged-sort-toolbar {
  width: 100% !important;
  max-width: 1180px !important;
  margin: 12px auto 10px auto !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 12px !important;
  box-sizing: border-box !important;
}

body:has(#discharge-month-clean-hidden) .discharged-sort-help {
  color: #667085 !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}

body:has(#discharge-month-clean-hidden) .discharged-sort-save-button {
  height: 42px !important;
  min-width: 138px !important;
  padding: 0 16px !important;
  border: 1px solid #1f6feb !important;
  border-radius: 10px !important;
  background: #1f6feb !important;
  color: #fff !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  white-space: nowrap !important;
}

body:has(#discharge-month-clean-hidden) .discharged-sort-table tbody tr {
  cursor: grab !important;
}

body:has(#discharge-month-clean-hidden) .discharged-sort-table tbody tr:active {
  cursor: grabbing !important;
}

body:has(#discharge-month-clean-hidden) .discharged-row-dragging {
  opacity: 0.55 !important;
  outline: 2px dashed #1f6feb !important;
  outline-offset: -2px !important;
}

body:has(#discharge-month-clean-hidden) .discharged-row-drag-over {
  box-shadow: inset 0 3px 0 #1f6feb !important;
}

/* ===== discharged-sort-save-safe-202607091341 END ===== */


/* duplicate-patient-confirm-panel-css-202607091553 */
.duplicate-patient-panel {
  margin: 18px 0 24px 0 !important;
  padding: 18px !important;
  border: 2px solid #f59e0b !important;
  border-radius: 14px !important;
  background: #fff7ed !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10) !important;
}

.duplicate-patient-panel h3 {
  margin: 0 0 10px 0 !important;
  font-size: 20px !important;
  font-weight: 800 !important;
}

.duplicate-patient-lead {
  color: #b91c1c !important;
  font-weight: 700 !important;
  line-height: 1.8 !important;
}

.duplicate-patient-table-wrap {
  overflow-x: auto !important;
  margin-top: 12px !important;
}

.duplicate-patient-table {
  width: 100% !important;
  border-collapse: collapse !important;
  background: #ffffff !important;
}

.duplicate-patient-table th,
.duplicate-patient-table td {
  border: 1px solid #e5e7eb !important;
  padding: 10px !important;
  text-align: left !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

.duplicate-patient-table th {
  background: #f3f4f6 !important;
  font-weight: 800 !important;
}

.duplicate-patient-same-name-box {
  margin-top: 16px !important;
  padding: 14px !important;
  border: 1px dashed #f97316 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
}

.duplicate-patient-same-name-box h4 {
  margin: 0 0 8px 0 !important;
  font-size: 17px !important;
  font-weight: 800 !important;
}

.duplicate-patient-panel .btn.small {
  display: inline-block !important;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  background: #2563eb !important;
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 700 !important;
}


/* duplicate-readmit-form-css-202607091612 */
.duplicate-readmit-form {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  align-items: stretch !important;
  max-width: 150px !important;
}

.duplicate-readmit-date {
  display: block !important;
  font-weight: 700 !important;
  white-space: normal !important;
}

.duplicate-readmit-date input {
  width: 130px !important;
  max-width: 130px !important;
  margin-top: 6px !important;
}

.duplicate-readmit-btn {
  width: 110px !important;
  min-height: 46px !important;
  white-space: normal !important;
  line-height: 1.35 !important;
  text-align: center !important;
  font-weight: 800 !important;
}

/* ===== duplicate-patient-table-readmit-layout-fix-202607100315 START ===== */

table.duplicate-patient-table th,
table.duplicate-patient-table td {
  vertical-align: top !important;
}

table.duplicate-patient-table td.discharged-actions {
  width: 170px !important;
  min-width: 170px !important;
  white-space: normal !important;
  vertical-align: top !important;
}

table.duplicate-patient-table td.discharged-actions form {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 10px !important;
  margin: 0 !important;
}

table.duplicate-patient-table td.discharged-actions .readmit-date-label {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 6px !important;
  margin: 0 !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

table.duplicate-patient-table td.discharged-actions .readmit-date-label input[type="date"] {
  width: 124px !important;
  min-width: 124px !important;
  max-width: 124px !important;
  box-sizing: border-box !important;
}

table.duplicate-patient-table td.discharged-actions .readmit-buttons {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 10px !important;
  width: 100% !important;
}

table.duplicate-patient-table td.discharged-actions .readmit-buttons button,
table.duplicate-patient-table td.discharged-actions .duplicate-readmit-btn,
table.duplicate-patient-table td.discharged-actions button[type="submit"] {
  width: 96px !important;
  min-width: 96px !important;
  text-align: center !important;
  white-space: normal !important;
  line-height: 1.35 !important;
}

/* ===== duplicate-patient-table-readmit-layout-fix-202607100315 END ===== */


/* ===== duplicate-readmit-layout-retry-202607100319 START ===== */

/*
   同じ氏名確認パネルの再入院操作を、
   退院患者一覧と同じ見た目に寄せる。
*/

.duplicate-patient-panel .duplicate-patient-table {
  table-layout: fixed !important;
  width: 100% !important;
}

.duplicate-patient-panel .duplicate-patient-table th,
.duplicate-patient-panel .duplicate-patient-table td {
  vertical-align: top !important;
}

.duplicate-patient-panel .duplicate-patient-table th:nth-child(1),
.duplicate-patient-panel .duplicate-patient-table td:nth-child(1) {
  width: 60px !important;
}

.duplicate-patient-panel .duplicate-patient-table th:nth-child(2),
.duplicate-patient-panel .duplicate-patient-table td:nth-child(2) {
  width: 150px !important;
}

.duplicate-patient-panel .duplicate-patient-table th:nth-child(3),
.duplicate-patient-panel .duplicate-patient-table td:nth-child(3) {
  width: 130px !important;
}

.duplicate-patient-panel .duplicate-patient-table th:nth-child(4),
.duplicate-patient-panel .duplicate-patient-table td:nth-child(4) {
  width: 160px !important;
}

.duplicate-patient-panel .duplicate-patient-table th:nth-child(5),
.duplicate-patient-panel .duplicate-patient-table td:nth-child(5) {
  width: 90px !important;
}

.duplicate-patient-panel .duplicate-patient-table th:nth-child(6),
.duplicate-patient-panel .duplicate-patient-table td:nth-child(6),
.duplicate-patient-panel .duplicate-patient-table th:nth-child(7),
.duplicate-patient-panel .duplicate-patient-table td:nth-child(7) {
  width: 130px !important;
}

.duplicate-patient-panel .duplicate-patient-table th:nth-child(8),
.duplicate-patient-panel .duplicate-patient-table td:nth-child(8) {
  width: 190px !important;
  min-width: 190px !important;
}

.duplicate-patient-panel td.discharged-actions {
  width: 190px !important;
  min-width: 190px !important;
  padding-top: 22px !important;
  text-align: center !important;
  white-space: normal !important;
}

.duplicate-patient-panel td.discharged-actions form {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  margin: 0 auto !important;
  width: 150px !important;
}

.duplicate-patient-panel td.discharged-actions .readmit-date-label {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  width: 150px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  text-align: center !important;
}

.duplicate-patient-panel td.discharged-actions input[type="date"] {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  height: 46px !important;
  box-sizing: border-box !important;
  font-size: 16px !important;
}

.duplicate-patient-panel td.discharged-actions .readmit-buttons {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 10px !important;
  width: 150px !important;
}

.duplicate-patient-panel td.discharged-actions .readmit-buttons button {
  width: 112px !important;
  min-width: 112px !important;
  max-width: 112px !important;
  min-height: 64px !important;
  white-space: normal !important;
  text-align: center !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
}

/* ===== duplicate-readmit-layout-retry-202607100319 END ===== */


/* ===== duplicate-panel-match-discharged-list-202607100322 START ===== */

/*
   同じ氏名確認パネルを
   退院患者一覧の列構成に合わせる。
*/

.duplicate-patient-panel .duplicate-patient-table {
  width: 100% !important;
  table-layout: fixed !important;
}

.duplicate-patient-panel .duplicate-patient-table th,
.duplicate-patient-panel .duplicate-patient-table td {
  vertical-align: top !important;
}

.duplicate-patient-panel .duplicate-patient-table th:nth-child(1),
.duplicate-patient-panel .duplicate-patient-table td:nth-child(1) {
  width: 220px !important;
}

.duplicate-patient-panel .duplicate-patient-table th:nth-child(2),
.duplicate-patient-panel .duplicate-patient-table td:nth-child(2) {
  width: 100px !important;
}

.duplicate-patient-panel .duplicate-patient-table th:nth-child(3),
.duplicate-patient-panel .duplicate-patient-table td:nth-child(3) {
  width: 130px !important;
}

.duplicate-patient-panel .duplicate-patient-table th:nth-child(4),
.duplicate-patient-panel .duplicate-patient-table td:nth-child(4) {
  width: 150px !important;
}

.duplicate-patient-panel .duplicate-patient-table th:nth-child(5),
.duplicate-patient-panel .duplicate-patient-table td:nth-child(5) {
  width: 150px !important;
}

.duplicate-patient-panel .duplicate-patient-table th:nth-child(6),
.duplicate-patient-panel .duplicate-patient-table td:nth-child(6) {
  width: auto !important;
}

.duplicate-patient-panel .duplicate-patient-table th:nth-child(7),
.duplicate-patient-panel .duplicate-patient-table td:nth-child(7) {
  width: 210px !important;
  min-width: 210px !important;
  text-align: center !important;
}

.duplicate-patient-panel td.discharged-actions {
  width: 210px !important;
  min-width: 210px !important;
  padding-top: 22px !important;
  text-align: center !important;
  white-space: normal !important;
}

.duplicate-patient-panel td.discharged-actions form {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 10px !important;
  width: 170px !important;
  margin: 0 auto !important;
}

.duplicate-patient-panel td.discharged-actions .readmit-date-label {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  width: 170px !important;
  margin: 0 !important;
  font-weight: 700 !important;
  text-align: center !important;
}

.duplicate-patient-panel td.discharged-actions input[type="date"],
.duplicate-patient-panel td.discharged-actions input[name="admission_date"] {
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;
  height: 46px !important;
  box-sizing: border-box !important;
  font-size: 16px !important;
}

.duplicate-patient-panel td.discharged-actions .readmit-buttons {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 10px !important;
  width: 170px !important;
}

.duplicate-patient-panel td.discharged-actions .readmit-buttons button {
  width: 112px !important;
  min-width: 112px !important;
  max-width: 112px !important;
  min-height: 64px !important;
  white-space: normal !important;
  line-height: 1.35 !important;
  text-align: center !important;
  font-weight: 700 !important;
}

/* ===== duplicate-panel-match-discharged-list-202607100322 END ===== */


/* ===== patient-management-panel-width-match-202607100402 START ===== */

/*
   患者管理画面で、
   同じ氏名確認パネルと患者追加フォームの横幅を、
   下の患者一覧テーブル幅に合わせる。
*/

.duplicate-patient-panel {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

.duplicate-patient-panel > table,
.duplicate-patient-panel table,
.duplicate-patient-panel .discharged-patient-list,
.duplicate-patient-panel .discharged-sort-table {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

.duplicate-patient-panel + h3,
.duplicate-patient-panel + h4 {
  width: 100% !important;
  max-width: none !important;
}

/*
   患者追加フォーム側。
   既存の card / panel / form 系クラスを広めに対象にする。
*/

form[action*="save_patient"],
form[action*="patients"],
.patient-form,
.patient-add-form,
.patient-add-panel,
.patient-add-card,
.master-form,
.master-edit-form,
.card:has(input[name="patient_name"]),
.panel:has(input[name="patient_name"]) {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

/*
   患者追加の白い枠が form ではなく
   親div側に付いている場合も効かせる。
*/

div:has(> h3):has(input[name="patient_name"]),
div:has(> h4):has(input[name="patient_name"]),
section:has(input[name="patient_name"]) {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

/*
   下の患者一覧テーブルと同じく、
   中の入力欄は横幅を自然に保つ。
*/

input[name="patient_name"],
input[name="patient_kana"],
input[name="hospital_patient_id"] {
  box-sizing: border-box !important;
}

/* ===== patient-management-panel-width-match-202607100402 END ===== */


/* ===== patient-card-table-same-width-202607100407 START ===== */

/*
   患者管理画面の
   患者追加カードと患者一覧テーブルの幅を統一する。
*/

body .patient-master-edit-card,
body table.discharged-sort-table {
  width: 900px !important;
  min-width: 900px !important;
  max-width: 900px !important;
  box-sizing: border-box !important;
}

/*
   中身のフォームはカード幅いっぱいに使う。
*/

body .patient-master-edit-card form {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

body .patient-master-edit-card .formgrid {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

body .patient-master-edit-card label {
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body .patient-master-edit-card input,
body .patient-master-edit-card select,
body .patient-master-edit-card textarea {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

/* ===== patient-card-table-same-width-202607100407 END ===== */


/* ===== patient-card-table-center-760-202607100408 START ===== */

/*
   患者管理画面の
   患者追加カードと患者一覧テーブルを
   同じ幅・同じ中央位置にそろえる。
*/

body .patient-master-edit-card,
body table.discharged-sort-table {
  width: 900px !important;
  min-width: 900px !important;
  max-width: 900px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

body .patient-master-edit-card form {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

body .patient-master-edit-card .formgrid {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

body .patient-master-edit-card input,
body .patient-master-edit-card select,
body .patient-master-edit-card textarea {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

/* ===== patient-card-table-center-760-202607100408 END ===== */


/* ===== patient-card-table-width-900-final-202607100410 START ===== */

/*
   患者管理画面：
   患者追加カードと患者一覧テーブルを
   同じ幅にそろえる。
*/

body .patient-master-edit-card,
body table.discharged-sort-table {
  width: 900px !important;
  min-width: 900px !important;
  max-width: 900px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

body .patient-master-edit-card form {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

body .patient-master-edit-card .formgrid {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
  box-sizing: border-box !important;
}

body .patient-master-edit-card input,
body .patient-master-edit-card select,
body .patient-master-edit-card textarea {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

/* ===== patient-card-table-width-900-final-202607100410 END ===== */


/* ===== patient-list-name-column-wide-202607100418 START ===== */

/*
   患者管理の下部一覧で、
   「名前」列を広げる。
*/

form#patient-sort-form table.list th:nth-child(3),
form#patient-sort-form table.list td:nth-child(3),
table.patient-sort-table th:nth-child(3),
table.patient-sort-table td:nth-child(3),
table.list th:nth-child(3),
table.list td:nth-child(3) {
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
  white-space: normal !important;
  box-sizing: border-box !important;
}

/*
   名前欄の中の文字を読みやすくする。
*/

form#patient-sort-form table.list td:nth-child(3),
table.patient-sort-table td:nth-child(3) {
  line-height: 1.45 !important;
  vertical-align: middle !important;
}

/* ===== patient-list-name-column-wide-202607100418 END ===== */


/* ===== patient-input-card-match-duplicate-202607100442 START ===== */

/*
   患者別入力ページの
   下の入力カード幅を、
   上の同じ氏名確認カードに合わせる。
*/

body .patient-input-wide-card {
  width: 100% !important;
  max-width: none !important;
  margin: 0 0 18px 0 !important;
  box-sizing: border-box !important;
}

body .patient-input-wide-card form {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

body .patient-input-wide-card .formgrid {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

body .patient-input-wide-card input,
body .patient-input-wide-card select,
body .patient-input-wide-card textarea {
  box-sizing: border-box !important;
}

/* ===== patient-input-card-match-duplicate-202607100442 END ===== */


/* ===== patient-name-nowrap-one-cell-202607102208 START ===== */

/*
   患者管理一覧の「名前」列を広げる。
   井上　さゆり等が1行で表示されるようにする。
*/

form#patient-sort-form table.list {
  table-layout: auto !important;
}

form#patient-sort-form table.list th:nth-child(3),
form#patient-sort-form table.list td:nth-child(3) {
  width: 280px !important;
  min-width: 280px !important;
  max-width: 280px !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

form#patient-sort-form table.list td:nth-child(3) *,
form#patient-sort-form table.list td:nth-child(3) strong,
form#patient-sort-form table.list td:nth-child(3) div,
form#patient-sort-form table.list td:nth-child(3) span {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

/* ===== patient-name-nowrap-one-cell-202607102208 END ===== */

/* patient-next-day-copy-css-202607110006 */
.patient-day-nav-center {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;

  flex: 0 0 220px !important;

  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
}

.patient-day-nav-center
.patient-day-nav-current-date {
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;

  box-sizing: border-box !important;
}

.patient-next-day-copy-form {
  display: block !important;

  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;

  margin: 8px 0 0 0 !important;
  padding: 0 !important;
}

.patient-next-day-copy-button {
  display: block !important;

  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
  min-height: 50px !important;

  margin: 0 !important;
  padding: 7px 10px !important;

  border: 1px solid #1d4ed8 !important;
  border-radius: 8px !important;

  background: #2563eb !important;
  color: #ffffff !important;

  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;

  text-align: center !important;
  white-space: normal !important;

  cursor: pointer !important;
}

.patient-next-day-copy-button:hover {
  background: #1d4ed8 !important;
}

.patient-next-day-copy-button:focus-visible {
  outline: 3px solid
    rgba(37, 99, 235, 0.3) !important;

  outline-offset: 2px !important;
}
/* patient-next-day-copy-css-202607110006 END */


/* patient-next-day-copy-balance-202607110017 */
.patient-day-nav-button {
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;
  align-self: center !important;
}

.patient-day-nav-center {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;

  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;

  margin: 0 28px !important;
}

.patient-day-nav-center
.patient-day-nav-current-date {
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;

  margin: 0 !important;
}

.patient-day-nav-center
.patient-next-day-copy-form {
  display: block !important;

  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;

  margin: 8px 0 0 0 !important;
}

.patient-day-nav-center
.patient-next-day-copy-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
  min-height: 66px !important;

  line-height: 1.4 !important;
  white-space: normal !important;
  text-align: center !important;
}
/* patient-next-day-copy-balance-202607110017 END */

/*
 patient-next-day-copy-grid-balance-202607110020
*/

/*
 日付ナビの親枠を、
 上1段・下3列のグリッドにする。
*/
body
:is(div, nav, section)
:has(> .patient-day-nav-center)
:has(> .patient-day-nav-button) {
  display: grid !important;

  grid-template-columns:
    220px
    220px
    220px !important;

  grid-template-rows:
    46px
    56px !important;

  column-gap: 24px !important;
  row-gap: 8px !important;

  justify-content: center !important;
  align-items: center !important;

  width: 100% !important;
  max-width: 100% !important;

  margin-left: auto !important;
  margin-right: auto !important;

  box-sizing: border-box !important;
}


/*
 中央ラッパーをグリッド上では解除し、
 日付と転記フォームを直接配置する。
*/
body
:is(div, nav, section)
:has(> .patient-day-nav-center)
:has(> .patient-day-nav-button)
> .patient-day-nav-center {
  display: contents !important;
}


/*
 現在の日付を1段目中央へ配置。
*/
body
:is(div, nav, section)
:has(> .patient-day-nav-center)
:has(> .patient-day-nav-button)
> .patient-day-nav-center
> .patient-day-nav-current-date {
  grid-column: 1 / 4 !important;
  grid-row: 1 !important;

  justify-self: center !important;
  align-self: center !important;

  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
  height: 46px !important;

  margin: 0 !important;

  box-sizing: border-box !important;
}


/*
 前日ボタンを2段目左へ配置。
*/
body
:is(div, nav, section)
:has(> .patient-day-nav-center)
:has(> .patient-day-nav-button)
> .patient-day-nav-button:first-of-type {
  grid-column: 1 !important;
  grid-row: 2 !important;
}


/*
 次の日ボタンを2段目右へ配置。
*/
body
:is(div, nav, section)
:has(> .patient-day-nav-center)
:has(> .patient-day-nav-button)
> .patient-day-nav-button:last-of-type {
  grid-column: 3 !important;
  grid-row: 2 !important;
}


/*
 左右ボタンの大きさを統一。
*/
body
:is(div, nav, section)
:has(> .patient-day-nav-center)
:has(> .patient-day-nav-button)
> .patient-day-nav-button {
  justify-self: center !important;
  align-self: center !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 190px !important;
  min-width: 190px !important;
  max-width: 190px !important;

  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;

  margin: 0 !important;
  padding: 6px 12px !important;

  box-sizing: border-box !important;
}


/*
 転記フォームを2段目中央へ配置。
*/
body
:is(div, nav, section)
:has(> .patient-day-nav-center)
:has(> .patient-day-nav-button)
> .patient-day-nav-center
> .patient-next-day-copy-form {
  grid-column: 2 !important;
  grid-row: 2 !important;

  justify-self: center !important;
  align-self: center !important;

  display: block !important;

  width: 190px !important;
  min-width: 190px !important;
  max-width: 190px !important;

  height: 56px !important;
  min-height: 56px !important;

  margin: 0 !important;
  padding: 0 !important;
}


/*
 転記ボタンも左右ボタンと
 同じ幅・高さに統一。
*/
body
:is(div, nav, section)
:has(> .patient-day-nav-center)
:has(> .patient-day-nav-button)
.patient-next-day-copy-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 190px !important;
  min-width: 190px !important;
  max-width: 190px !important;

  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;

  margin: 0 !important;
  padding: 5px 8px !important;

  box-sizing: border-box !important;

  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;

  text-align: center !important;
  white-space: normal !important;
}


/*
 画面幅が狭い場合だけ、
 3列を均等幅に縮小する。
*/
@media (max-width: 760px) {
  body
  :is(div, nav, section)
  :has(> .patient-day-nav-center)
  :has(> .patient-day-nav-button) {
    grid-template-columns:
      minmax(0, 1fr)
      minmax(0, 1fr)
      minmax(0, 1fr) !important;

    column-gap: 8px !important;

    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  body
  :is(div, nav, section)
  :has(> .patient-day-nav-center)
  :has(> .patient-day-nav-button)
  > .patient-day-nav-button,

  body
  :is(div, nav, section)
  :has(> .patient-day-nav-center)
  :has(> .patient-day-nav-button)
  > .patient-day-nav-center
  > .patient-next-day-copy-form,

  body
  :is(div, nav, section)
  :has(> .patient-day-nav-center)
  :has(> .patient-day-nav-button)
  .patient-next-day-copy-button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 190px !important;
  }
}

/*
 patient-next-day-copy-grid-balance-202607110020 END
*/

/*
 patient-day-nav-text-balance-202607110023
*/

/*
 現在表示中の日付
*/
.patient-day-nav-current-date {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  padding: 0 10px !important;

  font-family: inherit !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1 !important;

  letter-spacing: 0.01em !important;
  text-align: center !important;
  white-space: nowrap !important;

  font-variant-numeric:
    tabular-nums !important;

  box-sizing: border-box !important;
}


/*
 前日・次の日ボタン
*/
.patient-day-nav-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  padding: 0 12px !important;

  font-family: inherit !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1 !important;

  letter-spacing: 0.02em !important;
  text-align: center !important;
  white-space: nowrap !important;

  box-sizing: border-box !important;
}


/*
 転記ボタン内の強制改行を消す。
*/
.patient-next-day-copy-button br {
  display: none !important;
}


/*
 転記ボタンの文字を1行で中央配置。
*/
.patient-next-day-copy-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  padding: 0 4px !important;

  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;

  letter-spacing: 0 !important;
  text-align: center !important;
  white-space: nowrap !important;
  word-break: keep-all !important;

  box-sizing: border-box !important;
}


/*
 上下2か所で文字位置を統一。
*/
.patient-day-nav-center
.patient-day-nav-current-date,

.patient-day-nav-center
.patient-next-day-copy-button {
  text-indent: 0 !important;
}


/*
 狭い画面では転記文字だけ少し縮小。
*/
@media (max-width: 760px) {
  .patient-next-day-copy-button {
    font-size: 12px !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
  }
}

/*
 patient-day-nav-text-balance-202607110023 END
*/

/*
 patient-day-nav-label-size-202607110029
*/

/*
 前日・翌日ボタン
*/
.patient-day-nav-button {
  font-size: 17px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}


/*
 翌日へ転記ボタン
*/
.patient-next-day-copy-button {
  font-size: 17px !important;
  font-weight: 800 !important;
  line-height: 1 !important;

  letter-spacing: 0.01em !important;
}


/*
 日付表示
*/
.patient-day-nav-current-date {
  font-size: 16px !important;
  font-weight: 800 !important;
}

/*
 patient-day-nav-label-size-202607110029 END
*/



/*
 today-instruction-wrap-final-202607110044 START

 今日の指示画面のみを対象に、
 指示本文と予告指示の横はみ出しを防止。
*/

table.today-excel-table.today-no-id-table {
  table-layout: fixed !important;
}


/*
 本文セル・予告指示セル
*/
table.today-excel-table.today-no-id-table
td.today-excel-body,

table.today-excel-table.today-no-id-table
td.today-excel-note {
  box-sizing: border-box !important;

  min-width: 0 !important;

  white-space: pre-wrap !important;

  word-break: break-word !important;

  overflow-wrap: anywhere !important;

  line-break: strict !important;

  overflow: hidden !important;

  vertical-align: top !important;

  line-height: 1.5 !important;
}


/*
 セル内の要素にnowrap等があっても、
 セル幅に合わせて折り返す。
*/
table.today-excel-table.today-no-id-table
td.today-excel-body *,

table.today-excel-table.today-no-id-table
td.today-excel-note * {
  box-sizing: border-box !important;

  min-width: 0 !important;

  max-width: 100% !important;

  white-space: pre-wrap !important;

  word-break: break-word !important;

  overflow-wrap: anywhere !important;

  line-break: strict !important;
}


/*
 行の高さを内容に合わせる。
*/
table.today-excel-table.today-no-id-table
tbody tr,

table.today-excel-table.today-no-id-table
tbody td {
  height: auto !important;
}

/*
 today-instruction-wrap-final-202607110044 END
*/


/*
 today-instruction-body-exact-202607110104 START

 今日の指示画面の本文セルへ
 折り返しを直接指定する。
*/

html body
td.pre.today-excel-body.pre.today-excel-body,

html body
td.today-excel-body.pre.today-excel-body.pre {
  box-sizing: border-box !important;

  min-width: 0 !important;
  max-width: 100% !important;

  white-space: pre-wrap !important;

  word-break: break-word !important;

  overflow-wrap: anywhere !important;

  line-break: strict !important;

  text-wrap: wrap !important;

  overflow-x: hidden !important;

  vertical-align: top !important;

  height: auto !important;

  line-height: 1.5 !important;
}


/*
 セル内に要素がある場合も
 同じ折り返しを適用する。
*/
html body
td.pre.today-excel-body
> * {
  box-sizing: border-box !important;

  min-width: 0 !important;
  max-width: 100% !important;

  white-space: pre-wrap !important;

  word-break: break-word !important;

  overflow-wrap: anywhere !important;

  text-wrap: wrap !important;
}

/*
 today-instruction-body-exact-202607110104 END
*/

/* monthly-print-css-3day-v2-20260711 */

.monthly-print-page {
  box-sizing: border-box;
  max-width: 1000px;
  margin: 16px auto 28px;
  padding: 10px;
  background: #fff;
}

.monthly-print-page-header {
  display: grid;
  grid-template-columns:
    1fr 2fr auto;
  gap: 4px;
  align-items: stretch;
  margin-bottom: 4px;
}

.monthly-print-patient-sheet,
.monthly-print-patient-name,
.monthly-print-page-info {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #222;
  padding: 5px 7px;
  box-sizing: border-box;
}

.monthly-print-patient-sheet span,
.monthly-print-patient-name span {
  white-space: nowrap;
  font-size: 12px;
}

.monthly-print-patient-sheet strong,
.monthly-print-patient-name strong {
  flex: 1;
  min-width: 0;
  font-size: 16px;
}

.monthly-print-patient-name strong {
  background: #fff2cc;
  padding: 2px 6px;
}

.monthly-print-page-info {
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 82px;
  text-align: center;
}

.monthly-print-page-info span {
  font-size: 11px;
}

.monthly-print-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.monthly-print-table th,
.monthly-print-table td {
  border: 1px solid #222;
  padding: 3px 4px;
  vertical-align: top;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.monthly-print-table th {
  text-align: center;
  vertical-align: middle;
  background: #f2f2f2;
}

.monthly-print-table .col-date {
  width: 8%;
}

.monthly-print-table .col-note {
  width: 18%;
}

.monthly-print-table .col-id {
  width: 6%;
}

.monthly-print-table .col-category {
  width: 10%;
}

.monthly-print-table .col-treatment {
  width: 34%;
}

.monthly-print-table .col-sign {
  width: 10%;
}

.monthly-print-table .col-follow {
  width: 14%;
}

.monthly-print-date,
.monthly-print-id,
.monthly-print-category,
.monthly-print-sign {
  text-align: center;
}

.monthly-print-date {
  vertical-align: middle !important;
  font-weight: 700;
}

.monthly-print-note,
.monthly-print-treatment,
.monthly-print-follow,
.monthly-print-sign {
  white-space: pre-wrap;
}

@media print {

  @page {
    size: A4 portrait;
    margin: 5mm;
  }

  html,
  body {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .monthly-print-page {
    width: 200mm !important;
    min-height: 287mm !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    break-after: page !important;
    page-break-after: always !important;
  }

  .monthly-print-page-last {
    break-after: auto !important;
    page-break-after: auto !important;
  }

  .monthly-print-page-header {
    height: 13mm !important;
    margin: 0 0 2mm !important;
    gap: 1mm !important;
  }

  .monthly-print-patient-sheet,
  .monthly-print-patient-name,
  .monthly-print-page-info {
    border: 0.25mm solid #000 !important;
    padding: 1mm 1.5mm !important;
  }

  .monthly-print-patient-sheet span,
  .monthly-print-patient-name span {
    font-size: 8pt !important;
  }

  .monthly-print-patient-sheet strong,
  .monthly-print-patient-name strong {
    font-size: 11pt !important;
  }

  .monthly-print-page-info {
    min-width: 23mm !important;
  }

  .monthly-print-page-info strong {
    font-size: 9pt !important;
  }

  .monthly-print-page-info span {
    font-size: 7pt !important;
  }

  .monthly-print-table {
    width: 200mm !important;
    font-size: 7.2pt !important;
    line-height: 1.15 !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
  }

  .monthly-print-table th,
  .monthly-print-table td {
    border: 0.25mm solid #000 !important;
    padding: 0.6mm 0.8mm !important;
    overflow: visible !important;
  }

  .monthly-print-table thead th {
    height: 7mm !important;
    font-size: 7.2pt !important;
  }

  .monthly-print-table tbody tr {
    height: 7.5mm !important;
  }

  .monthly-print-day {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .monthly-print-date {
    font-size: 8pt !important;
  }

  .monthly-print-note,
  .monthly-print-treatment,
  .monthly-print-follow,
  .monthly-print-sign {
    white-space: pre-wrap !important;
  }
}

/* monthly-print-fit-3days-v3-20260711 */

@media print {

  html body .monthly-print-page {
    width: 200mm !important;
    min-width: 200mm !important;
    max-width: 200mm !important;

    min-height: 0 !important;
    height: auto !important;

    margin: 0 auto !important;
    padding: 0 !important;
  }

  html body .monthly-print-page-header {
    height: 9.5mm !important;
    min-height: 0 !important;

    margin-top: 0 !important;
    margin-bottom: 1mm !important;

    gap: 1mm !important;
  }

  html body
  .monthly-print-patient-sheet,

  html body
  .monthly-print-patient-name,

  html body
  .monthly-print-page-info {
    min-height: 0 !important;

    padding:
      0.5mm
      1mm
      !important;

    border-radius: 0 !important;
    box-shadow: none !important;
  }

  html body
  table.monthly-print-table {
    width: 200mm !important;

    min-width: 200mm !important;
    max-width: 200mm !important;

    border-collapse:
      collapse
      !important;

    border-spacing:
      0
      !important;

    table-layout:
      fixed
      !important;

    font-size:
      6pt
      !important;

    line-height:
      1.05
      !important;
  }

  html body
  table.monthly-print-table * {
    box-sizing:
      border-box
      !important;
  }

  html body
  table.monthly-print-table th,

  html body
  table.monthly-print-table td,

  html body
  table.monthly-print-table .pre {
    min-height:
      0
      !important;

    max-height:
      none
      !important;

    margin:
      0
      !important;

    border-radius:
      0
      !important;

    box-shadow:
      none
      !important;

    background-image:
      none
      !important;

    line-height:
      1.05
      !important;
  }

  html body
  table.monthly-print-table th {
    padding:
      0.35mm
      0.35mm
      !important;

    font-size:
      6pt
      !important;

    vertical-align:
      middle
      !important;
  }

  html body
  table.monthly-print-table td {
    height:
      auto
      !important;

    padding:
      0.3mm
      0.45mm
      !important;

    font-size:
      6pt
      !important;
  }

  html body
  table.monthly-print-table thead tr,

  html body
  table.monthly-print-table thead th {
    height:
      6mm
      !important;

    min-height:
      0
      !important;
  }

  html body
  table.monthly-print-table tbody tr {
    height:
      6.5mm
      !important;

    min-height:
      0
      !important;

    max-height:
      none
      !important;
  }

  html body
  table.monthly-print-table td > p,

  html body
  table.monthly-print-table td > div,

  html body
  table.monthly-print-table td > span {
    min-height:
      0
      !important;

    margin:
      0
      !important;

    padding:
      0
      !important;

    line-height:
      inherit
      !important;
  }

  html body
  .monthly-print-table .col-date {
    width:
      7%
      !important;
  }

  html body
  .monthly-print-table .col-note {
    width:
      14%
      !important;
  }

  html body
  .monthly-print-table .col-id {
    width:
      7%
      !important;
  }

  html body
  .monthly-print-table .col-category {
    width:
      8%
      !important;
  }

  html body
  .monthly-print-table .col-treatment {
    width:
      41%
      !important;
  }

  html body
  .monthly-print-table .col-sign {
    width:
      9%
      !important;
  }

  html body
  .monthly-print-table .col-follow {
    width:
      14%
      !important;
  }

  html body
  .monthly-print-date {
    font-size:
      6.5pt
      !important;

    line-height:
      1.15
      !important;

    vertical-align:
      middle
      !important;
  }

  html body
  .monthly-print-id,

  html body
  .monthly-print-category,

  html body
  .monthly-print-sign {
    vertical-align:
      middle
      !important;
  }

  html body
  .monthly-print-note,

  html body
  .monthly-print-treatment,

  html body
  .monthly-print-follow {
    vertical-align:
      top
      !important;

    white-space:
      pre-wrap
      !important;

    overflow-wrap:
      anywhere
      !important;

    word-break:
      normal
      !important;
  }

  html body
  .monthly-print-day {
    break-inside:
      avoid
      !important;

    page-break-inside:
      avoid
      !important;
  }
}

/* monthly-print-grid-v5-20260713 */

.monthly-v5-page {
  box-sizing: border-box;
  width: min(200mm, 100%);
  margin: 12px auto 24px;
  padding: 0;
  background: #fff;
  color: #111;
}

.monthly-v5-page-header {
  display: grid;
  grid-template-columns: 25% 55% 20%;
  min-height: 11mm;
  border-top: 1px solid #222;
  border-left: 1px solid #222;
}

.monthly-v5-page-header > div {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 1.2mm 1.6mm;
  border-right: 1px solid #222;
  border-bottom: 1px solid #222;
  border-radius: 0;
  box-shadow: none;
}

.monthly-v5-page-header span {
  flex: 0 0 auto;
  font-size: 8pt;
  white-space: nowrap;
}

.monthly-v5-page-header strong {
  min-width: 0;
  font-size: 10pt;
  overflow-wrap: anywhere;
}

.monthly-v5-patient-name strong {
  flex: 1;
  padding: 0.5mm 1mm;
  background: #fff2cc;
}

.monthly-v5-page-number {
  flex-direction: column;
  justify-content: center;
  gap: 1px !important;
  text-align: center;
}

.monthly-v5-page-number span {
  font-size: 7pt;
}

.monthly-v5-column-header,
.monthly-v5-day {
  display: grid;
  grid-template-columns: 7.5% 17.5% 9% 39% 11% 16%;
  width: 100%;
}

.monthly-v5-column-header {
  min-height: 8mm;
  border-left: 1px solid #222;
}

.monthly-v5-column-header > div {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0.6mm 0.8mm;
  border-right: 1px solid #222;
  border-bottom: 1px solid #222;
  background: #f0f3f7;
  font-size: 7pt;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.monthly-v5-day {
  height: 82mm;
  border-left: 1px solid #222;
  break-inside: avoid;
  page-break-inside: avoid;
}

.monthly-v5-cell {
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  padding: 0.45mm 0.7mm;
  border-right: 1px solid #222;
  border-bottom: 1px solid #222;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  background: #fff;
  font-size: 6.5pt;
  line-height: 1.08;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: pre-wrap;
}

.monthly-v5-date,
.monthly-v5-category,
.monthly-v5-sign {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.monthly-v5-date {
  font-size: 7pt;
  font-weight: 700;
}

.monthly-v5-note,
.monthly-v5-treatment,
.monthly-v5-follow {
  text-align: left;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 5mm;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .monthly-v5-page {
    width: 200mm !important;
    max-width: 200mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    break-after: page !important;
    page-break-after: always !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .monthly-v5-page-last {
    break-after: auto !important;
    page-break-after: auto !important;
  }

  .monthly-v5-page-header {
    min-height: 11mm !important;
  }

  .monthly-v5-column-header {
    min-height: 8mm !important;
  }

  .monthly-v5-day {
    height: 82mm !important;
  }

  .monthly-v5-cell {
    font-size: 6.5pt !important;
    line-height: 1.08 !important;
  }
}


/* monthly-print-hide-control-v6b-20260713 */

@media print {

  /*
   * 月間印刷の操作欄を、
   * 印刷時だけ非表示にする。
   */

  body:has(.monthly-v5-page)
  form.toolbar.no-print,

  body:has(.monthly-v5-page)
  .toolbar.no-print,

  body:has(.monthly-v5-page)
  .no-print {
    display: none !important;

    width: 0 !important;
    height: 0 !important;

    min-width: 0 !important;
    min-height: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;

    overflow: hidden !important;
  }

  /*
   * layout_headerが表示する
   * 「月間印刷」の見出しを隠す。
   */

  body:has(.monthly-v5-page)
  main > h1:first-of-type,

  body:has(.monthly-v5-page)
  main > h2:first-of-type,

  body:has(.monthly-v5-page)
  .page-title:first-of-type {
    display: none !important;

    height: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden !important;
  }

  /*
   * ページ前の強制改ページを
   * 全ページで解除する。
   *
   * ページ後で改ページする方式へ
   * 統一する。
   */

  body:has(.monthly-v5-page)
  .monthly-v5-page {
    break-before: auto !important;

    page-break-before:
      auto
      !important;

    break-after:
      page
      !important;

    page-break-after:
      always
      !important;
  }

  /*
   * 最終ページの後には
   * 空白ページを作らない。
   */

  body:has(.monthly-v5-page)
  .monthly-v5-page-last {
    break-after:
      auto
      !important;

    page-break-after:
      auto
      !important;
  }

  /*
   * 上部の余白を解除する。
   */

  body:has(.monthly-v5-page)
  main {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  body:has(.monthly-v5-page)
  .monthly-v5-page:first-of-type {
    margin-top: 0 !important;
  }
}


/* device-menu-disabled-20260713 START */
a[href*="route=devices"],
nav a[href*="route=devices"],
.menu a[href*="route=devices"],
.top-menu a[href*="route=devices"] {
    display: none !important;
}
/* device-menu-disabled-20260713 END */

/* auto-backup-status-css-20260713 START */

.auto-backup-status-card {
  margin: 0 0 24px;
  padding: 22px;
  border: 1px solid #d7e0ec;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 4px 14px
    rgba(31, 50, 75, .08);
}

.auto-backup-status-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.auto-backup-status-heading h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.auto-backup-status-heading p {
  margin: 0;
  color: #526277;
}

.auto-backup-status-badge {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 700;
}

.auto-backup-status-badge.is-success {
  color: #166534;
  background: #dcfce7;
}

.auto-backup-status-badge.is-error {
  color: #991b1b;
  background: #fee2e2;
}

.auto-backup-status-badge.is-neutral {
  color: #475569;
  background: #e2e8f0;
}

.auto-backup-status-grid {
  display: grid;
  grid-template-columns:
    repeat(
      3,
      minmax(0, 1fr)
    );
  gap: 12px;
}

.auto-backup-status-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e1e7ef;
  border-radius: 12px;
  background: #f8fafc;
}

.auto-backup-status-label,
.auto-backup-status-value {
  display: block;
  overflow-wrap: anywhere;
}

.auto-backup-status-label {
  margin-bottom: 6px;
  color: #64748b;
  font-size: 13px;
}

.auto-backup-status-value {
  color: #172033;
  font-size: 16px;
}

.auto-backup-status-note {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 16px;
  padding: 13px 15px;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a5f;
}

.auto-backup-status-note.is-error {
  background: #fff1f2;
  color: #881337;
}

@media (max-width: 900px) {
  .auto-backup-status-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }
}

@media (max-width: 600px) {
  .auto-backup-status-heading {
    flex-direction: column;
  }

  .auto-backup-status-grid {
    grid-template-columns: 1fr;
  }
}

/* auto-backup-status-css-20260713 END */

/* discharged-search-buttons-admin-canonical-exact-v3-20260726 */
@media (min-width: 1101px) {
    .discharged-patients-search-form
    .discharged-search-buttons
    button[type="submit"],
    .discharged-patients-search-form
    .discharged-search-buttons
    a.button {
        margin: 0 0 6px 0 !important;
    }
}

/* ===== today-display-date-button-match-v2-20260727 START ===== */

/*
 * 今日の指示画面だけを対象とする。
 *
 * :has()は使用しない。
 *
 * route=today のhidden入力より後にある
 * 直接の表示ボタンだけを対象とする。
 */

form.toolbar
> input[name="route"][value="today"]
~ button {

  display: inline-flex !important;

  align-items: center !important;
  justify-content: center !important;

  height: 50px !important;
  min-height: 50px !important;
  max-height: 50px !important;

  padding-top: 0 !important;
  padding-bottom: 0 !important;

  box-sizing: border-box !important;

  line-height: 1.2 !important;

}


/*
 * デスクトップでは、
 * 表示日入力欄の上端・下端にも合わせる。
 *
 * 実測：
 *
 * 修正前の下余白 4px
 * 必要な下余白　 6px
 */

@media (min-width: 901px) {

  form.toolbar
  > input[name="route"][value="today"]
  ~ button {

    margin-bottom: 6px !important;

  }

}

/* ===== today-display-date-button-match-v2-20260727 END ===== */

/* ===== monthly-day-separator-cell-border-v3-20260727 START ===== */

/*
 * 日全体へ重ねていた疑似要素を停止する。
 *
 * 2日目以降の先頭6セルそれぞれに、
 * 同じ2pxの上罫線を設定する。
 */

.monthly-v5-page
> .monthly-v5-day
+ .monthly-v5-day::before {

  content: none !important;

  display: none !important;

}


.monthly-v5-page
> .monthly-v5-day
+ .monthly-v5-day
> .monthly-v5-cell:nth-child(-n+6) {

  border-top:
    2px
    solid
    #222222
    !important;

}

/* ===== monthly-day-separator-cell-border-v3-20260727 END ===== */

/* ===== discharged-date-full-visible-v2-20260818 START ===== */
/*
 * Discharged patient list:
 * Keep the table inside its existing outer width,
 * but allocate enough width for YYYY/MM/DD + calendar icon.
 */
table.discharged-patient-list {
  width: 100% !important;
  table-layout: fixed !important;
}

/* Previous admission date remains unchanged. */
table.discharged-patient-list th:nth-child(4),
table.discharged-patient-list td:nth-child(4) {
  width: 120px !important;
}

/* Discharge date: widened only here. */
table.discharged-patient-list th:nth-child(5),
table.discharged-patient-list td:nth-child(5) {
  width: 145px !important;
  min-width: 145px !important;
  max-width: 145px !important;
  box-sizing: border-box !important;
  text-align: center !important;
  overflow: hidden !important;
}

/* Date control fits inside the 145px cell and shows the full date. */
table.discharged-patient-list td:nth-child(5) input[type="date"] {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  font-size: 12px !important;
  padding: 8px 3px !important;
}

/* Save button also stays inside the discharge-date cell. */
table.discharged-patient-list td:nth-child(5) button {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding-left: 3px !important;
  padding-right: 3px !important;
  white-space: nowrap !important;
  font-size: 12px !important;
}

/* Do not alter the readmit column. */
/* ===== discharged-date-full-visible-v2-20260818 END ===== */

/* ===== discharged-date-full-visible-v3-20260818 START ===== */
/*
 * V3: 145px was still too narrow on Windows Chrome.
 * Allocate 170px only to the discharge-date column.
 */
table.discharged-patient-list {
  width: 100% !important;
  table-layout: fixed !important;
}

/* Previous admission date remains unchanged. */
table.discharged-patient-list th:nth-child(4),
table.discharged-patient-list td:nth-child(4) {
  width: 120px !important;
}

/* Discharge date: enough for YYYY/MM/DD + native calendar icon. */
table.discharged-patient-list th:nth-child(5),
table.discharged-patient-list td:nth-child(5) {
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;
  box-sizing: border-box !important;
  text-align: center !important;
  overflow: hidden !important;
}

/* Native date control: use the full cell width with minimal horizontal padding. */
table.discharged-patient-list td:nth-child(5) input[type="date"] {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  font-size: 13px !important;
  padding-left: 2px !important;
  padding-right: 2px !important;
}

/* Save button stays inside the same cell. */
table.discharged-patient-list td:nth-child(5) button {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding-left: 3px !important;
  padding-right: 3px !important;
  white-space: nowrap !important;
  font-size: 12px !important;
}

/* Readmit column is intentionally untouched. */
/* ===== discharged-date-full-visible-v3-20260818 END ===== */

/* ===== discharged-page-clarity-v4-20260818 START ===== */
/* 退院日セル内を見やすく */
table.discharged-patient-list td:nth-child(5) {
  vertical-align: top !important;
}

table.discharged-patient-list td:nth-child(5) form {
  gap: 8px !important;
}

table.discharged-patient-list td:nth-child(5) button {
  font-weight: 700 !important;
}

/* 備考欄は左寄せ＋上寄せ */
table.discharged-patient-list th:nth-child(6),
table.discharged-patient-list td:nth-child(6) {
  text-align: left !important;
  vertical-align: top !important;
}

table.discharged-patient-list td:nth-child(6) {
  padding-left: 12px !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
}
/* ===== discharged-page-clarity-v4-20260818 END ===== */

/* ===== discharged-style-match-v5-20260818 START ===== */

/*
 * 退院日:
 * 再入院日の見た目に合わせ、
 * 小さく指定されていた文字を通常のフォーム書体へ戻す。
 */
table.discharged-patient-list td:nth-child(5) input[type="date"] {
  font-family: inherit !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: normal !important;
  color: #111827 !important;
}

/*
 * 「退院日を更新」:
 * 特別な小型表示をやめ、他の白い操作ボタンと同じ系統へ。
 */
table.discharged-patient-list td:nth-child(5) button[type="submit"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
  min-height: 44px !important;

  margin: 8px auto !important;
  padding: 9px 12px !important;

  box-sizing: border-box !important;
  white-space: nowrap !important;
  text-align: center !important;
  line-height: 1.35 !important;

  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 700 !important;

  color: #1f2937 !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  box-shadow: var(--shadow-soft) !important;
  cursor: pointer !important;
}

/* 備考欄は前回の左寄せ・上寄せを維持する。 */
table.discharged-patient-list th:nth-child(6),
table.discharged-patient-list td:nth-child(6) {
  text-align: left !important;
  vertical-align: top !important;
}

/* ===== discharged-style-match-v5-20260818 END ===== */

/* ===== discharged-date-text-shift-v6-20260818 START ===== */
/*
 * 退院日の先頭文字が左枠に近すぎるため、
 * 文字だけ少し右へ寄せる。
 * 対象は退院日列のみ。再入院列は変更しない。
 */
table.discharged-patient-list td:nth-child(5) input[type="date"] {
  padding-left: 8px !important;
  padding-right: 4px !important;
}
/* ===== discharged-date-text-shift-v6-20260818 END ===== */
