:root {
  --bg: #e8e8e8;
  --panel: #ffffff;
  --line: #c9c9c9;
  --line-strong: #8a8a8a;
  --ink: #333333;
  --muted: #777777;
  --topbar: #444444;
  --home: #2f9d68;
  --blue: #005bac;
  --blue-soft: #eef3f9;
  --yellow-soft: #fff7cf;
  --green-soft: #e3f3e3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Meiryo", "Yu Gothic", sans-serif;
  font-size: 12px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(560px, 100%);
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #fafafa;
  padding: 46px 30px 34px;
  text-align: center;
}

.login-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
}

.login-status {
  margin: 16px auto 0;
  width: min(420px, 100%);
  border: 1px solid #a9c9e8;
  border-radius: 4px;
  background: #eef6ff;
  padding: 10px 12px;
  color: #244d70;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  text-align: left;
}

.login-status[data-type="error"] {
  border-color: #e2aaa0;
  background: #fff0ed;
  color: #b0412e;
}

.login-button-slot {
  min-height: 44px;
  display: flex;
  justify-content: center;
}

.client-login-form {
  width: min(340px, 100%);
  margin: 0 auto;
  text-align: left;
}

#clientTotpForm,
#clientTotpEnrollmentForm {
  width: min(420px, 100%);
}

.client-login-form label {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
  font-weight: 700;
}

.client-login-form input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #aaa;
  border-radius: 3px;
  padding: 8px 10px;
  background: #fff;
}

.client-first-login {
  margin: 2px 0 20px;
  border: 1px solid #d8c7ad;
  border-radius: 4px;
  background: #fff8ed;
  padding: 14px;
}

.client-first-login strong {
  display: block;
  margin-bottom: 5px;
  color: #6b3a00;
}

.client-first-login p {
  margin: 0 0 10px;
  color: #555;
  font-size: 12px;
  line-height: 1.6;
}

.client-password-setup {
  width: 100%;
  min-height: 40px;
  border: 1px solid #c95e00;
  border-radius: 3px;
  background: #e8710a;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.client-password-setup:disabled {
  border-color: #bbb;
  background: #ccc;
  cursor: not-allowed;
}

.client-activation-code-panel {
  margin-top: 16px;
  border: 1px solid #d8c7ad;
  border-radius: 4px;
  background: #fff8ed;
  padding: 12px;
}

.client-activation-code-panel strong {
  color: #6b3a00;
}

.client-activation-code-panel p {
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.6;
}

.client-activation-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.client-activation-code-row code {
  min-width: 220px;
  border: 1px solid #c9b28e;
  border-radius: 3px;
  background: #fff;
  padding: 8px 10px;
  color: #222;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.client-login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: #666;
  font-size: 12px;
  font-weight: 700;
}

.client-login-divider::before,
.client-login-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid #ccc;
}

.client-login-divider span {
  white-space: nowrap;
}

.client-login-submit {
  width: 100%;
  min-height: 42px;
  border: 1px solid #004f98;
  border-radius: 3px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.client-login-submit:disabled {
  border-color: #bbb;
  background: #ccc;
  cursor: not-allowed;
}

.login-manual-link {
  margin: 18px 0 0;
  font-size: 14px;
}

.login-manual-link a {
  color: var(--blue);
}

.client-login-cancel {
  width: 100%;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
}

.client-login-guide {
  margin: 0 0 14px;
  color: var(--ink);
  text-align: left;
}

.client-totp-instructions {
  margin: 0 0 18px;
  border: 1px solid #a9c9e8;
  border-radius: 5px;
  background: #eef6ff;
  padding: 14px 16px;
  color: #244d70;
}

.client-totp-instructions strong {
  display: block;
  margin-bottom: 6px;
  color: #123e65;
  font-size: 15px;
}

.client-totp-instructions p {
  margin: 0 0 8px;
  line-height: 1.7;
}

.client-totp-instructions ol {
  margin: 0;
  padding-left: 22px;
  color: #333;
  line-height: 1.8;
}

.client-totp-device-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 12px 0 8px;
  border-bottom: 1px solid #8eb5d7;
}

.client-totp-device-tabs button {
  min-height: 38px;
  border: 1px solid #a9c9e8;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: #fff;
  color: #315b7d;
  font-weight: 700;
  cursor: pointer;
}

.client-totp-device-tabs button.is-active {
  background: var(--blue);
  color: #fff;
}

.client-totp-device-guide {
  border: 1px solid #c8dceb;
  border-radius: 0 0 4px 4px;
  background: #fff;
  padding: 12px 14px;
}

.client-totp-device-guide li + li {
  margin-top: 5px;
}

.client-totp-instructions .client-totp-app-examples {
  margin: 10px 0 0;
  color: #555;
  font-size: 11px;
}

@media (max-width: 520px) {
  .login-screen {
    align-items: start;
    padding: 12px;
  }

  .login-panel {
    padding: 28px 16px 24px;
  }

  .client-totp-device-tabs {
    grid-template-columns: 1fr;
    border-bottom: 0;
  }

  .client-totp-device-tabs button {
    border-bottom: 1px solid #a9c9e8;
    border-radius: 4px;
  }
}

.client-login-form .client-totp-code-input {
  min-height: 52px;
  border: 2px solid #555;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-align: center;
}

.client-totp-code-help {
  margin: -6px 0 16px;
  color: #666;
  font-size: 11px;
  line-height: 1.6;
}

.client-totp-help {
  margin-top: 18px;
  border-top: 1px solid #ddd;
  padding-top: 12px;
  color: #555;
}

.client-totp-help summary {
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
}

.client-totp-help-link {
  display: inline-block;
  color: var(--blue);
  font-weight: 700;
}

.client-totp-camera-warning {
  border-left: 4px solid #d35400;
  background: #fff4e8;
  padding: 8px 10px;
  color: #7a3100;
  font-weight: 700;
}

.client-totp-qr-caption {
  color: #315b7d !important;
  font-weight: 700;
}

.client-totp-manual-setup {
  margin: 14px 0;
  border: 1px solid #c8dceb;
  border-radius: 4px;
  background: #f7fbff;
  padding: 12px;
}

.client-totp-manual-setup summary {
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
}

.client-totp-manual-setup ol {
  margin: 10px 0;
  padding-left: 22px;
  line-height: 1.8;
}

.client-totp-secret-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.client-totp-secret-row .action-button {
  min-width: 70px;
}

.client-totp-help p {
  margin: 8px 0 0;
  line-height: 1.7;
}

.client-totp-qr-panel {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d4d4d4;
  background: #fff;
}

.client-totp-qr-panel img {
  width: 220px;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.client-totp-qr-panel p {
  margin: 0;
  color: #b42318;
  font-size: 13px;
  line-height: 1.6;
}

.client-totp-setup-link {
  display: inline-block;
  margin: -4px 0 14px;
  color: var(--blue);
  font-weight: 700;
}

.app-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.app-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 7px 12px;
  background: var(--topbar);
  color: #fff;
  font-size: 13px;
}

.topbar-left,
.topbar-right,
.ctrlbar,
.ctrlbar-left,
.ctrlbar-right,
.dashboard-foot,
.searchbar,
.actionbar,
.button-row,
.admin-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.home-pill {
  display: inline-block;
  background: var(--home);
  color: #fff;
  border-radius: 4px;
  padding: 2px 9px;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  font: inherit;
}

.pill {
  display: inline-block;
  background: #666;
  color: #fff;
  border-radius: 10px;
  padding: 2px 9px;
  font-size: 11px;
}

.service-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.service-switch-label {
  color: #ddd;
  white-space: nowrap;
}

