:root {
  --khx-base: #f8fafc;
  --khx-blue: #d9eff8;
  --khx-pink: #f8dee7;
  --khx-ink: #303d49;
  --khx-muted: #5f6f7d;
  --khx-line: #d5dfe6;
  --khx-focus: #3a728a;
  --khx-panel: #ffffff;
  --khx-soft: #f0f7fa;
  --khx-shadow: 0 7px 20px rgba(49, 75, 98, .06);
  --khx-font: "BIZ UDPGothic", "Yu Gothic UI", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--khx-base); color: var(--khx-ink); -webkit-text-size-adjust: 100%; }
body.khx-body { margin: 0; min-width: 0; background: var(--khx-base); color: var(--khx-ink); font-family: var(--khx-font); font-size: 16px; line-height: 1.65; }
.khx-body a { color: inherit; text-decoration: none; }
.khx-body button, .khx-body input, .khx-body select, .khx-body textarea { font: inherit; }
.khx-body button, .khx-body a, .khx-body input, .khx-body select, .khx-body textarea { touch-action: manipulation; }
.khx-body button { cursor: pointer; color: inherit; }
.khx-body button:disabled { cursor: default; opacity: .55; }
.khx-body button:focus-visible, .khx-body a:focus-visible { outline: 3px solid var(--khx-focus); outline-offset: 4px; }
.khx-body input:focus, .khx-body select:focus, .khx-body textarea:focus { outline: 3px solid var(--khx-blue); border-color: var(--khx-focus); }
.khx-body svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* サンプルと同じ外枠：固定サイドバー、左余白付きシェル、77pxトップバー。 */
.khx-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; width: 236px; flex-direction: column; overflow-y: auto; padding: 30px 20px; border-right: 1px solid #e5ebef; background: #fff; }
.khx-brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: .02em; }
.khx-brand > span:last-child { display: block; }
.khx-brand strong { display: block; }
.khx-brand small { display: block; color: var(--khx-muted); font-size: 12px; font-weight: 500; letter-spacing: .1em; }
.khx-mark { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 14px; background: var(--khx-blue); color: #3e697c; font-size: 12px; }
.khx-sidebar-title, .khx-sidebar-heading { margin: 30px 12px 12px; color: var(--khx-muted); font-size: 12px; letter-spacing: .1em; }
.khx-nav { display: grid; gap: 0; }
.khx-nav a { display: flex; width: 100%; min-height: 46px; align-items: center; gap: 12px; margin-bottom: 4px; padding: 11px 13px; border: 0; border-radius: 11px; background: none; text-align: left; font-size: 14px; font-weight: 600; }
.khx-nav a:hover { background: #edf5f8; }
.khx-nav a.is-active { background: var(--khx-blue); color: #2d5363; }
.khx-nav a.is-active::after { margin-left: auto; padding: 1px 6px; border-radius: 5px; background: #fff; content: "現在"; font-size: 11px; }
.khx-nav .khx-icon { width: 19px; height: 19px; color: #617481; }
.khx-nav a.is-active .khx-icon { color: #3e697c; }
.khx-nav-secondary { margin-bottom: 0; }
.khx-sidebar-bottom { margin-top: auto; padding-top: 20px; }
.khx-clinic { padding: 18px 12px 3px; border-top: 1px solid var(--khx-line); font-size: 14px; }
.khx-clinic strong { display: block; font-size: 16px; }
.khx-small { color: var(--khx-muted); font-size: 12px; }
.khx-clinic-picker { display: grid; gap: 5px; margin-top: 12px; color: var(--khx-muted); font-size: 11px; font-weight: 700; }
.khx-clinic-picker select { width: 100%; min-height: 40px; padding: 7px 9px; border: 1px solid #aebec9; border-radius: 9px; background: #fff; color: var(--khx-ink); }
.khx-nav-logout { display: flex; align-items: center; gap: 12px; margin: 10px 0 0; padding: 11px 13px; color: var(--khx-ink); font-size: 14px; font-weight: 600; }
.khx-nav-logout .khx-icon { width: 19px; height: 19px; color: #617481; }
.khx-skip { position: fixed; top: 12px; left: 18px; z-index: 12; padding: 8px 12px; border-radius: 10px; background: var(--khx-ink); color: #fff; transform: translateY(-150%); }
.khx-skip:focus { transform: none; }

.khx-shell { min-height: 100vh; margin-left: 236px; }
.khx-topbar { display: flex; height: 77px; align-items: center; justify-content: space-between; gap: 15px; padding: 0 48px; border-bottom: 1px solid #e5ebef; background: rgba(255, 255, 255, .72); font-size: 14px; }
.khx-crumb { color: var(--khx-muted); }
.khx-crumb > span { margin: 0 12px; color: #a0acb6; }
.khx-top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.khx-env { padding: 5px 12px; border-radius: 30px; background: var(--khx-blue); color: #355f73; font-size: 12px; white-space: nowrap; }
.khx-switch, .khx-logout { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 8px 12px; border: 1px solid var(--khx-line); border-radius: 10px; background: #fff; font-size: 12px; font-weight: 700; }
.khx-switch { border-color: #e3a2b8; background: #fff8fa; color: #a45270; }
.khx-mobile-menu { display: none; align-items: center; gap: 6px; min-height: 42px; padding: 8px; border: 0; background: transparent; font-size: 13px; }
.khx-main { width: 100%; max-width: 1280px; min-height: calc(100vh - 77px); margin: 0 auto; padding: 36px 48px 60px; }
.khx-footer-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 34px; padding-top: 17px; border-top: 1px solid #e1e8ec; color: var(--khx-muted); font-size: 12px; }
.khx-footer-note .khx-icon { width: 17px; height: 17px; margin-top: 2px; }
.khx-footer-note p { margin: 0; }

.khx-page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.khx-kicker { margin: 0 0 5px; color: var(--khx-muted); font-size: 12px; letter-spacing: .15em; }
.khx-page-head h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: .04em; line-height: 1.4; }
.khx-lead { max-width: 760px; margin: 0; color: var(--khx-muted); font-size: 14px; }
.khx-purpose { max-width: 760px; margin: 14px 0 0; padding: 12px 16px; border-left: 3px solid #dc7f9e; border-radius: 0 10px 10px 0; background: #fff; color: var(--khx-muted); font-size: 13px; }
.khx-purpose strong { color: #8d5269; }
.khx-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.khx-page-actions { display: grid; justify-items: end; gap: 9px; flex-shrink: 0; }
.khx-action-buttons { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.khx-action-buttons .khx-button { white-space: nowrap; }
.khx-button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 10px; padding: 11px 21px; border: 1px solid var(--khx-line); border-radius: 12px; background: #fff; color: var(--khx-ink); text-align: center; font-size: 14px; font-weight: 700; }
.khx-button:hover { filter: brightness(.97); }
.khx-button.primary { border-color: var(--khx-pink); background: var(--khx-pink); color: #704853; }
.khx-button.secondary { border-color: var(--khx-blue); background: var(--khx-blue); }
.khx-button.quiet { border-color: transparent; background: transparent; }
.khx-button.danger { border-color: #dfa0b2; background: #fff; color: #99475f; }
.khx-block { width: 100%; }

.khx-section { margin: 20px 0; padding: 26px; border: 1px solid #dfe7ed; border-radius: 19px; background: var(--khx-panel); box-shadow: var(--khx-shadow); }
.khx-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.khx-section-title { display: flex; align-items: flex-start; gap: 12px; }
.khx-step { display: inline-grid; width: 30px; height: 30px; flex-shrink: 0; place-items: center; border-radius: 10px; background: var(--khx-blue); font-size: 14px; font-weight: 800; }
.khx-section h2 { margin: 0; font-size: 20px; line-height: 1.5; }
.khx-section-head p { margin: 4px 0 0; color: var(--khx-muted); font-size: 14px; }
.khx-section-note { color: var(--khx-muted); font-size: 12px; }
.khx-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border-radius: 20px; background: var(--khx-blue); color: #355f73; font-size: 12px; font-weight: 700; white-space: nowrap; }
.khx-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.khx-tools-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.khx-card { display: grid; gap: 7px; padding: 23px; border: 1px solid #e0e8ed; border-radius: 18px; background: #fff; text-align: left; }
.khx-card:hover { transform: translateY(-2px); box-shadow: var(--khx-shadow); }
.khx-card-featured { border-color: #b7d9e7; background: #f2f9fc; }
.khx-card-icon { display: grid; width: 49px; height: 49px; place-items: center; border-radius: 15px; background: var(--khx-blue); color: #3e697c; }
.khx-card h3 { margin: 0; font-size: 17px; }
.khx-card p { margin: 0; color: var(--khx-muted); font-size: 14px; }
.khx-card-link { display: flex; align-items: center; gap: 6px; margin-top: 5px; color: #355f73; font-size: 13px; font-weight: 700; }

.khx-period { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 0 0 24px; padding: 16px 20px; border: 1px solid #dfe7ed; border-radius: 15px; background: #fff; }
.khx-period > div { display: grid; gap: 0; min-width: 170px; }
.khx-period > div strong { font-size: 15px; }
.khx-period > div span { color: var(--khx-muted); font-size: 12px; }
.khx-period input { width: 225px; min-height: 48px; padding: 10px 13px; border: 1px solid #aebec9; border-radius: 9px; background: var(--khx-base); color: var(--khx-ink); }
.khx-period-form { display: flex; align-items: flex-end; gap: 10px; }
.khx-period-status { align-self: center; margin-left: auto; color: var(--khx-muted); font-size: 12px; }
.khx-period-office { display: flex; align-items: flex-end; gap: 10px; margin-left: auto; }
.khx-period-office .khx-field { min-width: 210px; }
.khx-period-links { display: flex; gap: 8px; flex-wrap: wrap; }
.khx-date-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 17px; }
.khx-date-pill { display: grid; min-width: 62px; min-height: 55px; place-items: center; padding: 6px 8px; border: 1px solid #d6e2e9; border-radius: 11px; background: #fff; color: var(--khx-ink); }
.khx-date-pill.is-current { border-color: #87b5ca; background: var(--khx-blue); }
.khx-date-pill strong { font-size: 17px; line-height: 1.2; }
.khx-date-pill small { color: var(--khx-muted); font-size: 10px; }

.khx-field { display: grid; min-width: 0; gap: 7px; color: var(--khx-ink); font-size: 14px; font-weight: 650; }
.khx-field > span:first-child { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.khx-field small { color: var(--khx-muted); font-size: 12px; font-weight: 400; }
.khx-field input, .khx-field select, .khx-field textarea, .khx-filter input, .khx-filter select { width: 100%; min-height: 48px; min-width: 0; padding: 10px 13px; border: 1px solid #aebec9; border-radius: 9px; background: #fff; color: var(--khx-ink); }
.khx-field textarea { display: block; min-height: 110px; resize: vertical; line-height: 1.6; }
.khx-field input::placeholder { color: #788691; font-size: 14px; }
.khx-required { display: inline-flex; padding: 1px 6px; border-radius: 4px; background: #f8e3ea; color: #704853; font-size: 11px; font-weight: 500; }
.khx-optional { display: inline-flex; padding: 1px 6px; border-radius: 4px; background: #edf2f5; color: #5d6a73; font-size: 11px; font-weight: 500; }
.khx-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 25px; }
.khx-field.wide, .khx-wide { grid-column: 1 / -1; }
.khx-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 26px; padding-top: 20px; border-top: 1px solid #e6ecf0; }
.khx-help { margin: 0; color: var(--khx-muted); font-size: 12px; }
.khx-alert { margin: 18px 0; padding: 15px 18px; border-radius: 12px; background: #fcf0f4; color: #754552; font-size: 13px; }
.khx-alert.ok { background: var(--khx-blue); color: #355f73; }
.khx-alert-text { color: #934b65; font-weight: 700; }
.khx-upload-error { overflow: hidden; }
.khx-visit-error-details { margin-top: 12px; overflow: hidden; color: var(--khx-ink); font-weight: 400; }
.khx-visit-error-details table { width: 100%; table-layout: fixed; border-collapse: collapse; background: #fff; font-size: 12px; line-height: 1.45; }
.khx-visit-error-details th, .khx-visit-error-details td { padding: 6px 8px; border: 1px solid #dbe5ea; text-align: left; vertical-align: top; overflow-wrap: anywhere; word-break: break-word; }
.khx-visit-error-details th { background: #f3f7f9; font-weight: 700; }
.khx-visit-error-details th:nth-child(1), .khx-visit-error-details td:nth-child(1) { width: 13%; }
.khx-visit-error-details th:nth-child(2), .khx-visit-error-details td:nth-child(2) { width: 18%; }
.khx-visit-error-details th:nth-child(3), .khx-visit-error-details td:nth-child(3) { width: 16%; }
.khx-visit-error-details th:nth-child(4), .khx-visit-error-details td:nth-child(4) { width: 21%; }
.khx-visit-error-details th:nth-child(5), .khx-visit-error-details td:nth-child(5) { width: 32%; }
.khx-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.khx-stat { padding: 20px; border-radius: 15px; background: var(--khx-soft); }
.khx-stat span { display: block; margin-bottom: 7px; color: var(--khx-muted); font-size: 13px; }
.khx-stat strong { display: block; font-size: 25px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.5; }
.khx-stat strong small { margin-left: 5px; font-size: 13px; font-weight: 500; }
.khx-stat > small { color: var(--khx-muted); font-size: 11px; }
.khx-read { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.khx-read-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid #eaf0f3; font-size: 14px; }
.khx-read-row span { color: var(--khx-muted); }
.khx-read-row b { overflow-wrap: anywhere; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.khx-subcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.khx-subcard { padding: 18px; border: 1px solid #dce5eb; border-radius: 14px; background: #fff; }
.khx-subcard h3 { margin: 0 0 8px; font-size: 15px; }
.khx-subcard .khx-read { grid-template-columns: 1fr; }
.khx-flow { display: flex; align-items: center; gap: 16px; margin: 25px 0; color: var(--khx-muted); font-size: 13px; }
.khx-flow strong { color: var(--khx-ink); }
.khx-flow span { color: var(--khx-line); }
.khx-balance-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.khx-balance-callout { margin: 18px 0; padding: 18px 20px; border-radius: 13px; background: #f1f6f9; }
.khx-balance-summary .khx-balance-callout { margin: 0; }
.khx-balance-callout span, .khx-balance-callout small { display: block; color: var(--khx-muted); font-size: 12px; }
.khx-balance-callout strong { display: block; font-size: 25px; font-weight: 750; font-variant-numeric: tabular-nums; }
.khx-difference-callout { display: grid; min-height: 104px; align-content: center; gap: 4px; padding: 18px 20px; border: 1px solid #e4d8de; border-radius: 13px; background: #fff8fa; }
.khx-difference-callout > span, .khx-difference-callout > small { color: var(--khx-muted); font-size: 12px; }
.khx-difference-callout > strong { color: #754552; font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.khx-difference-callout.is-diff { border-color: #d9a7b7; background: #fff1f5; }
.khx-difference-callout.is-diff > strong { color: #934b65; }
.khx-difference-callout.is-match { border-color: #b9d9d0; background: #f3fbf8; }
.khx-difference-callout.is-match > strong { color: #2d7467; }
.khx-difference, .khx-balance-difference { margin: 14px 0 0; color: var(--khx-muted); font-size: 12px; }
.khx-difference.is-diff, .khx-balance-difference.is-diff { color: #8d5269; font-weight: 700; }
.khx-negative { display: block; margin-top: 3px; color: #934b65; font-size: 12px; font-weight: 600; }

.khx-filter { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border: 1px solid #dfe7ed; border-radius: 15px; background: #fff; }
.khx-filter .khx-field { flex: 1; min-width: 200px; }
.khx-filter > .khx-button { flex-shrink: 0; }
.khx-upload { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.khx-upload .khx-field { flex: 1; min-width: 250px; }
.khx-state-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; padding: 5px; border-radius: 13px; background: #eef3f6; }
.khx-state-tab { display: inline-flex; min-height: 48px; flex: 1; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 9px; color: var(--khx-ink); font-size: 14px; font-weight: 600; }
.khx-state-tab strong { padding: 1px 7px; border-radius: 20px; background: #f0f4f6; font-size: 12px; }
.khx-state-tab.is-active { background: var(--khx-blue); color: #2f5364; box-shadow: 0 2px 5px rgba(37, 68, 87, .04); }
.khx-state-tab.is-active strong { background: #fff; }
.khx-choice { display: flex; gap: 16px; margin: 0 0 15px; padding: 12px 14px; border: 1px solid #dce5eb; border-radius: 10px; }
.khx-choice legend { padding: 0 4px; color: var(--khx-muted); font-size: 12px; }
.khx-choice label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.khx-choice input { width: 18px; min-height: 18px; }

.khx-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.khx-work-list, .khx-work-detail { min-width: 0; }
.khx-work-detail { padding: 24px; border-left: 1px solid #e5edf1; background: #fbfdfe; }
.khx-select-row { display: grid; grid-template-columns: auto minmax(110px, 1fr) minmax(100px, 1fr) auto; align-items: center; gap: 9px 13px; margin: 9px 0; padding: 14px 15px; border: 1px solid #dce5eb; border-radius: 13px; background: #fff; font-size: 13px; }
.khx-select-row:hover, .khx-select-row.is-selected { border-color: #87b5ca; background: #eff8fc; }
.khx-select-row > span:first-child { color: var(--khx-muted); font-variant-numeric: tabular-nums; }
.khx-select-row small, .khx-select-row em { color: var(--khx-muted); font-size: 11px; font-style: normal; }
.khx-select-row b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.khx-select-row em { grid-column: 2 / -1; }
.khx-selected-amount { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin: 15px 0; padding: 16px 18px; border-radius: 12px; background: var(--khx-blue); }
.khx-selected-amount span { color: var(--khx-muted); font-size: 13px; }
.khx-selected-amount strong { font-size: 25px; font-variant-numeric: tabular-nums; }
.khx-sub-form { margin-top: 17px; padding-top: 17px; border-top: 1px solid #e4ecf0; }

.khx-action-grid { align-items: start; }
.khx-action-card { display: grid; gap: 16px; padding: 22px; border: 1px solid #dce5eb; border-radius: 15px; background: #fff; }
.khx-action-card h3 { margin: 0; font-size: 17px; }
.khx-opening { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; padding: 13px 16px; border-radius: 10px; background: #f2f6f8; font-size: 13px; }
.khx-record-list, .khx-income-records, .khx-summary-clinics, .khx-clinic-list, .khx-employee-list { display: grid; gap: 14px; }
.khx-record { padding: 23px; border: 1px solid #dfe7ed; border-radius: 16px; background: #fff; }
.khx-income-record { padding: 23px; border: 1px solid #dfe7ed; border-radius: 16px; background: #fff; }
.khx-record-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.khx-record-head h3 { margin: 0; font-size: 17px; }
.khx-record-head small, .khx-record-meta { color: var(--khx-muted); font-size: 12px; }
.khx-record-head > strong { white-space: nowrap; font-size: 20px; font-variant-numeric: tabular-nums; }
.khx-record-meta { display: flex; justify-content: space-between; gap: 12px 30px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid #e9eef2; }
.khx-date-label { display: inline-block; margin-bottom: 3px; color: var(--khx-muted); font-size: 12px; }
.khx-date-label.day-sunday, .khx-table-day.day-sunday { color: #b25571; }
.khx-date-label.day-saturday, .khx-table-day.day-saturday { color: #4c7890; }
.khx-details { margin-top: 14px; border: 1px solid #dfe7ed; border-radius: 14px; background: #fff; }
.khx-details > summary { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 20px; list-style: none; cursor: pointer; font-size: 15px; font-weight: 700; }
.khx-details > summary::after { content: "＋"; font-size: 20px; font-weight: 400; }
.khx-details[open] > summary::after { content: "−"; }
.khx-details > summary::-webkit-details-marker { display: none; }
.khx-details-body { padding: 0 20px 22px; }
.khx-bonus-backfill-section .khx-details { margin-top: 0; }
.khx-bonus-backfill-summary { display: grid; gap: 4px; }
.khx-bonus-backfill-summary small { color: var(--khx-muted); font-size: 12px; font-weight: 500; }
.khx-delete-form { display: grid; gap: 12px; margin-top: 20px; padding: 15px; border-radius: 12px; background: #f8f0f3; }
.khx-locked-label { display: inline-flex; margin-top: 14px; padding: 5px 9px; border-radius: 6px; background: var(--khx-blue); color: #355f73; font-size: 12px; }

.khx-clinic-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 17px 18px; border: 1px solid #dce5eb; border-radius: 15px; background: #fff; }
.khx-clinic-card:hover { border-color: #87b5ca; box-shadow: var(--khx-shadow); }
.khx-clinic-mark { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 13px; background: var(--khx-blue); color: #3e697c; }
.khx-clinic-card > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.khx-clinic-card strong { font-size: 16px; }
.khx-clinic-card small { color: var(--khx-muted); font-size: 12px; }
.khx-state-line { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 5px; }
.khx-state-line i { padding: 2px 6px; border-radius: 6px; background: #f0f4f6; color: var(--khx-muted); font-size: 10px; font-style: normal; }
.khx-clinic-action { color: #355f73; font-size: 13px; font-weight: 700; white-space: nowrap; }

.khx-empty { padding: 35px 20px; border-radius: 15px; background: var(--khx-base); text-align: center; }
.khx-empty .khx-card-icon { margin: 0 auto 15px; }
.khx-empty strong { display: block; margin-bottom: 8px; }
.khx-empty span { display: block; color: var(--khx-muted); font-size: 14px; }
.khx-empty .khx-button { margin-top: 20px; }
.khx-summary-clinic { padding: 20px; border: 1px solid #dce5eb; border-radius: 14px; background: #fff; }
.khx-summary-clinic .khx-summary { margin: 14px 0; }
.khx-related-link { display: inline-flex; margin-top: 12px; color: #355f73; font-size: 13px; font-weight: 700; }

.khx-view-switch { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0 0 20px; padding: 10px 14px; border: 1px solid #dfe7ed; border-radius: 13px; background: #fff; }
.khx-view-switch > div:first-child { display: grid; gap: 0; }
.khx-view-switch strong { font-size: 14px; }
.khx-view-switch span { color: var(--khx-muted); font-size: 12px; }
.khx-toggle { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: #eef3f6; }
.khx-toggle button { min-height: 40px; padding: 7px 13px; border: 0; border-radius: 8px; background: transparent; color: var(--khx-muted); font-size: 12px; font-weight: 700; }
.khx-toggle button[aria-pressed="true"] { background: var(--khx-blue); color: #2f5364; }
.khx-management-toggle { gap: 3px; padding: 3px; }
.khx-management-choice { display: flex; min-width: 0; flex: 1; margin: 0; }
.khx-management-choice button { display: grid; width: 100%; min-height: 48px; align-content: center; gap: 2px; padding: 7px 13px; text-align: left; }
.khx-management-choice button span { color: inherit; font-size: 12px; }
.khx-management-choice button small { color: inherit; font-size: 10px; font-weight: 500; line-height: 1.35; opacity: .82; }
.khx-management-button { display: grid; min-width: 220px; min-height: 48px; align-content: center; gap: 2px; padding: 7px 15px; border: 0; border-radius: 9px; background: var(--khx-blue); color: #2f5364; font-size: 12px; font-weight: 700; text-align: left; }
.khx-management-button small { color: inherit; font-size: 10px; font-weight: 500; line-height: 1.35; opacity: .82; }
.khx-income-note { margin: 18px 0 0; }
.khx-income-reason { margin-top: 0; }
.khx-income-record .khx-summary { margin: 18px 0 0; }

.khx-price-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.khx-price-card { padding: 24px; border: 1px solid #dce7ed; border-radius: 16px; background: #fff; }
.khx-price-card > span { color: var(--khx-muted); font-size: 12px; }
.khx-price-card h3 { margin: 10px 0 6px; }
.khx-price-card p { color: var(--khx-muted); font-size: 13px; }
.khx-price-card > strong { display: block; margin-top: 16px; font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; }
.khx-price-card > small { color: var(--khx-muted); font-size: 12px; }
.khx-master-list { display: grid; gap: 12px; }
.khx-master-row { display: grid; grid-template-columns: auto repeat(2, minmax(0, 1fr)); align-items: end; gap: 14px; padding: 16px; border: 1px solid #dce5eb; border-radius: 13px; background: #fff; }
.khx-master-row > small, .khx-id { color: var(--khx-muted); font-size: 11px; }
.khx-price-edit-row { grid-template-columns: auto repeat(5, minmax(0, 1fr)); }
.khx-check { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; font-size: 13px; white-space: nowrap; }
.khx-check input { width: 19px; height: 19px; min-height: 19px; }
.khx-employee-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.khx-employee { padding: 20px; border: 1px solid #dce5eb; border-radius: 14px; background: #fff; }
.khx-employee h3 { margin: 0 0 10px; }
.khx-log-row { border: 1px solid #dce5eb; border-radius: 12px; background: #fff; }
.khx-log-row summary { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 12px; min-height: 52px; padding: 12px 15px; cursor: pointer; list-style: none; font-size: 12px; }
.khx-log-row summary::-webkit-details-marker { display: none; }
.khx-log-row summary > strong { padding: 2px 6px; border-radius: 5px; background: var(--khx-blue); font-size: 10px; }
.khx-log-detail { padding: 0 15px 14px; color: var(--khx-muted); font-size: 12px; }
.khx-log-detail p { margin: 3px 0; }

.khx-original-head { margin-bottom: 16px; }
.khx-original-table-wrap { width: 100%; max-height: calc(100vh - 230px); overflow: auto; border: 1px solid #dfe7ed; border-radius: 13px; background: #fff; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; cursor: grab; touch-action: pan-x pan-y; }
.khx-original-table-wrap.dragging { cursor: grabbing; user-select: none; }
.khx-original-table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 11px; }
.khx-original-table th, .khx-original-table td { padding: 7px 8px; border: 1px solid #d5dfe6; text-align: center; vertical-align: middle; white-space: nowrap; }
.khx-original-table th { background: #eef3f6; font-weight: 700; }
.khx-original-table thead th { position: sticky; top: 0; z-index: 4; }
.khx-original-table thead tr:nth-child(2) th { top: var(--khx-sub-top, 44px); z-index: 4; }
.khx-original-table thead tr:first-child th:first-child,
.khx-original-table thead tr:first-child th:nth-child(2),
.khx-original-table tbody tr > :first-child,
.khx-original-table tbody tr > :nth-child(2) { position: sticky; z-index: 5; background: #f5fafc; }
.khx-original-table thead tr:first-child th:first-child,
.khx-original-table tbody tr > :first-child { left: 0; min-width: 34px; width: 34px; }
.khx-original-table thead tr:first-child th:nth-child(2),
.khx-original-table tbody tr > :nth-child(2) { left: 34px; min-width: 58px; width: 58px; box-shadow: 1px 0 0 #d5dfe6; }
.khx-original-table thead tr:first-child th:first-child,
.khx-original-table thead tr:first-child th:nth-child(2) { z-index: 6; }
.khx-original-table thead tr:first-child th { height: 44px; line-height: 1.3; white-space: normal; }
.khx-original-table td { background: #fff; font-variant-numeric: tabular-nums; }
.khx-original-table tr.is-empty td { background: #f8fafc; color: var(--khx-muted); }
.khx-table-day { background: #f5fafc !important; font-weight: 700; }
.khx-table-calc { font-weight: 400; }
.khx-cell-man { background: #fff9fb !important; }
.khx-cell-balance { background: #f8fcfd !important; }
.khx-cell-form { display: grid; gap: 4px; justify-items: center; }
.khx-table-input { width: 80px; min-height: 32px; padding: 4px 5px; border: 1px solid #aebec9; border-radius: 5px; text-align: right; font-size: 11px; }
.khx-icon-button { min-height: 28px; padding: 3px 8px; border: 1px solid #b7d9e7; border-radius: 6px; background: var(--khx-blue); color: #355f73; font-size: 10px; }
.khx-table-note { margin: 12px 0 0; color: var(--khx-muted); font-size: 11px; }

@media (min-width: 1600px) {
  .khx-main { padding-top: 44px; }
  .khx-card { min-height: 155px; }
}
@media (max-width: 1100px) {
  .khx-sidebar { width: 208px; padding: 25px 13px; }
  .khx-shell { margin-left: 208px; }
  .khx-main { padding: 28px; }
  .khx-topbar { padding: 0 28px; }
  .khx-tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .khx-subcards { grid-template-columns: 1fr 1fr; }
  .khx-stat { padding: 16px; }
  .khx-stat strong { font-size: 22px; }
}
@media (max-width: 760px) {
  .khx-sidebar { display: none; top: 67px; bottom: 0; width: 260px; box-shadow: 10px 0 30px rgba(32, 55, 74, .08); }
  .khx-sidebar.is-open { display: flex; }
  .khx-shell { margin-left: 0; }
  .khx-topbar { position: sticky; top: 0; z-index: 6; height: 67px; padding: 0 18px; background: #fff; }
  .khx-mobile-menu { display: inline-flex; }
  .khx-crumb { display: none; }
  .khx-top-actions { gap: 6px; }
  .khx-top-actions .khx-logout { display: none; }
  .khx-top-actions .khx-switch { min-height: 36px; padding: 7px 9px; font-size: 11px; white-space: nowrap; }
  .khx-env { font-size: 11px; }
  .khx-main { padding: 24px 18px 45px; }
  .khx-page-head { display: block; margin-bottom: 23px; }
  .khx-page-head h1 { font-size: 26px; }
  .khx-page-head > .khx-button, .khx-page-head > .khx-tools { margin-top: 18px; }
  .khx-page-head > .khx-button { width: 100%; }
  .khx-section { padding: 20px 16px; border-radius: 16px; }
  .khx-section h2 { font-size: 18px; }
  .khx-section-head { align-items: flex-start; }
  .khx-section-note { display: none; }
  .khx-card-grid, .khx-subcards, .khx-form-grid, .khx-summary, .khx-read, .khx-price-cards, .khx-employee-list { grid-template-columns: 1fr; }
  .khx-tools-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .khx-card { padding: 20px; min-height: 130px; }
  .khx-tools-grid .khx-card { padding: 17px 13px; }
  .khx-tools-grid .khx-card h3 { font-size: 14px; }
  .khx-tools-grid .khx-card p { font-size: 12px; }
  .khx-period { align-items: stretch; padding: 15px; gap: 10px; }
  .khx-period > div { width: 100%; }
  .khx-period input, .khx-period-form { width: 100%; }
  .khx-period-status { margin-left: 0; }
  .khx-period-office { width: 100%; align-items: stretch; margin-left: 0; }
  .khx-period-office .khx-field { min-width: 0; flex: 1; }
  .khx-filter { align-items: stretch; padding: 15px; }
  .khx-filter .khx-field { min-width: 0; }
  .khx-filter > .khx-button { width: 100%; }
  .khx-upload { display: grid; }
  .khx-upload .khx-field { min-width: 0; }
  .khx-state-tabs { margin-bottom: 20px; }
  .khx-state-tab { min-width: 140px; padding: 10px 8px; font-size: 13px; }
  .khx-form-actions { align-items: stretch; flex-direction: column; }
  .khx-form-actions .khx-button { width: 100%; }
  .khx-flow { gap: 6px; font-size: 11px; }
  .khx-workspace { grid-template-columns: 1fr; }
  .khx-work-detail { padding: 18px 0 0; border-top: 1px solid #e5edf1; border-left: 0; }
  .khx-select-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .khx-select-row small { grid-column: 2; }
  .khx-select-row em { grid-column: 2 / -1; }
  .khx-record, .khx-income-record { padding: 18px; }
  .khx-record-head { align-items: flex-start; flex-direction: column; }
  .khx-record-head > strong { align-self: flex-end; }
  .khx-record-meta { gap: 8px 18px; }
  .khx-income-record .khx-summary { grid-template-columns: 1fr; }
  .khx-details-body { padding: 0 15px 18px; }
  .khx-view-switch { align-items: stretch; flex-direction: column; }
  .khx-toggle { width: 100%; }
  .khx-toggle button { flex: 1; }
  .khx-management-choice button { min-height: 52px; }
  .khx-master-row, .khx-price-edit-row { grid-template-columns: 1fr; align-items: stretch; }
  .khx-original-table { font-size: 10px; }
  .khx-original-table th, .khx-original-table td { padding: 5px 6px; }
  .khx-footer-note { margin-top: 24px; }
}

/* 管理画面の専用レイアウト。きはらレイアウトの余白・見出し・カードのリズムで、
   価格・履歴・ログ・原本を表示する。 */
.khx-price-master-list, .khx-doctor-list, .khx-doctor-unlinked-list, .khx-alias-relink-list,
.khx-archive-list, .khx-log-list { display: grid; gap: 15px; }
.khx-price-master-card, .khx-doctor-unlinked-card, .khx-archive-card, .khx-log-card {
  padding: 20px; border: 1px solid var(--khx-line); border-radius: 16px; background: #fff;
}
.khx-price-master-card.is-hidden { background: #f7fafb; }
.khx-price-master-head, .khx-doctor-card-head, .khx-archive-head, .khx-log-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 15px;
}
.khx-price-master-head h3, .khx-doctor-card-head h3, .khx-archive-head h3 { margin: 4px 0 0; font-size: 18px; }
.khx-price-master-head > div, .khx-archive-head > div { min-width: 0; }
.khx-price-master-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.khx-price-master-fields .wide { grid-column: 1 / -1; }
.khx-price-master-foot, .khx-archive-meta, .khx-log-meta {
  display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 15px; padding-top: 13px;
  border-top: 1px solid #e8eef1; color: var(--khx-muted); font-size: 12px;
}
.khx-price-master-new { border-style: dashed; background: #fbfdfe; }
.khx-price-master-new .khx-price-master-fields { margin-top: 14px; }
.khx-doctor-purpose-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.khx-doctor-purpose-grid > div { display: grid; gap: 5px; padding: 15px; border-radius: 12px; background: #f6fafb; }
.khx-doctor-purpose-grid span, .khx-doctor-unlinked-card .khx-read span { color: var(--khx-muted); font-size: 12px; }
.khx-doctor-card { padding: 22px; border: 1px solid #dfe7ed; border-radius: 17px; background: #fff; }
.khx-doctor-card.is-multi { border-color: #9ed6e7; background: #fbfeff; }
.khx-doctor-card-metrics { display: flex; flex-wrap: wrap; gap: 7px; color: var(--khx-muted); font-size: 12px; }
.khx-doctor-card-metrics span, .khx-status-chip { display: inline-flex; min-height: 27px; align-items: center; padding: 4px 9px; border-radius: 999px; background: var(--khx-blue); color: #355f73; font-size: 11px; font-weight: 800; white-space: nowrap; }
.khx-doctor-card-clinics { margin-top: 13px; padding: 11px 13px; border-radius: 10px; background: #f7fafb; color: var(--khx-muted); font-size: 13px; }
.khx-doctor-edit-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, auto); align-items: end; gap: 12px; margin-top: 15px; }
.khx-doctor-edit-grid .wide { min-width: 0; }
.khx-doctor-unlinked-card { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr); gap: 19px; }
.khx-doctor-unlinked-card .khx-read { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.khx-doctor-unlinked-card .khx-read > div { display: grid; gap: 5px; }
.khx-doctor-unlinked-card .khx-read b { overflow-wrap: anywhere; font-size: 14px; }
.khx-alias-list { display: grid; gap: 10px; }
.khx-alias-relink-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.khx-alias-relink-card { display: grid; gap: 7px; padding: 14px; border: 1px solid #dfe7ed; border-radius: 12px; background: #fbfdfe; }
.khx-alias-relink-card small { color: var(--khx-muted); font-size: 12px; }
.khx-doctor-note p { margin: 5px 0; color: var(--khx-muted); font-size: 13px; }
.khx-deletion-meta { display: grid; justify-items: end; gap: 3px; }
.khx-deletion-meta span, .khx-deletion-reason > span { color: var(--khx-muted); font-size: 12px; }
.khx-deletion-reason { margin-top: 15px; padding: 12px 14px; border-radius: 10px; background: #fff7fa; }
.khx-deletion-reason p { margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.khx-deletion-section { margin-top: 16px; }
.khx-deletion-section:first-child { margin-top: 0; }
.khx-deletion-section h4 { margin: 0 0 8px; font-size: 14px; }
.khx-deletion-section dl { display: grid; gap: 0; margin: 0; }
.khx-deletion-section dl > div { display: grid; grid-template-columns: minmax(120px, .35fr) minmax(0, 1fr); border-bottom: 1px solid #e6eef1; font-size: 13px; }
.khx-deletion-section dt, .khx-deletion-section dd { margin: 0; padding: 8px 9px; overflow-wrap: anywhere; }
.khx-deletion-section dt { background: #f5fafb; color: var(--khx-muted); }
.khx-deletion-section dd { white-space: pre-wrap; }
.khx-log-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.khx-log-filter .khx-form-actions { grid-column: 1 / -1; }
.khx-log-counts { display: flex; align-items: baseline; flex-wrap: wrap; gap: 11px 19px; margin-bottom: 15px; color: var(--khx-muted); font-size: 13px; }
.khx-log-counts b { color: var(--khx-ink); font-size: 19px; font-variant-numeric: tabular-nums; }
.khx-log-counts small { margin-left: auto; }
.khx-log-card { border-left: 4px solid #cfe3ea; }
.khx-log-card.khx-log-warn { border-left-color: #d7b36b; }
.khx-log-card.khx-log-error { border-left-color: #d28ba1; }
.khx-log-time, .khx-log-level, .khx-log-event { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border-radius: 8px; background: #f0f6f8; color: var(--khx-muted); font-size: 11px; white-space: nowrap; }
.khx-log-level { font-weight: 800; }
.khx-log-event { color: var(--khx-ink); }
.khx-log-summary { margin-top: 12px; overflow-wrap: anywhere; font-size: 14px; font-weight: 700; }
.khx-log-more { margin-top: 13px; min-height: 36px; font-size: 12px; }
.khx-log-detail-box { margin: 13px 0 0; padding: 13px; overflow: auto; border-radius: 10px; background: #f6fafb; color: var(--khx-ink); font: 12px/1.6 ui-monospace, monospace; white-space: pre-wrap; }
.khx-log-pagination { display: flex; justify-content: space-between; gap: 13px; align-items: center; margin-top: 17px; }
.khx-log-pagination > div { display: flex; flex-wrap: wrap; gap: 9px; }
.khx-month-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; color: var(--khx-muted); font-size: 12px; }
.khx-chip { display: inline-flex; min-height: 31px; align-items: center; padding: 5px 10px; border-radius: 999px; background: #eef5f7; color: #355f73; text-decoration: none; font-size: 12px; font-weight: 700; }
.khx-chip.is-active { background: var(--khx-blue); outline: 1px solid var(--khx-focus); }
.khx-archive-actions { margin-bottom: 15px; }
.khx-archive-head h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.khx-archive-card .khx-details { margin-top: 14px; }
.khx-archive-card .khx-details-body ul { margin: 0; padding-left: 20px; color: var(--khx-muted); font-size: 13px; }
.khx-archive-error { border-color: #e6c8d2; background: #fffafd; }
.khx-archive-reason { margin-top: 15px; padding: 12px 14px; border-radius: 10px; background: #fff3f6; }
.khx-archive-reason > span { color: #9a526a; font-size: 12px; font-weight: 800; }
.khx-archive-reason p { margin: 5px 0 0; overflow-wrap: anywhere; font-size: 14px; }
.khx-progress-compare { display: grid; gap: 15px; }
.khx-progress-compare-group { display: grid; gap: 10px; }
.khx-progress-compare-group > h3 { margin: 0; font-size: 16px; }
.khx-progress-compare-row { display: grid; grid-template-columns: minmax(170px, 1.3fr) repeat(5, minmax(95px, 1fr)) auto; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid #dce7eb; border-radius: 12px; background: #fff; color: inherit; text-decoration: none; }
.khx-progress-compare-row.is-total { border-color: #a8d9e8; background: #f3fbfd; }
.khx-progress-compare-row:hover { border-color: #87b5ca; background: #fbfeff; }
.khx-progress-compare-row > div:not(.khx-progress-compare-name) { display: grid; gap: 3px; min-width: 0; }
.khx-progress-compare-row span, .khx-progress-compare-row small { color: var(--khx-muted); font-size: 11px; }
.khx-progress-compare-row b { overflow-wrap: anywhere; font-size: 13px; font-variant-numeric: tabular-nums; }
.khx-progress-compare-name { display: grid; gap: 3px; min-width: 0; }
.khx-progress-compare-name strong { overflow-wrap: anywhere; }
.khx-progress-compare-row > em { color: #2d667e; font-size: 12px; font-style: normal; font-weight: 800; white-space: nowrap; }

/* 進捗表の年月・基準日を横方向のまとまりとして扱い、1440pxでも
   集計カードが不要に下へ押し出されないようにする。 */
.khx-body .khx-progress-period > .khx-period-heading { display: grid; gap: 0; min-width: 170px; }
.khx-body .khx-progress-period > .khx-period-links,
.khx-body .khx-progress-period > .khx-date-pills { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; width: auto; margin-top: 0; }

@media (max-width: 980px) {
  .khx-price-master-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .khx-doctor-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .khx-doctor-edit-grid .wide { grid-column: 1 / -1; }
  .khx-log-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .khx-price-master-fields, .khx-doctor-purpose-grid, .khx-doctor-unlinked-card .khx-read,
  .khx-alias-relink-list, .khx-log-filter { grid-template-columns: 1fr; }
  .khx-price-master-head, .khx-archive-head { display: grid; }
  .khx-price-master-head .khx-status-chip { justify-self: start; }
  .khx-price-master-head .khx-check { order: 2; }
  .khx-doctor-edit-grid { grid-template-columns: 1fr; }
  .khx-doctor-edit-grid .wide { grid-column: auto; }
  .khx-log-counts small { width: 100%; margin-left: 0; }
  .khx-log-pagination { align-items: stretch; flex-direction: column; }
  .khx-archive-head .khx-button { width: 100%; }
  .khx-progress-compare-row { grid-template-columns: 1fr 1fr; align-items: start; }
  .khx-progress-compare-name, .khx-progress-compare-row > em { grid-column: 1 / -1; }
  .khx-progress-compare-row > em { justify-self: start; }
  .khx-body .khx-progress-period > .khx-period-links,
  .khx-body .khx-progress-period > .khx-date-pills { width: 100%; }
}
@media print {
  .khx-sidebar, .khx-topbar, .khx-page-head .khx-tools, .khx-period, .khx-form-actions, .khx-button, .khx-state-tabs, .khx-mobile-menu, .khx-footer-note { display: none !important; }
  .khx-shell, .khx-main { display: block; min-height: 0; margin: 0; padding: 0; max-width: none; }
  .khx-section, .khx-record, .khx-price-card { break-inside: avoid; box-shadow: none; }
  .khx-original-table-wrap { max-height: none; overflow: visible; cursor: auto; }
  .khx-details .khx-details-body { display: block; }
  .khx-summary { grid-template-columns: repeat(3, 1fr); }
  body.khx-body { background: #fff; font-size: 12px; }
}

/* 振込確認は候補の確認から登録までをカード内で完結させる。 */
.khx-import-strip { display: grid; grid-template-columns: minmax(210px, .8fr) minmax(0, 2fr); align-items: center; gap: 20px; margin: 18px 0 22px; padding: 18px 21px; border: 1px solid #e5c5d0; border-radius: 15px; background: #fff8fa; }
.khx-import-strip > div { display: grid; gap: 3px; }
.khx-import-strip strong { color: #854b62; font-size: 15px; }
.khx-import-strip span { color: var(--khx-muted); font-size: 12px; }
.khx-import-strip form { display: grid; grid-template-columns: minmax(145px, .8fr) minmax(220px, 1.3fr) auto; align-items: end; gap: 12px; }
.khx-import-strip .khx-button { min-height: 45px; }
.khx-result-line { display: block; margin-top: 5px; }
.khx-transfer-cards { display: grid; gap: 14px; }
.khx-transfer-card { padding: 21px; border: 1px solid #dce5eb; border-radius: 16px; background: #fff; }
.khx-transfer-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.khx-transfer-card-head h3 { margin: 2px 0 2px; font-size: 17px; }
.khx-transfer-card-head small { color: var(--khx-muted); font-size: 12px; }
.khx-transfer-card-head > strong { white-space: nowrap; color: #2d667e; font-size: 21px; font-variant-numeric: tabular-nums; }
.khx-transfer-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #e9eef2; color: var(--khx-muted); font-size: 12px; }
.khx-transfer-card .khx-details { margin-top: 15px; }
@media (max-width: 760px) {
  .khx-import-strip { grid-template-columns: 1fr; gap: 12px; padding: 15px; }
  .khx-import-strip form { grid-template-columns: 1fr; align-items: stretch; }
  .khx-transfer-card { padding: 18px; }
  .khx-transfer-card-head { flex-direction: column; }
  .khx-transfer-card-head > strong { align-self: flex-end; }
}

.khx-cash-tabs { margin: 18px 0 22px; }
.khx-cash-tabs .khx-toggle { gap: 0; }
.khx-cash-tabs .khx-toggle a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 18px; border-radius: 9px; color: var(--khx-muted); font-size: 12px; text-decoration: none; }
.khx-cash-tabs .khx-toggle a.is-active { background: var(--khx-pink); color: #75445a; font-weight: 700; }
.khx-transfer-ledger .khx-action-card { width: 100%; }
.khx-transfer-card { display: grid; gap: 12px; padding: 21px; border: 1px solid #dce5eb; border-radius: 16px; background: #fff; }
.khx-transfer-status { display: grid; gap: 3px; justify-items: end; color: var(--khx-muted); font-size: 12px; text-align: right; }
.khx-transfer-status strong { color: #2d667e; font-size: 15px; }
.khx-transfer-status strong.is-unpaid, .khx-transfer-paid.is-unpaid { color: #9a5b36; }
.khx-transfer-paid { padding: 10px 12px; border-radius: 8px; background: #f5fafc; color: #365b6d; font-size: 12px; }
.khx-transfer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.khx-transfer-actions form { margin: 0; }
.khx-cash-tabs .khx-toggle a:first-child { border-radius: 9px 0 0 9px; }
.khx-cash-tabs .khx-toggle a:last-child { border-radius: 0 9px 9px 0; }
.khx-clinic-settings { display: grid; gap: 14px; margin-top: 14px; padding: 21px; border: 1px solid #dce5eb; border-radius: 16px; background: #fff; }
.khx-clinic-settings.is-off { background: #f6f8fa; }
.khx-clinic-settings .khx-record-head { margin: 0; }
.khx-clinic-env { padding-top: 10px; border-top: 1px solid #e8eef2; color: var(--khx-muted); font-size: 11px; }
.khx-clinic-env strong { color: #9a5b36; }
.khx-nested { margin-top: 16px; box-shadow: none; background: #fbfdfe; }
.khx-subsection { display: grid; gap: 10px; margin-top: 18px; }
.khx-subsection h3 { margin: 0; color: var(--khx-ink); font-size: 15px; }
.khx-bonus-row { grid-template-columns: auto repeat(3, minmax(100px, 1fr)); }

@media (max-width: 760px) {
  .khx-cash-tabs .khx-toggle { display: grid; grid-template-columns: 1fr 1fr; }
  .khx-cash-tabs .khx-toggle a { padding-inline: 8px; }
  .khx-transfer-status { justify-items: start; text-align: left; }
  .khx-clinic-settings { padding: 16px; }
  .khx-bonus-row { grid-template-columns: 1fr; }
}

/* 集計・設定系も、サンプルの「目的→選択→カード結果」のリズムに統一する。 */
.khx-data-list, .khx-record-list, .khx-progress-list, .khx-bonus-clinic-grid, .khx-jinjer-summary-grid, .khx-unlisted-list, .khx-link-list { display: grid; gap: 15px; }
.khx-data-card, .khx-record, .khx-bonus-card, .khx-progress-clinic, .khx-progress-corp, .khx-jinjer-summary, .khx-unlisted, .khx-link-row { padding: 21px; border: 1px solid #dfe7ed; border-radius: 16px; background: #fff; }
.khx-data-card-head, .khx-record-head, .khx-progress-category-head, .khx-bonus-scope, .khx-ranking-row, .khx-report-award-head, .khx-report-award-row, .khx-bonus-staff-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.khx-data-card h3, .khx-data-card h4, .khx-record h3, .khx-bonus-card h3, .khx-progress-clinic h3, .khx-progress-corp h3, .khx-unlisted h3 { margin: 0; }
.khx-data-card-head small, .khx-record small, .khx-progress-category-head small, .khx-bonus-card small, .khx-help { color: var(--khx-muted); font-size: 12px; }
.khx-data-card-head > strong, .khx-record-head > strong, .khx-progress-category-head > strong { color: #2d667e; font-size: 21px; font-variant-numeric: tabular-nums; }
.khx-data-card.compact { padding: 17px; }.khx-nested-list { margin: 11px 0 0 13px; }.khx-stat-grid, .khx-progress-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-top: 16px; }.khx-stat-grid > div, .khx-progress-stat { padding: 11px 13px; border-radius: 10px; background: #f5fafc; }.khx-stat-grid span, .khx-progress-stat span { display: block; color: var(--khx-muted); font-size: 11px; }.khx-stat-grid b, .khx-progress-stat strong { display: block; margin-top: 4px; font-size: 17px; font-variant-numeric: tabular-nums; }
.khx-data-pills, .khx-month-grid { display: grid; grid-template-columns: repeat(12, minmax(42px, 1fr)); gap: 7px; margin-top: 15px; }.khx-data-pill, .khx-month-grid > div { display: grid; gap: 2px; min-width: 0; padding: 8px 5px; border-radius: 8px; background: #f3f7f9; text-align: center; }.khx-data-pill.has-value { background: var(--khx-blue); color: #2d6177; }.khx-data-pill b, .khx-month-grid span { color: var(--khx-muted); font-size: 10px; }.khx-data-pill span, .khx-month-grid b { font-size: 12px; font-variant-numeric: tabular-nums; }.khx-data-pill small, .khx-month-grid small, .khx-month-grid em { color: var(--khx-muted); font-size: 9px; font-style: normal; overflow-wrap: anywhere; }
.khx-clinic-list { display: grid; gap: 9px; }.khx-clinic-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 14px 16px; border: 1px solid #dfe7ed; border-radius: 13px; }.khx-clinic-card:hover { border-color: #87b5ca; background: #f6fbfd; }.khx-clinic-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: var(--khx-blue); color: #3e697d; }.khx-clinic-main { display: grid; gap: 1px; }.khx-clinic-main small, .khx-clinic-action { color: var(--khx-muted); font-size: 11px; }.khx-clinic-action { color: #2d667e; font-weight: 800; white-space: nowrap; }
.khx-compare-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 15px; }.khx-compare-card { display: grid; gap: 4px; padding: 12px; border-radius: 10px; background: #f5fafc; }.khx-compare-card span, .khx-compare-card small { color: var(--khx-muted); font-size: 11px; }.khx-compare-card b { font-size: 18px; }.khx-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }.khx-report-card { padding: 16px; border: 1px solid #dfe7ed; border-radius: 13px; }.khx-report-card h3 { margin: 0 0 8px; font-size: 15px; }.khx-report-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; padding: 9px 0; border-top: 1px solid #e8eef1; }.khx-report-row small { grid-column: 1 / -1; color: var(--khx-muted); font-size: 11px; }
.khx-frequency-controls { grid-template-columns: minmax(100px,.7fr) auto minmax(190px,1.7fr) minmax(160px,1fr) auto; }.khx-frequency-clinics { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; grid-column: 1 / -1; padding-top: 5px; }.khx-frequency-grid { display: grid; grid-template-columns: 120px repeat(12,minmax(48px,1fr)); gap: 6px; overflow-x: auto; padding-bottom: 8px; color: var(--khx-muted); font-size: 11px; }.khx-frequency-grid > * { min-width: 48px; padding: 8px 4px; border-radius: 7px; background: #f5fafc; text-align: center; }.khx-frequency-row { display: grid; grid-template-columns: 120px repeat(12,minmax(48px,1fr)); gap: 6px; overflow-x: auto; padding: 6px 0; }.khx-frequency-row > * { min-width: 48px; padding: 8px 4px; border-radius: 7px; background: #fff; text-align: center; font-size: 12px; }.khx-frequency-row > span.has-value { background: var(--khx-blue); font-weight: 800; }.khx-frequency-list { display: grid; gap: 12px; }.khx-frequency-card { padding: 16px; border: 1px solid #dfe7ed; border-radius: 14px; background: #fff; }.khx-frequency-card h3 { margin: 0 0 8px; font-size: 15px; }
.khx-award-suggestion { display: grid; gap: 8px; padding: 16px; border: 1px solid #dfe7ed; border-radius: 13px; }.khx-ranking-row { align-items: center; padding: 10px 0; border-top: 1px solid #e8eef1; }.khx-ranking-row form { margin-left: auto; }.khx-rank { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: var(--khx-pink); color: #8c4a65; font-weight: 800; }
.khx-progress-hero { background: #f1fafd; }.khx-progress-hero-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; }.khx-progress-rate { display: block; margin-top: 6px; color: #2d667e; font-size: 37px; line-height: 1; }.khx-progress-rate.is-low, .khx-progress-category-head > strong.is-low { color: #aa5a70; }.khx-progress-bar { height: 10px; overflow: hidden; margin: 15px 0; border-radius: 999px; background: #e4eef2; }.khx-progress-bar i { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: #8fcfe7; }.khx-progress-category-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }.khx-progress-category { padding: 17px; border: 1px solid #dfe7ed; border-radius: 14px; background: #fff; }.khx-progress-category .khx-read { grid-template-columns: 1fr; }.khx-progress-patients { display: grid; gap: 8px; margin-top: 13px; }.khx-progress-patient { display: grid; gap: 1px; padding: 9px 11px; border-radius: 8px; background: #f6fafb; }.khx-progress-patient span, .khx-progress-patient small, .khx-progress-patient em { color: var(--khx-muted); font-size: 11px; font-style: normal; }.khx-progress-patient strong { font-size: 16px; }.khx-progress-clinic-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }.khx-progress-clinic, .khx-progress-corp { color: inherit; text-decoration: none; }.khx-progress-clinic:hover { border-color: #87b5ca; background: #f6fbfd; }.khx-mini-category-list { display: grid; gap: 7px; margin-top: 13px; }.khx-mini-category-list > div { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 9px; padding-bottom: 6px; border-bottom: 1px solid #e8eef1; font-size: 11px; }.khx-mini-category-list span, .khx-mini-category-list em { color: var(--khx-muted); font-style: normal; }
.khx-bonus-clinic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.khx-bonus-card { display: grid; gap: 12px; }.khx-bonus-scope { align-items: center; padding-top: 10px; border-top: 1px solid #e8eef1; font-size: 12px; }.khx-bonus-scope > span { color: var(--khx-muted); }.khx-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }.khx-bonus-month { display: flex; justify-content: space-between; gap: 9px; padding: 9px 11px; border-radius: 8px; background: #f6fafb; font-size: 12px; }.khx-bonus-month i { color: #3f8068; font-style: normal; font-weight: 800; }.khx-bonus-days { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; padding: 11px; border-radius: 11px; background: #f5fafc; }.khx-bonus-day { display: grid; gap: 1px; min-width: 45px; padding: 7px; border-radius: 8px; background: #fff; text-align: center; font-size: 11px; }.khx-bonus-day small { color: var(--khx-muted); font-size: 10px; }.khx-bonus-staff-list { display: grid; gap: 11px; }.khx-bonus-staff { padding: 15px; border: 1px solid #dfe7ed; border-radius: 13px; background: #fff; }.khx-bonus-checks { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }.khx-bonus-check { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border: 1px solid #dce7eb; border-radius: 8px; font-size: 11px; cursor: pointer; }.khx-bonus-check.is-checked { border-color: #91cddd; background: var(--khx-blue); }.khx-bonus-check input { width: 16px; height: 16px; }.khx-bonus-total { display: flex; justify-content: space-between; gap: 13px; margin-top: 13px; padding: 14px 16px; border-radius: 10px; background: #f2fafd; }.khx-bonus-total span { color: var(--khx-muted); font-size: 12px; }.khx-bonus-total b { color: #2d667e; font-size: 18px; }.khx-staff-edit-list { display: grid; gap: 10px; }.khx-staff-edit { display: grid; grid-template-columns: minmax(180px,1.4fr) repeat(2,minmax(100px,.6fr)) auto; align-items: end; gap: 11px; padding: 13px; border: 1px solid #dfe7ed; border-radius: 10px; }.khx-staff-edit > div { display: grid; gap: 3px; }.khx-staff-edit > div small { color: var(--khx-muted); font-size: 11px; }.khx-warning { color: #a45a43; font-weight: 700; }
.khx-bonus-view-controls { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 14px 0; padding: 10px 14px; border: 1px solid #dfe7ed; border-radius: 13px; background: #fbfdfe; }
.khx-bonus-view-controls > div:first-child { display: grid; min-width: 0; gap: 2px; }
.khx-bonus-view-controls strong { font-size: 13px; }
.khx-bonus-view-controls span { color: var(--khx-muted); font-size: 11px; }
.khx-bonus-toggle { flex-shrink: 0; gap: 2px; padding: 3px; }
.khx-bonus-toggle button { min-height: 36px; padding: 6px 12px; font-size: 11px; white-space: nowrap; }
.khx-bonus-toggle button[aria-pressed="true"] { background: var(--khx-blue); color: #2f5364; box-shadow: 0 2px 5px rgba(37,68,87,.04); }
.khx-body [data-khx-bonus-view-panel][hidden] { display: none !important; }
.khx-bonus-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid #dfe7ed; border-radius: 13px; background: #fff; }
.khx-bonus-table { width: 100%; min-width: 720px; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.khx-bonus-table th, .khx-bonus-table td { padding: 9px 7px; border-bottom: 1px solid #e7edf0; vertical-align: middle; text-align: center; }
.khx-bonus-table thead th { background: #f4f8fa; color: var(--khx-muted); font-size: 10px; font-weight: 800; }
.khx-bonus-table thead th:first-child { width: 150px; text-align: left; }
.khx-bonus-table thead th:nth-child(2) { width: 92px; }
.khx-bonus-table thead th:last-child { width: 88px; }
.khx-bonus-table thead th small { display: block; margin-top: 2px; font-size: 9px; font-weight: 500; }
.khx-bonus-table tbody tr:last-child th, .khx-bonus-table tbody tr:last-child td { border-bottom: 0; }
.khx-bonus-table tbody tr:hover { background: #f7fcfe; }
.khx-bonus-table tbody th { color: #254457; text-align: left; font-weight: 800; }
.khx-bonus-table-name { display: block; overflow-wrap: anywhere; font-size: 15px; line-height: 1.45; }
.khx-bonus-table .khx-badge { margin-right: 3px; }
.khx-bonus-table-check-cell { padding: 5px 3px; }
.khx-bonus-table .khx-bonus-check { display: grid; min-height: 42px; align-content: center; justify-items: center; gap: 1px; padding: 4px 2px; border-radius: 7px; font-size: 10px; }
.khx-bonus-table .khx-bonus-check input { width: 14px; height: 14px; }
.khx-bonus-table .khx-bonus-check small { color: var(--khx-muted); font-size: 9px; }
.khx-bonus-table .khx-bonus-check.is-checked small { color: #2f6176; }
.khx-bonus-table-total { color: #2d667e; font-variant-numeric: tabular-nums; white-space: nowrap; }
.khx-bonus-table-total strong { font-size: 12px; }
.khx-bonus-staff .khx-record-head h3 { font-size: 20px; line-height: 1.45; }
.khx-jinjer-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.khx-jinjer-summary { display: grid; gap: 11px; color: inherit; text-decoration: none; }.khx-jinjer-summary.is-current { border-color: #dc7f9e; background: #fff8fa; }.khx-jinjer-summary > div:first-child { display: flex; justify-content: space-between; gap: 11px; }.khx-jinjer-summary > div:first-child span, .khx-jinjer-summary small { color: var(--khx-muted); font-size: 11px; }.khx-jinjer-summary > div:nth-child(2) { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }.khx-jinjer-summary > div:nth-child(2) b, .khx-jinjer-summary > div:nth-child(2) small { text-align: center; }.khx-jinjer-summary em { color: #2d667e; font-size: 12px; font-style: normal; font-weight: 800; }.khx-jinjer-counts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }.khx-jinjer-counts > div { padding: 13px; border-radius: 10px; background: #f5fafc; text-align: center; }.khx-jinjer-counts strong { display: block; color: #2d667e; font-size: 24px; }.khx-jinjer-counts span { color: var(--khx-muted); font-size: 11px; }.khx-jinjer-legend { display: flex; flex-wrap: wrap; gap: 13px; margin: 14px 0; color: var(--khx-muted); font-size: 11px; }.khx-jinjer-legend b { display: inline-grid; width: 23px; height: 23px; margin-right: 4px; place-items: center; border-radius: 6px; background: var(--khx-blue); color: #2d667e; }.khx-jinjer-filter { display: flex; justify-content: space-between; gap: 13px; align-items: center; flex-wrap: wrap; margin-bottom: 11px; }.khx-jinjer-staff-list { display: grid; gap: 11px; }.khx-jinjer-staff { padding: 14px; border: 1px solid #dfe7ed; border-radius: 11px; }.khx-jinjer-days { display: grid; grid-template-columns: repeat(auto-fit,minmax(58px,1fr)); gap: 6px; margin-top: 11px; }.khx-jinjer-day { display: grid; gap: 1px; padding: 7px 4px; border-radius: 7px; background: #f3f7f9; text-align: center; }.khx-jinjer-day b, .khx-jinjer-day small { color: var(--khx-muted); font-size: 9px; }.khx-jinjer-day strong { font-size: 14px; }.khx-jinjer-day.over { background: #fff0f3; color: #a34e6b; }.khx-jinjer-day.other { background: #fff8e9; color: #9a7132; }.khx-jinjer-day.under { background: #edf8f4; color: #3d8068; }.khx-jinjer-day.unknown { background: #f2f0fa; color: #68568f; }.khx-unlisted { display: grid; grid-template-columns: minmax(0,1fr) minmax(300px,1fr); gap: 16px; }.khx-unlisted .khx-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; }.khx-unlisted .khx-form .khx-check { grid-column: 1 / -1; }.khx-bulk-form { display: flex; flex-wrap: wrap; align-items: end; gap: 11px; margin-top: 13px; padding: 14px; border-radius: 10px; background: #f5fafc; }.khx-bulk-form .khx-field { min-width: 195px; }.khx-link-list { gap: 9px; }.khx-link-row { display: grid; grid-template-columns: minmax(150px,.8fr) minmax(200px,1fr) minmax(150px,1fr); align-items: center; gap: 13px; padding: 12px 14px; }.khx-link-row > div { display: grid; }.khx-link-row small { color: var(--khx-muted); font-size: 11px; }.khx-link-row > span { color: var(--khx-muted); font-size: 11px; }
.khx-setup-image { max-width: 100%; border: 1px solid #dfe7ed; border-radius: 12px; background: #fff; }.khx-step-list, .khx-instruction-list { display: grid; gap: 11px; counter-reset: khx-steps; }.khx-step-list > li, .khx-instruction-list > li { display: grid; grid-template-columns: auto 1fr; gap: 11px; padding: 13px; border-radius: 10px; background: #f5fafc; list-style: none; }.khx-step-list > li::before, .khx-instruction-list > li::before { counter-increment: khx-steps; content: counter(khx-steps); display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; background: var(--khx-blue); color: #2d667e; font-weight: 800; }.khx-closed-day-list { display: grid; gap: 10px; }.khx-closed-day { display: flex; justify-content: space-between; gap: 13px; padding: 12px 14px; border: 1px solid #dfe7ed; border-radius: 10px; }.khx-closed-day small { color: var(--khx-muted); }.khx-target-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }.khx-target-table td, .khx-target-table th { padding: 11px; text-align: left; }.khx-target-table tbody tr { background: #f5fafc; }.khx-target-table tbody td:first-child { border-radius: 9px 0 0 9px; }.khx-target-table tbody td:last-child { border-radius: 0 9px 9px 0; }

/* 進捗分析レポート：サンプル同様、選択画面と生成した紙面を別のカードとして扱う。 */
.khx-report-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }.khx-report-choice-grid.compact { margin-top: 13px; }.khx-report-choice { display: grid; gap: 6px; min-height: 112px; padding: 20px; border: 1px solid #dfe7ed; border-radius: 15px; background: #fff; text-align: left; cursor: pointer; }.khx-report-choice:hover, .khx-report-choice.is-selected { border-color: #dc7f9e; background: #fff7fa; }.khx-report-choice strong { font-size: 18px; }.khx-report-choice span, .khx-report-choice em { color: var(--khx-muted); font-size: 12px; font-style: normal; }.khx-report-target-step { margin-top: 23px; padding-top: 23px; border-top: 1px solid #e6edf0; }.khx-report-step-label, .khx-report-substep { display: flex; align-items: flex-start; gap: 11px; }.khx-report-step-label h3, .khx-report-substep h3 { margin: 0; font-size: 17px; }.khx-report-step-label p, .khx-report-substep p { margin: 4px 0 0; color: var(--khx-muted); font-size: 12px; }.khx-step.small { width: 27px; height: 27px; border-radius: 8px; font-size: 11px; }.khx-report-form-card { display: grid; gap: 18px; padding: 19px; border: 1px solid #e0e9ed; border-radius: 14px; background: #fbfdfe; }.khx-report-four-fields { grid-template-columns: repeat(4,minmax(0,1fr)); }.khx-report-free-fields { display: grid; gap: 15px; }.khx-report-editor-wrap { display: grid; gap: 11px; }.khx-report-toolbar { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px; border: 1px solid #dce7eb; border-bottom: 0; border-radius: 9px 9px 0 0; background: #eff7fa; }.khx-report-toolbar button { min-height: 31px; padding: 5px 11px; border: 1px solid #c9dbe2; border-radius: 7px; background: #fff; color: var(--khx-ink); font-size: 11px; cursor: pointer; }.khx-report-editor { min-height: 105px; padding: 12px; border: 1px solid #aebec9; border-radius: 0 0 9px 9px; background: #fff; }.khx-report-editor:focus { outline: 3px solid rgba(143,207,231,.35); border-color: #62b5d3; }.khx-report-awards { display: grid; gap: 8px; padding: 13px; border: 1px solid #e0e9ed; border-radius: 10px; background: #fff; }.khx-report-award-head { align-items: center; }.khx-report-award-head strong { font-size: 12px; }.khx-report-award-row { align-items: center; padding-top: 9px; border-top: 1px solid #e8eef1; }.khx-report-award-row > div { display: grid; gap: 3px; min-width: 0; }.khx-report-award-row small, .khx-report-award-row em { color: var(--khx-muted); font-size: 10px; font-style: normal; }.khx-report-award-row span { font-size: 12px; overflow-wrap: anywhere; }.khx-report-award-name { color: #c85b78; }.khx-report-award-heading { font-weight: 800; }.khx-report-radio-group { display: flex; flex-wrap: wrap; gap: 15px; margin: 0; padding: 12px 14px; border: 1px solid #dce7eb; border-radius: 10px; }.khx-report-radio-group legend { padding: 0 5px; color: var(--khx-muted); font-size: 11px; }.khx-report-radio-group label { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }.khx-report-radio-group input { width: 17px; height: 17px; }.khx-report-chip-editor { display: grid; gap: 9px; padding: 11px; border: 1px solid #dce7eb; border-radius: 9px; background: #fff; }.khx-report-chips { display: flex; gap: 7px; flex-wrap: wrap; }.khx-report-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; background: var(--khx-blue); color: #2d6177; font-size: 11px; }.khx-report-chip button { border: 0; background: transparent; color: #6b7d87; cursor: pointer; }.khx-report-chip-input { display: flex; gap: 8px; }.khx-report-chip-input input { flex: 1; min-width: 0; min-height: 39px; padding: 8px 10px; border: 1px solid #aebec9; border-radius: 8px; }.khx-report-bonus-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin-top: 9px; }.khx-report-bonus-item { display: flex; justify-content: space-between; gap: 9px; align-items: center; padding: 9px 11px; border: 1px solid #dce7eb; border-radius: 9px; background: #fff; font-size: 11px; }.khx-report-bonus-item input { width: 74px; min-height: 37px; padding: 6px; border: 1px solid #aebec9; border-radius: 7px; text-align: right; }.khx-report-inline-fields label { display: inline-grid; gap: 5px; color: var(--khx-muted); font-size: 11px; }.khx-report-inline-fields input { width: 82px; min-height: 37px; padding: 6px; border: 1px solid #aebec9; border-radius: 7px; }.khx-report-sakura-table table { width: 100%; border-collapse: collapse; margin-top: 9px; font-size: 11px; }.khx-report-sakura-table th, .khx-report-sakura-table td { padding: 7px; border: 1px solid #dce7eb; text-align: center; }.khx-report-sakura-table th { background: var(--khx-blue); }.khx-report-sakura-table input { width: 67px; min-height: 31px; padding: 4px; border: 1px solid #aebec9; border-radius: 6px; text-align: right; }.khx-form-error { padding: 10px 13px; border-left: 3px solid #c85b78; border-radius: 0 8px 8px 0; background: #fff0f4; color: #93455f; font-size: 12px; }.khx-report-output { margin-top: 19px; }.khx-report-paper { width: min(100%, 840px); margin: 0 auto; padding: 29px; border: 1px solid #d9e4e9; border-radius: 14px; background: #fff; box-shadow: 0 13px 32px rgba(46,83,103,.07); }.khx-report-paper-title { margin: 0 0 19px; padding-bottom: 13px; border-bottom: 2px solid #a8d9e8; text-align: center; font-size: 22px; }.khx-report-clinic-kpis { display: grid; gap: 13px; }.khx-report-clinic-kpi-row { padding: 13px; border: 1px solid #dfe7ed; border-radius: 11px; }.khx-report-clinic-kpi-row.is-focus { border-color: #dc7f9e; background: #fff9fb; }.khx-report-clinic-kpi-row h3 { margin: 0 0 10px; font-size: 15px; }.khx-report-kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }.khx-report-kpi { display: grid; gap: 4px; padding: 9px; border: 1px solid #e0e9ed; border-radius: 8px; background: #f7fbfc; }.khx-report-kpi.is-total { border-color: #a8d9e8; background: #effaff; }.khx-report-kpi-title { color: var(--khx-muted); font-size: 10px; }.khx-report-kpi > strong { font-size: 17px; }.khx-report-kpi > strong.is-ok { color: #327b9b; }.khx-report-kpi > strong.is-warn { color: #ad5870; }.khx-report-value-line { display: flex; justify-content: space-between; gap: 9px; color: var(--khx-muted); font-size: 10px; }.khx-report-value-line strong { color: var(--khx-ink); font-variant-numeric: tabular-nums; }.khx-report-congrats { margin: 13px 0; padding: 11px; border-radius: 8px; background: #fff2f5; color: #9c5270; text-align: center; font-size: 12px; font-weight: 800; }.khx-report-patient-card, .khx-report-paper-extra, .khx-report-paper-note { margin-top: 17px; padding-top: 14px; border-top: 1px solid #dfe8ec; }.khx-report-patient-card h3, .khx-report-paper-extra h3 { margin: 0 0 9px; text-align: center; font-size: 15px; }.khx-report-patient-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }.khx-report-patient-clinic { display: grid; gap: 4px; padding: 10px; border-radius: 8px; background: #f5fafc; }.khx-report-patient-clinic > strong { font-size: 12px; }.khx-report-paper-extra table, .khx-report-sakura-paper table { width: 100%; border-collapse: collapse; font-size: 11px; }.khx-report-paper-extra th, .khx-report-paper-extra td, .khx-report-sakura-paper th, .khx-report-sakura-paper td { padding: 8px; border: 1px solid #d5e0e5; text-align: center; }.khx-report-paper-extra th, .khx-report-sakura-paper th { background: #eef8fb; }.khx-report-paper-note { color: var(--khx-ink); font-size: 12px; }.khx-report-rank-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }.khx-report-rank-card { overflow: hidden; border: 1px solid #dfe8ec; border-radius: 10px; }.khx-report-rank-card h3 { margin: 0; padding: 11px 13px; background: #eef8fb; font-size: 13px; }.khx-report-rank-list { display: grid; gap: 6px; padding: 10px 13px; }.khx-report-rank-line { display: grid; grid-template-columns: 50px minmax(0,1fr) auto; gap: 8px; align-items: baseline; font-size: 11px; }.khx-report-rank-line strong { font-variant-numeric: tabular-nums; }.khx-report-rank-number { color: #a44f6c; }.khx-report-sakura-paper { grid-column: 1 / -1; }.khx-report-draft-list { display: grid; gap: 9px; }.khx-report-draft-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }.khx-report-draft-open { display: grid; gap: 3px; min-width: 0; padding: 12px 14px; border: 1px solid #dce7eb; border-radius: 9px; background: #fff; text-align: left; cursor: pointer; }.khx-report-draft-open:hover { border-color: #87b5ca; background: #f6fbfd; }.khx-report-draft-open strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.khx-report-draft-open span { color: var(--khx-muted); font-size: 11px; }.khx-report-export-sandbox { position: fixed; left: -10000px; top: 0; z-index: -1; padding: 0; background: #fff; }.khx-report-toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: min(430px,calc(100vw - 48px)); padding: 13px 17px; border: 1px solid #c9dce3; border-radius: 10px; background: #fff; box-shadow: 0 13px 34px rgba(35,65,82,.18); font-size: 13px; }.khx-report-toast.is-ok { color: #2f735d; }.khx-report-toast.is-error { border-color: #dda4b5; color: #9a4b64; background: #fff6f8; }.khx-button:active { transform: scale(.97); }.khx-card, .khx-button, .khx-report-choice, .khx-report-draft-open { transition: transform 180ms cubic-bezier(.22,1,.36,1), border-color 180ms cubic-bezier(.22,1,.36,1), background-color 180ms cubic-bezier(.22,1,.36,1), box-shadow 180ms cubic-bezier(.22,1,.36,1); }

@media (max-width: 980px) { .khx-report-four-fields, .khx-stat-grid, .khx-progress-category-grid, .khx-report-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.khx-frequency-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }.khx-bonus-clinic-grid, .khx-progress-clinic-grid { grid-template-columns: 1fr; }.khx-staff-edit { grid-template-columns: repeat(2,minmax(0,1fr)); }.khx-link-row { grid-template-columns: 1fr 1fr; }.khx-link-row > span { grid-column: 1 / -1; } }
@media (max-width: 760px) { .khx-report-choice-grid, .khx-report-rank-grid, .khx-report-patient-grid, .khx-report-grid { grid-template-columns: 1fr; }.khx-report-four-fields, .khx-stat-grid, .khx-progress-category-grid, .khx-report-kpi-grid, .khx-report-bonus-grid { grid-template-columns: 1fr 1fr; }.khx-form-actions { align-items: stretch; flex-direction: column; }.khx-form-actions > .khx-tools { display: grid; grid-template-columns: 1fr 1fr; }.khx-form-actions > .khx-tools .khx-button { width: 100%; }.khx-report-chip-input, .khx-unlisted, .khx-bulk-form { display: grid; grid-template-columns: 1fr; }.khx-unlisted .khx-form { grid-template-columns: 1fr; }.khx-jinjer-counts, .khx-jinjer-summary-grid { grid-template-columns: 1fr 1fr; }.khx-report-paper { padding: 18px 12px; }.khx-report-paper-title { font-size: 18px; }.khx-report-rank-line { grid-template-columns: 44px minmax(0,1fr) auto; }.khx-report-draft-row { grid-template-columns: 1fr; }.khx-report-draft-row > .khx-button { width: 100%; }.khx-data-pills, .khx-month-grid { grid-template-columns: repeat(6,minmax(40px,1fr)); }.khx-frequency-grid, .khx-frequency-row { grid-template-columns: 90px repeat(12,minmax(42px,1fr)); }.khx-staff-edit, .khx-link-row { grid-template-columns: 1fr; }.khx-link-row > span { grid-column: auto; }.khx-report-page-head > .khx-tools { margin-top: 18px; } }
@media print { .khx-report-page-head, .khx-report-selection, .khx-report-drafts, .khx-report-work > .khx-section-head, .khx-report-form-card, .khx-report-toast, .khx-topbar, .khx-sidebar, .khx-footer-note { display: none !important; }.khx-shell, .khx-main { display: block; width: 100%; max-width: none; margin: 0; padding: 0; }.khx-report-output { margin: 0; }.khx-report-paper { width: 100%; border: 0; border-radius: 0; box-shadow: none; } }

/* サンプルURLの外枠・ホームのレイアウトをそのまま基準にする。 */
.khx-sidebar.sidebar { width: 236px; padding: 30px 20px; }
.khx-sidebar .khx-brand.brand { gap: 11px; }
.khx-sidebar .khx-brand .brand-icon { width: 43px; height: 43px; }
.khx-sidebar .khx-brand .brand-icon .khx-icon { width: 23px; height: 23px; }
.khx-sidebar .khx-nav .nav-link { margin-bottom: 4px; }
.khx-shell.shell { margin-left: 236px; }
.khx-topbar.topbar { height: 77px; padding: 0 48px; }
.khx-main.workspace { max-width: 1280px; padding: 36px 48px 60px; }
.khx-body .khx-page-head.heading { margin-bottom: 28px; }
.khx-body .khx-page-head .khx-kicker.eyebrow { margin: 0 0 5px; }
.khx-body .khx-page-head .khx-lead.sub { max-width: 760px; }
.khx-body .khx-page-head > .khx-button { white-space: nowrap; }
.khx-home .khx-section { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.khx-home .khx-section + .khx-section { margin-top: 0; }
.khx-home .khx-section-head { margin: 30px 0 16px; }
.khx-home .khx-section-title { align-items: center; }
.khx-home .khx-daily-grid .khx-card { display: flex; align-items: flex-start; gap: 17px; min-height: 144px; }
.khx-home .khx-daily-grid .khx-card .card-content { display: block; }
.khx-home .khx-daily-grid .khx-card h3 { margin: 0 0 6px; }
.khx-home .khx-tools-grid .khx-card { display: block; min-height: 0; padding: 20px; }
.khx-home .khx-tools-grid .khx-card .khx-icon { margin-bottom: 12px; color: #557687; }
.khx-home .khx-tools-grid .khx-card h3 { margin-bottom: 7px; font-size: 15px; }
.khx-home .khx-tools-grid .khx-card p { font-size: 12px; line-height: 1.7; }
.khx-home .khx-card:hover { transform: translateY(-2px); }

/* 小口管理はサンプルの balance-band → flow → panel の順序に固定する。 */
.khx-body .balance-band { margin: 0 0 0; }
.khx-body .balance-band .balance-head { margin-bottom: 16px; }
.khx-body .khx-cash-input-panel .tabs { max-width: 630px; }
.khx-body .khx-cash-input-panel [role="tabpanel"] { max-width: 850px; }
.khx-body .khx-cash-input-panel .fields { max-width: 850px; }
.khx-body .khx-cash-input-panel .form-bottom { max-width: 850px; }
.khx-body .khx-cash-scope { margin: 0 0 20px; }
.khx-body .khx-cash-scope .khx-view-switch { margin: 0; border: 0; box-shadow: none; }
.khx-body .khx-cash-closing { margin: 0 0 20px; }
.khx-body .fields .khx-wide { grid-column: 1 / -1; }
.khx-body dialog .khx-form-grid { gap: 17px 20px; }
.khx-body dialog .khx-form-actions { margin-top: 22px; }
.khx-body .khx-entry-description { margin-top: 10px; }
.khx-body .khx-record .detail-disclosure { display: inline-block; margin: 0 0 0 auto; max-width: 100%; vertical-align: middle; }
.khx-body .khx-record .detail-disclosure > summary { min-height: 38px; padding: 6px 11px; font-size: 12px; }
.khx-body .khx-record .entry-bottom { align-items: center; }
.khx-body .khx-record .detail-disclosure[open] { display: block; margin-top: 12px; }
.khx-body .khx-record .detail-disclosure[open] > summary { min-height: 56px; padding: 19px 20px; font-size: 15px; }
.khx-body .khx-record .detail-content { padding: 0 20px 22px; }
.khx-body .khx-record .delete-form { margin-top: 20px; }

/* ボタンやカードの反応はサンプルの短い操作感に合わせ、hoverはマウス操作時だけ付ける。 */
.khx-body .khx-button:active, .khx-body .button:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .khx-body .khx-button:hover, .khx-body .button:hover { filter: brightness(.97); }
  .khx-body .khx-card:hover, .khx-body .daily-card:hover, .khx-body .tool-card:hover { box-shadow: 0 7px 20px rgba(49,75,98,.06); }
}
@media (prefers-reduced-motion: reduce) {
  .khx-body *, .khx-body *::before, .khx-body *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (max-width: 760px) {
  .khx-sidebar.sidebar { display: none; top: 67px; bottom: 0; width: 260px; padding: 25px 13px; }
  .khx-sidebar.sidebar.is-open { display: flex; }
  .khx-shell.shell { margin-left: 0; }
  .khx-topbar.topbar { position: sticky; top: 0; z-index: 6; height: 67px; padding: 0 18px; background: #fff; }
  .khx-main.workspace { padding: 24px 18px 45px; }
  .khx-body .khx-page-head.heading { display: block; margin-bottom: 23px; }
  .khx-body .khx-page-head > .khx-button { margin-top: 18px; }
  .khx-home .khx-daily-grid .khx-card { min-height: 130px; padding: 20px; }
  .khx-home .khx-tools-grid .khx-card { min-height: 0; padding: 17px 13px; }
  .khx-home .khx-tools-grid .khx-card h3 { font-size: 14px; }
  .khx-body .khx-record .entry-bottom { align-items: flex-start; flex-wrap: wrap; }
  .khx-body .khx-record .detail-disclosure { width: 100%; margin-top: 4px; }
  .khx-body .khx-record .detail-disclosure > summary { width: 100%; }
}

/* サンプルの入力パネルと確認ダイアログ。フォームは横並びにせず、選択中の1枚だけ見せる。 */
.khx-body .tabs { display: flex; max-width: 630px; gap: 6px; margin: 0 0 24px; padding: 5px; border-radius: 13px; background: #eef3f6; }
.khx-body .tabs button { flex: 1; min-height: 48px; padding: 11px 18px; border: 0; border-radius: 9px; background: transparent; font-size: 14px; font-weight: 600; }
.khx-body .tabs button[aria-selected="true"] { background: var(--khx-blue); color: #2f5364; box-shadow: 0 2px 5px rgba(37,68,87,.04); }
.khx-dialog-lead { margin: 0 0 12px; color: var(--khx-muted); font-size: 14px; }
.khx-body .review-list { display: grid; gap: 0; margin-top: 10px; }
.khx-body .review-row { display: grid; grid-template-columns: minmax(145px, .75fr) minmax(0, 1.25fr); gap: 12px 20px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid #e6ecf0; font-size: 14px; }
.khx-body .review-row span { color: var(--khx-muted); }
.khx-body .review-row b { min-width: 0; overflow-wrap: anywhere; text-align: right; font-variant-numeric: tabular-nums; }
.khx-body .khx-toast { right: 25px; bottom: 25px; z-index: 30; }
.khx-body dialog[open] { animation: khx-dialog-in 180ms cubic-bezier(.22,1,.36,1); }
@keyframes khx-dialog-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .khx-body dialog[open] { animation: none; } }
@media (max-width: 760px) {
  .khx-body .tabs button { padding: 10px 8px; font-size: 13px; }
  .khx-body .khx-toast { right: 15px; bottom: 15px; left: 15px; max-width: none; }
  .khx-body .dialog-actions .button { flex: 1; }
}

/* マスタ系はサンプルの「目的→選択→確認→保存」の流れを画面ごとに持つ。 */
.khx-master-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.khx-master-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 13px; min-height: 152px; padding: 19px; border: 1px solid #dfe7ed; border-radius: 15px; background: #fff; }
.khx-master-card-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--khx-blue); color: #3e697c; }
.khx-master-card-body { display: grid; align-content: start; gap: 8px; min-width: 0; }
.khx-master-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.khx-master-card-top strong { font-size: 15px; }
.khx-master-card-desc { color: var(--khx-muted); font-size: 12px; line-height: 1.65; }
.khx-master-card-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; color: #2d667e; font-size: 11px; font-weight: 700; }
.khx-master-card-meta b { font-size: 17px; line-height: 1; }
.khx-master-guide { max-width: 760px; }
.khx-master-guide .khx-step-list { margin: 0; padding: 0; }
.khx-price-filter { align-items: end; }
.khx-price-filter .khx-field { min-width: 145px; }
.khx-price-master-list, .khx-doctor-list, .khx-doctor-unlinked-list, .khx-alias-relink-list { display: grid; gap: 14px; }
.khx-price-master-card { display: grid; gap: 16px; padding: 21px; border: 1px solid #dfe7ed; border-radius: 16px; background: #fff; }
.khx-price-master-card.is-hidden { background: #f7f9fa; }
.khx-price-master-card.is-hidden h3 { color: var(--khx-muted); }
.khx-price-master-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 15px; }
.khx-price-master-head h3 { margin: 0; font-size: 17px; }
.khx-price-master-head .khx-check { min-width: 86px; }
.khx-status-chip { display: inline-flex; min-height: 27px; align-items: center; padding: 4px 9px; border-radius: 20px; background: var(--khx-blue); color: #355f73; font-size: 11px; font-weight: 700; white-space: nowrap; }
.is-hidden .khx-status-chip { background: #edf2f5; color: var(--khx-muted); }
.khx-price-edit-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 18px; padding-top: 15px; border-top: 1px solid #e7eef1; }
.khx-price-edit-fields .wide { grid-column: 1 / -1; }
.khx-price-master-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-top: 12px; border-top: 1px solid #e9eef2; color: var(--khx-muted); font-size: 11px; }
.khx-price-master-new { border-color: #b7d9e7; background: #f5fbfd; }
.khx-price-master-new .khx-price-master-head { grid-template-columns: auto minmax(0, 1fr) auto; }
.khx-doctor-purpose-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.khx-doctor-purpose-grid > div { display: grid; gap: 3px; padding: 13px; border-radius: 10px; background: #f5fafc; }
.khx-doctor-purpose-grid strong { font-size: 13px; }
.khx-doctor-purpose-grid span { color: var(--khx-muted); font-size: 11px; }
.khx-doctor-bootstrap-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.khx-doctor-bootstrap-card > div { display: grid; gap: 4px; }
.khx-doctor-bootstrap-card p { margin: 0; }
.khx-doctor-unlinked-card { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(0, 1.2fr); gap: 18px; padding: 19px; border: 1px solid #e8c2cf; border-radius: 15px; background: #fff9fb; }
.khx-doctor-unlinked-card h3 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.khx-doctor-unlinked-card .khx-read { grid-template-columns: 1fr; }
.khx-doctor-card { display: grid; gap: 14px; padding: 21px; border: 1px solid #dfe7ed; border-radius: 16px; background: #fff; }
.khx-doctor-card.is-multi { border-color: #b7d9e7; background: #f8fcfd; }
.khx-doctor-card-head { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.khx-doctor-card h3 { margin: 0; font-size: 18px; }
.khx-doctor-card-metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.khx-doctor-card-metrics span { padding: 4px 8px; border-radius: 20px; background: var(--khx-blue); color: #355f73; font-size: 11px; font-weight: 700; }
.khx-doctor-card-clinics { padding: 10px 12px; border-radius: 9px; background: #f5fafc; color: #2d667e; font-size: 12px; font-weight: 700; }
.khx-doctor-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, auto); align-items: end; gap: 14px 18px; padding-top: 15px; border-top: 1px solid #e7eef1; }
.khx-doctor-edit-grid .wide { grid-column: 1 / -1; }
.khx-alias-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 18px; }
.khx-alias-relink-card { display: grid; gap: 7px; padding: 15px; border: 1px solid #dfe7ed; border-radius: 12px; background: #f8fcfd; }
.khx-alias-relink-card small { color: var(--khx-muted); font-size: 11px; font-weight: 400; }
.khx-doctor-note { color: var(--khx-muted); font-size: 12px; }
.khx-doctor-note p { margin: 0 0 7px; }
.khx-doctor-note p:last-child { margin-bottom: 0; }

@media (max-width: 980px) {
  .khx-master-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .khx-price-edit-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .khx-doctor-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .khx-doctor-edit-grid .wide { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .khx-master-grid, .khx-doctor-purpose-grid, .khx-price-edit-fields, .khx-alias-list { grid-template-columns: 1fr; }
  .khx-master-card { min-height: 0; }
  .khx-price-master-head, .khx-price-master-new .khx-price-master-head { grid-template-columns: auto minmax(0, 1fr); }
  .khx-price-master-head .khx-status-chip, .khx-price-master-head > .khx-optional { grid-column: 2; justify-self: start; }
  .khx-doctor-bootstrap-card, .khx-doctor-unlinked-card { grid-template-columns: 1fr; }
  .khx-doctor-bootstrap-card .khx-button { width: 100%; }
  .khx-doctor-card-head { flex-direction: column; }
  .khx-doctor-edit-grid { grid-template-columns: 1fr; align-items: stretch; }
  .khx-doctor-edit-grid .wide { grid-column: auto; }
}

/* 日報・振込確認の補助要素も、サンプルの panel / record の間隔にそろえる。 */
.khx-date-chooser { margin: -8px 0 22px; }
.khx-date-chooser > summary { min-height: 48px; padding: 13px 17px; font-size: 13px; }
.khx-date-chooser .khx-details-body { padding: 0 17px 17px; }
.khx-date-chooser .khx-date-pills { margin-top: 0; }
.khx-date-chooser .khx-period-links { margin-top: 14px; }
.khx-import-details { margin: 0 0 22px; }
.khx-import-details > summary { color: #8d5269; }
.khx-record-selected { border-color: #87b5ca; background: #f6fbfd; }
.khx-record-selected .khx-record-meta { border-top-color: #cfe3eb; }
.khx-record-meta > .khx-button { min-height: 40px; padding: 7px 13px; font-size: 12px; }
.khx-selected-section { border-color: #b7d9e7; }
.khx-selected-section .khx-form + .khx-form { margin-top: 20px; }
.khx-selected-section .khx-delete-form { margin-top: 20px; }
.khx-selected-section .khx-block { margin-top: 2px; }
.khx-date-chooser + .khx-alert { margin-top: 0; }

@media (max-width: 760px) {
  .khx-date-chooser { margin-top: -5px; }
  .khx-date-chooser .khx-date-pills { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .khx-date-chooser .khx-date-pill { min-width: 0; min-height: 44px; padding: 5px; font-size: 12px; }
  .khx-record-meta > .khx-button { width: 100%; }
}

/* タッチ端末ではhoverを操作状態として残さず、選択・フォーカス・文言で状態を伝える。 */
@media (hover: none), (pointer: coarse) {
  .khx-body .khx-nav a:hover { background: transparent; }
  .khx-body .khx-button:hover { filter: none; }
  .khx-body .khx-card:hover, .khx-body .daily-card:hover, .khx-body .tool-card:hover,
  .khx-body .khx-home .khx-card:hover { transform: none; box-shadow: none; }
  .khx-body .khx-select-row:hover, .khx-body .khx-clinic-card:hover,
  .khx-body .khx-progress-clinic:hover, .khx-body .khx-report-choice:hover,
  .khx-body .khx-report-draft-open:hover { border-color: inherit; background: inherit; box-shadow: none; }
}

/* ログイン入口もサンプルの白いパネル＋水色・ピンクの構成へそろえる。 */
.khx-login-body { min-height: 100vh; margin: 0; background: var(--khx-base); color: var(--khx-ink); font-family: var(--khx-font); }
.khx-login-body a { color: inherit; }
.khx-login-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(390px, .95fr); width: min(1120px, calc(100% - 48px)); min-height: min(720px, calc(100vh - 48px)); margin: 24px auto; overflow: hidden; border: 1px solid #dfe7ed; border-radius: 24px; background: #fff; box-shadow: var(--khx-shadow); }
.khx-login-intro { display: flex; flex-direction: column; justify-content: space-between; padding: 54px 58px; background: linear-gradient(145deg, #eefaff 0%, #f8fcfd 62%, #fff 100%); }
.khx-login-brand { align-self: flex-start; }
.khx-login-brand > span:last-child { display: grid; gap: 1px; }
.khx-login-brand small, .khx-login-brand strong { display: block; }
.khx-login-eyebrow, .khx-login-panel-kicker { margin: 0; color: #5f8fa4; font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.khx-login-intro h1 { margin: 16px 0 15px; font-size: clamp(34px, 5vw, 50px); line-height: 1.25; letter-spacing: -.04em; }
.khx-login-intro > p:not(.khx-login-eyebrow) { max-width: 470px; margin: 0; color: var(--khx-muted); font-size: 15px; }
.khx-login-steps { display: flex; flex-wrap: wrap; gap: 8px; }
.khx-login-steps span { padding: 7px 11px; border-radius: 999px; background: var(--khx-blue); color: #355f73; font-size: 12px; font-weight: 800; }
.khx-login-panel { align-self: center; padding: 54px 58px; }
.khx-login-panel h2 { margin: 10px 0 7px; font-size: 30px; }
.khx-login-lead { margin: 0; color: var(--khx-muted); font-size: 14px; }
.khx-login-error { margin: 20px 0 0; }
.khx-login-form { display: grid; gap: 20px; margin-top: 28px; }
.khx-login-body input:focus, .khx-login-body select:focus { outline: 3px solid var(--khx-blue); border-color: var(--khx-focus); }
.khx-login-submit { width: 100%; margin-top: 3px; min-height: 52px; }
.khx-login-switch { display: block; margin-top: 20px; color: #a45270 !important; font-size: 13px; font-weight: 800; text-align: center; text-decoration: none; }
.khx-login-note { margin: 28px 0 0; color: var(--khx-muted); font-size: 11px; line-height: 1.8; }
@media (max-width: 760px) {
  .khx-login-shell { display: block; width: min(100% - 24px, 560px); min-height: 0; margin: 12px auto; border-radius: 18px; }
  .khx-login-intro { min-height: 315px; padding: 30px 25px; }
  .khx-login-intro h1 { font-size: 34px; }
  .khx-login-panel { padding: 32px 25px 35px; }
}

/* live sample の共通部品を、きはら専用の body 配下で再現する。 */
.khx-body .button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 10px; padding: 11px 21px; border: 1px solid var(--khx-line); border-radius: 12px; background: #fff; color: var(--khx-ink); text-align: center; font-size: 14px; font-weight: 700; text-decoration: none; }
.khx-body .button.primary { border-color: var(--khx-pink); background: var(--khx-pink); color: #704853; }
.khx-body .button.secondary { border-color: var(--khx-blue); background: var(--khx-blue); }
.khx-body .button.quiet { border-color: transparent; background: transparent; }
.khx-body .button.danger { border-color: #dfa0b2; color: #99475f; }
.khx-body .heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.khx-body .eyebrow { margin: 0 0 5px; color: var(--khx-muted); font-size: 12px; letter-spacing: .15em; }
.khx-body .heading h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: .04em; line-height: 1.4; }
.khx-body .sub { color: var(--khx-muted); font-size: 14px; }
.khx-body .small { color: var(--khx-muted); font-size: 12px; }
.khx-body .notice-box { display: flex; gap: 11px; margin: 18px 0; padding: 15px 18px; border-radius: 12px; background: #f0f7fa; color: #455d6a; font-size: 13px; }
.khx-body .notice-box svg { width: 19px; height: 19px; flex-shrink: 0; }
.khx-body .notice-box p { flex: 1; margin: 0; }
.khx-body .notice-box.pink { background: #fcf0f4; }
.khx-body .empty-state { padding: 35px 20px; border-radius: 15px; background: var(--khx-base); text-align: center; }
.khx-body .empty-state .icon-block { margin: 0 auto 15px; }
.khx-body .empty-state h3 { margin: 0 0 8px; }
.khx-body .empty-state p { max-width: 530px; margin: auto; color: var(--khx-muted); font-size: 14px; }
.khx-body .empty-state .button { margin-top: 20px; }
.khx-body .status-chip { display: inline-flex; min-height: 27px; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 6px; background: var(--khx-blue); color: var(--khx-ink); font-size: 12px; font-weight: 600; white-space: nowrap; }
.khx-body .status-chip.neutral { background: #edf1f4; color: var(--khx-muted); }
.khx-body .status-chip svg { width: 15px; height: 15px; }
.khx-body .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 16px; }
.khx-body .section-title h2 { margin: 0; font-size: 20px; line-height: 1.5; }
.khx-body .section-title { display: flex; align-items: center; gap: 12px; }
.khx-body .number { display: inline-grid; width: 30px; height: 30px; flex-shrink: 0; place-items: center; border-radius: 10px; background: var(--khx-blue); font-size: 14px; font-weight: 800; }
.khx-body .daily-grid, .khx-body .tools-grid { display: grid; gap: 16px; }
.khx-body .daily-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.khx-body .daily-card { display: flex; min-height: 144px; align-items: flex-start; gap: 17px; padding: 23px; border: 1px solid #e0e8ed; border-radius: 18px; background: #fff; text-align: left; }
.khx-body .daily-card.featured { border-color: #b7d9e7; background: #f2f9fc; }
.khx-body .icon-block { display: grid; width: 49px; height: 49px; flex-shrink: 0; place-items: center; border-radius: 15px; background: var(--khx-blue); color: #3e697c; }
.khx-body .card-content { flex: 1; min-width: 0; }
.khx-body .daily-card h3 { margin: 0 0 6px; font-size: 17px; }
.khx-body .daily-card p, .khx-body .tool-card p { color: var(--khx-muted); font-size: 14px; }
.khx-body .card-action { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: #355f73; font-size: 13px; font-weight: 700; }
.khx-body .tools-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.khx-body .tool-card { min-height: 143px; padding: 20px; border: 1px solid #e0e8ed; border-radius: 15px; background: #fff; text-align: left; }
.khx-body .tool-card h3 { margin: 0 0 7px; font-size: 15px; }
.khx-body .tool-card p { font-size: 12px; line-height: 1.7; }
.khx-body .balance-band { padding: 22px 25px; border-radius: 20px; background: var(--khx-blue); }
.khx-body .balance-head { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; font-size: 15px; font-weight: 700; }
.khx-body .balances { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.khx-body .balance { padding: 17px 20px; border: 1px solid #fff; border-radius: 13px; background: rgba(255,255,255,.85); }
.khx-body .balance.is-negative { border-color: #e1b4c2; background: #fff5f8; }
.khx-body .balance label { color: var(--khx-muted); font-size: 13px; }
.khx-body .money { font-size: 28px; font-weight: 750; letter-spacing: .02em; line-height: 1.5; font-variant-numeric: tabular-nums; }
.khx-body .money small { margin-left: 5px; font-size: 14px; font-weight: 500; }
.khx-body .balance .small { font-size: 11px; }
.khx-body .negative { margin-top: 3px; color: #934b65; font-size: 12px; font-weight: 600; }
.khx-body .flow { display: flex; align-items: center; gap: 16px; margin: 25px 0; color: var(--khx-muted); font-size: 13px; }
.khx-body .flow b { color: var(--khx-ink); }
.khx-body .flow i { width: 70px; height: 1px; background: var(--khx-line); }
.khx-body .panel { margin-bottom: 20px; padding: 26px; border: 1px solid #dfe7ed; border-radius: 19px; background: #fff; }
.khx-body .panel.closing { background: #f1f6f9; }
.khx-body .panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.khx-body .panel-head .sub { margin-top: 4px; }
.khx-body .khx-section-head > .number + div { margin-right: auto; }
.khx-body .compact-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 20px 0; font-size: 14px; }
.khx-body .compact-summary > div { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.khx-body .form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding-top: 20px; border-top: 1px solid #e4ecf0; }
.khx-body .form-actions .hint, .khx-body .form-actions .sub { margin: 0; }
.khx-body .khx-daily-actions .khx-tools { align-items: center; }
.khx-body .khx-daily-actions .khx-usb-message { margin: 0; color: var(--khx-muted); font-size: 12px; }
.khx-body .khx-daily-links { margin-top: 18px; }
.khx-body .chip-link { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; margin: 8px 8px 0 0; padding: 10px 14px; border-radius: 10px; background: #eff6fa; color: var(--khx-ink); font-size: 13px; font-weight: 650; }
.khx-body .chip-link .khx-icon { width: 17px; height: 17px; }
.khx-body .khx-period { position: relative; align-items: center; }
.khx-body .khx-period .khx-date-chooser { position: relative; margin: 0; border: 0; background: transparent; }
.khx-body .khx-period .khx-date-chooser > summary { display: flex; min-height: 48px; box-sizing: border-box; align-items: center; padding: 8px 12px; border: 1px solid var(--khx-line); border-radius: 9px; background: #fff; color: var(--khx-ink); font-size: 12px; }
.khx-body .khx-period .khx-date-chooser .khx-details-body { position: absolute; top: calc(100% + 8px); left: 0; z-index: 8; width: min(700px, calc(100vw - 32px)); padding: 17px; border: 1px solid #dfe7ed; border-radius: 14px; background: #fff; box-shadow: 0 12px 30px rgba(49, 75, 98, .14); }
.khx-body .khx-period .khx-date-chooser .khx-date-pills { margin-top: 0; }
@media (min-width: 761px) {
  .khx-body .khx-daily-period { align-items: flex-end; }
  .khx-body .khx-daily-period .khx-date-chooser { align-self: flex-end; }
}
.khx-body .khx-daily-save-form .khx-form-grid,
.khx-body .khx-daily-save-form .form-bottom { width: 100%; max-width: none; }
.khx-body .tabs { display: flex; max-width: 630px; gap: 6px; margin: 0 0 24px; padding: 5px; border-radius: 13px; background: #eef3f6; }
.khx-body .tabs button { flex: 1; min-height: 48px; padding: 11px 18px; border: 0; border-radius: 9px; background: transparent; font-size: 14px; font-weight: 600; }
.khx-body .tabs button[aria-selected="true"] { background: var(--khx-blue); color: #2f5364; box-shadow: 0 2px 5px rgba(37,68,87,.04); }
.khx-body .fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 25px; max-width: 850px; }
.khx-body .field { min-width: 0; }
.khx-body .field .hint, .khx-body .hint { display: block; margin-top: 6px; color: var(--khx-muted); font-size: 12px; }
.khx-body .error { margin-top: 5px; color: #754552; font-size: 13px; font-weight: 600; }
.khx-body .form-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 850px; margin-top: 26px; padding-top: 20px; border-top: 1px solid #e6ecf0; }
.khx-body .form-bottom .sub { max-width: 550px; font-size: 12px; }
.khx-body .entry { margin-top: 14px; padding: 20px; border: 1px solid #dce5eb; border-radius: 14px; background: #fff; }
.khx-body .entry-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.khx-body .entry-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.khx-body .entry-title h3 { margin: 0; }
.khx-body .pill { padding: 3px 8px; border-radius: 6px; background: var(--khx-blue); font-size: 12px; font-weight: 500; }
.khx-body .entry-amount { color: var(--khx-ink); font-size: 20px; font-weight: 750; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.khx-body .entry-info { display: flex; flex-wrap: wrap; gap: 12px 30px; color: var(--khx-muted); font-size: 13px; }
.khx-body .entry-info b { color: var(--khx-ink); font-weight: 500; }
.khx-body .entry-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #e9eef2; font-size: 13px; }
.khx-body .entry-bottom .button { min-height: 38px; padding: 6px 11px; font-size: 12px; }
.khx-body .opening { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 16px; border-radius: 10px; background: #f2f6f8; font-size: 13px; }
.khx-body .khx-cash-scope-note { margin: 9px 2px 0; color: var(--khx-muted); font-size: 11px; line-height: 1.6; }
.khx-body .closing-row { display: flex; align-items: flex-end; gap: 15px; max-width: 640px; margin-top: 18px; }
.khx-body .closing-row .field { flex: 1; }
.khx-body .status-closed { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 14px 18px; border-radius: 12px; background: var(--khx-blue); font-size: 14px; }
.khx-body .month-title { color: var(--khx-muted); font-size: 14px; font-weight: 500; }
.khx-body .dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.khx-body .dialog-actions .button { min-height: 42px; }
.khx-body dialog { width: min(650px, calc(100% - 28px)); max-height: 90vh; overflow: auto; padding: 30px; border: 1px solid var(--khx-line); border-radius: 20px; background: #fff; color: var(--khx-ink); }
.khx-body dialog .khx-dialog-paired-field { align-self: stretch; align-content: start; grid-template-rows: auto 48px auto; }
.khx-body dialog .khx-dialog-paired-field > input,
.khx-body dialog .khx-dialog-paired-field > select,
.khx-body dialog .khx-dialog-paired-field > textarea { box-sizing: border-box; height: 48px; min-height: 48px; }
.khx-body dialog .khx-dialog-amount-field .khx-amount { display: flex; width: 100%; min-width: 0; height: 48px; align-items: center; gap: 8px; }
.khx-body dialog .khx-dialog-amount-field .khx-amount input { flex: 0 1 220px; width: auto; min-width: 0; height: 48px; box-sizing: border-box; }
.khx-body dialog .khx-dialog-amount-field .khx-amount > span { flex: 0 0 auto; white-space: nowrap; font-size: 14px; font-weight: 600; }
@media (min-width: 761px) {
  .khx-body dialog .khx-dialog-paired-field > span:first-child { flex-wrap: nowrap; white-space: nowrap; }
}
.khx-body dialog::backdrop { background: rgba(38,58,72,.33); backdrop-filter: blur(3px); }
.khx-body .dialog-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.khx-body .dialog-title h2 { margin: 0; }
.khx-body .dialog-close { display: grid; width: 36px; height: 36px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #f0f4f6; font-size: 22px; }
.khx-body .demo-note { margin: 15px 0; padding: 10px 13px; border-radius: 9px; background: #f3f6f8; color: var(--khx-muted); font-size: 12px; }
.khx-body .khx-cash-negative-warning { display: grid; gap: 4px; margin: 15px 0; padding: 13px 15px; border: 1px solid #e1b4c2; border-left: 4px solid #a6536d; border-radius: 10px; background: #fff5f8; color: #754552; }
.khx-body .khx-cash-negative-warning strong { font-size: 14px; }
.khx-body .khx-cash-negative-warning p, .khx-body .khx-cash-negative-warning span { margin: 0; font-size: 12px; line-height: 1.6; }
.khx-body .khx-cash-negative-warning span { color: #8d6370; }
.khx-body .delete-form { margin-top: 20px; padding: 15px; border-radius: 12px; background: #f8f0f3; }
.khx-body [data-khx-cash-view-panel][hidden] { display: none !important; }
.khx-body .khx-cash-record-controls { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 12px; margin: 18px 0 4px; }
.khx-body .khx-cash-control { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid #dfe7ed; border-radius: 13px; background: #fbfdfe; }
.khx-body .khx-cash-control-label { display: grid; min-width: 125px; gap: 2px; }
.khx-body .khx-cash-control-label strong { font-size: 13px; }
.khx-body .khx-cash-control-label span { color: var(--khx-muted); font-size: 11px; white-space: nowrap; }
.khx-body .khx-cash-toggle { flex-shrink: 0; gap: 2px; padding: 3px; }
.khx-body .khx-cash-toggle button { min-height: 36px; padding: 6px 10px; font-size: 11px; white-space: nowrap; }
.khx-body .khx-cash-toggle button[aria-pressed="true"] { background: var(--khx-blue); color: #2f5364; box-shadow: 0 2px 5px rgba(37,68,87,.04); }
.khx-body .khx-cash-table-wrap { max-width: 100%; min-width: 0; overflow-x: auto; border: 1px solid #dfe7ed; border-radius: 14px; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.khx-body .khx-cash-table-wrap:focus-visible { outline: 3px solid var(--khx-focus); outline-offset: 3px; }
.khx-body .khx-cash-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; font-size: 12px; }
.khx-body .khx-cash-table th, .khx-body .khx-cash-table td { padding: 12px 11px; border-bottom: 1px solid #e7edf0; vertical-align: top; text-align: left; }
.khx-body .khx-cash-table thead th { background: #f6f9fa; color: var(--khx-muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.khx-body .khx-cash-table tbody th { background: #fff; font-weight: 700; white-space: nowrap; }
.khx-body .khx-cash-table tbody tr:last-child th, .khx-body .khx-cash-table tbody tr:last-child td { border-bottom: 0; }
.khx-body .khx-cash-table th small { display: block; margin-top: 3px; color: var(--khx-muted); font-size: 10px; font-weight: 500; }
.khx-body .khx-cash-table .is-number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.khx-body .khx-cash-table td:nth-child(5), .khx-body .khx-cash-table td:nth-child(6) { max-width: 180px; white-space: normal; overflow-wrap: anywhere; }
.khx-body .khx-cash-table-action { white-space: nowrap; }
.khx-body .khx-cash-table-action .button { min-height: 36px; padding: 6px 11px; font-size: 12px; }
.khx-body .khx-cash-table th:nth-child(1), .khx-body .khx-cash-table td:nth-child(1) { width: 9%; }
.khx-body .khx-cash-table th:nth-child(2), .khx-body .khx-cash-table td:nth-child(2) { width: 7%; }
.khx-body .khx-cash-table th:nth-child(3), .khx-body .khx-cash-table td:nth-child(3) { width: 9%; }
.khx-body .khx-cash-table th:nth-child(4), .khx-body .khx-cash-table td:nth-child(4) { width: 9%; }
.khx-body .khx-cash-table th:nth-child(5), .khx-body .khx-cash-table td:nth-child(5) { width: 10%; }
.khx-body .khx-cash-table th:nth-child(6), .khx-body .khx-cash-table td:nth-child(6) { width: 12%; }
.khx-body .khx-cash-table th:nth-child(7), .khx-body .khx-cash-table td:nth-child(7) { width: 8%; }
.khx-body .khx-cash-table th:nth-child(8), .khx-body .khx-cash-table td:nth-child(8),
.khx-body .khx-cash-table th:nth-child(9), .khx-body .khx-cash-table td:nth-child(9) { width: 8%; }
.khx-body .khx-cash-table th:nth-child(10), .khx-body .khx-cash-table td:nth-child(10) { width: 11%; }
.khx-body .khx-cash-table th:nth-child(11), .khx-body .khx-cash-table td:nth-child(11) { width: 9%; }
.khx-body .khx-cash-filter-empty { margin-top: 14px; }
.khx-body .khx-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  .khx-body .heading { display: block; }
  .khx-body .khx-page-actions { justify-items: stretch; margin-top: 18px; }
  .khx-body .khx-action-buttons { justify-content: stretch; }
  .khx-body .khx-action-buttons .khx-button { flex: 1 1 auto; }
  .khx-body .khx-view-switch { align-items: stretch; flex-direction: column; }
  .khx-body .khx-management-choice, .khx-body .khx-management-button { width: 100%; min-width: 0; }
  .khx-body .khx-balance-summary { grid-template-columns: 1fr; }
  .khx-body .khx-difference-callout > strong { font-size: 28px; }
  .khx-body .heading > .month-title { display: block; margin-top: 12px; }
  .khx-body .daily-grid, .khx-body .tools-grid { grid-template-columns: 1fr; }
  .khx-body .daily-card { min-height: 130px; padding: 20px; }
  .khx-body .tools-grid { gap: 10px; }
  .khx-body .tool-card { min-height: 0; padding: 17px 13px; }
  .khx-body .balances, .khx-body .fields { grid-template-columns: 1fr; }
  .khx-body .balance-band { padding: 18px; }
  .khx-body .panel { padding: 20px 17px; }
  .khx-body .tabs { max-width: none; }
  .khx-body .khx-period .khx-date-chooser { width: 100%; }
  .khx-body .khx-period .khx-date-chooser > summary { width: 100%; }
  .khx-body .khx-period .khx-date-chooser .khx-details-body { left: 0; right: auto; width: 100%; }
  .khx-body .compact-summary { align-items: flex-start; flex-direction: column; gap: 10px; }
  .khx-body .compact-summary > div { justify-content: flex-start; }
  .khx-body .form-actions { align-items: stretch; flex-direction: column; }
  .khx-body .form-actions .button { width: 100%; }
  .khx-body .khx-daily-actions .khx-tools { display: block; }
  .khx-body .khx-daily-links .chip-link { margin-right: 4px; }
  .khx-body .form-bottom { align-items: stretch; flex-direction: column; }
  .khx-body .form-bottom .button { width: 100%; }
  .khx-body .review-row { grid-template-columns: 1fr; gap: 2px; }
  .khx-body .review-row b { text-align: left; }
  .khx-body .entry-top { align-items: flex-start; flex-direction: column; }
  .khx-body .entry-amount { align-self: flex-end; }
  .khx-body .entry-bottom, .khx-body .closing-row { align-items: stretch; flex-direction: column; }
  .khx-body .entry-bottom .button, .khx-body .closing-row .button { width: 100%; }
  .khx-body .khx-cash-record-controls { grid-template-columns: 1fr; }
  .khx-body .khx-cash-control { align-items: stretch; flex-direction: column; }
  .khx-body .khx-cash-control-label { min-width: 0; }
  .khx-body .khx-cash-control-label span { white-space: normal; }
  .khx-body .khx-cash-toggle { width: 100%; }
  .khx-body .khx-cash-toggle button { flex: 1; }
  .khx-body .notice-box { align-items: flex-start; }
  .khx-body .empty-state { padding: 30px 16px; }
  .khx-body .dialog-actions { flex-direction: column; }
  .khx-body .dialog-actions .button { width: 100%; }
}

/* 本系と同じ階層を、きはらレイアウトの視覚言語で表示する。 */
.khx-nav { gap: 19px; }
.khx-nav-group { display: grid; gap: 5px; }
.khx-nav-group-title { display: flex; align-items: center; gap: 8px; margin: 0 12px 2px; color: var(--khx-muted); font-size: 11px; letter-spacing: .08em; }
.khx-nav-group-title > span { display: inline-grid; width: 24px; height: 24px; place-items: center; border-radius: 8px; background: var(--khx-blue); color: #36758d; font-size: 10px; font-weight: 800; letter-spacing: 0; }
.khx-nav-group-links { display: grid; gap: 3px; }
.khx-nav-group-links .khx-nav-link { min-height: 39px; margin-bottom: 0; padding: 7px 10px; font-size: 12px; }
.khx-nav-code { display: inline-grid; width: 19px; height: 19px; flex: 0 0 19px; place-items: center; border-radius: 6px; background: #eef5f8; color: #5e7d8b; font-size: 9px; font-weight: 800; }
.khx-nav-group-links .khx-nav-link.is-active .khx-nav-code { background: #fff; color: #3e697c; }
.khx-view-tabs { display: flex; gap: 4px; max-width: 100%; margin: 0 0 22px; padding: 5px; overflow-x: auto; border: 1px solid #dfe7ed; border-radius: 13px; background: #eef3f6; scrollbar-width: thin; }
.khx-view-tabs a { display: inline-flex; min-height: 46px; flex: 1 0 auto; align-items: center; justify-content: center; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; color: var(--khx-muted); font-size: 13px; font-weight: 700; white-space: nowrap; transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease; }
.khx-view-tabs a:hover { border-color: #b7d9e7; background: #f8fdff; color: #2f6176; }
.khx-view-tabs a.is-active { border-color: #e3a2b8; background: var(--khx-pink); color: #704853; }
.khx-state-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none; }
.khx-state-tabs::-webkit-scrollbar { display: none; }
.khx-state-tab { min-width: 145px; flex: 1 0 145px; border: 1px solid transparent; transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease; white-space: nowrap; }
.khx-state-tab:hover { border-color: #b7d9e7; background: #f8fdff; }
.khx-state-tab:active, .khx-view-tabs a:active, .khx-toggle button:active { transform: scale(.98); }

@media (min-width: 761px) {
  .khx-body .khx-state-tabs:not(.khx-transfer-tabs) { display: grid; width: 100%; max-width: none; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: visible; }
  .khx-state-tab { min-width: 0; flex: none; padding-inline: 12px; font-size: 14px; }
  .khx-state-tab strong { padding-inline: 7px; font-size: 12px; }
}

.khx-bank-candidate-meta { display: block; color: #315e71 !important; font-size: 14px !important; font-weight: 800; letter-spacing: .01em; overflow-wrap: anywhere; }
.khx-record-head small { color: #476674; font-size: 13px; font-weight: 650; }
.khx-selected-section { scroll-margin-top: 95px; position: sticky; top: 95px; align-self: start; }
.khx-section:has(+ .khx-selected-section) { display: inline-block; width: calc(50% - 12px); margin-right: 18px; vertical-align: top; }
.khx-section:has(+ .khx-selected-section) + .khx-selected-section { display: inline-block; width: calc(50% - 12px); vertical-align: top; }

@media (max-width: 760px) {
  .khx-nav { gap: 12px; }
  .khx-nav-group-title { margin-inline: 6px; }
  .khx-nav-group-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .khx-nav-group-links .khx-nav-link { min-height: 38px; }
  .khx-nav-group-links .khx-nav-link span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .khx-view-tabs { margin-inline: -2px; }
  .khx-state-tab { min-width: 128px; flex-basis: 128px; }
  .khx-section:has(+ .khx-selected-section), .khx-section:has(+ .khx-selected-section) + .khx-selected-section { display: block; width: auto; margin-right: 0; }
  .khx-selected-section { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  .khx-button, .khx-card, .khx-toggle button, .khx-nav-group-links a, .khx-view-tabs a, .khx-state-tab { transition: none; }
}

/* 報奨金の区分・店舗・月を、きはらレイアウト専用の選択部品として表示する。 */
.khx-bonus-context { overflow: hidden; padding: 0; }
.khx-context-row { display: grid; grid-template-columns: minmax(190px, .75fr) minmax(0, 1.25fr); align-items: center; gap: 20px; padding: 20px 22px; border-bottom: 1px solid #dfe7ed; background: linear-gradient(135deg, #effaff 0%, #fff 74%); }
.khx-context-current { display: grid; min-width: 0; gap: 2px; }
.khx-context-kicker, .khx-context-label { color: var(--khx-muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.khx-context-current > strong { overflow-wrap: anywhere; color: #315e71; font-size: 21px; line-height: 1.3; }
.khx-context-period { color: var(--khx-muted); font-size: 13px; }
.khx-context-tabs { display: grid; min-width: 0; gap: 8px; }
.khx-context-tab-list, .khx-context-option-list { display: flex; min-width: 0; flex-wrap: wrap; gap: 8px; }
.khx-context-tabs a, .khx-context-option { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid #c3d9e2; border-radius: 11px; background: #fff; color: #315e71; font-size: 13px; font-weight: 700; line-height: 1.3; text-decoration: none; transition: transform 180ms cubic-bezier(.22,1,.36,1), border-color 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease; }
.khx-context-tabs a:hover, .khx-context-option:hover { border-color: #a6cfdf; background: #f5fcfe; color: #2f6176; box-shadow: 0 5px 14px rgba(62, 105, 124, .10); }
.khx-context-tabs a:focus-visible, .khx-context-option:focus-visible { outline: 3px solid var(--khx-focus); outline-offset: 3px; }
.khx-context-tabs a:active, .khx-context-option:active { transform: scale(.97); }
.khx-context-tabs a.is-active { border-color: #e3a2b8; background: var(--khx-pink); color: #704853; box-shadow: none; }
.khx-context-links { display: grid; gap: 14px; padding: 17px 22px 21px; background: #fff; }
.khx-context-group { display: grid; grid-template-columns: 45px minmax(0, 1fr); align-items: start; gap: 12px; min-width: 0; }
.khx-context-group > .khx-context-label { padding-top: 9px; }
.khx-context-option { min-height: 36px; padding: 7px 11px; border-radius: 9px; font-size: 12px; }
.khx-context-option.is-active { border-color: #e3a2b8; background: #fff5f8; color: #704853; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(227, 162, 184, .12); }
.khx-inline-action { display: inline-flex; min-height: 28px; align-items: center; margin-inline: 2px; padding: 2px 9px; border: 1px solid #b7d9e7; border-radius: 7px; background: #f3fbfe; color: #315e71 !important; font-size: 12px; font-weight: 700; line-height: 1.35; text-decoration: none; white-space: nowrap; transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease; }
.khx-inline-action:hover, .khx-inline-action:focus-visible { border-color: #8fc5d9; background: var(--khx-blue); color: #2f6176 !important; }
.khx-inline-action:focus-visible { outline: 3px solid var(--khx-focus); outline-offset: 3px; }
@media (max-width: 760px) {
  .khx-context-row { grid-template-columns: 1fr; gap: 15px; padding: 17px; }
  .khx-context-tabs { padding-top: 2px; }
  .khx-context-links { padding: 15px 17px 18px; }
  .khx-context-group { grid-template-columns: 1fr; gap: 6px; }
  .khx-context-group > .khx-context-label { padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .khx-context-tabs a, .khx-context-option, .khx-inline-action { transition: none; }
}

.khx-original-table-scroll-top { overflow-x: auto; overflow-y: hidden; height: 14px; margin: 0 0 5px; border: 1px solid #dfe7ed; border-radius: 8px; background: #f8fbfc; }
.khx-original-table-scroll-top > div { height: 1px; }
@media print { .khx-original-table-scroll-top { display: none !important; } }

/* 銀行入金履歴は、小口管理と同じくカード／表を切り替えて確認する。 */
.khx-body .khx-bank-list-section { padding-top: 20px; padding-bottom: 20px; }
.khx-body .khx-bank-list-section .khx-section-head { margin-bottom: 12px; }
.khx-body .khx-bank-list-section .khx-summary { gap: 10px; margin: 12px 0; }
.khx-body .khx-bank-list-section .khx-stat { padding: 13px 20px; }
.khx-body .khx-bank-list-section .khx-stat span { margin-bottom: 2px; font-size: 12px; }
.khx-body .khx-bank-list-section .khx-stat strong { font-size: 22px; line-height: 1.35; }
.khx-body [data-khx-bank-view-panel][hidden] { display: none !important; }
.khx-body .khx-bank-view-controls { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 18px 0 14px; padding: 10px 14px; border: 1px solid #dfe7ed; border-radius: 13px; background: #fbfdfe; }
.khx-body .khx-bank-view-label { display: grid; min-width: 0; gap: 2px; }
.khx-body .khx-bank-view-label strong { font-size: 13px; }
.khx-body .khx-bank-view-label span { color: var(--khx-muted); font-size: 11px; }
.khx-body .khx-bank-toggle { flex-shrink: 0; gap: 2px; padding: 3px; }
.khx-body .khx-bank-toggle button { min-height: 36px; padding: 6px 12px; font-size: 11px; white-space: nowrap; }
.khx-body .khx-bank-toggle button[aria-pressed="true"] { background: var(--khx-blue); color: #2f5364; box-shadow: 0 2px 5px rgba(37,68,87,.04); }
.khx-body .khx-bank-table-wrap { max-width: 100%; min-width: 0; overflow-x: auto; border: 1px solid #dfe7ed; border-radius: 14px; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.khx-body .khx-bank-table-wrap:focus-visible { outline: 3px solid var(--khx-focus); outline-offset: 3px; }
.khx-body .khx-bank-table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 12px; }
.khx-body .khx-bank-table th, .khx-body .khx-bank-table td { padding: 12px 11px; border-bottom: 1px solid #e7edf0; vertical-align: middle; text-align: left; }
.khx-body .khx-bank-table thead th { background: #f6f9fa; color: var(--khx-muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.khx-body .khx-bank-table tbody th { background: #fff; font-weight: 700; white-space: nowrap; }
.khx-body .khx-bank-table tbody tr:last-child th, .khx-body .khx-bank-table tbody tr:last-child td { border-bottom: 0; }
.khx-body .khx-bank-table tfoot td { border-top: 2px solid #cfe3eb; border-bottom: 0; background: #f5fafc; }
.khx-body .khx-bank-table .is-number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.khx-body .khx-bank-table td:nth-child(4), .khx-body .khx-bank-table td:nth-child(5) { overflow-wrap: anywhere; }
.khx-body .khx-bank-table-action { white-space: nowrap; }
.khx-body .khx-bank-table-action .button { min-height: 36px; padding: 6px 11px; font-size: 12px; }
.khx-body .khx-bank-status { display: inline-flex; min-height: 27px; align-items: center; padding: 4px 9px; border-radius: 999px; background: var(--khx-blue); color: #2f6176; font-size: 11px; font-weight: 700; white-space: nowrap; }

@media (max-width: 760px) {
  .khx-body .khx-bank-list-section { padding: 17px 16px; }
  .khx-body .khx-bank-list-section .khx-stat { padding: 13px 16px; }
  .khx-body .khx-bank-view-controls { align-items: stretch; flex-direction: column; }
  .khx-body .khx-bank-toggle { width: 100%; }
  .khx-body .khx-bank-toggle button { flex: 1; }
}

/* 振込入金確認の照合フロー。サンプルHTMLの「一覧＋右側の詳細」を、
   きはらレイアウトの色・余白へ合わせて実装する。 */
.khx-transfer-head { align-items: end; }
.khx-transfer-result { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.khx-transfer-flow { overflow: visible; }
.khx-body .khx-transfer-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
.khx-transfer-tabs .khx-state-tab { min-width: 0; }
.khx-transfer-tabs .khx-state-tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.khx-transfer-subnav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 13px; color: var(--khx-muted); font-size: 12px; }
.khx-transfer-subnav a { color: #315e71; font-weight: 700; text-decoration: none; }
.khx-transfer-subnav a:hover { text-decoration: underline; }
.khx-transfer-filter { grid-template-columns: minmax(190px, .35fr) minmax(280px, .7fr) auto; align-items: end; }
.khx-transfer-view-controls { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0 0 12px; padding: 10px 14px; border-bottom: 1px solid #e7edf0; background: #fbfdfe; }
.khx-transfer-view-controls > div:first-child { display: grid; min-width: 0; gap: 2px; }
.khx-transfer-view-controls strong { font-size: 13px; }
.khx-transfer-view-controls span { color: var(--khx-muted); font-size: 11px; }
.khx-transfer-toggle { flex-shrink: 0; gap: 2px; padding: 3px; }
.khx-transfer-toggle button { min-height: 36px; padding: 6px 12px; font-size: 11px; white-space: nowrap; }
.khx-transfer-toggle button[aria-pressed="true"] { background: var(--khx-blue); color: #2f5364; box-shadow: 0 2px 5px rgba(37,68,87,.04); }
.khx-body [data-khx-transfer-view-panel][hidden] { display: none !important; }
.khx-transfer-card-list { display: grid; gap: 10px; padding: 12px; }
.khx-transfer-card { display: grid; gap: 10px; padding: 14px; border: 1px solid #dfe7ed; border-radius: 13px; background: #fff; }
.khx-transfer-card.is-selected { border-color: #8fcfe7; background: #f5fcff; box-shadow: 0 4px 14px rgba(57,91,108,.06); }
.khx-transfer-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.khx-transfer-card-head > div { min-width: 0; }
.khx-transfer-card-head h3 { margin: 4px 0 2px; color: #254457; font-size: 15px; overflow-wrap: anywhere; }
.khx-transfer-card-head small { display: block; color: var(--khx-muted); font-size: 11px; }
.khx-transfer-card-head > strong { color: #2d667e; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.khx-transfer-card-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px 12px; color: var(--khx-muted); font-size: 11px; }
.khx-transfer-card-meta span:last-child { grid-column: 1 / -1; }
.khx-transfer-card-actions { display: flex; justify-content: flex-end; padding-top: 2px; }
.khx-transfer-card-status { display: flex; justify-content: flex-start; padding-top: 2px; }
.khx-transfer-card-expected { justify-content: flex-start; padding-top: 2px; }
.khx-transfer-card-expected .khx-amount input { width: 110px; }
.khx-transfer-section { min-width: 0; }
.khx-transfer-workspace { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(350px, .85fr); gap: 18px; align-items: start; }
.khx-transfer-list-pane, .khx-transfer-detail-pane { min-width: 0; }
.khx-transfer-list-pane { overflow: hidden; border: 1px solid #dfe7ed; border-radius: 15px; background: #fff; }
.khx-transfer-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid #dfe7ed; border-radius: 15px; background: #fff; }
.khx-transfer-list-pane .khx-transfer-table-wrap { border: 0; border-radius: 0; }
.khx-transfer-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 12px; }
.khx-transfer-table th, .khx-transfer-table td { padding: 13px 12px; border-bottom: 1px solid #e7edf0; vertical-align: middle; text-align: left; white-space: nowrap; }
.khx-transfer-table thead th { background: #f4f8fa; color: var(--khx-muted); font-size: 11px; font-weight: 800; }
.khx-transfer-table tbody tr { transition: background-color 160ms ease; }
.khx-transfer-table tbody tr:hover, .khx-transfer-table tbody tr.is-selected { background: #f3fbfe; }
.khx-transfer-table tbody tr:last-child td { border-bottom: 0; }
.khx-transfer-table td strong { display: block; color: #254457; font-size: 13px; }
.khx-transfer-table td small { display: block; margin-top: 3px; color: var(--khx-muted); font-size: 10px; }
.khx-transfer-table td.number { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }
/* 手順番号用の .number を、振込入金確認の金額セルへ適用しない。 */
.khx-body .khx-transfer-table td.number { display: table-cell; width: auto; height: auto; min-height: 0; flex-shrink: initial; place-items: initial; border-radius: 0; background: transparent; font-size: inherit; }
.khx-transfer-table td:last-child { text-align: right; }

/* 未入金は予定額入力と詳細操作を同じ画面内に収める。 */
@media (min-width: 601px) {
  .khx-transfer-table--unpaid { table-layout: fixed; }
  .khx-transfer-table--unpaid th,
  .khx-transfer-table--unpaid td { box-sizing: border-box; white-space: normal; }
  .khx-transfer-table--unpaid td:nth-child(2),
  .khx-transfer-table--unpaid td:nth-child(4) { overflow-wrap: anywhere; word-break: break-word; }
  .khx-transfer-table--unpaid td.number,
  .khx-transfer-table--unpaid td:last-child { white-space: nowrap; }
  .khx-transfer-table--unpaid .khx-expected-cell { min-width: 0; }
  .khx-transfer-table--unpaid .khx-expected-inline-form { min-width: 0; justify-content: flex-start; }
  .khx-transfer-table--unpaid td:last-child .khx-transfer-select { display: inline-flex; max-width: 100%; box-sizing: border-box; align-items: center; justify-content: center; }
  .khx-transfer-table--unpaid:not(:has(th:nth-child(7))) th:nth-child(1),
  .khx-transfer-table--unpaid:not(:has(th:nth-child(7))) td:nth-child(1) { width: 11%; }
  .khx-transfer-table--unpaid:not(:has(th:nth-child(7))) th:nth-child(2),
  .khx-transfer-table--unpaid:not(:has(th:nth-child(7))) td:nth-child(2) { width: 24%; }
  .khx-transfer-table--unpaid:not(:has(th:nth-child(7))) th:nth-child(3),
  .khx-transfer-table--unpaid:not(:has(th:nth-child(7))) td:nth-child(3) { width: 15%; }
  .khx-transfer-table--unpaid:not(:has(th:nth-child(7))) th:nth-child(4),
  .khx-transfer-table--unpaid:not(:has(th:nth-child(7))) td:nth-child(4) { width: 9%; }
  .khx-transfer-table--unpaid:not(:has(th:nth-child(7))) th:nth-child(5),
  .khx-transfer-table--unpaid:not(:has(th:nth-child(7))) td:nth-child(5) { width: 28%; }
  .khx-transfer-table--unpaid:not(:has(th:nth-child(7))) th:nth-child(6),
  .khx-transfer-table--unpaid:not(:has(th:nth-child(7))) td:nth-child(6) { width: 13%; }

  .khx-transfer-table--unpaid:has(th:nth-child(7)) th:nth-child(1),
  .khx-transfer-table--unpaid:has(th:nth-child(7)) td:nth-child(1) { width: 10%; }
  .khx-transfer-table--unpaid:has(th:nth-child(7)) th:nth-child(2),
  .khx-transfer-table--unpaid:has(th:nth-child(7)) td:nth-child(2) { width: 19%; }
  .khx-transfer-table--unpaid:has(th:nth-child(7)) th:nth-child(3),
  .khx-transfer-table--unpaid:has(th:nth-child(7)) td:nth-child(3) { width: 10%; }
  .khx-transfer-table--unpaid:has(th:nth-child(7)) th:nth-child(4),
  .khx-transfer-table--unpaid:has(th:nth-child(7)) td:nth-child(4) { width: 13%; }
  .khx-transfer-table--unpaid:has(th:nth-child(7)) th:nth-child(5),
  .khx-transfer-table--unpaid:has(th:nth-child(7)) td:nth-child(5) { width: 8%; }
  .khx-transfer-table--unpaid:has(th:nth-child(7)) th:nth-child(6),
  .khx-transfer-table--unpaid:has(th:nth-child(7)) td:nth-child(6) { width: 27%; }
  .khx-transfer-table--unpaid:has(th:nth-child(7)) th:nth-child(7),
  .khx-transfer-table--unpaid:has(th:nth-child(7)) td:nth-child(7) { width: 13%; }
}

/* 銀行CSV候補も、店舗未確定と同じ左一覧・右詳細の2ペインで表示する。 */
@media (min-width: 601px) {
  .khx-transfer-table-wrap--bank { overflow-x: hidden; }
  .khx-transfer-table--bank { min-width: 0; table-layout: fixed; }
  .khx-transfer-table--bank th,
  .khx-transfer-table--bank td { box-sizing: border-box; white-space: normal; }
  .khx-transfer-table--bank th:nth-child(1),
  .khx-transfer-table--bank td:nth-child(1) { width: 13%; }
  .khx-transfer-table--bank th:nth-child(2),
  .khx-transfer-table--bank td:nth-child(2) { width: 22%; }
  .khx-transfer-table--bank th:nth-child(3),
  .khx-transfer-table--bank td:nth-child(3) { width: 12%; }
  .khx-transfer-table--bank th:nth-child(4),
  .khx-transfer-table--bank td:nth-child(4) { width: 13%; }
  .khx-transfer-table--bank th:nth-child(5),
  .khx-transfer-table--bank td:nth-child(5) { width: 13%; }
  .khx-transfer-table--bank th:nth-child(6),
  .khx-transfer-table--bank td:nth-child(6) { width: 12%; }
  .khx-transfer-table--bank th:nth-child(7),
  .khx-transfer-table--bank td:nth-child(7) { width: 15%; }
  .khx-transfer-table--bank td:nth-child(2),
  .khx-transfer-table--bank td:nth-child(4),
  .khx-transfer-table--bank td:nth-child(5),
  .khx-transfer-table--bank td:nth-child(6) { overflow-wrap: anywhere; word-break: break-word; }
  .khx-transfer-table--bank td:nth-child(1),
  .khx-transfer-table--bank td.number,
  .khx-transfer-table--bank td:last-child { white-space: nowrap; }
  .khx-transfer-table--bank td:last-child .khx-transfer-select { box-sizing: border-box; max-width: 100%; }
}

/* 店舗未確定はPC画面内で完結させ、不要な列を減らした店舗表示を優先する。 */
@media (min-width: 601px) {
  .khx-transfer-table-wrap--clinic-unassigned { overflow-x: hidden; }
  .khx-transfer-table--clinic-office,
  .khx-transfer-table--clinic-store { min-width: 0; table-layout: fixed; }
  .khx-transfer-table--clinic-office th,
  .khx-transfer-table--clinic-office td,
  .khx-transfer-table--clinic-store th,
  .khx-transfer-table--clinic-store td { white-space: normal; box-sizing: border-box; }

  .khx-transfer-table--clinic-office th:nth-child(1),
  .khx-transfer-table--clinic-office td:nth-child(1) { width: 12%; }
  .khx-transfer-table--clinic-office th:nth-child(2),
  .khx-transfer-table--clinic-office td:nth-child(2) { width: 21%; }
  .khx-transfer-table--clinic-office th:nth-child(3),
  .khx-transfer-table--clinic-office td:nth-child(3) { width: 12%; }
  .khx-transfer-table--clinic-office th:nth-child(4),
  .khx-transfer-table--clinic-office td:nth-child(4) { width: 12%; }
  .khx-transfer-table--clinic-office th:nth-child(5),
  .khx-transfer-table--clinic-office td:nth-child(5) { width: 12%; }
  .khx-transfer-table--clinic-office th:nth-child(6),
  .khx-transfer-table--clinic-office td:nth-child(6) { width: 16%; }
  .khx-transfer-table--clinic-office th:nth-child(7),
  .khx-transfer-table--clinic-office td:nth-child(7) { width: 15%; }

  .khx-transfer-table--clinic-store th:nth-child(1),
  .khx-transfer-table--clinic-store td:nth-child(1) { width: 15%; }
  .khx-transfer-table--clinic-store th:nth-child(2),
  .khx-transfer-table--clinic-store td:nth-child(2) { width: 33%; }
  .khx-transfer-table--clinic-store th:nth-child(3),
  .khx-transfer-table--clinic-store td:nth-child(3) { width: 15%; }
  .khx-transfer-table--clinic-store th:nth-child(4),
  .khx-transfer-table--clinic-store td:nth-child(4) { width: 22%; }
  .khx-transfer-table--clinic-store th:nth-child(5),
  .khx-transfer-table--clinic-store td:nth-child(5) { width: 15%; }

  .khx-transfer-table--clinic-office td:nth-child(2),
  .khx-transfer-table--clinic-office td:nth-child(4),
  .khx-transfer-table--clinic-office td:nth-child(5),
  .khx-transfer-table--clinic-office td:nth-child(6),
  .khx-transfer-table--clinic-store td:nth-child(2),
  .khx-transfer-table--clinic-store td:nth-child(4) { overflow-wrap: anywhere; word-break: break-word; }
  .khx-transfer-table--clinic-office td:last-child,
  .khx-transfer-table--clinic-store td:last-child { white-space: nowrap; }
  .khx-transfer-table--clinic-office td:last-child .khx-transfer-select,
  .khx-transfer-table--clinic-store td:last-child .khx-transfer-select { box-sizing: border-box; display: inline-flex; max-width: 100%; align-items: center; justify-content: center; }
  .khx-transfer-table--clinic-office td.number,
  .khx-transfer-table--clinic-store td.number { white-space: nowrap; }
}

.khx-transfer-select { min-height: 32px; padding: 6px 10px; border-radius: 8px; font-size: 11px; white-space: nowrap; }
.khx-transfer-select.is-selected { border-color: #e3a2b8; background: #fff2f6; color: #704853; }
.khx-transfer-detail-pane { position: sticky; top: 22px; min-height: 100%; padding: 22px; border: 1px solid #cfe3eb; border-radius: 17px; background: linear-gradient(180deg, #fbfeff 0%, #fff 42%); box-shadow: 0 7px 22px rgba(57, 91, 108, .07); }
.khx-transfer-detail-head { padding-bottom: 17px; border-bottom: 1px solid #e3edf1; }
.khx-transfer-detail-head h3 { margin: 5px 0 4px; color: #254457; font-size: 20px; }
.khx-transfer-detail-head p { margin: 0; color: var(--khx-muted); font-size: 12px; }
.khx-transfer-facts { display: grid; gap: 0; margin: 0; }
.khx-transfer-facts > div { display: grid; grid-template-columns: 115px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf2f4; }
.khx-transfer-facts dt { color: var(--khx-muted); font-size: 11px; font-weight: 700; }
.khx-transfer-facts dd { min-width: 0; margin: 0; color: #254457; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.khx-transfer-facts .khx-emphasis { color: #17718a; font-size: 22px; font-variant-numeric: tabular-nums; }
.khx-status { display: inline-flex; min-height: 25px; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.khx-status-wait { background: #fff3d7; color: #866119; }
.khx-status-review { background: #fff0f5; color: #8a4e64; }
.khx-status-paid { background: #e7f8f2; color: #197061; }
.khx-transfer-detail-form { display: grid; gap: 13px; margin-top: 16px; }
.khx-transfer-detail-form .khx-button { width: 100%; }
.khx-transfer-detail-empty { display: grid; min-height: 280px; place-content: center; justify-items: center; gap: 10px; color: var(--khx-muted); text-align: center; }
.khx-transfer-detail-empty .khx-step { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: var(--khx-blue); color: #315e71; font-size: 19px; }
.khx-transfer-detail-empty h3 { margin: 0; color: #315e71; font-size: 17px; }
.khx-transfer-detail-empty p { max-width: 230px; margin: 0; font-size: 12px; line-height: 1.7; }
.khx-transfer-warning { margin: 0; font-size: 12px; }
.khx-transfer-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 18px; }
.khx-transfer-detail-actions > form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.khx-transfer-detail-actions .khx-field { min-width: 180px; }
.khx-inline-form { margin: 0; }
.khx-expected-cell { min-width: 176px; }
.khx-expected-inline-form { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin: 0; }
.khx-expected-inline-form .khx-amount { display: inline-flex; min-width: 0; align-items: center; gap: 4px; }
.khx-expected-inline-form .khx-amount input { width: 78px; min-width: 0; min-height: 32px; padding: 6px 7px; text-align: right; font-size: 12px; }
.khx-expected-inline-form .khx-amount > span { font-size: 11px; }
.khx-expected-save { min-height: 32px; padding: 6px 8px; font-size: 11px; white-space: nowrap; }
.khx-expected-empty { color: var(--khx-muted); font-weight: 600; }
.khx-transfer-bank-detail .khx-transfer-facts { max-width: 760px; }
.khx-transfer-bank-detail .khx-transfer-detail-actions { justify-content: flex-start; }
.khx-transfer-upload { display: grid; gap: 16px; }
.khx-transfer-upload .khx-form-grid { max-width: 760px; }
.khx-transfer-flow .khx-filter { margin-bottom: 0; }
.khx-payer-patient-row { grid-template-columns: auto repeat(3, minmax(140px, 1fr)) repeat(2, minmax(130px, 1fr)); }

@media (max-width: 1060px) {
  .khx-transfer-workspace { grid-template-columns: 1fr; }
  .khx-transfer-detail-pane { position: static; }
  .khx-transfer-detail-empty { min-height: 170px; }
  .khx-payer-patient-row { grid-template-columns: auto repeat(2, minmax(150px, 1fr)); }
}
@media (max-width: 760px) {
  .khx-bonus-view-controls, .khx-transfer-view-controls { align-items: stretch; flex-direction: column; }
  .khx-bonus-toggle, .khx-transfer-toggle { width: 100%; }
  .khx-bonus-toggle button, .khx-transfer-toggle button { flex: 1; }
  .khx-bonus-table-wrap { overflow-x: auto; }
  .khx-transfer-tabs { display: flex; overflow-x: auto; }
  .khx-transfer-tabs .khx-state-tab { flex: 1 0 145px; }
  .khx-transfer-filter { grid-template-columns: 1fr; }
  .khx-transfer-detail-pane { padding: 17px; }
  .khx-transfer-facts > div { grid-template-columns: 95px minmax(0, 1fr); }
  .khx-payer-patient-row { grid-template-columns: 1fr; }
}