.service-switch-track {
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(64px, 1fr));
  align-items: center;
  min-height: 28px;
  padding: 2px;
  border: 1px solid #737b85;
  border-radius: 999px;
  background: #3f4751;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.service-switch-tab {
  position: relative;
  z-index: 1;
  min-width: 64px;
  min-height: 24px;
  padding: 2px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #c8cdd3;
  font: inherit;
  cursor: pointer;
  transition: color 160ms ease;
}

.service-switch-tab.is-active {
  color: #202833;
  font-weight: 700;
}

.service-switch-tab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.service-switch-thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc(50% - 2px);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 180ms ease;
}

.service-switch-tab[data-internal-service="review"].is-active ~ .service-switch-thumb {
  transform: translateX(100%);
}

@media (prefers-reduced-motion: reduce) {
  .service-switch-thumb,
  .service-switch-tab {
    transition: none;
  }
}

.logout-button,
.wire-tab,
.wire-action,
.action-button {
  border: 1px solid #cfcfcf;
  border-radius: 3px;
  background: #fff;
  padding: 4px 10px;
}

.logout-button,
.action-button {
  cursor: pointer;
}

.ctrlbar {
  justify-content: space-between;
  padding: 7px 12px;
  border-bottom: 1px solid #ddd;
  background: #fafafa;
}

.wire-tab {
  font-weight: 700;
  cursor: pointer;
}

.wire-tab.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.wire-tab-update {
  color: #1a73b8;
}

.wire-action {
  border-color: #6b4fbb;
  color: #6b4fbb;
  font-weight: 700;
  cursor: pointer;
}

.facility-pending-panel {
  padding: 10px 12px;
  border-bottom: 1px solid #ddd;
  background: #fafafa;
}

.facility-pending-title {
  margin-bottom: 6px;
  color: #6b4fbb;
  font-weight: 700;
}

.facility-pending-list {
  display: grid;
  gap: 4px;
}

.facility-pending-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  padding: 7px 10px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.facility-pending-row:hover {
  border-color: #6b4fbb;
  background: #f8f5ff;
}

.facility-pending-facility {
  font-weight: 700;
}

.facility-pending-elapsed,
.facility-pending-empty {
  color: var(--muted);
}

@media (max-width: 640px) {
  .facility-pending-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

.scope-text,
.ctrl-note,
.screen-subnote,
.small-note,
.admin-meta {
  color: var(--muted);
  font-size: 10px;
}

.ctrlbar-guide {
  padding: 4px 12px 6px;
  border-bottom: 1px solid #ddd;
  background: #fafafa;
  color: var(--muted);
  font-size: 10px;
}

.review-view-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #f3f3f3;
  border-bottom: 1px solid #d7d7d7;
}

.review-view-button {
  padding: 4px 10px;
  border: 1px solid #cfcfcf;
  border-radius: 3px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.review-view-button.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.workspace {
  padding: 0 12px 24px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.screen-heading {
  margin: 12px 0 6px;
  font-size: 18px;
}

.detail-back-link {
  display: inline-block;
  margin-top: 12px;
  color: #075ea8;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.detail-back-link:hover {
  color: #003f73;
}

.matrix-wrap,
.list-wrap,
.admin-card {
  background: var(--panel);
  border: 2px solid var(--line-strong);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

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

th {
  background: #f0f0f0;
}

.matrix-table {
  table-layout: fixed;
}

.matrix-table th,
.matrix-table td {
  text-align: center;
  white-space: nowrap;
}

.matrix-table th {
  white-space: normal;
  word-break: break-word;
}

.matrix-table .facility-cell,
.matrix-table .facility-head {
  width: 260px;
  text-align: left;
  font-weight: 700;
  white-space: normal;
  word-break: break-word;
}

.facility-workspace-link {
  color: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-color: #7b68c8;
  text-underline-offset: 2px;
}

.facility-workspace-link:hover {
  color: #5f45a5;
}

.matrix-table .group-row td {
  background: #f9f0ff;
  color: #7b4f9f;
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  padding: 3px 6px;
}

.matrix-table .group-total td,
.matrix-table .grand-total td {
  font-weight: 700;
}

.matrix-table .group-total .facility-cell,
.matrix-table .grand-total .facility-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matrix-table .grand-total td {
  background: #edf5ff;
}

.cell-action {
  cursor: pointer;
}

.cell-action:hover {
  text-decoration: underline;
  outline: 2px solid #4a7ebb;
  outline-offset: -2px;
}

.cell-hot {
  background: var(--yellow-soft);
  color: #d32f2f;
  font-weight: 700;
}

.cell-done {
  color: #5a9a5a;
  font-weight: 700;
}

.cell-zero {
  color: #bbb;
}

.dashboard-alert {
  margin-top: 0;
  padding: 6px 8px;
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #b8d7f1;
  border-top: 0;
  font-size: 11px;
  font-weight: 700;
}

.dashboard-note {
  margin: 6px 0 0;
  padding: 0 8px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-note-block {
  margin: 4px 0 0;
  padding: 0 8px 6px;
  color: #5d5d5d;
  font-size: 10px;
  line-height: 1.6;
}

.dashboard-foot {
  margin-top: 12px;
}

.info-box,
.detail-panel,
.rail-section {
  background: var(--panel);
  border: 1px solid var(--line);
}

.info-box {
  flex: 1;
  min-width: 280px;
}

.box-label,
.panel-title,
.rail-title,
.admin-card-title {
  background: #eee;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
}

.admin-card-title {
  margin-bottom: 10px;
}

.status-stack {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.status-row,
.pending-item,
.comment-card {
  border: 1px solid #ddd;
  background: #f7f7f7;
  padding: 6px;
}

.searchbar {
  margin-bottom: 8px;
}

.searchbar input,
.form-stack input,
.form-stack select,
.form-stack textarea {
  min-width: 260px;
  padding: 5px 8px;
  border: 1px solid #aaa;
  border-radius: 3px;
  width: 100%;
}

.admin-search {
  min-width: 260px;
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-search:hover {
  border-color: #b7bdc9;
}

.admin-search:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.filter-pill {
  border: 1px solid #aaa;
  background: #fafafa;
  padding: 4px 8px;
  border-radius: 3px;
}

.case-wire-screen {
  margin-top: 12px;
  background: #fff;
  border: 2px solid var(--line-strong);
  /* overflow-x:auto だと縦方向のsticky基準になってしまうため、スクロールコンテナを作らないclipを使う */
  overflow-x: clip;
}

/* 問い合わせ一覧: ヘッダー・検索条件・一覧の項目名をスクロール中も固定表示する。
   各段のtop値は app.js の updateStickyOffsets() が実測した高さで設定する */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
}

#messageDashboardCtrlbar {
  position: sticky;
  top: var(--sticky-topbar-h, 0px);
  z-index: 29;
}

.case-sticky-head {
  position: sticky;
  top: var(--sticky-ctrlbar-top, 0px);
  z-index: 28;
  margin: -10px -12px 0;
  padding: 10px 12px 0;
  background: #fff;
}

.case-list-table thead th {
  position: sticky;
  top: var(--sticky-thead-top, 0px);
  z-index: 27;
  box-shadow: 0 1px 0 var(--line);
}

.case-wire-main {
  padding: 10px 12px;
}

.case-wire-searchbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.case-wire-searchbar input {
  flex: 1 1 360px;
  min-width: 260px;
  padding: 6px 10px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.case-wire-searchbar input:hover {
  border-color: #b7bdc9;
}

.case-wire-searchbar input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.case-filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #d5d9e0;
  background: #fff;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.case-filter:hover {
  border-color: #b7bdc9;
}

.case-filter:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.case-filter select {
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.case-filter select:focus {
  outline: none;
}

.case-facility-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11px;
}

.case-facility-filter select {
  min-width: 210px;
  padding: 6px 10px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.case-facility-filter select:hover {
  border-color: #b7bdc9;
}

.case-facility-filter select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.case-list-table th,
.case-list-table td {
  font-size: 11px;
}

.case-list-note {
  padding: 0;
}

.manual-case-form-panel {
  margin-top: 12px;
  border: 2px solid #4a7ebb;
  border-radius: 4px;
  background: #f5f8fb;
}

.manual-case-form-title {
  background: #4a7ebb;
  color: #fff;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.manual-case-form {
  padding: 10px 12px;
}

.manual-case-form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px 16px;
}

.manual-case-text-row {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.manual-case-form-row:first-child {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.manual-case-form textarea {
  min-height: 110px;
}

.manual-case-form.form-stack label {
  display: block;
}

.manual-case-form label > input,
.manual-case-form label > select,
.manual-case-form label > textarea {
  display: block;
  margin-top: 4px;
}

/* 固定表示は、隣の入力欄と同じ高さ・同じ行位置にそろえる */
.manual-case-facility-fixed {
  display: flex;
  align-items: center;
  min-height: 32px;
  margin-top: 4px;
  padding: 0 2px;
  font-weight: 700;
}

.required-mark {
  color: #c00;
}

.list-table tr[data-case-id] {
  cursor: pointer;
}

.list-table tr[data-case-id]:hover {
  background: #f7fbff;
}

.status-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 10px;
  color: #fff;
}

.status-human_check {
  background: #c9a227;
}

.status-checking {
  background: #707b86;
}

.status-reply_draft_pending {
  background: #c98221;
}

.status-translating {
  background: #6282a4;
}

.status-pending_facility {
  background: #d2772a;
}

.status-auto_sending,
.status-manual_sending {
  background: #4a7ebb;
}

.status-completed {
  background: #35825b;
}

.status-no_action {
  background: #9a9a9a;
}

.status-waiting_inquiry {
  background: #999;
}

.status-linked {
  background: #4a7ebb;
}

.priority-high {
  color: #c0392b;
  font-weight: 700;
}

.case-header {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  font-size: 11px;
  background: #f7f7f7;
  border: 1px solid #e0e0e0;
  padding: 6px 8px;
  margin-bottom: 8px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 174px minmax(620px, 1fr) 250px;
  border: 2px solid var(--line-strong);
  background: var(--panel);
  align-items: stretch;
}

.detail-main {
  padding: 10px 12px;
  min-width: 0;
}

.detail-case-nav {
  border-right: 1px solid #c7c7c7;
  background: #f4f4f4;
  min-width: 0;
}

.detail-case-nav-title {
  padding: 6px 8px;
  background: #dedede;
  border-bottom: 1px solid #c3c3c3;
  font-size: 11px;
  font-weight: 700;
}

.detail-case-list {
  display: grid;
}

.detail-case-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-bottom: 1px solid #d3d3d3;
  background: #f8f8f8;
  color: #333;
  text-align: left;
  cursor: pointer;
}

.detail-case-item:hover {
  background: #eef4f9;
}

.detail-case-item.is-active {
  background: #dce8f5;
  box-shadow: inset 4px 0 #4a7ebb;
}

.detail-case-item small {
  color: #666;
  line-height: 1.4;
}

.detail-case-item .status-badge {
  justify-self: start;
}

.detail-case-nav-note {
  padding: 7px 8px;
  color: #777;
  font-size: 10px;
}

.detail-panel {
  margin-bottom: 10px;
}

.reservation-panel-title {
  padding-right: 0;
  padding-left: 0;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr) minmax(220px, 1fr);
  align-items: baseline;
  gap: 0 10px;
  background: #dce8f5;
  color: #333;
}

.panel-title-note {
  color: #667;
  font-size: 10px;
  font-weight: 400;
}

.detail-info-table th {
  white-space: nowrap;
  background: #edf2f7;
  color: #555;
  font-weight: 400;
}

.history-table tr.current-row td {
  background: #fffbe6;
}

.history-heading-note {
  display: block;
  margin-top: 2px;
  color: #777;
  font-size: 9px;
  font-weight: 400;
}

.history-table td {
  vertical-align: top;
}

.inquiry-content {
  white-space: pre-wrap;
}

.inquiry-body-input {
  width: 100%;
  min-height: 120px;
  box-sizing: border-box;
  border: 1px solid #9fb4ca;
  border-radius: 2px;
  padding: 6px;
  resize: vertical;
  background: #fff;
  font: inherit;
}

.reply-translation {
  white-space: pre-wrap;
}

.reply-editor-cell {
  padding: 5px;
}

.historical-reply {
  padding: 5px;
}

.historical-reply-body {
  min-height: 42px;
  border-right: 1px solid #b7c8da;
  border-left: 1px solid #b7c8da;
  padding: 6px;
  background: #fff;
  white-space: pre-wrap;
}

.reply-frame {
  border: 1px solid #b7c8da;
  background: #eef3f8;
  padding: 4px 6px;
  font-size: 11px;
  white-space: pre-wrap;
}

/* 文頭・文末は案件ごとに直せる入力欄（見た目は枠のまま。直せる状態では白地にして編集中だと分かるようにする） */
textarea.reply-frame-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.4;
  resize: vertical;
  margin: 0;
}

textarea.reply-frame-input:not([readonly]):focus {
  background: #fff;
}

.reply-frame-top {
  border-radius: 3px 3px 0 0;
  border-bottom: 0;
}

.reply-frame-bottom {
  border-radius: 0 0 3px 3px;
  border-top: 0;
}

.answer-search-note {
  margin-top: 6px;
  border: 1px solid #e3c98a;
  border-radius: 3px;
  background: #fff8e6;
  color: #7a5200;
  padding: 4px 6px;
  font-size: 11px;
}

.answer-search-note.is-error {
  border-color: #e5a7a0;
  background: #fdecea;
  color: #b42318;
}

/* 定型文マスターの社内向け注意書き（案件詳細の現在行の「問い合わせ内容」の先頭。社内のみ。docs/architecture-canned-rules.md §6.2） */
.canned-internal-notice {
  margin-bottom: 6px;
  border: 1px solid #9cc3e6;
  border-left-width: 4px;
  border-radius: 3px;
  background: #eef6fd;
  color: #1d4f7a;
  padding: 4px 6px;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.canned-internal-notice-label {
  display: inline-block;
  margin-right: 6px;
  font-weight: 700;
}

/* 定型文マスター画面 */
/* 画面の型・部品はメッセージテンプレート（css/provisional-templates.css の provisional-template-*）を使い、ここは定型文マスター固有の並びだけ */
.canned-rules, .notification-templates { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.canned-rules > .admin-meta, .notification-templates > .admin-meta { margin: 0; }
.notification-templates .provisional-template-form { grid-template-columns: minmax(0, 1fr); }
.notification-templates .provisional-template-form-grid.notification-template-form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
.notification-template-table td { vertical-align: top; }
.notification-template-table .provisional-template-edit-row > td:last-child { white-space: normal; }
.notification-template-updated { white-space: pre-line; color: var(--muted); }
.template-action-row { align-items: center; gap: 10px; }
@media (max-width: 720px) {
  .notification-templates .provisional-template-form-grid.notification-template-form-grid { grid-template-columns: minmax(0, 1fr); }
}
.provisional-template-page-feedback.is-error,
.provisional-template-feedback.is-error { color: #b42318; }
.canned-rules-table td { vertical-align: top; }
.canned-rules-table .provisional-template-edit-row > td:last-child { white-space: normal; }
.canned-rules-table .provisional-template-actions { min-width: 150px; }
.canned-rules-table th:nth-child(1) { width: 3em; }
.canned-rules-table th:nth-child(2) { width: 5em; }
.canned-rules-table th:nth-child(4) { width: 9em; }
.canned-rules-table .provisional-template-body-preview { max-width: none; color: var(--ink); }
.canned-rule-updated { white-space: pre-line; color: var(--muted); }
.canned-rule-name { font-weight: 700; }
.canned-rule-row-disabled td, .canned-rule-row-disabled .provisional-template-body-preview { color: #888; }

.canned-rule-check { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.canned-rule-form { grid-template-columns: minmax(0, 1fr); }
.canned-rule-form input[type="checkbox"] { width: auto; min-height: 0; }
.canned-rule-form label.canned-rule-check { display: inline-flex; color: var(--ink); font-weight: 400; font-size: 12px; }
.canned-rule-form .provisional-template-form-grid.canned-rule-basic { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.canned-rule-form .provisional-template-form-grid.canned-rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.canned-rule-form .canned-rule-enabled { align-self: center; color: var(--ink); font-size: 12px; }
.canned-rule-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; margin: 0; padding: 8px 12px 12px; border: 1px solid #d5d9e0; border-radius: 8px; }
.canned-rule-group > legend { padding: 0 6px; font-weight: 700; font-size: 12px; }
.canned-rule-group > .form-help { margin: 0; }
.canned-rule-subsection { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.canned-rule-subhead { font-weight: 600; font-size: 11px; color: var(--muted); }
.canned-rule-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; color: var(--ink); font-weight: 400; font-size: 12px; }
.canned-rule-form .canned-rule-sentence select,
.canned-rule-form .canned-rule-sentence input { width: auto; max-width: 100%; }
.canned-rule-form .canned-rule-sentence input[type="number"] { width: 6.5em; }
.canned-rule-form .canned-rule-sentence input[type="text"] { flex: 1 1 180px; min-width: 0; }
.canned-rule-lines-table th:nth-child(1) { width: 10em; }
.canned-rule-lines-table th:nth-child(3) { width: 1%; }
.canned-rule-lines-table td { vertical-align: middle; background: #fff; }
.canned-rule-extras { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.canned-rule-extra { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; padding: 8px 10px; border: 1px solid #e2e5ea; border-radius: 8px; background: #fbfbfc; }
.canned-rule-extra-type { padding-top: 8px; font-weight: 700; }
.canned-rule-extra-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.canned-rule-add-row { display: flex; flex-wrap: wrap; gap: 6px; }
.canned-rule-preview { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.canned-rule-preview-text { margin: 0; font-size: 13px; color: var(--ink); }
.canned-rule-preview-warning { margin: 0; color: #b42318; font-weight: 700; }
.canned-rule-form .is-invalid { border-color: #b42318 !important; box-shadow: 0 0 0 3px #fde7e4; }
@media (max-width: 720px) {
  /* 狭い画面では一覧の行を縦積みにする（編集フォームが表の幅に引っ張られて横にはみ出さないように） */
  .canned-rules-table thead { display: none; }
  .canned-rules-table, .canned-rules-table tbody, .canned-rules-table tr, .canned-rules-table td { display: block; width: auto; }
  .canned-rules-table tr { border-bottom: 2px solid var(--line); }
  .canned-rules-table td, .canned-rules-table td:last-child { border: 0; border-top: 1px solid #eee; white-space: normal; }
  .canned-rules-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
  .canned-rules-table td.provisional-template-actions { display: flex; flex-wrap: wrap; gap: 4px; }
  .canned-rules-table td.provisional-template-actions::before { width: 100%; }
  .canned-rule-form .provisional-template-form-grid.canned-rule-basic,
  .canned-rule-form .provisional-template-form-grid.canned-rule-grid { grid-template-columns: minmax(0, 1fr); }
  .canned-rule-extra { grid-template-columns: minmax(0, 1fr) auto; }
  .canned-rule-extra-body { grid-column: 1 / -1; grid-row: 2; }
  .canned-rule-extra-type { padding-top: 4px; }
}

/* 誤回答フラグ・訂正済み回答（回答欄の下）。見た目は既存の注記・チェック・ボタンを使い、並びだけ決める */
.answer-correction-panel {
  margin-top: 6px;
  display: grid;
  gap: 4px;
  justify-items: start;
  font-size: 12px;
}

.reply-body-input {
  display: block;
  width: 100%;
  min-height: 112px;
  box-sizing: border-box;
  resize: vertical;
  border: 1px solid #b7c8da;
  background: #fff;
  padding: 6px;
  color: #333;
  font: inherit;
  line-height: 1.5;
}

.reply-body-input[readonly] {
  background: #f7f7f7;
  color: #666;
}

.history-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: #777;
  font-size: 10px;
}

.add-row-button {
  border-style: dashed;
  background: #fff;
}

.case-actionbar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 14px;
}

.case-corrected-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 10px;
  padding: 4px 10px;
  border: 1px solid #b45309;
  border-radius: 4px;
  background: #fffaf3;
  font-size: 13px;
  font-weight: 700;
  color: #7c2d12;
  cursor: pointer;
}

.case-corrected-check[hidden] {
  display: none;
}

.case-facility-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  font-size: 13px;
  font-weight: 700;
}

.case-facility-check select {
  margin-left: 6px;
}

.case-facility-check-note {
  font-weight: 400;
  color: #475569;
}

.case-facility-check-note.is-error {
  color: #b91c1c;
}

.case-actionbar .action-button.is-active:not(:disabled) {
  border-color: #1769aa;
  background: #1769aa;
  color: #fff;
  font-weight: 700;
}

.case-actionbar .action-button.is-active:not(:disabled):hover {
  background: #11558b;
}

.action-button.is-disabled,
.action-button:disabled {
  border-color: #d4d4d4;
  background: #eee;
  color: #aaa;
  cursor: not-allowed;
  box-shadow: none;
}

.action-feedback {
  min-height: 18px;
  padding: 2px 4px;
  color: #287b58;
  font-size: 11px;
}

.action-feedback.is-error {
  color: #b42318;
}

.ok-cell {
  color: #3a6;
  font-weight: 700;
}

.muted-cell {
  color: #bbb;
}

.detail-rail {
  border-left: 1px solid #ccc;
  background: #fafafa;
  min-width: 0;
}

.rail-section {
  border: 0;
  border-bottom: 2px solid #ccc;
}

.facility-comment-section {
  border-bottom: 0;
}

.facility-rail-title {
  background: #e7edf5;
}

.rail-lock {
  float: right;
  color: #777;
  font-size: 9px;
  font-weight: 400;
}

.rail-body {
  padding: 6px;
  font-size: 11px;
}

.comment-list {
  display: grid;
  gap: 6px;
  margin-bottom: 7px;
}

.comment-empty {
  padding: 8px;
  border: 1px solid #ddd;
  background: #fff;
  color: #888;
}

.comment-item {
  border: 1px solid #d4d9df;
  background: #fff;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 6px;
  border-bottom: 1px solid #e3e6e9;
  background: #f3f5f7;
  color: #59636e;
  font-size: 9px;
}

.comment-delete {
  margin-top: 4px;
  padding: 1px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #a33327;
  font-size: 11px;
  cursor: pointer;
}

.comment-delete:hover {
  background: #fff0ec;
}

.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 6px 6px;
}

.comment-actions .comment-delete { margin-top: 0; }

.comment-action {
  padding: 1px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #334155;
  font-size: 11px;
  cursor: pointer;
}

.comment-action:hover:not(:disabled) { background: #eef2f6; }
.comment-action:disabled { cursor: default; opacity: 0.55; }
.comment-action.is-pressed { opacity: 1; color: #fff; font-weight: 700; }
.comment-action-approved.is-pressed { background: #15803d; border-color: #15803d; }
.comment-action-rejected.is-pressed { background: #b91c1c; border-color: #b91c1c; }
.comment-action-cnc_confirmed.is-pressed { background: #1d4ed8; border-color: #1d4ed8; }

/* 承認/却下/CNC確認済が押されたコメントは、背景色で一目で分かるようにする */
.comment-item.comment-review-approved { background: #e7f6ec; border-color: #86c79a; }
.comment-item.comment-review-rejected { background: #fdeaea; border-color: #e0a1a1; }
.comment-item.comment-review-cnc_confirmed { background: #e8effd; border-color: #9db6ee; }
.comment-review-result { align-self: center; font-size: 11px; font-weight: 700; }
.comment-review-result-approved { color: #15803d; }
.comment-review-result-rejected { color: #b91c1c; }

.comment-body {
  padding: 6px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-type-badge {
  display: inline-block;
  padding: 0 5px;
  border-radius: 2px;
  color: #fff;
  font-weight: 700;
}

.comment-type-internal { background: #5b6b7c; }
.comment-type-facility { background: #b45309; }
.comment-item-facility { border-left: 3px solid #b45309; }
.comment-item-internal { border-left: 3px solid #5b6b7c; }

.comment-type-label {
  display: block;
  margin: 4px 0 2px;
  font-weight: 700;
}

.comment-type-select {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 6px;
  padding: 5px;
  font: inherit;
}

.comment-input.comment-input-internal { border: 2px solid #5b6b7c; }
.comment-input.comment-input-facility { border: 2px solid #b45309; background: #fffaf3; }

.comment-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #bbb;
  background: #fff;
  padding: 6px;
  font: inherit;
  resize: vertical;
}

.comment-submit {
  margin-top: 5px;
  font-size: 10px;
}

.comment-feedback {
  min-height: 16px;
  margin-top: 4px;
  color: #287b58;
  font-size: 9px;
}

.comment-feedback.is-error {
  color: #b42318;
}

.rail-help {
  margin: 6px 0 0;
  color: #777;
  font-size: 9px;
}

.source-list {
  margin: 0;
  padding-left: 18px;
}

.admin-toolbar {
  margin: 10px 0;
}

.admin-toolbar:not(.wire-tab-strip):not(.user-toolbar) {
  padding: 12px 14px;
  border: 1px solid #e2e5ea;
  border-radius: 10px;
  background: #fbfbfc;
}

.admin-grid {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.admin-grid.two-col {
  grid-template-columns: 1fr 1fr;
}

.admin-card {
  overflow: hidden;
}

.admin-table td:last-child,
.admin-table th:last-child {
  white-space: nowrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.summary-card {
  background: var(--panel);
  border: 1px solid #cfcfcf;
  padding: 10px 12px;
}

.summary-card-label {
  font-size: 10px;
  color: var(--muted);
}

.summary-card-value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 700;
}

.report-control-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
  margin: 10px 0 8px;
  padding: 8px 12px;
  background: #f5f8fb;
  border: 1px solid #c8d8ea;
  border-radius: 4px;
  font-size: 11px;
}

.report-control-block {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.report-control-block b {
  flex-basis: 100%;
}

/* Scoped to #appShell (internal app only) so this modernized look never
   leaks into client-portal.html, which reuses the .report-control-field
   class with its own, deliberately different styling. */
#appShell .report-control-field {
  display: grid;
  gap: 5px;
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
}

#appShell .report-control-field select,
#appShell .report-control-field input:not([type="file"]) {
  min-width: 180px;
  padding: 6px 10px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#appShell .report-control-field select:hover,
#appShell .report-control-field input:not([type="file"]):hover {
  border-color: #b7bdc9;
}

#appShell .report-control-field select:focus,
#appShell .report-control-field input:not([type="file"]):focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0 3px;
  border-bottom: 1px solid #bfbfbf;
}

.report-tab {
  padding: 6px 14px;
  border: 1px solid #bfbfbf;
  border-bottom: 0;
  background: #f5f5f5;
  font-weight: 700;
  cursor: default;
}

.report-tab.is-active {
  background: #4a7ebb;
  color: #fff;
}

.report-note {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 10px;
}

.report-section {
  margin-top: 10px;
}

.table-scroll {
  overflow-x: auto;
}

.report-monthly-table {
  min-width: 780px;
  font-size: 10px;
}

.report-monthly-table th,
.report-monthly-table td,
.report-review-table th,
.report-review-table td {
  text-align: center;
}

.report-monthly-table th:first-child,
.report-monthly-table td:first-child,
.report-review-table th:first-child,
.report-review-table td:first-child {
  text-align: left;
}

.current-month {
  background: #fffbe6 !important;
  font-weight: 700;
}

.report-success-row {
  background: #f0f7f0;
  font-weight: 700;
}

.report-muted-row {
  background: #f5f5f5;
}

.report-total-row {
  background: #eef3fb;
  font-weight: 700;
}

.report-chart {
  padding: 8px;
  background: #fff;
}

.report-chart svg {
  width: 100%;
  max-width: 760px;
  font-family: inherit;
}

.report-chart line {
  stroke: #cfcfcf;
}

.report-chart .grid {
  stroke: #eee;
}

.report-chart text {
  fill: #666;
  font-size: 10px;
  text-anchor: middle;
}

.booking-bars rect {
  fill: #4a7ebb;
  opacity: 0.85;
}

.agoda-bars rect {
  fill: #e67e22;
  opacity: 0.85;
}

.expedia-line {
  fill: none;
  stroke: #27ae60;
  stroke-width: 3;
  stroke-dasharray: 5 3;
}

.report-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
  color: #555;
  font-size: 11px;
}

.report-legend i {
  display: inline-block;
  width: 12px;
  height: 8px;
  margin-right: 4px;
  vertical-align: middle;
}

.legend-blue {
  background: #4a7ebb;
}

.legend-orange {
  background: #e67e22;
}

.legend-green {
  background: #27ae60;
}

.report-slide-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px;
}

.report-slide-thumb {
  display: grid;
  gap: 8px;
  place-items: center;
  width: 260px;
  min-height: 160px;
  padding: 12px;
  border: 1px solid #aaa;
  background: #fff;
  text-align: center;
  color: #555;
  font-size: 10px;
}

.report-slide-thumb b {
  color: #005bac;
  font-size: 13px;
}

.report-slide-thumb em {
  padding: 5px;
  background: #eef3fb;
  font-style: normal;
  font-weight: 700;
}

.report-slide-actions {
  flex: 1;
  min-width: 260px;
  font-size: 11px;
}

.report-slide-actions ul {
  margin: 6px 0 10px 16px;
  padding: 0;
  line-height: 1.8;
}

.report-subtitle {
  margin-top: 12px;
}

.report-review-table {
  min-width: 640px;
  font-size: 10px;
}

.report-status {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.report-status.done {
  background: #d5edda;
  color: #1c6b32;
}

.report-status.pending {
  background: #fff3cd;
  color: #855d00;
}

.form-stack {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.form-stack label {
  display: grid;
  gap: 4px;
}

.inline-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.inline-check input {
  width: auto;
  min-width: 0;
}

.master-ota-checklist {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.user-toolbar {
  justify-content: space-between;
  align-items: center;
}

.user-tab-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.user-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.user-list-header-stacked {
  display: grid;
  justify-content: stretch;
  margin-bottom: 0;
}

.add-entry-button,
.user-create-button {
  border: 1px solid #d97706;
  background: linear-gradient(180deg, #f59e0b 0%, #ea580c 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.24);
}

.add-entry-button:hover,
.user-create-button:hover {
  filter: brightness(1.03);
}

.action-button.danger {
  border-color: #b42318;
  color: #b42318;
}

.action-button.danger:hover {
  background: #fff2f0;
}

.user-panel-group {
  display: none;
}

.user-panel-group.is-active {
  display: block;
}

.choice-group {
  border: 1px solid #d6d6d6;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.choice-group legend {
  padding: 0 6px;
  color: #666;
}

.master-section-tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
  flex-wrap: wrap;
}

.master-wire-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.master-wire-side {
  background: #f4f4f4;
  border: 0;
  padding: 8px;
}

.master-wire-side-item {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px dashed #cfcfcf;
  background: transparent;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  outline: none;
}

.master-wire-side-item + .master-wire-side-item {
  margin-top: 0;
}

.master-wire-side-item.is-active {
  background: #dcdcdc;
  border-bottom-color: transparent;
  color: #333;
  font-weight: 700;
}

.master-wire-main {
  display: grid;
  gap: 14px;
}

.master-section-tab {
  padding: 6px 12px;
  border: 1px solid #cfcfcf;
  background: #fff;
  font-size: 12px;
}

.master-section-tab.is-active {
  background: #eef5ff;
  border-color: #4a7ebb;
  color: #24538a;
  font-weight: 700;
}

.master-list-header {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.master-filter-row label {
  display: grid;
  gap: 5px;
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
}

.master-filter-row select {
  min-width: 220px;
  padding: 6px 10px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.master-filter-row select:hover {
  border-color: #b7bdc9;
}

.master-filter-row select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.master-list-header-stacked {
  display: grid;
  justify-content: stretch;
}

.master-action-row {
  display: flex;
  justify-content: flex-start;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.master-form-panel,
.master-auth-panel {
  margin-top: 14px;
  border: 2px solid #4a7ebb;
  border-radius: 4px;
  background: #f5f8fb;
}

.master-auth-panel {
  border-color: #8e6bb0;
  background: #f9f6ff;
}

.master-wire-form-panel {
  margin-top: 0;
}

.master-auth-table-panel {
  margin-top: 0;
}

.master-unimplemented-panel {
  min-height: 180px;
  padding: 32px 24px;
  color: #666;
  text-align: center;
  background: #fafafa;
}

.master-unimplemented-label {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 14px;
  color: #777;
  font-size: 12px;
  font-weight: 700;
  background: #e9e9e9;
  border: 1px solid #ccc;
  border-radius: 999px;
}

.master-unimplemented-panel p {
  margin: 6px 0;
}

.wire-tab-strip {
  margin: 0 0 10px;
}

.communication-status {
  display: inline-block;
  min-width: 58px;
  padding: 2px 7px;
  text-align: center;
  font-weight: 700;
  border-radius: 999px;
}

.communication-status-success {
  color: #1f6c3d;
  background: #e5f4ea;
}

.communication-status-failed {
  color: #a22828;
  background: #fbe7e7;
}

.communication-status-skipped {
  color: #765a17;
  background: #fff3cf;
}

.notification-section {
  margin-bottom: 12px;
}

.notification-preview-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  align-items: flex-start;
}

.notification-settings-panel {
  flex: 1 1 280px;
  min-width: 0;
  font-size: 12px;
}

.notification-settings-panel input,
.notification-settings-panel textarea {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.notification-settings-panel .short-input {
  min-width: 0;
  width: 64px;
}

.notification-mail-preview {
  flex: 2 1 360px;
  min-width: 0;
  font-size: 12px;
}

.notification-mail-body {
  padding: 12px 16px;
  line-height: 1.8;
}

.notification-mail-heading {
  margin: 12px 0 6px;
  padding-bottom: 2px;
  font-weight: 700;
  border-bottom: 1px solid currentColor;
}

.notification-mail-heading.is-message {
  color: #1565c0;
}

.notification-mail-heading.is-review {
  color: #6a1b9a;
}

.notification-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.notification-preview-table th,
.notification-preview-table td {
  padding: 4px 8px;
  border: 1px solid #ccc;
}

.notification-preview-table th {
  text-align: left;
  background: #f0f4ff;
}

.notification-preview-table .attention {
  background: #fff8e1;
}

.notification-mail-footer {
  margin-top: 14px;
  color: #555;
  font-size: 11px;
}

.notification-unimplemented-panel {
  min-height: 130px;
  border-top: 0;
}

.schedule-missing {
  color: #b42318;
  font-weight: 700;
}

.master-form-title {
  padding: 5px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: #4a7ebb;
}

.master-auth-title {
  background: #8e6bb0;
}

.master-form-stack {
  gap: 14px;
}

.master-form-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.master-form-row-split {
  grid-template-columns: 0.85fr 1.15fr;
}

.master-form-row-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.master-form-row[data-facility-property-row] {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.master-option-card {
  border: 1px solid #c8d8ea;
  border-radius: 3px;
  background: #fff;
  padding: 10px 12px;
}

.send-method-note {
  margin: 4px 0 2px;
  font-size: 12px;
  color: #5b6b7d;
}

.send-method-note:empty {
  display: none;
}

.send-method-note.is-warning {
  color: #9a5b00;
  font-weight: 700;
}

.case-category-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 4px 0 6px;
  font-size: 13px;
}

.case-category-row:empty {
  display: none;
}

/* 表の「状態」の列(幅が狭い)では、バッジの下に縦に積む */
.status-cell .case-category-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 0 0;
  font-size: 12px;
}

.status-cell .case-category-add {
  max-width: 100%;
}

.case-category-label {
  margin-right: 2px;
}

.case-category-empty,
.case-category-note {
  color: #7a8ca3;
}

.case-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 4px 1px 8px;
  border: 1px solid #b8cde6;
  border-radius: 10px;
  background: #eef5fc;
}

.case-category-chip.is-archived {
  border-style: dashed;
  background: #f4f4f4;
  color: #6b7785;
}

.case-category-ai {
  padding: 0 4px;
  border-radius: 3px;
  background: #dce8f7;
  color: #2f5f96;
  font-size: 10px;
  font-weight: 700;
}

.case-category-remove {
  border: 0;
  background: transparent;
  color: #5b6b7d;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 4px;
}

.case-category-remove:hover:not(:disabled) {
  color: #b3261e;
}

.case-category-feedback {
  flex-basis: 100%;
  color: #b3261e;
  font-size: 12px;
}

.case-category-feedback:empty {
  display: none;
}

.case-history-section {
  margin-top: 10px;
}

.case-history-toggle {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid #c8d8ea;
  border-radius: 3px;
  background: #eef5fc;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.case-history-panel {
  padding: 8px 2px;
  font-size: 12px;
}

.case-history-target,
.case-history-note,
.case-history-status {
  color: #5b6b7d;
  margin: 4px 0;
}

.case-history-list {
  list-style: none;
  margin: 6px 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.case-history-entry {
  padding: 6px 8px;
  border: 1px solid #d5e0ee;
  border-radius: 3px;
  background: #fff;
}

.case-history-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: #5b6b7d;
}

.case-history-actor {
  font-weight: 700;
  color: #1f2d3d;
}

.case-history-actor.is-client {
  color: #6b3fa0;
}

.case-history-summary {
  margin: 2px 0 4px;
  font-weight: 700;
}

.case-history-change {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  padding: 1px 0;
}

.case-history-field {
  min-width: 5em;
  color: #5b6b7d;
}

.case-history-value {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.case-history-text {
  flex: 1;
  min-width: 0;
}

.case-history-side-label {
  margin-top: 4px;
  color: #5b6b7d;
}

.case-history-text-body,
.case-history-comment-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 4px 6px;
  border-radius: 3px;
  background: #f6f8fb;
}

.case-history-truncated {
  color: #8a6d1f;
  font-size: 11px;
}

.case-history-comment {
  margin-top: 2px;
}

.master-category-list {
  list-style: none;
  margin: 8px 0;
  padding: 0;
  display: grid;
  gap: 4px;
  max-width: 420px;
}

.master-category-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #c8d8ea;
  border-radius: 3px;
  background: #f7fafd;
  padding: 4px 8px;
  cursor: grab;
}

.master-category-item.is-dragging {
  opacity: 0.4;
}

.master-category-item.is-drop-target {
  border-color: #2f6fb5;
  box-shadow: 0 -2px 0 #2f6fb5;
}

.master-category-handle {
  color: #7a8ca3;
  user-select: none;
}

.master-category-item input {
  min-width: 0;
}

.master-category-add-row {
  display: flex;
  gap: 8px;
  max-width: 420px;
}

.master-category-add-row input {
  flex: 1;
  min-width: 0;
}

.review-price-card {
  background: #f9f6ff;
  border-color: #c8b0e0;
}

.master-option-title {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
}

.master-service-options,
.master-inline-input,
.master-template-grid,
.master-auth-grid {
  display: grid;
  gap: 10px;
}

.master-service-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.master-inline-input {
  grid-template-columns: 80px auto;
  align-items: center;
}

.master-template-grid,
.master-auth-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.master-auth-card {
  border: 1px solid #d8c9ea;
  background: #fff;
  padding: 10px 12px;
}

.master-auth-card-name {
  font-weight: 700;
}

.master-auth-card-status {
  display: inline-block;
  margin: 6px 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.master-auth-card-status.is-ready {
  background: #e7f6ec;
  color: #217a41;
}

.master-auth-card-status.is-partial {
  background: #fff4df;
  color: #b36a00;
}

.master-auth-card-status.is-missing {
  background: #f2f2f2;
  color: #666;
}

.master-mini-badge,
.master-state-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
}

.master-mini-badge {
  color: #fff;
  margin-right: 4px;
}

.master-mini-badge.is-message {
  background: #4a7ebb;
}

.master-mini-badge.is-review {
  background: #8e6bb0;
}

.master-state-badge.is-ready {
  background: #e7f6ec;
  color: #217a41;
}

.master-state-badge.is-missing {
  background: #f2f2f2;
  color: #666;
}

.master-switch-text.is-on {
  color: #217a41;
  font-weight: 700;
}

.master-switch-text.is-off {
  color: #999;
}

.compact-table th,
.compact-table td {
  font-size: 11px;
}

.password-toggle-wrap {
  position: relative;
  display: block;
  max-width: none;
}

.password-toggle-wrap > input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 36px;
}

.password-toggle-button {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #666;
  cursor: pointer;
}

.password-toggle-button:hover {
  color: #222;
}

.form-help {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: #777;
}

.user-form-panel {
  margin-top: 12px;
  border: 2px solid #4a7ebb;
  border-radius: 4px;
  background: #f5f8fb;
}

.user-form-panel-client {
  border-color: #8e6bb0;
  background: #f9f6ff;
}

.user-form-panel-title {
  padding: 5px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: #4a7ebb;
}

.user-form-panel-client .user-form-panel-title {
  background: #8e6bb0;
}

.user-form-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.user-form-row-split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

@media (max-width: 1100px) {
  .detail-layout,
  .admin-grid.two-col,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .detail-rail {
    border-left: 0;
    border-top: 1px solid #ccc;
  }

  .detail-case-nav {
    border-right: 0;
    border-bottom: 1px solid #ccc;
  }

  .detail-case-list {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .master-form-row,
  .master-form-row-split,
  .master-form-row-compact,
  .master-wire-layout,
  .master-service-options,
  .master-template-grid,
  .master-auth-grid {
    grid-template-columns: 1fr;
  }

  .user-form-row,
  .user-form-row-split {
    grid-template-columns: 1fr;
  }
}
.gmenu-btn {
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #fff;
  padding: 4px 8px;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.gmenu-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.18);
}

.topbar-breadcrumb {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.breadcrumb-sep {
  opacity: 0.6;
}

.gsidebar {
  flex-shrink: 0;
  width: 0;
  padding: 8px 0;
  border-right: 0 solid var(--line);
  background: #fff;
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  transition: width 0.22s ease, border-right-width 0.22s ease;
}

.gsidebar.is-open {
  width: 220px;
  border-right-width: 1px;
  overflow-y: auto;
}

.gmenu-sect {
  padding: 7px 14px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.gmenu-item {
  display: block;
  width: 100%;
  padding: 7px 14px;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.gmenu-item:hover,
.gmenu-item:focus-visible {
  background: #faf7fd;
}

.gmenu-item[aria-current="page"] {
  background: #8e6bb0;
  color: #fff;
  font-weight: 700;
}
.facility-chat-badge {
  margin-left: 6px;
  padding: 3px 7px;
  border: 1px solid #ccd4de;
  border-radius: 12px;
  background: #f2f4f7;
  color: #536273;
  cursor: pointer;
  white-space: nowrap;
  font: inherit;
}

.facility-chat-badge.is-unread {
  border-color: #a33327;
  background: #fff0ec;
  color: #92291d;
  font-weight: 700;
}

.facility-chat-badge:focus-visible {
  outline: 2px solid #174ea6;
  outline-offset: 2px;
}

.facility-chat-total {
  margin-left: 8px;
  font-weight: 700;
}

.facility-chat-panel {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.facility-chat-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.facility-chat-heading h2 {
  margin: 0;
  font-size: 18px;
}

.facility-chat-messages {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 180px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 16px 0;
}

.facility-chat-message {
  width: min(85%, 700px);
  padding: 12px;
  border: 1px solid #d8dfe7;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.facility-chat-message.is-client {
  align-self: flex-start;
  background: #f5f6f8;
}

.facility-chat-message.is-internal {
  align-self: flex-end;
  background: #edf5ff;
}

.facility-chat-message .comment-meta {
  flex-wrap: wrap;
  gap: 8px;
}

.facility-chat-attachment {
  display: inline-block;
  margin-top: 8px;
}

.facility-chat-unread-divider {
  border-top: 1px solid #a33327;
  padding-top: 8px;
  text-align: center;
  color: #92291d;
}

.facility-chat-form {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #d8dfe7;
}

.facility-chat-form .report-control-field {
  min-width: 0;
}

.client-portal .client-portal-group-child {
  background: #f4f7fa;
}

.client-portal .client-portal-group-child[hidden] {
  display: none;
}

.client-portal .client-portal-group-child > td:first-child {
  padding-left: 36px;
}

.client-portal .client-portal-group-toggle {
  min-width: 32px;
  min-height: 32px;
  margin-right: 8px;
}

.client-portal .client-portal-group-note {
  display: block;
  margin: 4px 0;
  color: #465568;
  font-size: 0.875rem;
}

.client-case-detail .client-case-related ol {
  display: grid;
  gap: 12px;
  padding-left: 24px;
}

.client-case-detail .client-case-related li {
  padding: 12px;
  border: 1px solid #d8dfe7;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.client-case-detail .client-case-related li[aria-current="true"] {
  background: #edf5ff;
}

.client-portal .client-portal-group-toggle:focus-visible,
.client-case-detail [data-client-related-case]:focus-visible {
  outline: 2px solid #245ca6;
  outline-offset: 2px;
}

.case-group-header {
  font-weight: 700;
  margin-bottom: 12px;
}

.case-block {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin: 16px 0;
  padding: 12px;
  scroll-margin-top: 16px;
}

.case-block.is-focused {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px #bfdbfe;
}

.case-block-title {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: #f1f5f9;
  color: #1e293b;
  padding: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.case-block-title:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.case-block-collapsed {
  padding: 4px;
}

/* 問い合わせのまとめ（docs/architecture-case-merge.md §6） */
.case-merge-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 6px 4px;
  font-size: 0.85rem;
  color: #334155;
  cursor: pointer;
}

.case-merge-select:has(input:disabled) {
  color: #94a3b8;
  cursor: not-allowed;
}

.history-add-row #caseMergeButton {
  margin-left: 8px;
}

.case-block [hidden] {
  display: none;
}

.case-group-count {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  color: #475569;
}

#caseCommentTarget {
  padding: 10px;
  background: #eff6ff;
  overflow-wrap: anywhere;
}

.detail-case-item[aria-current="true"] {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

/* Reservation rows and their matching memo inputs share the same grid tracks. */
.reservation-info-panel { container-type: inline-size; }
.reservation-info-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr) minmax(220px, 1fr);
  grid-template-rows: repeat(3, minmax(40px, auto));
}
.reservation-info-layout .detail-info-table {
  display: grid;
  grid-row: 1 / 4;
  grid-template-rows: subgrid;
  grid-template-columns: repeat(3, auto minmax(0, 1fr));
  min-width: 0;
}
.reservation-info-layout .detail-info-table tbody {
  display: grid;
  grid-row: 1 / 4;
  grid-column: 1 / -1;
  grid-template-rows: subgrid;
  grid-template-columns: subgrid;
}
.reservation-info-layout .detail-info-table tr {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
}
.reservation-info-layout .detail-info-table th,
.reservation-info-layout .detail-info-table td {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow-wrap: anywhere;
}
.reservation-info-layout #detailRoomInfo { grid-column: 2 / -1; }
.tll-memo-fields {
  display: grid;
  grid-column: 2;
  grid-row: 1 / 4;
  grid-template-rows: subgrid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding-left: 10px;
  min-width: 0;
}
.staff-note-fields { grid-column: 3; }
.reservation-panel-heading { padding-left: 8px; display: flex; align-items: baseline; gap: 10px; }
.reservation-panel-memo-title { padding-left: 21px; font-size: 12px; font-weight: 700; }
.tll-memo-fields textarea { grid-column: 1; grid-row: 1 / 4; min-width: 0; width: 100%; height: 100%; box-sizing: border-box; margin: 3px 0; resize: none; font: inherit; line-height: 1.4; }
.tll-memo-status { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.tll-memo-status .action-feedback { min-height: 0; }
/* 予約情報の7項目の手動編集（docs/architecture-reservation-edit.md §5） */
.reservation-edit-buttons { display: inline-flex; gap: 6px; margin-left: auto; }
.reservation-edit-button { padding: 1px 10px; font-size: 12px; line-height: 1.6; }
.reservation-manual-badge { display: inline-block; margin-left: 4px; padding: 0 5px; border: 1px solid #c58b00; border-radius: 3px; background: var(--yellow-soft); color: #7a5600; font-size: 10px; line-height: 1.5; vertical-align: middle; cursor: help; }
.reservation-edit-field { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; max-width: 100%; }
.reservation-edit-field input, .reservation-edit-field select, .reservation-edit-field textarea { max-width: 100%; box-sizing: border-box; font: inherit; }
.reservation-edit-field input[type="number"] { width: 6em; }
.reservation-edit-room { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; }
.reservation-edit-room label { display: inline-flex; flex-direction: column; gap: 2px; font-size: 12px; }
.reservation-edit-room textarea { min-width: 16em; resize: vertical; }
.reservation-edit-revert { padding: 0 6px; border: 1px solid #9aa7b4; border-radius: 3px; background: #fff; color: #2c4a6b; font-size: 11px; line-height: 1.6; cursor: pointer; }
.reservation-edit-note, .reservation-edit-latest { color: var(--muted); font-size: 11px; }
.reservation-edit-latest:empty, .reservation-edit-note:empty, .reservation-edit-error:empty { display: none; }
.reservation-edit-error { color: #b42318; font-size: 11px; }
#detailNights input { width: 5em; margin-right: 2px; }
@media (max-width: 900px) {
  .reservation-info-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(9, minmax(40px, auto)); }
  .tll-memo-fields { grid-column: 1; grid-row: 4 / 7; padding-left: 0; }
  .staff-note-fields { grid-column: 1; grid-row: 7 / 10; }
  .reservation-panel-title { grid-template-columns: minmax(0, 1fr); }
  .reservation-panel-memo-title { display: none; }
}
@media (max-width: 560px) {
  .reservation-info-layout .detail-info-table th { white-space: normal; }
  .reservation-info-layout .detail-info-table { grid-template-columns: repeat(3, minmax(0, 0.8fr) minmax(0, 1fr)); }
}

@container (max-width: 760px) {
  .reservation-info-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(9, minmax(40px, auto)); }
  .tll-memo-fields { grid-column: 1; grid-row: 4 / 7; padding-left: 0; }
  .staff-note-fields { grid-column: 1; grid-row: 7 / 10; }
  .reservation-panel-title { grid-template-columns: minmax(0, 1fr); }
  .reservation-panel-memo-title { display: none; }
}
@container (max-width: 560px) {
  .reservation-info-layout .detail-info-table th { white-space: normal; }
  .reservation-info-layout .detail-info-table { grid-template-columns: repeat(3, minmax(0, 0.8fr) minmax(0, 1fr)); }
}

.copy-button {
  margin-left: 4px;
  padding: 1px 8px;
  border: 1px solid #9aa7b4;
  border-radius: 3px;
  background: #fff;
  color: #2c4a6b;
  font-size: 11px;
  line-height: 1.6;
  cursor: pointer;
  vertical-align: middle;
}

.copy-button:hover {
  background: #eef3f8;
}

.copy-button.is-copied {
  border-color: #2e8b57;
  color: #2e8b57;
}

.facility-comment-badge {
  margin-left: 4px;
  padding: 3px 7px;
  border: 1px solid #ccd4de;
  border-radius: 12px;
  background: #f2f4f7;
  color: #536273;
  cursor: pointer;
  white-space: nowrap;
  font: inherit;
}

.facility-comment-badge.is-unread {
  border-color: #a33327;
  background: #fff0ec;
  color: #92291d;
  font-weight: 700;
}

.facility-comment-badge:focus-visible {
  outline: 2px solid #174ea6;
  outline-offset: 2px;
}

.case-comment-unread {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid #a33327;
  border-radius: 10px;
  background: #fff0ec;
  color: #92291d;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* 対応不要の案件は、一覧の行と案件詳細のブロックをグレーにして、対応が必要な案件と見分けやすくする */
tr.is-no-action > td {
  background: #e5e7eb;
  color: #4b5563;
}

.list-table tr.is-no-action:hover > td {
  background: #d9dce1;
}

.case-block[data-no-action="true"] {
  background: #eceff1;
}

.case-block[data-no-action="true"] .history-table tr.current-row td {
  background: #e5e7eb;
}

tr.has-unread-comment > td:first-child {
  box-shadow: inset 3px 0 0 #a33327;
}

.admin-meta.is-error {
  color: #c00;
  font-weight: 700;
}

.billing-warnings {
  border-color: #a33327;
  background: #fff0ec;
  color: #92291d;
}

.billing-warnings ul {
  margin: 6px 0 0 18px;
}

#billingSettingsBody input[type="text"] {
  width: 100%;
  min-width: 220px;
}

#billingSettingsBody input[type="number"] {
  width: 110px;
}

/* 監査ログの「詳細」は変更前後の値が長くなるため、折り返して全文を読めるようにする */
#auditLogBody td:last-child {
  white-space: normal;
  overflow-wrap: anywhere;
}

.case-edit-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid #b45309;
  border-radius: 2px;
  color: #b45309;
  font-size: 10px;
  white-space: nowrap;
}

.password-toggle-button .icon-eye-off { display: none; }
.password-toggle-button[aria-pressed="true"] .icon-eye { display: none; }
.password-toggle-button[aria-pressed="true"] .icon-eye-off { display: block; }
