:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --panel: #ffffff;
  --line: #deded8;
  --text: #22231f;
  --muted: #737369;
  --accent: #326a67;
  --accent-2: #b55d35;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
body.has-sidebar { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { border: 1px solid var(--accent); background: var(--accent); color: white; border-radius: 6px; padding: 8px 14px; cursor: pointer; }
.small-button { padding: 5px 9px; font-size: 13px; }
.text-button { border: 0; background: transparent; color: var(--accent); padding: 0; }
.button-link { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--accent); background: var(--accent); color: white; border-radius: 6px; padding: 8px 14px; text-decoration: none; }
.button-link:disabled { opacity: .55; cursor: not-allowed; }
.card-link { margin-top: 10px; display: inline-flex; }
.app-frame { min-height: 100vh; height: 100vh; overflow: hidden; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { background: #fbfbf8; border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.brand-block { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 10px; padding: 4px 4px 14px; border-bottom: 1px solid var(--line); }
.brand-logo { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 10px 24px rgba(47, 117, 110, .14); }
.brand-copy { min-width: 0; display: grid; gap: 3px; }
.brand-block strong { font-size: 16px; font-weight: 400; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-block span { color: var(--muted); font-size: 13px; }
.brand-block span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidenav { display: grid; gap: 6px; }
.nav-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sidenav a { min-height: 42px; display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; border-radius: 8px; padding: 7px 10px; font-weight: 400; }
.sidenav a:hover { background: #edf4f2; color: var(--accent); }
.nav-icon-wrap { width: 28px; height: 28px; flex: 0 0 28px; display: inline-grid; place-items: center; border: 1px solid #d8e5e1; border-radius: 8px; background: #f1f7f5; color: var(--accent); transition: background .18s ease, border-color .18s ease, color .18s ease; }
.nav-icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sidenav a:hover .nav-icon-wrap { border-color: #b9d2cb; background: #ffffff; color: var(--accent); }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 4px 0; display: grid; gap: 10px; }
.sidebar-account form { margin: 0; }
.sidebar-account button { width: 100%; height: 40px; border: 0; border-radius: 8px; background: #176c5d; color: #fff; padding: 0 14px; font-size: 14px; font-weight: 700; line-height: 1.35; box-shadow: 0 10px 22px rgba(23, 108, 93, .2); }
.sidebar-account button:hover { background: #0f5f56; color: #fff; }
.content-frame { min-width: 0; min-height: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.statusbar { min-height: 66px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 24px; background: #fbfbf8; border-bottom: 1px solid var(--line); }
.statusbar-user { display: grid; gap: 4px; min-width: 0; }
.statusbar-user strong, .statusbar-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statusbar-user span { color: var(--muted); font-size: 12px; }
.global-patient-search { width: min(380px, 42vw); }
.global-patient-search input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: white; font-size: 13px; }
.global-patient-search input::placeholder { color: #8a8a80; }
.global-patient-suggestions { z-index: 70; }
.global-patient-suggestions .suggestion-item { padding: 10px 12px 10px 14px; }
.global-patient-suggestions .suggestion-item span { font-size: 12px; }
.shell { padding: 24px; }
.has-sidebar .shell { flex: 1 1 auto; min-height: 0; overflow: auto; }
.auth-shell { min-height: 100vh; display: grid; align-items: start; }
.message-list {
  position: fixed;
  z-index: 80;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  inline-size: min(560px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  pointer-events: none;
  transition: opacity .24s ease, transform .24s ease;
}
.message-list.is-hiding { opacity: 0; transform: translate(-50%, -8px); }
.message {
  margin: 0;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: rgba(20, 20, 20, .82);
  color: white;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}
.login-panel { max-width: 420px; margin: 80px auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 28px; }
.login-panel input { width: 100%; margin-top: 6px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; }
.dashboard-page { max-width: 1280px; height: calc(100vh - 104px); margin: 0 auto; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 18px; overflow: hidden; }
.has-sidebar .dashboard-page { height: calc(100vh - 114px); }
.dashboard-summary-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metric-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.metric-card strong { display: block; font-size: 28px; line-height: 1.1; }
.metric-card span { color: var(--muted); }
.dashboard-grid { min-height: 0; display: grid; grid-template-columns: minmax(420px, 1fr) minmax(520px, 1.25fr); gap: 18px; align-items: stretch; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
h1, h2 { margin: 0 0 14px; font-size: 22px; letter-spacing: 0; }
h2 { font-size: 18px; }
h3 { margin: 0 0 8px; font-size: 15px; letter-spacing: 0; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.metric-row div { border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.metric-row strong { display: block; font-size: 26px; }
.metric-row span, .list-item span, .empty, .detail-panel p, .page-subtitle, dt { color: var(--muted); }
.muted-text { color: var(--muted); }
.list { display: grid; gap: 8px; }
.dashboard-list-panel, .detail-panel.dashboard-detail-panel { min-height: 0; display: flex; flex-direction: column; }
.dashboard-patient-list { min-height: 0; flex: 1; align-content: start; overflow: auto; padding-right: 4px; }
.dashboard-detail-panel { overflow: hidden; }
.dashboard-detail-scroll { min-height: 0; flex: 1; overflow: auto; padding-right: 4px; }
.dashboard-summary-section { margin-top: 0; }
.summary-note-head { margin-bottom: 8px; }
.dashboard-detail-actions { margin-top: 16px; }
.list-item { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 4px; color: var(--text); text-decoration: none; }
.list-item:hover, .list-item.is-active { border-color: var(--accent); background: #f3f8f7; }
.dashboard-patient-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dashboard-list-text { min-width: 0; overflow-wrap: anywhere; }
.dashboard-appointment-tags { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.dashboard-appointment-tag { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; font-size: 11px; line-height: 1.25; font-weight: 700; white-space: nowrap; }
.dashboard-appointment-tag.is-status { color: #174f44; border-color: #bdd8d1; background: #e8f4f1; }
.dashboard-appointment-tag.is-warning { color: #9f2a21; border-color: #f0c6bd; background: #fff0ed; }
.dashboard-appointment-tag.is-radar { color: #6b3f00; border-color: #e6c36c; background: #fff6d8; }
.deal-radar-dashboard-reminder { margin-bottom: 14px; }
.treatment-opportunity-dashboard-reminder { border-color: #c7ddd5; border-left: 4px solid #2f7d6a; background: #fbfdfa; gap: 10px; }
.dashboard-key-membership-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dashboard-key-membership-card div { min-width: 0; display: grid; gap: 4px; }
.dashboard-key-membership-card span { color: var(--muted); font-size: 12px; line-height: 1.3; }
.dashboard-key-membership-card strong { color: var(--text); font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.dashboard-key-membership-card em { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 24px; border: 1px solid #d9b26f; border-radius: 999px; background: #fff7dc; color: #7d5700; padding: 3px 8px; font-size: 12px; font-style: normal; font-weight: 700; line-height: 1.2; }
.dashboard-action-card { display: grid; gap: 11px; }
.dashboard-action-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dashboard-action-card-head > div { min-width: 0; display: grid; gap: 3px; }
.dashboard-action-eyebrow { color: var(--muted); font-size: 12px; line-height: 1.3; }
.dashboard-action-title { color: var(--text); font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.dashboard-action-pill { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 26px; border: 1px solid #c9d8d3; border-radius: 999px; padding: 3px 9px; background: white; color: #244d43; font-size: 12px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.dashboard-action-pill.is-today_push { border-color: #d9b26f; background: #fff7dc; color: #7d5700; }
.dashboard-action-pill.is-confirm_intent { border-color: #bdd8d1; background: #e8f4f1; color: #174f44; }
.dashboard-action-pill.is-light_confirm { border-color: #d7d8c6; background: #fbf8e8; color: #5d5a2e; }
.dashboard-action-pill.is-prep_only { border-color: #cbd6e5; background: #eef4fb; color: #334b69; }
.dashboard-action-tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dashboard-action-tag { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; border: 1px solid #dce8e3; border-radius: 999px; padding: 3px 8px 3px 4px; background: white; color: #3d4541; font-size: 13px; font-weight: 400; line-height: 1.35; overflow-wrap: anywhere; }
.dashboard-action-tag b { flex: 0 0 auto; border-radius: 999px; padding: 1px 5px; background: #e8f4f1; color: #174f44; font-size: 13px; line-height: 1.35; font-weight: 700; }
.dashboard-action-tag.is-relationship { border-color: #c9dccf; background: #f8fbf6; }
.dashboard-action-tag.is-evidence { border-color: #e8e1cf; background: #fffdf7; }
.dashboard-action-tag.is-evidence b { background: #fff2c7; color: #7d5700; }
.dashboard-action-followup { margin-top: -2px; }
.dashboard-action-tag.is-followup { border-color: #d7e8df; background: #f7fbf9; }
.dashboard-action-tag.is-followup b { background: #e4f1ec; color: #1f5c4c; }
.dashboard-action-section { display: grid; gap: 3px; }
.dashboard-action-section span { color: var(--text); font-size: 13px; font-weight: 700; line-height: 1.35; }
.dashboard-action-section p { margin: 0; color: var(--text); font-size: 13px; font-weight: 400; line-height: 1.55; }
.dashboard-action-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #e7ede8; padding-top: 9px; }
.dashboard-action-footer p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.deal-radar-dashboard-detail-btn { flex: 0 0 auto; padding: 5px 9px; font-size: 12px; }

.twb-page { display: grid; gap: 18px; }
.twb-filterbar { display: grid; grid-template-columns: minmax(240px, 1fr) 150px 150px 180px auto; gap: 12px; align-items: end; padding: 18px; border: 1px solid #dfe7e2; border-radius: 8px; background: #fff; }
.twb-filterbar h1 { margin: 0; color: var(--text); font-size: 24px; line-height: 1.2; letter-spacing: 0; }
.twb-filterbar p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.twb-filterbar label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.twb-filterbar input, .twb-filterbar select { width: 100%; min-height: 38px; border: 1px solid #cfdad4; border-radius: 6px; padding: 7px 9px; background: #fff; color: var(--text); font-size: 14px; }
.twb-filterbar .twb-filter-notice { grid-column: 1 / -1; margin: 0; border-radius: 6px; padding: 8px 10px; background: #fff8e7; color: #7b5a19; font-size: 13px; line-height: 1.45; }
.twb-overview { display: grid; gap: 14px; }
.twb-overview-head { display: grid; gap: 5px; }
.twb-overview-head span { color: var(--text); font-size: 18px; font-weight: 700; line-height: 1.3; }
.twb-overview-head p { margin: 0; color: #53605b; font-size: 14px; font-weight: 400; line-height: 1.6; }
.twb-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.twb-card { min-height: 252px; display: grid; grid-template-rows: auto auto 1fr auto; gap: 13px; border: 1px solid #dfe7e2; border-radius: 8px; padding: 18px; background: #fff; box-shadow: 0 6px 18px rgba(27, 45, 38, 0.04); }
.twb-card-head { display: grid; justify-items: start; gap: 8px; }
.twb-card-head span { color: #3f4b46; font-size: 15px; font-weight: 700; line-height: 1.35; }
.twb-card-head strong { color: var(--text); font-size: 34px; line-height: 1; letter-spacing: 0; }
.twb-card > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.twb-card-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-content: start; }
.twb-card-metrics span { display: grid; gap: 5px; color: #65716c; font-size: 12px; line-height: 1.3; }
.twb-card-metrics b { color: var(--text); font-size: 18px; line-height: 1.2; }
.twb-card-actions { display: flex; gap: 8px; justify-content: flex-end; }
.twb-card-actions button, .twb-work-grid button { border: 1px solid #cfded6; border-radius: 6px; background: #fff; color: #164f44; font-size: 13px; font-weight: 700; cursor: pointer; }
.twb-card-actions button { min-height: 34px; padding: 6px 11px; }
.twb-card-actions button:hover, .twb-work-grid button:hover { border-color: #82aa9d; background: #f5fbf8; }
.twb-opportunity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.twb-opportunity-grid div { display: grid; gap: 4px; padding: 9px 0; border-top: 1px solid #edf1ee; }
.twb-opportunity-grid span { color: #65716c; font-size: 12px; line-height: 1.35; }
.twb-opportunity-grid strong { color: var(--text); font-size: 22px; line-height: 1.15; }
.twb-opportunity-grid em { color: #6f6350; font-size: 12px; font-style: normal; line-height: 1.3; }
.twb-work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; align-content: start; }
.twb-work-grid button { min-height: 58px; display: grid; gap: 4px; justify-items: start; padding: 9px 10px; text-align: left; }
.twb-work-grid span { color: #65716c; font-size: 12px; line-height: 1.3; }
.twb-work-grid strong { color: var(--text); font-size: 22px; line-height: 1.1; }
.twb-drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(15, 28, 24, 0.24); }
.twb-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: 100vw; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 14px; padding: 22px; background: #f8faf8; box-shadow: -14px 0 34px rgba(15, 28, 24, 0.18); transform: translateX(104%); transition: transform 180ms ease; overflow: auto; }
.twb-drawer.is-open { transform: translateX(0); }
.twb-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.twb-drawer-head span { color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.3; }
.twb-drawer-head h2 { margin: 3px 0 0; color: var(--text); font-size: 22px; line-height: 1.25; letter-spacing: 0; }
.twb-drawer-head button, .twb-modal-head button { border: 1px solid #d4dfd9; border-radius: 6px; background: #fff; color: #46514c; min-height: 32px; padding: 5px 10px; cursor: pointer; }
.twb-drawer-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.twb-drawer-summary span { display: grid; gap: 5px; border: 1px solid #dfe7e2; border-radius: 8px; background: #fff; padding: 12px; color: #65716c; font-size: 14px; line-height: 1.35; }
.twb-drawer-summary b { color: var(--text); font-size: 20px; line-height: 1.2; }
.twb-table-wrap { min-height: 0; align-self: start; overflow: auto; border: 1px solid #dfe7e2; border-radius: 8px; background: #fff; }
.twb-table-wrap.is-plain { border: 0; border-radius: 0; background: transparent; }
.twb-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.twb-table.is-small { font-size: 14px; }
.twb-table.is-large { font-size: 16px; }
.twb-table th { position: sticky; top: 0; z-index: 1; background: #f3f7f4; color: #4f5b56; font-size: 14px; font-weight: 700; text-align: left; white-space: nowrap; }
.twb-table.is-large th { font-size: 16px; }
.twb-table th, .twb-table td { border-bottom: 1px solid #edf1ee; padding: 9px 10px; vertical-align: top; }
.twb-table td { color: var(--text); }
.twb-deal-table { font-size: 17px; }
.twb-deal-table th:first-child, .twb-deal-table td:first-child,
.twb-appointment-table th:first-child, .twb-appointment-table td:first-child,
.twb-membership-table th:first-child, .twb-membership-table td:first-child { min-width: 112px; white-space: nowrap; }
.twb-appointment-table th:nth-child(4), .twb-appointment-table td:nth-child(4) { min-width: 150px; width: 18%; }
.twb-appointment-table th:nth-child(5), .twb-appointment-table td:nth-child(5) { min-width: 118px; width: 14%; }
.twb-appointment-table th:nth-child(7), .twb-appointment-table td:nth-child(7) { min-width: 180px; width: 24%; }
.twb-membership-table th:nth-child(5), .twb-membership-table td:nth-child(5) { min-width: 118px; width: 15%; }
.twb-membership-table th:nth-child(6), .twb-membership-table td:nth-child(6) { min-width: 150px; width: 20%; }
.twb-nondeal-list, .twb-attention-list { display: grid; gap: 12px; align-content: start; }
.twb-nondeal-card { display: grid; gap: 12px; border: 1px solid #dfe7e2; border-radius: 8px; background: #fff; padding: 16px; }
.twb-nondeal-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.twb-nondeal-title strong { color: var(--text); font-size: 20px; line-height: 1.25; }
.twb-nondeal-title > span { color: var(--muted); font-size: 15px; line-height: 1.3; }
.twb-attribution-chip { position: relative; display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; padding: 3px 9px; background: #edf6f2; color: #164f44 !important; font-size: 14px !important; font-weight: 700; cursor: default; }
.twb-tooltip { position: absolute; left: 0; top: calc(100% + 8px); z-index: 3; width: 280px; display: none; border: 1px solid #d7e0db; border-radius: 8px; padding: 10px; background: #fff; box-shadow: 0 10px 24px rgba(15, 28, 24, 0.14); color: #38443f !important; font-size: 14px !important; font-weight: 400 !important; line-height: 1.55 !important; }
.twb-attribution-chip:hover .twb-tooltip { display: block; }
.twb-field-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.twb-field-grid div { display: grid; gap: 4px; min-width: 0; }
.twb-field-grid span { color: #53605b; font-size: 15px; font-weight: 700; line-height: 1.3; }
.twb-field-grid strong { color: var(--text); font-size: 14px; font-weight: 400; line-height: 1.45; overflow-wrap: anywhere; }
.twb-analysis-block { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; border-radius: 8px; padding: 12px; }
.twb-analysis-block.is-treatment { background: #f3f8f5; }
.twb-analysis-block.is-membership { background: #fff8e7; }
.twb-analysis-block.is-neutral { grid-template-columns: minmax(0, 1fr); background: #f6f7f5; }
.twb-analysis-block span { color: var(--text); font-size: 16px; font-weight: 700; line-height: 1.35; }
.twb-analysis-block p { margin: 4px 0 0; color: #46514c; font-size: 15px; line-height: 1.55; }
.twb-analysis-block button { border: 1px solid #cfded6; border-radius: 6px; background: #fff; min-height: 32px; padding: 5px 10px; color: #164f44; font-size: 14px; font-weight: 700; cursor: pointer; }
.twb-attention-card { border: 1px solid #dfe7e2; border-radius: 8px; background: #fff; padding: 14px; }
.twb-tabs { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
.twb-tab-list { display: inline-flex; align-items: center; gap: 6px; border-bottom: 1px solid #dfe7e2; padding-bottom: 6px; }
.twb-tab-list button { min-height: 34px; border: 1px solid #d7e2dc; border-radius: 6px; background: #fff; color: #53605b; padding: 7px 11px; font-size: 15px; font-weight: 700; cursor: pointer; }
.twb-tab-list button b { margin-left: 4px; color: inherit; font-size: 14px; }
.twb-tab-list button.is-active { border-color: #1f6f5f; background: #1f6f5f; color: #fff; }
.twb-tab-panel { display: none; min-height: 0; }
.twb-tab-panel.is-active { display: block; }
.twb-empty { margin: 0; border: 1px dashed #cfdad4; border-radius: 8px; background: #fff; padding: 22px; color: var(--muted); font-size: 16px; text-align: center; }
.twb-drawer .dashboard-action-eyebrow { font-size: 14px; }
.twb-drawer .dashboard-action-title { font-size: 18px; }
.twb-drawer .dashboard-action-pill { font-size: 14px; }
.twb-drawer .dashboard-action-tag,
.twb-drawer .dashboard-action-tag b,
.twb-drawer .dashboard-action-section span,
.twb-drawer .dashboard-action-section p { font-size: 15px; }
.twb-drawer .dashboard-action-footer p { font-size: 14px; }
.twb-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(15, 28, 24, 0.28); }
.twb-modal[hidden] { display: none; }
.twb-modal-card { width: min(620px, 92vw); max-height: 86vh; display: grid; grid-template-rows: auto minmax(0, 1fr); border-radius: 8px; background: #fff; box-shadow: 0 18px 48px rgba(15, 28, 24, 0.2); overflow: hidden; }
.twb-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid #edf1ee; padding: 16px 18px; }
.twb-modal-head h3 { margin: 0; color: var(--text); font-size: 18px; line-height: 1.3; letter-spacing: 0; }
.twb-modal-body { min-height: 0; overflow: auto; padding: 18px; }
.twb-analysis-detail dl { display: grid; gap: 13px; margin: 0; }
.twb-analysis-detail div { display: grid; gap: 5px; }
.twb-analysis-detail dt { color: #53605b; font-size: 13px; font-weight: 700; line-height: 1.35; }
.twb-analysis-detail dd { margin: 0; color: var(--text); font-size: 14px; line-height: 1.65; }
.twb-analysis-detail p { margin: 0 0 5px; }
@media (max-width: 1120px) {
  .twb-filterbar { grid-template-columns: minmax(220px, 1fr) 145px 145px 160px auto; }
  .twb-card-metrics,
  .twb-opportunity-grid,
  .twb-work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .twb-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .twb-filterbar,
  .twb-card-grid,
  .twb-card-metrics,
  .twb-opportunity-grid,
  .twb-work-grid,
  .twb-field-grid,
  .twb-drawer-summary { grid-template-columns: 1fr; }
  .twb-card { min-height: 0; }
  .twb-drawer { width: 100vw; padding: 16px; }
  .twb-analysis-block { grid-template-columns: 1fr; }
  .twb-card-actions { justify-content: stretch; }
  .twb-card-actions button { flex: 1 1 0; }
}
.dashboard-appointment-note-card { border-color: #dce4ea; background: #fbfdff; }
.dashboard-appointment-note-card strong { color: #334b69; }
.detail-panel { min-height: 360px; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.summary-grid.single { grid-template-columns: 1fr; }
.summary-grid div { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
dt { font-size: 12px; margin-bottom: 4px; }
dd { margin: 0; }
.section-block { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px; }
.section-block p { margin: 6px 0; }
.page-panel { max-width: 1180px; margin: 0 auto; }
.narrow-panel { max-width: 680px; }
.filter-bar { display: flex; align-items: end; gap: 12px; margin: 18px 0; flex-wrap: wrap; }
.compact-filter-bar { margin: 12px 0 14px; flex-wrap: nowrap; }
.filter-bar label { display: grid; gap: 6px; }
.compact-filter-bar label { flex: 1 1 0; min-width: 0; }
.filter-bar span { font-size: 12px; color: var(--muted); }
.filter-bar input, .filter-bar select { min-width: 220px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.compact-filter-bar input, .compact-filter-bar select { min-width: 0; width: 100%; }
.suggestion-field { position: relative; }
.suggestion-list { position: absolute; z-index: 10; top: 100%; left: 0; right: 0; margin-top: 4px; display: grid; max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 10px 24px rgba(34, 35, 31, .12); }
.suggestion-list[hidden] { display: none; }
.suggestion-item { display: grid; gap: 3px; padding: 9px 10px; color: var(--text); text-decoration: none; border-top: 1px solid var(--line); }
.suggestion-item:first-child { border-top: 0; }
.suggestion-item:hover { background: #f3f8f7; color: var(--accent); }
.suggestion-item span { color: var(--muted); }
.treatment-suggestion-field input { width: 100%; }
.suggestion-list button.suggestion-item { width: 100%; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: white; box-shadow: none; cursor: pointer; font: inherit; text-align: left; }
.suggestion-list button.suggestion-item:first-child { border-top: 0; }
.suggestion-list button.suggestion-item:hover,
.suggestion-list button.suggestion-item:focus { background: #f3f8f7; color: var(--accent); outline: 0; }
.suggestion-list button.suggestion-item span { font-weight: 400; }
.table-list { display: grid; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.table-row { display: grid; grid-template-columns: 1.2fr 1fr .7fr 1fr .8fr; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
.patient-list-toolbar { display: flex; justify-content: flex-end; margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.patient-list-toolbar span { font-weight: 600; color: var(--text); }
.patient-center-list { overflow-x: auto; }
.table-row.patient-center-row { grid-template-columns: minmax(210px, 1.55fr) .75fr .38fr .38fr .58fr minmax(86px, .68fr) minmax(180px, 1.25fr) .58fr .58fr; min-width: 1120px; }
.table-row.followup-row { grid-template-columns: 1fr .85fr 1.1fr .9fr 2fr; }
.table-row.followup-row > * { font-size: 14px; }
.boss-report-page { max-width: 1320px; }
.boss-report-filter label:first-child { min-width: 260px; }
.boss-report-filter .period-control.is-hidden { display: none; }
.boss-report-filter .period-date-field.is-hidden { display: none; }
.boss-report-meta { display: flex; align-items: baseline; gap: 12px; margin: 10px 0 14px; }
.boss-report-meta span { color: var(--muted); }
.boss-metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.boss-metric-grid div { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: white; }
.boss-metric-grid .boss-metric-card { position: relative; padding-right: 36px; }
.boss-metric-grid div.is-alert { border-color: #f0c6bd; background: #fff0ed; }
.boss-metric-grid strong { display: block; font-size: 24px; line-height: 1.15; }
.boss-metric-grid span { color: var(--muted); font-size: 13px; }
.boss-metric-tip-wrap { position: absolute; top: 10px; right: 10px; z-index: 4; }
.boss-metric-tip-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border: 1px solid #cfd8d3; border-radius: 50%; background: #fbfbf8; color: #52615b; font-size: 11px; line-height: 1; cursor: help; padding: 0; }
.boss-metric-tip-icon:hover, .boss-metric-tip-icon:focus { border-color: var(--accent); color: var(--accent); outline: none; }
.boss-metric-tip { position: absolute; top: 26px; right: 0; z-index: 30; width: max-content; max-width: 260px; padding: 8px 10px; border: 1px solid #d8d8d0; border-radius: 8px; background: #fffefa; box-shadow: 0 10px 28px rgba(31, 33, 28, .16); color: var(--text); font-size: 12px; line-height: 1.45; text-align: left; white-space: normal; opacity: 0; visibility: hidden; transform: translateY(-2px); transition: opacity .12s ease, transform .12s ease, visibility .12s ease; pointer-events: none; }
.boss-metric-tip-wrap:hover .boss-metric-tip, .boss-metric-tip-icon:focus + .boss-metric-tip { opacity: 1; visibility: visible; transform: translateY(0); }
.boss-doctor-section { display: grid; gap: 10px; }
.boss-analysis-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 14px 0; background: #fbfbf8; }
.boss-analysis-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.boss-analysis-card h2 { margin: 0; font-size: 16px; }
.boss-analysis-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.boss-analysis-spinner { width: 14px; height: 14px; border: 2px solid #d8d8d2; border-top-color: var(--accent); border-radius: 50%; animation: boss-analysis-spin .8s linear infinite; }
.boss-analysis-status:not(.is-loading) .boss-analysis-spinner { display: none; }
.boss-analysis-card [data-ai-analysis-retry] { margin-top: 10px; }
@keyframes boss-analysis-spin { to { transform: rotate(360deg); } }
.boss-analysis-markdown { color: var(--text); line-height: 1.55; font-size: 13px; }
.boss-analysis-markdown p { margin: 3px 0; }
.boss-analysis-markdown .boss-analysis-section-title { margin-top: 10px; font-size: 14px; }
.boss-analysis-markdown .boss-analysis-section-title:first-child { margin-top: 0; }
.boss-analysis-markdown .boss-analysis-point span { display: inline-block; min-width: 24px; color: var(--muted); }
.preline-text { white-space: pre-line; color: var(--text); line-height: 1.6; }
.section-title-row.boss-doctor-head { align-items: baseline; justify-content: flex-start; gap: 14px; }
.boss-doctor-head h2 { margin: 0; white-space: nowrap; }
.boss-doctor-metrics { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; }
.boss-doctor-metrics span { border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; background: #fbfbf8; }
.boss-doctor-metrics .is-alert { border-color: #f0c6bd; background: #fff0ed; color: #a93429; }
.boss-detail-title { margin-top: 8px; }
.table-row.boss-report-row { grid-template-columns: repeat(var(--report-columns, 9), minmax(88px, 1fr)); min-width: max(100%, calc(var(--report-columns, 9) * 98px)); }
.table-row.boss-report-row > * { min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.boss-detail-table { overflow-x: auto; width: 100%; }
.boss-detail-table .boss-report-row { width: 100%; }
.conversion-judgement-cell { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.conversion-judgement-cell.is-success { color: #2e7058; }
.conversion-judgement-cell.is-danger { color: #a93429; }
.conversion-judgement-cell.is-warning { color: #9a621f; }
.conversion-judgement-cell.is-neutral { color: #52615b; }
.conversion-judgement-cell.is-muted { color: var(--muted); }
.conversion-tip-icon { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border: 1px solid #cfd8d3; border-radius: 50%; background: #fbfbf8; color: #52615b; font-size: 11px; line-height: 1; cursor: pointer; padding: 0; flex: 0 0 auto; }
.conversion-tip-popover { position: fixed; z-index: 9999; width: min(320px, calc(100vw - 24px)); padding: 10px 12px; border: 1px solid #d8d8d0; border-radius: 8px; background: #fffefa; box-shadow: 0 10px 28px rgba(31, 33, 28, .18); color: var(--text); font-size: 12px; line-height: 1.55; text-align: left; white-space: pre-line; font-weight: 400; pointer-events: none; }
.conversion-tip-popover[hidden] { display: none; }
.missing-tags-cell { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.missing-tag { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px; border: 1px solid #e8c8bf; border-radius: 999px; background: #fff4f0; color: #9d463b; font-size: 12px; line-height: 1.2; white-space: nowrap; }
.treatment-opportunity-page { max-width: 1440px; min-width: 0; margin: 0 auto; display: grid; gap: 14px; }
.to-topbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.to-title h1 { margin: 0; font-size: 22px; line-height: 1.2; }
.to-toolbar { display: grid; justify-items: start; gap: 6px; }
.to-toolbar input[type="hidden"] { display: none; }
.to-filter-main { display: flex; align-items: center; justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
.to-date-range { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.to-date-range .to-input { width: 142px; }
.to-range-buttons { display: inline-flex; align-items: center; justify-content: flex-start; gap: 10px; flex-wrap: wrap; }
.to-shortcut { min-height: 22px; border: 0; background: transparent; color: #54635f; padding: 0 1px; font-size: 12px; font-weight: 800; line-height: 1.2; cursor: pointer; }
.to-shortcut:hover, .to-shortcut.is-active { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.to-select, .to-input, .to-form-grid textarea { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); padding: 7px 10px; }
.to-input { width: 190px; }
.to-btn { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #283735; padding: 7px 12px; font-weight: 700; box-shadow: none; }
.to-btn:hover, .to-link-btn:hover { border-color: #b8d7d1; background: #f2f8f6; color: var(--accent); }
.to-btn.is-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.to-btn.is-danger { border-color: #b9342a; background: #b9342a; color: #fff; }
.to-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.to-nav button { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #31403d; padding: 8px 12px; font-weight: 700; }
.to-nav button span { min-width: 24px; min-height: 22px; display: inline-grid; place-items: center; border-radius: 999px; background: #eef2f0; color: var(--muted); font-size: 12px; padding: 2px 7px; }
.to-nav button.is-active { border-color: #b8d7d1; background: #e8f4f1; color: var(--accent); }
.to-nav button.is-active span { background: #fff; color: var(--accent); }
.to-view { display: none; gap: 14px; }
.to-view.is-active { display: grid; }
.to-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.to-summary-grid.is-six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.to-metric { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 14px; }
.to-metric span, .to-metric small { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
.to-metric strong { display: block; margin: 4px 0; font-size: 26px; line-height: 1.1; color: var(--text); overflow-wrap: anywhere; }
.to-metric.is-green { background: #edf7f4; border-color: #c6ded8; }
.to-metric.is-blue { background: #eef5ff; border-color: #c8d9ef; }
.to-metric.is-amber { background: #fff7e5; border-color: #ead49c; }
.to-metric.is-red { background: #fff1ee; border-color: #efc3bb; }
.to-section { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 14px; }
.to-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.to-section-head h2 { margin: 0; font-size: 17px; }
.to-section-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.to-panel-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.to-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; border: 1px solid #d8ddd8; border-radius: 999px; background: #eef2f0; color: #52615b; padding: 2px 8px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.to-pill.is-green { border-color: #b9d8d0; background: #e6f4f1; color: #176c5d; }
.to-pill.is-blue { border-color: #c2d4ef; background: #eaf2ff; color: #255fbc; }
.to-pill.is-amber { border-color: #e6c36c; background: #fff6d8; color: #875700; }
.to-pill.is-red { border-color: #efc3bb; background: #fff0ed; color: #b42318; }
.to-table-wrap { width: 100%; overflow-x: visible; border: 1px solid var(--line); border-radius: 8px; }
.to-table { width: 100%; min-width: 0; border-collapse: collapse; background: #fff; table-layout: fixed; }
.to-col-patient { width: 9%; }
.to-col-title { width: 15%; }
.to-col-value { width: 7%; }
.to-col-responsibility { width: 15%; }
.to-col-follow { width: 9%; }
.to-col-risk { width: 8%; }
.to-col-suggest { width: auto; }
.to-col-potential { width: 6%; }
.to-col-operate { width: 8%; }
.to-table th, .to-table td { padding: 10px 8px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; line-height: 1.45; }
.to-table th { border-top: 0; background: #fbfbf8; color: #56635f; font-size: 12px; font-weight: 700; white-space: nowrap; }
.to-table td > span, .to-table small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.to-table td strong { overflow-wrap: anywhere; }
.to-responsibility-cell strong, .to-responsibility-cell span { display: block; overflow-wrap: anywhere; }
.to-responsibility-cell span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.to-evidence-cell, .to-plain-note-cell { color: #41504c; overflow-wrap: anywhere; }
.to-plain-note-cell { line-height: 1.55; }
.to-follow-cell, .to-operate-cell { white-space: nowrap; }
.to-follow-cell .to-pill { vertical-align: middle; }
.to-follow-cell small { display: inline-block; margin: 0 0 0 6px; white-space: nowrap; vertical-align: middle; }
.to-link-btn { border: 0; background: transparent; color: var(--accent); padding: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.to-link-btn.is-danger { color: #b42318; }
.to-inline-form { display: inline-block; margin: 0 6px 4px 0; }
.to-money { color: #176c5d; font-weight: 800; white-space: nowrap; }
.to-money.is-red, .to-money.red { color: #b42318; }
.to-empty { margin: 0; color: var(--muted); font-size: 13px; }
.to-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.to-compact-list { display: grid; gap: 8px; }
.to-info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.to-info-cell { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #fbfbf8; padding: 9px 10px; }
.to-info-cell strong { display: block; color: #27332f; font-size: 12px; font-weight: 700; line-height: 1.35; }
.to-info-cell span { display: block; margin-top: 4px; color: #384541; font-size: 13px; font-weight: 400; line-height: 1.45; overflow-wrap: anywhere; }
.to-mini-row { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfbf8; padding: 10px; }
.to-mini-row div { min-width: 0; display: grid; gap: 3px; }
.to-mini-row strong { font-size: 13px; overflow-wrap: anywhere; }
.to-mini-row span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.to-mini-row .to-mini-label { color: #27332f; font-size: 12px; font-weight: 700; }
.to-mini-row .to-mini-value { color: #384541; font-size: 13px; font-weight: 400; }
.to-board { display: grid; grid-template-columns: repeat(4, minmax(190px, 1fr)); gap: 10px; overflow-x: auto; }
.to-column { min-width: 190px; display: grid; align-content: start; gap: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fbfbf8; padding: 10px; }
.to-column-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.to-column-head strong { color: #176c5d; white-space: nowrap; }
.to-status-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.to-status-panel { min-height: 430px; display: grid; grid-template-rows: auto minmax(0, 1fr); align-content: start; }
.to-card-list { min-height: 0; display: grid; align-content: start; gap: 8px; }
.to-ranking-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.to-rank-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.to-rank-table th, .to-rank-table td { padding: 10px 8px; border-top: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: middle; }
.to-rank-table th { border-top: 0; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.to-rank-table td:first-child { min-width: 0; display: flex; align-items: center; gap: 8px; }
.to-rank-table td strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.to-rank-index { width: 22px; height: 22px; flex: 0 0 22px; display: inline-grid; place-items: center; border-radius: 50%; background: #e8f4f1; color: #176c5d; font-size: 12px; font-weight: 800; }
.to-op-card { width: 100%; border: 1px solid #dde4e1; border-radius: 8px; background: #fff; color: var(--text); padding: 10px; display: grid; gap: 8px; text-align: left; box-shadow: none; }
.to-op-card:hover { border-color: #b8d7d1; background: #f7fbfa; color: var(--text); }
.to-op-card.is-suspected { border-color: #e6c36c; background: #fff9e8; text-decoration: none; }
.to-op-card.is-suspected:hover { background: #fff4d1; }
.to-op-card h3 { margin: 0; font-size: 14px; line-height: 1.35; }
.to-op-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.to-op-responsibility { display: grid; gap: 3px; color: #56635f; font-size: 12px; line-height: 1.35; }
.to-priority { min-width: 24px; border-radius: 999px; padding: 1px 7px; font-weight: 700; text-align: center; }
.to-priority.is-high { background: #fff0ed; color: #b42318; }
.to-priority.is-medium { background: #fff6d8; color: #875700; }
.to-priority.is-low { background: #eef2f0; color: #52615b; }
.to-drawer-mask { position: fixed; inset: 0; z-index: 80; background: rgba(31, 33, 28, .26); opacity: 0; transition: opacity .18s ease; }
.to-drawer-mask.is-open { opacity: 1; }
.to-drawer-mask[hidden] { display: none; }
.to-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 81; width: min(560px, calc(100vw - 28px)); background: #fffefa; border-left: 1px solid #dfe4dc; box-shadow: -18px 0 40px rgba(31, 33, 28, .18); transform: translateX(100%); transition: transform .2s ease; display: flex; flex-direction: column; }
.to-drawer.is-open { transform: translateX(0); }
.to-drawer-head { flex: 0 0 auto; min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.to-drawer-head h2 { margin: 0; font-size: 18px; }
.to-drawer-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.to-close { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: #333; padding: 0; font-size: 20px; line-height: 1; }
.to-drawer-body { flex: 1 1 auto; min-height: 0; overflow: auto; display: grid; align-content: start; gap: 12px; padding: 16px 18px 24px; }
.to-detail-block { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px; }
.to-detail-block h3 { margin: 0 0 8px; font-size: 14px; }
.to-detail-block p { margin: 0; color: #384541; line-height: 1.65; font-size: 13px; }
.to-followup-columns { display: grid; gap: 8px; }
.to-followup-subsection { border: 1px solid #edf2f0; border-radius: 8px; background: #fbfdfc; padding: 10px; }
.to-followup-subsection > strong { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text); }
.to-drawer-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.to-drawer-actions .to-btn { width: 100%; }
[data-to-drawer-action-block] .to-drawer-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.to-inline-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.to-inline-actions .to-btn { min-height: 28px; border-color: #cfe1dc; background: #eef7f4; color: #236b5d; padding: 4px 9px; font-size: 12px; font-weight: 400; line-height: 1.35; }
.to-inline-actions .to-btn:hover { border-color: #b8d7d1; background: #e5f2ef; color: #176c5d; }
.to-evidence-source { margin: 0 0 6px; color: #6b746f; font-size: 12px; font-weight: 700; }
.to-form-grid { display: grid; gap: 8px; }
.to-form-grid .to-input { width: 100%; }
.to-form-grid textarea { width: 100%; min-height: 74px; resize: vertical; }
.to-table.is-suspected { table-layout: fixed; }
.to-table.is-suspected th:nth-child(1) { width: 8%; }
.to-table.is-suspected th:nth-child(2) { width: 12%; }
.to-table.is-suspected th:nth-child(3) { width: 6%; }
.to-table.is-suspected th:nth-child(4) { width: 7%; }
.to-table.is-suspected th:nth-child(5) { width: 6%; }
.to-table.is-suspected th:nth-child(6) { width: 14%; }
.to-table.is-suspected th:nth-child(7) { width: 18%; }
.to-table.is-suspected th:nth-child(8) { width: 19%; }
.to-table.is-suspected th:nth-child(9) { width: 10%; }
.to-table.is-suspected td { min-width: 0; overflow: hidden; }
.to-table.is-suspected .to-operate-cell { white-space: normal; }
.to-suspected-text-cell { min-width: 0; max-width: 0; overflow: hidden; }
.to-suspected-text-btn { display: -webkit-box; width: 100%; max-width: 100%; max-height: 4.4em; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; white-space: normal; overflow-wrap: anywhere; word-break: break-all; text-align: left; line-height: 1.45; text-decoration-thickness: 1px; }
.to-review-actions { min-width: 0; display: grid; align-content: start; justify-items: start; gap: 5px; }
.to-review-actions .to-link-btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.to-table.is-charge-detail th:nth-child(1) { width: 34%; }
.to-table.is-charge-detail th:nth-child(2) { width: 18%; }
.to-table.is-charge-detail th:nth-child(3) { width: 14%; }
.to-table.is-charge-detail th:nth-child(4) { width: 12%; }
.to-table.is-charge-detail th:nth-child(5) { width: 12%; }
.to-table.is-charge-detail tr.is-matched td { background: #fff9e8; }
.to-modal-mask { position: fixed; inset: 0; z-index: 90; background: rgba(31, 33, 28, .3); opacity: 0; transition: opacity .18s ease; }
.to-modal-mask.is-open { opacity: 1; }
.to-modal-mask[hidden] { display: none; }
.to-modal { position: fixed; top: 50%; left: 50%; z-index: 91; width: min(430px, calc(100vw - 28px)); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid #dfe4dc; border-radius: 8px; background: #fffefa; box-shadow: 0 18px 46px rgba(31, 33, 28, .22); transform: translate(-50%, -48%) scale(.98); opacity: 0; transition: opacity .18s ease, transform .18s ease; }
.to-modal.is-wide { width: min(760px, calc(100vw - 28px)); }
.to-modal.is-record-detail { overflow: hidden; display: flex; flex-direction: column; }
.to-modal.is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.to-modal[hidden] { display: none; }
.to-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.to-modal-head h2 { margin: 0; font-size: 17px; }
.to-modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.to-modal-body { padding: 16px 18px 18px; }
.to-modal.is-record-detail .to-modal-head { flex: 0 0 auto; position: relative; z-index: 1; }
.to-modal.is-record-detail .to-modal-body { min-height: 0; overflow: auto; }
.to-modal-field { display: grid; gap: 6px; }
.to-modal-field[hidden], .to-modal-confirm[hidden] { display: none !important; }
.to-modal-field label { color: #41504c; font-size: 13px; font-weight: 700; }
.to-modal-confirm { margin: 0; border: 1px solid #efc3bb; border-radius: 8px; background: #fff0ed; color: #8f251d; padding: 10px 12px; font-size: 13px; line-height: 1.6; }
.to-modal-error { margin: 0; border: 1px solid #efc3bb; border-radius: 8px; background: #fff0ed; color: #b42318; padding: 8px 10px; font-size: 13px; }
.to-modal-error[hidden] { display: none; }
.to-modal-loading { margin: 0; border: 1px solid #d7e3dd; border-radius: 8px; background: #f6faf8; color: #31433e; padding: 10px 12px; font-size: 13px; line-height: 1.6; }
.to-modal-loading[hidden] { display: none; }
.to-modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.to-record-detail { display: grid; gap: 12px; }
.to-record-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.to-record-meta div { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 8px 10px; min-width: 0; }
.to-record-meta dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.to-record-meta dd { margin: 3px 0 0; color: #27332f; font-size: 13px; overflow-wrap: anywhere; }
.to-record-summary { border: 1px solid #d7e3dd; border-radius: 8px; background: #f6faf8; padding: 10px 12px; }
.to-record-summary strong { display: block; margin-bottom: 4px; color: #31433e; font-size: 12px; }
.to-record-summary p { margin: 0; color: #31433e; font-size: 12px; line-height: 1.65; }
.to-modal-record-sections { margin-top: 0; }
.to-modal-record-sections .medical-record-section-title { font-size: 13px; }
.to-modal-record-sections .medical-record-section-body { font-size: 12px; line-height: 1.65; }
.to-modal-record-sections .medical-record-section-tooth { font-size: 12px; line-height: 1.5; }
.to-modal-record-sections .medical-record-section-tooth span { font-size: 12px; }
.to-record-original { margin-top: 2px; }
.to-record-original summary { color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 600; }
.to-record-detail pre { max-height: 32vh; overflow: auto; margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px; color: #27332f; font-family: inherit; font-size: 13px; line-height: 1.7; }
.to-script-output { margin: 0 0 14px; white-space: pre-wrap; word-break: break-word; border: 1px solid #d7e3dd; border-radius: 8px; background: #f6faf8; padding: 12px; color: #27332f; line-height: 1.8; }
.to-copy-feedback { color: #28735b; font-size: 13px; font-weight: 700; }
.to-event-disclosure { padding: 0; }
.to-event-disclosure summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; color: #31433e; font-size: 13px; font-weight: 700; list-style: none; }
.to-event-disclosure summary::-webkit-details-marker { display: none; }
.to-event-disclosure .to-compact-list { margin-top: 8px; }
.to-event-toggle { color: var(--accent); font-size: 12px; font-weight: 600; }
.to-event-toggle-open { display: none; }
.to-event-disclosure[open] .to-event-toggle-open { display: inline; }
.to-event-disclosure[open] .to-event-toggle-closed { display: none; }
.to-potential-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfbf8; padding: 10px; }
.to-potential-item div { min-width: 0; display: grid; gap: 3px; }
.to-potential-item strong { font-size: 13px; }
.to-potential-item span { color: var(--muted); font-size: 12px; }
.to-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; color: var(--muted); font-size: 13px; }
.to-page-summary { white-space: nowrap; }
.to-page-links { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.to-page-btn, .to-page-ellipsis { min-width: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; color: #41504c; font-size: 13px; font-weight: 700; text-decoration: none; }
.to-page-btn:hover { border-color: #b8d7d1; background: #f7fbfa; color: #176c5d; }
.to-page-btn.is-active { border-color: #176c5d; background: #176c5d; color: #fff; }
.to-page-btn.is-disabled, .to-page-ellipsis { background: #f4f5f2; color: #9aa39d; pointer-events: none; }
@media (max-width: 1280px) {
  .to-summary-grid.is-six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .to-status-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .to-topbar, .to-section-head { align-items: stretch; flex-direction: column; }
  .to-toolbar { justify-items: stretch; }
  .to-filter-main, .to-date-range, .to-toolbar > *, .to-input { width: 100%; }
  .to-filter-main > .to-select, .to-filter-main > .to-btn { width: 100%; }
  .to-date-range .to-input { min-width: 0; width: auto; flex: 1 1 0; }
  .to-range-buttons { justify-content: flex-start; width: 100%; }
  .to-shortcut { margin-right: 6px; }
  .to-summary-grid, .to-summary-grid.is-six, .to-split, .to-status-board, .to-ranking-grid, .to-info-grid { grid-template-columns: 1fr; }
  .to-table-wrap { overflow-x: auto; }
  .to-table { min-width: 980px; }
  .to-board { grid-template-columns: repeat(4, minmax(210px, 72vw)); }
  .to-status-panel { min-height: auto; }
  .to-drawer { width: min(100vw, calc(100vw - 10px)); }
  .to-record-meta { grid-template-columns: 1fr; }
  .to-pagination { align-items: stretch; flex-direction: column; }
  .to-page-summary { white-space: normal; }
  .to-page-links { justify-content: flex-start; }
}
.boss-summary-table { overflow-x: auto; margin-top: 16px; }
.boss-summary-table .table-list { min-width: 100%; width: max-content; }
.table-row.boss-summary-row { grid-template-columns: repeat(var(--report-columns, 8), minmax(94px, 1fr)); min-width: max(100%, calc(var(--report-columns, 8) * 106px)); }
.table-row.boss-summary-row > * { min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.boss-summary-detail-button { border: 0; border-radius: 0; padding: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.boss-summary-detail-button:hover { color: #174f44; }
.boss-report-drawer-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(31, 33, 28, .26); opacity: 0; transition: opacity .18s ease; }
.boss-report-drawer-overlay.is-open { opacity: 1; }
.boss-report-drawer-overlay[hidden] { display: none; }
.boss-report-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 81; width: min(1180px, calc(100vw - 28px)); background: #fffefa; border-left: 1px solid #dfe4dc; box-shadow: -18px 0 40px rgba(31, 33, 28, .18); transform: translateX(100%); transition: transform .2s ease; display: flex; flex-direction: column; }
.boss-report-drawer.is-open { transform: translateX(0); }
.boss-report-drawer[hidden] { display: none; }
.boss-report-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px 16px; border-bottom: 1px solid #eceee8; background: #fbfbf8; }
.boss-report-drawer-head h2 { margin: 0 0 4px; font-size: 18px; line-height: 1.35; }
.boss-report-drawer-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.boss-report-drawer-actions { display: inline-flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.boss-report-drawer-close { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid #d8ded8; border-radius: 50%; background: white; color: #52615b; cursor: pointer; font-size: 0; line-height: 1; flex: 0 0 auto; }
.boss-report-drawer-close::before,
.boss-report-drawer-close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 13px; height: 1.5px; border-radius: 999px; background: currentColor; transform-origin: center; }
.boss-report-drawer-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.boss-report-drawer-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.boss-report-drawer-body { min-height: 0; overflow: auto; padding: 18px 22px 24px; }
.missing-items { color: #a93429; font-weight: 600; }
.section-title-row.followup-doctor-head { justify-content: flex-start; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.followup-doctor-head h2 { margin: 0; line-height: 1.3; }
.followup-doctor-metrics { display: inline-flex; align-items: baseline; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.followup-doctor-metrics span,
.followup-doctor-metrics strong { display: inline-flex; align-items: baseline; font-size: 14px; line-height: 1.4; }
.followup-doctor-metrics strong { border-radius: 6px; padding: 2px 8px; background: #fff0ed; color: #b13a2d; font-weight: 400; }
.table-row.user-row { grid-template-columns: 1fr 1fr .8fr 1fr .7fr .6fr; }
.table-row.platform-admin-row { grid-template-columns: 1.1fr 1fr .6fr .9fr .5fr; }
.table-row.platform-parameter-row { grid-template-columns: 1fr 1.5fr .8fr .5fr; }
.table-row.platform-clinic-row { grid-template-columns: 1.3fr .55fr .9fr .85fr .8fr .8fr .5fr; }
.table-row.platform-lingjian-row { grid-template-columns: 1.15fr 1.35fr .65fr .65fr .72fr .65fr .75fr .45fr; }
.table-row.platform-source-row { grid-template-columns: 1.2fr .7fr .65fr .75fr .65fr .8fr 1.15fr; }
.lingjian-queue-page { max-width: 1320px; }
.lingjian-sync-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 12px 0 16px; }
.lingjian-sync-metrics div { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: white; }
.lingjian-sync-metrics div.is-alert { border-color: #f0c6bd; background: #fff0ed; }
.lingjian-sync-metrics div.is-active { border-color: #bdd8d1; background: #e8f4f1; }
.lingjian-sync-metrics span { display: block; color: var(--muted); font-size: 13px; }
.lingjian-sync-metrics strong { display: block; margin-top: 4px; font-size: 26px; line-height: 1.1; }
.lingjian-api-call-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0 16px; }
.lingjian-api-call-metrics div { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: white; }
.lingjian-api-call-metrics div.is-alert { border-color: #f0c6bd; background: #fff0ed; }
.lingjian-api-call-metrics span { display: block; color: var(--muted); font-size: 13px; }
.lingjian-api-call-metrics strong { display: block; margin-top: 4px; font-size: 26px; line-height: 1.1; }
.lingjian-api-chart-switcher { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.lingjian-api-chart-switcher button { border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; background: #fff; color: var(--muted); font-size: 12px; line-height: 1.2; cursor: pointer; }
.lingjian-api-chart-switcher button.is-active { border-color: #bdd8d1; background: #e8f4f1; color: var(--accent); font-weight: 700; }
.lingjian-api-chart-wrap { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; overflow-x: auto; }
.lingjian-api-chart { display: block; min-width: 760px; width: 100%; height: auto; }
.lingjian-api-chart-bg { fill: #fbfbf8; stroke: var(--line); }
.lingjian-api-grid-line { stroke: #e8e8e1; stroke-width: 1; }
.lingjian-api-axis-label { fill: var(--muted); font-size: 11px; }
.lingjian-api-line { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lingjian-api-hover-layer.is-hidden { display: none; }
.lingjian-api-hover-line { stroke: #9bb8b2; stroke-width: 1; stroke-dasharray: 4 4; }
.lingjian-api-hover-point { fill: #326a67; stroke: #fff; stroke-width: 2; }
.lingjian-api-hover-box { fill: #fff; stroke: #bdd8d1; filter: drop-shadow(0 6px 14px rgba(34, 54, 52, .14)); }
.lingjian-api-hover-layer text { fill: var(--text); font-size: 12px; }
.lingjian-api-hover-layer .lingjian-api-hover-date { fill: var(--accent); font-weight: 700; }
.lingjian-monitor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lingjian-monitor-section { min-width: 0; }
.lingjian-sync-run-table,
.lingjian-snapshot-table,
.lingjian-api-call-table { overflow-x: auto; }
.table-row.lingjian-sync-run-row { grid-template-columns: .72fr 1fr .65fr .95fr .8fr 1.2fr 1.45fr; min-width: 1120px; align-items: start; }
.table-row.lingjian-snapshot-row { grid-template-columns: 1fr 1.25fr .45fr .75fr .7fr; min-width: 760px; }
.table-row.lingjian-data-issue-row { grid-template-columns: .65fr .9fr 1.8fr .82fr .82fr .7fr; min-width: 1040px; align-items: start; }
.table-row.lingjian-api-call-row { grid-template-columns: 1.4fr .65fr .65fr .65fr .65fr .75fr; min-width: 840px; }
.table-row.lingjian-sync-run-row > *,
.table-row.lingjian-snapshot-row > *,
.table-row.lingjian-data-issue-row > *,
.table-row.lingjian-api-call-row > * { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.table-row.lingjian-sync-run-row.is-overdue { background: #fff7f5; }
.lingjian-counts { font-variant-numeric: tabular-nums; }
.lingjian-meta-chip { display: inline-flex; max-width: 100%; margin: 0 4px 4px 0; border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; color: var(--muted); background: #fbfbf8; font-size: 11px; line-height: 1.35; vertical-align: top; }
.lingjian-task-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.lingjian-task-summary span { border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; color: var(--muted); background: #fbfbf8; font-size: 12px; }
.table-row:first-child { border-top: 0; }
.table-head { background: #f4f4ef; color: var(--muted); font-size: 13px; }
.table-row a { color: var(--accent); text-decoration: none; font-weight: 600; }
.patient-center-list [data-patient-rows] { display: contents; }
.patient-center-list a.table-row { color: var(--text); text-decoration: none; }
.patient-center-list a.table-row:hover { background: #f3f8f7; }
.patient-center-list a.table-row > span { font-size: 14px; }
.patient-name-cell { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.patient-name-cell strong { font-size: 14px; }
.patient-tag-indicator { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: 0 0 auto; border: 1px solid #bfd4dc; border-radius: 50%; background: #eaf4f7; color: #356b80; cursor: help; }
.patient-tag-indicator:hover,
.patient-tag-indicator:focus-visible { border-color: #6fa3b5; background: #dceef3; color: #24586c; outline: none; }
.patient-tag-indicator svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.patient-tag-tooltip { position: fixed; z-index: 1000; max-width: min(340px, calc(100vw - 16px)); border: 1px solid #43534d; border-radius: 6px; padding: 8px 10px; background: #26332e; box-shadow: 0 8px 20px rgba(15, 28, 24, .18); color: #fff; font-size: 13px; font-weight: 400; line-height: 1.5; white-space: normal; pointer-events: none; }
.patient-recording-indicator { width: 20px; height: 20px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #2f8f69; background: #e7f5ef; border: 1px solid #bdd8d1; }
.patient-recording-indicator.is-missing { color: #b23b2d; background: #fff0ed; border-color: #f0c3ba; }
.patient-recording-indicator svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.compact-tags { gap: 3px; flex-wrap: nowrap; white-space: nowrap; }
.status-tag { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 2px 6px; font-size: 11px; line-height: 1.2; font-weight: 700; white-space: nowrap; }
.status-tag.is-positive { border-color: #2f8f69; color: #145b43; background: #e6f6ee; }
.status-tag.is-negative { border-color: #c44335; color: #9f2a21; background: #fff0ed; }
.status-tag.is-neutral { color: var(--muted); background: #f4f4ef; }
.list-loader { padding: 12px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }
.detail-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.patient-detail-page { max-width: 1280px; height: calc(100vh - 56px); margin: -24px auto; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 0; overflow: hidden; }
.has-sidebar .patient-detail-page { height: calc(100vh - 66px); }
.anchor-sentinel { display: block; block-size: 0; overflow: hidden; }
.patient-overview { z-index: 4; padding: 12px 0 12px; }
.patient-overview-body { display: block; }
.patient-overview-grid { margin: 0; }
.patient-overview-grid.summary-grid { grid-template-columns: 150px 150px 220px minmax(360px, 1fr); align-items: stretch; }
.patient-tag-panel { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 8px 48px 8px 10px; min-height: 58px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 8px 12px; }
.patient-tag-panel > .secondary-link { position: absolute; top: 10px; right: 10px; font-size: 12px; font-weight: 400; }
.patient-tag-panel .overview-tag-group,
.patient-tag-panel .compact-overview-tags { border: 0; border-radius: 0; padding: 0; }
.overview-tag-group { min-width: 0; display: grid; gap: 5px; }
.overview-tag-title { color: var(--muted); font-size: 12px; white-space: nowrap; }
.compact-overview-tags { gap: 5px; max-height: 26px; overflow: hidden; }
.compact-overview-tags .tag-chip { padding: 3px 7px; font-size: 12px; }
.patient-tag-chip { border-color: #bdd8d1; background: #e8f4f1; color: #174f44; font-weight: 600; }
.patient-card { position: sticky; top: 76px; }
.patient-card h1 { margin-bottom: 4px; }
.patient-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.patient-card-head .secondary-link { font-size: 13px; line-height: 1.4; white-space: nowrap; }
.patient-title-line { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.patient-title-line h1 { margin: 0; }
.patient-record-no { margin: 0; color: var(--muted); font-weight: 600; }
.inline-info-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.inline-info-pair > div { min-width: 0; border: 0; padding: 0; }
.side-info-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 14px 0; display: grid; gap: 12px; }
.side-info-card .section-title-row h2 { margin: 0; font-size: 16px; }
.side-tag-group { display: grid; gap: 8px; }
.side-tag-group > strong { font-size: 13px; color: var(--text); }
.side-tag-list { gap: 6px; }
.side-tag-list .tag-chip { padding: 4px 8px; font-size: 12px; }
.compact-tag-summary { display: grid; gap: 8px; margin: 0; }
.compact-tag-summary div { display: grid; gap: 3px; }
.patient-timeline-panel { min-height: var(--timeline-panel-min-height, 0); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; padding: 16px 18px 18px; background: var(--panel); }
.patient-timeline-head { align-items: flex-start; }
.patient-timeline-head h2 { margin: 0; }
.patient-timeline-metrics { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.patient-timeline-metrics span { min-width: 112px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fbfbf8; display: grid; gap: 2px; text-align: right; }
.patient-timeline-metrics strong { color: var(--accent); font-size: 15px; line-height: 1.2; }
.patient-timeline-metrics small { color: var(--muted); font-size: 11px; }
.timeline-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; min-height: 0; height: 100%; }
.timeline-rail { overflow: auto; padding-right: 8px; border-right: 1px solid var(--line); display: grid; align-content: start; gap: 8px; }
.timeline-rail a { position: relative; display: grid; gap: 3px; padding: 9px 10px 9px 18px; border-radius: 8px; color: var(--text); text-decoration: none; }
.timeline-rail a::before { content: ""; position: absolute; left: 4px; top: 14px; inline-size: 8px; block-size: 8px; border-radius: 999px; background: var(--line); }
.timeline-rail a:hover, .timeline-rail a.is-current { background: #f3f8f7; color: var(--accent); }
.timeline-rail a.is-current::before { background: var(--accent); }
.timeline-rail span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.timeline-scroll { min-width: 0; overflow: auto; overflow-anchor: none; padding-right: 6px; }
.timeline-entry { border-top: 1px solid var(--line); padding: 0 0 12px; }
.timeline-entry:first-child { border-top: 0; }
.timeline-summary { display: grid; grid-template-columns: 136px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 13px 0; cursor: pointer; list-style: none; }
.timeline-summary::-webkit-details-marker { display: none; }
.timeline-summary-side { display: grid; justify-items: start; min-width: 0; }
.timeline-summary .timeline-date { color: var(--muted); font-weight: 700; }
.timeline-summary strong { padding-top: 1px; font-size: 16px; }
.timeline-toggle { color: var(--accent); font-size: 13px; font-weight: 600; }
.timeline-toggle-open { display: none; }
.timeline-entry[open] .timeline-toggle-open { display: inline; }
.timeline-entry[open] .timeline-toggle-closed { display: none; }
.timeline-entry-content { display: grid; grid-template-columns: 136px minmax(0, 1fr); align-items: start; gap: 12px; padding: 0 0 6px; }
.timeline-entry-side-meta { display: grid; justify-items: start; gap: 5px; color: var(--muted); font-size: 12px; line-height: 1.35; min-width: 0; }
.timeline-entry-side-meta-line { overflow-wrap: anywhere; }
.timeline-entry-body { display: grid; gap: 16px; min-width: 0; padding: 0; }
.timeline-section { display: grid; gap: 8px; }
.timeline-section + .timeline-section { border-top: 1px dashed var(--line); padding-top: 14px; }
.timeline-section h3 { margin: 0; }
.timeline-section .record-card:first-of-type { margin-top: 0; }
.timeline-text-block { max-height: 260px; overflow: auto; margin: 6px 0 0; }
.medical-record-sections { display: grid; gap: 8px; margin-top: 4px; }
.medical-record-section { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fffdfa; display: grid; gap: 5px; }
.medical-record-section-title { color: var(--accent); font-size: 14px; line-height: 1.4; }
.medical-record-section-group { display: grid; gap: 4px; padding-top: 7px; }
.medical-record-section-group + .medical-record-section-group { border-top: 1px dashed var(--line); margin-top: 3px; }
.medical-record-section-tooth { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; color: var(--text); line-height: 1.55; }
.medical-record-section-tooth span { color: var(--accent); font-weight: 700; font-size: 13px; }
.medical-record-section-body { margin: 0; line-height: 1.75; white-space: normal; word-break: break-word; }
.medical-record-original { margin-top: 4px; }
.medical-record-original summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.timeline-charge-actions { display: flex; justify-content: flex-start; margin-top: 1px; }
.timeline-charge-button { border: 1px solid #bdd8d1; border-radius: 6px; padding: 4px 9px; background: #edf7f4; color: var(--accent); font-size: 12px; line-height: 1.35; cursor: pointer; }
.timeline-charge-button:hover { border-color: var(--accent); background: #e5f3ee; }
.tab-strip { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.tab-strip a, .tab-strip label { border: 1px solid var(--line); border-radius: 6px; color: var(--text); padding: 7px 10px; text-decoration: none; cursor: pointer; user-select: none; }
.tab-strip a:hover, .tab-strip label:hover { border-color: var(--accent); color: var(--accent); }
.tab-input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.tab-pages { min-height: 420px; }
.tab-page { display: none; }
.patient-tabs .section-block { border-top: 0; margin-top: 0; padding-top: 16px; }
#tab-records:checked ~ .tab-strip label[for="tab-records"],
#tab-summary:checked ~ .tab-strip label[for="tab-summary"],
#tab-oral:checked ~ .tab-strip label[for="tab-oral"],
#tab-reception:checked ~ .tab-strip label[for="tab-reception"],
#tab-warranty:checked ~ .tab-strip label[for="tab-warranty"] { border-color: var(--accent); background: #edf4f2; color: var(--accent); font-weight: 600; }
#tab-records:checked ~ .tab-pages .tab-page-records,
#tab-summary:checked ~ .tab-pages .tab-page-summary,
#tab-oral:checked ~ .tab-pages .tab-page-oral,
#tab-reception:checked ~ .tab-pages .tab-page-reception,
#tab-warranty:checked ~ .tab-pages .tab-page-warranty { display: block; }
.record-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 8px; display: grid; gap: 4px; }
.summary-report-card { margin-top: 0; border: 0; background: #fff8e8; padding: 14px; }
.summary-report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.summary-report-head > div { min-width: 0; display: grid; gap: 3px; }
.summary-report-head strong { font-size: 16px; line-height: 1.35; }
.summary-report-head .secondary-link { flex: 0 0 auto; }
.summary-report-card .report-markdown-body { border: 0; border-radius: 0; padding: 8px 0 0; background: transparent; }
.record-card span { color: var(--muted); font-size: 13px; }
.notice-card { border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; margin: 12px 0; display: grid; gap: 5px; }
.notice-card p { margin: 0; }
.notice-card.warning { border-color: #d9b26f; background: #fff8e8; }
.notice-card.warning strong { color: #8a5a10; }
.compact-notice { margin: 8px 0 0; }
.section-title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.record-actions { justify-content: flex-start; }
.secondary-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.link-button { border: 0; background: transparent; padding: 0; cursor: pointer; }
.stack-form { display: grid; gap: 16px; margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-field { display: grid; gap: 6px; }
.form-field label { color: var(--muted); font-size: 13px; }
.form-field input, .form-field select, .form-field textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.form-field.inline-check { display: flex; align-items: center; gap: 10px; }
.form-field.inline-check input { width: auto; }
.parameter-description { font-size: 14px; }
.builtin-parameter-form .form-field > label { color: var(--text); font-size: 16px; }
.builtin-parameter-form .form-field.inline-check { justify-content: flex-start; }
.help-text { color: var(--muted); font-size: 12px; }
.checkbox-group ul { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 0; }
.checkbox-group li label { color: var(--text); display: flex; align-items: center; gap: 8px; }
.checkbox-group input { width: auto; }
.patient-tag-edit-section { display: grid; gap: 12px; }
.patient-tag-edit-section h2 { margin: 0; font-size: 16px; }
.patient-impression-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.followup-tag-category-list { display: grid; gap: 14px; }
.followup-tag-category { display: grid; gap: 8px; }
.followup-tag-category h3 { margin: 0; font-size: 14px; color: var(--muted); }
.followup-tag-options { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-check-option { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; border: 1px solid var(--line); border-radius: 999px; padding: 0 11px; background: #fbfbf8; color: var(--text); font-size: 14px; cursor: pointer; }
.tag-check-option:has(input:checked) { border-color: #bdd8d1; background: #e8f4f1; color: #174f44; font-weight: 600; }
.tag-check-option input { width: auto; margin: 0; }
.action-row { display: flex; align-items: center; gap: 12px; }
.settings-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-nav { position: sticky; top: 76px; display: grid; gap: 8px; }
.settings-nav a { color: var(--text); text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.settings-nav a:hover { border-color: var(--accent); color: var(--accent); }
.settings-section { padding-bottom: 20px; }
.settings-section + .settings-section { border-top: 1px solid var(--line); padding-top: 18px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.membership-settings-grid { margin-top: 14px; }
.compact-form { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 10px 0 16px; }
.compact-form p { display: grid; gap: 5px; margin: 0; }
.compact-form label { color: var(--muted); font-size: 13px; }
.compact-form input, .compact-form select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.toggle-line { display: flex; align-items: center; gap: 8px; color: var(--text); }
.toggle-line input[type="checkbox"], .setting-check-field input[type="checkbox"] { flex: 0 0 auto; width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; border-radius: 4px; accent-color: var(--accent); }
.setting-check-field .toggle-line { align-self: start; }
.toggle-line span { line-height: 1.35; }
.catalog-list { display: grid; gap: 10px; }
.catalog-category { border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.tag-catalog { display: grid; gap: 10px; }
.tag-category-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; }
.tag-category-row > div:first-child { min-width: 0; display: grid; gap: 5px; }
.tag-category-row strong { font-size: 14px; line-height: 1.4; }
.membership-rule-list { margin-top: 8px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill { display: inline-flex; align-items: center; min-height: 28px; border: 1px solid #d7e3dd; border-radius: 999px; padding: 4px 10px; background: #f7faf8; color: var(--text); font-size: 13px; line-height: 1.35; }
.tag-chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; }
.is-muted { opacity: .55; }
.settings-modal[hidden] { display: none; }
.settings-modal { position: fixed; inset: 0; z-index: 125; display: grid; place-items: center; padding: 24px; }
.settings-modal-backdrop { position: absolute; inset: 0; background: rgba(31, 33, 28, .36); }
.settings-modal-panel { position: relative; z-index: 1; width: min(720px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 48px)); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fffefa; box-shadow: 0 24px 70px rgba(31, 33, 28, .22); padding: 18px; }
.settings-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.settings-modal-header h3 { margin: 0; font-size: 17px; line-height: 1.35; }
.settings-modal .compact-form { margin: 0; }
.photo-upload-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.photo-upload-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.photo-upload-grid.treatment-photo-upload-grid { grid-template-columns: 1fr; }
.treatment-confirm-actions { margin-top: 20px; }
.treatment-existing-section { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; }
.treatment-existing-section .section-title-row h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.oral-upload-section { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; }
.oral-upload-section .section-title-row h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.oral-count-pill { display: inline-flex; align-items: center; border: 1px solid #bdd8d1; border-radius: 999px; padding: 5px 10px; background: #e8f4f1; color: var(--accent); font-size: 13px; font-weight: 700; white-space: nowrap; }
.oral-bulk-drop { border: 1px dashed #b8c4c0; border-radius: 8px; padding: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #fbfbf8; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.oral-bulk-drop.is-drag-over { border-color: #2f6f64; background: #eef7f3; box-shadow: 0 0 0 3px rgba(47, 111, 100, .12); }
.oral-bulk-drop span { color: var(--muted); font-size: 13px; }
.bulk-file-input { position: absolute; inset-block-start: 0; inset-inline-start: 0; inline-size: 1px; block-size: 1px; opacity: 0; overflow: hidden; pointer-events: none; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.oral-photo-item { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.photo-preview-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.photo-preview-meta .toggle-line { font-size: 13px; }
.photo-slot { position: relative; overflow: visible; border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; align-content: start; gap: 9px; min-height: 150px; }
.photo-slot strong { font-size: 15px; }
.photo-slot span { color: var(--muted); font-size: 13px; }
.photo-slot input[type="file"] { position: absolute; inset-block-start: 0; inset-inline-start: 0; inline-size: 1px; block-size: 1px; opacity: 0; overflow: hidden; pointer-events: none; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.photo-slot-preview { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.photo-slot-preview.is-hidden { visibility: hidden; }
.photo-slot-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; align-self: start; font-size: 14px; }
.photo-slot-actions .toggle-line { font-size: 14px; }
.file-pick-button { display: inline-flex; align-items: center; justify-content: center; align-self: center; min-height: 34px; max-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: #fff; color: var(--text); font-size: 14px; cursor: pointer; }
.file-pick-button:hover { border-color: var(--accent); color: var(--accent); }
.photo-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.photo-preview-grid.oral-preview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.photo-preview-grid.selected-photo-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.photo-preview-grid.treatment-photo-selected-grid,
.photo-preview-grid.existing-treatment-photo-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.treatment-photo-selected-grid .photo-preview,
.existing-treatment-photo-grid .photo-preview { min-width: 0; }
.treatment-photo-selected-grid .photo-preview img,
.existing-treatment-photo-grid .photo-preview img { aspect-ratio: 1 / 1; border-radius: 6px; }
.treatment-existing-photo { border: 1px solid var(--line); border-radius: 8px; padding: 7px; background: #fff; cursor: pointer; }
.treatment-existing-photo:has(input:checked) { border-color: #c76d5a; background: #fff7f4; }
.photo-delete-check { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.photo-delete-check input { width: auto; margin: 0; }
.photo-preview-grid.timeline-photo-grid { grid-template-columns: repeat(auto-fit, minmax(72px, 92px)); gap: 8px; justify-content: start; }
.timeline-photo-grid .photo-preview { gap: 4px; }
.timeline-photo-grid .photo-preview img { aspect-ratio: 1 / 1; border-radius: 6px; }
.timeline-photo-grid .photo-preview span { font-size: 11px; line-height: 1.35; }
.photo-preview { display: grid; gap: 6px; color: var(--text); text-decoration: none; }
.photo-preview img { inline-size: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #f4f4ef; }
.photo-preview span { color: var(--muted); font-size: 12px; }
.photo-preview:hover img { border-color: var(--accent); }
.charge-modal[hidden] { display: none; }
.charge-modal { position: fixed; inset: 0; z-index: 122; display: grid; place-items: center; padding: 24px; }
.charge-modal-backdrop { position: absolute; inset: 0; border: 0; border-radius: 0; padding: 0; background: rgba(31, 33, 28, .38); cursor: default; }
.charge-modal-panel { position: relative; z-index: 1; width: min(920px, calc(100vw - 48px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: #fffefa; box-shadow: 0 24px 80px rgba(31, 33, 28, .24); overflow: hidden; }
.charge-modal-head { flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 14px 16px; background: #fbfbf8; }
.charge-modal-head h2 { margin: 0; font-size: 17px; }
.charge-modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.charge-modal-close { inline-size: 30px; block-size: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 999px; padding: 0; background: #fff; color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }
.charge-modal-body { min-height: 0; overflow: auto; padding: 14px 16px 16px; }
.charge-detail-list { display: grid; gap: 12px; }
.charge-order-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; display: grid; gap: 8px; }
.charge-order-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.charge-order-card header span { color: var(--accent); font-weight: 700; white-space: nowrap; }
.charge-order-card p { margin: 0; color: var(--muted); font-size: 12px; }
.charge-detail-table-wrap { overflow-x: auto; }
.charge-detail-table { width: 100%; min-width: 760px; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.charge-detail-table th, .charge-detail-table td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.charge-detail-table th { color: var(--muted); font-weight: 700; background: #fbfbf8; white-space: nowrap; }
.charge-detail-table .charge-col-item { width: 24%; }
.charge-detail-table .charge-col-type { width: 16%; }
.charge-detail-table .charge-col-tooth { width: 18%; word-break: break-word; overflow-wrap: anywhere; }
.charge-detail-table .charge-col-doctor { width: 11%; white-space: nowrap; }
.charge-detail-table .charge-col-count { width: 10%; white-space: nowrap; }
.charge-detail-table .charge-col-amount { width: 21%; white-space: nowrap; }
.charge-payment-list { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
body.charge-modal-open { overflow: hidden; }
.photo-lightbox[hidden] { display: none; }
.photo-lightbox { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 28px; }
.photo-lightbox-backdrop { position: absolute; inset: 0; border: 0; border-radius: 0; padding: 0; background: rgba(20, 20, 18, .76); cursor: zoom-out; }
.photo-lightbox-content { position: relative; z-index: 1; margin: 0; display: grid; gap: 10px; max-inline-size: min(1120px, calc(100vw - 56px)); max-block-size: calc(100vh - 56px); }
.photo-lightbox-content img { display: block; max-inline-size: 100%; max-block-size: calc(100vh - 116px); object-fit: contain; border-radius: 8px; background: #111; box-shadow: 0 24px 80px rgba(0, 0, 0, .34); }
.photo-lightbox-content figcaption { justify-self: center; color: #fff; font-size: 14px; }
.photo-lightbox-close { position: absolute; top: -14px; right: -14px; inline-size: 34px; block-size: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.72); border-radius: 999px; padding: 0; background: rgba(20, 20, 18, .86); color: #fff; font-size: 24px; line-height: 1; }
body.photo-lightbox-open { overflow: hidden; }
.status-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.status-card-grid div { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 6px; }
.status-card-grid span { color: var(--muted); font-size: 12px; }
.status-card-grid strong { font-size: 15px; }
.status-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 0; list-style: none; counter-reset: step; }
.status-steps li { border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: var(--muted); background: #fbfbf8; }
.status-steps li::before { counter-increment: step; content: counter(step); display: inline-flex; align-items: center; justify-content: center; inline-size: 20px; block-size: 20px; margin-right: 7px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; }
.status-steps li.is-current { border-color: var(--accent); color: var(--accent); background: #edf4f2; font-weight: 600; }
.status-steps li.is-danger { border-color: #b8493f; color: #9f3a2f; background: #fff6f3; }
.plain-text-block { white-space: pre-wrap; word-break: break-word; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fbfbf8; }
.report-body { line-height: 1.72; }
.compact-text-block { margin: 6px 0; max-height: 180px; overflow: hidden; }
.event-list { display: grid; gap: 8px; }
.note-list { display: grid; gap: 8px; margin-top: 14px; }
.compact-note-form { gap: 10px; margin-top: 12px; }
.event-item { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; background: #fbfbf8; }
.event-item span { color: var(--muted); font-size: 12px; }
.event-item p { margin: 0; }
.error-text { color: #9f3a2f; }
.form-errors, .errorlist { color: #9f3a2f; }
.form-errors { border: 1px solid #e4b8af; background: #fff6f3; border-radius: 8px; padding: 10px 12px; }
.errorlist { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.stack-form > .errorlist.nonfield { margin: 0 0 2px; padding: 13px 16px; list-style: none; border: 1px solid #e09b91; border-left-width: 4px; border-radius: 8px; background: #fff0ed; color: #9f2f26; font-size: 15px; font-weight: 700; line-height: 1.55; }
.button-link.secondary { border-color: var(--line); background: #fff; color: var(--text); }
.button-link.secondary:hover { border-color: var(--accent); color: var(--accent); }
.inline-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-actions form { margin: 0; }
.case-library-page,
.case-wizard-page { max-width: 1380px; margin: 0 auto; display: grid; gap: 16px; }
.case-library-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.case-library-head h1,
.case-wizard-main h1 { margin-bottom: 6px; }
.case-empty-text { grid-column: 1 / -1; margin: 4px 0; color: var(--muted); }
.case-search-panel { padding: 14px; }
.case-search-grid { display: grid; grid-template-columns: minmax(260px, 1.4fr) repeat(5, minmax(140px, 1fr)) auto; gap: 10px; align-items: end; }
.case-search-grid label,
.case-theme-form label,
.case-report-edit-form label,
.case-patient-search label { display: grid; gap: 6px; min-width: 0; }
.case-search-grid span,
.case-theme-form label > span,
.case-report-edit-form label > span,
.case-patient-search label > span { color: var(--muted); font-size: 12px; }
.case-search-grid input,
.case-search-grid select,
.case-theme-form input,
.case-theme-form select,
.case-report-edit-form input,
.case-report-edit-form textarea,
.case-patient-search input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: #fff; }
.case-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.case-result-card { display: grid; gap: 12px; width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; color: var(--text); text-align: left; box-shadow: none; }
.case-result-card:hover { border-color: var(--accent); background: #fbfffd; }
.case-result-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.case-result-photos img,
.case-result-photos div { width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 6px; object-fit: cover; background: #f4f4ef; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.case-result-body { display: grid; gap: 7px; }
.case-result-body h2 { margin: 0; font-size: 17px; line-height: 1.35; }
.case-result-body p { margin: 0; color: #3d4541; line-height: 1.5; }
.case-result-body small { color: var(--muted); }
.case-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.case-chip-row span { border: 1px solid #dbe4df; border-radius: 999px; padding: 3px 8px; background: #f6faf8; color: #315a52; font-size: 12px; line-height: 1.35; }
.case-drawer-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(31,33,28,.28); opacity: 0; transition: opacity .18s ease; }
.case-drawer-overlay.is-open { opacity: 1; }
.case-drawer-overlay[hidden] { display: none; }
.case-drawer { position: fixed; inset: 0 0 0 auto; z-index: 91; width: min(1040px, calc(100vw - 32px)); background: #fffefa; border-left: 1px solid #dfe4dc; box-shadow: -20px 0 48px rgba(31,33,28,.18); transform: translateX(100%); transition: transform .2s ease; display: flex; flex-direction: column; }
.case-drawer.is-open { transform: translateX(0); }
.case-drawer[hidden] { display: none; }
.case-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fbfbf8; }
.case-drawer-close,
.case-modal-close,
.case-photo-viewer-close { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid #d8ded8; border-radius: 50%; padding: 0; background: white; color: #52615b; font-size: 0; }
.case-drawer-close::before,
.case-drawer-close::after,
.case-modal-close::before,
.case-modal-close::after,
.case-photo-viewer-close::before,
.case-photo-viewer-close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 13px; height: 1.5px; border-radius: 999px; background: currentColor; transform-origin: center; }
.case-drawer-close::before,
.case-modal-close::before,
.case-photo-viewer-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.case-drawer-close::after,
.case-modal-close::after,
.case-photo-viewer-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.case-drawer-body { overflow: auto; padding: 20px; }
.case-detail { display: grid; gap: 18px; }
.case-detail-hero { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.case-main-photo { display: grid; gap: 6px; }
.case-main-photo span { color: var(--muted); font-size: 13px; }
.case-main-photo img,
.case-photo-placeholder { width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 8px; object-fit: cover; background: #f4f4ef; display: grid; place-items: center; color: var(--muted); }
.case-detail-title h2 { margin: 0 0 6px; font-size: 24px; line-height: 1.35; }
.case-detail-title p { margin: 0 0 10px; color: #3d4541; }
.case-report-section { border-top: 1px solid var(--line); padding-top: 16px; }
.case-report-section h3 { margin-bottom: 10px; font-size: 16px; }
.case-collapsible-section summary { cursor: pointer; font-size: 16px; font-weight: 700; list-style: none; }
.case-collapsible-section summary::-webkit-details-marker { display: none; }
.case-collapsible-section summary::after { content: "展开"; margin-left: 8px; color: var(--accent); font-size: 13px; font-weight: 600; }
.case-collapsible-section[open] summary { margin-bottom: 10px; }
.case-collapsible-section[open] summary::after { content: "收起"; }
.case-basic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.case-basic-grid div { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fbfbf8; }
.case-basic-grid span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.case-basic-grid strong { overflow-wrap: anywhere; }
.case-ordered-list { margin: 0; padding-left: 22px; display: grid; gap: 7px; line-height: 1.65; }
.case-feedback-text { margin: 0; line-height: 1.7; color: #3d4541; }
.case-photo-stage-entry-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.case-photo-stage-entry { display: grid; grid-template-rows: auto auto auto; gap: 7px; min-height: 0; border-color: #dbe4df; background: #f6faf8; color: #23453f; padding: 8px; text-align: left; }
.case-photo-stage-entry:hover { border-color: var(--accent); background: #f2faf7; }
.case-photo-stage-entry strong { font-size: 14px; line-height: 1.3; }
.case-photo-stage-entry span { display: block; color: var(--muted); font-size: 12px; }
.case-stage-thumb,
.case-stage-thumb-placeholder { width: 100%; aspect-ratio: 4 / 3; border: 1px solid #dbe4df; border-radius: 6px; object-fit: cover; background: #eef4f1; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.case-detail-actions { display: flex; justify-content: flex-start; }
.case-photo-viewer[hidden] { display: none; }
.case-photo-viewer { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 24px; }
.case-photo-viewer-backdrop { position: absolute; inset: 0; border: 0; border-radius: 0; background: rgba(20,20,18,.76); }
.case-photo-viewer-panel { position: relative; z-index: 1; width: min(1040px, calc(100vw - 48px)); display: grid; gap: 10px; }
.case-photo-viewer-head { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px 34px; gap: 8px; align-items: center; color: #fff; }
.case-photo-viewer-head button:not(.case-photo-viewer-close) { width: 38px; height: 34px; border-color: rgba(255,255,255,.68); border-radius: 999px; padding: 0; background: rgba(20,20,18,.72); color: #fff; font-size: 24px; line-height: 1; }
.case-photo-viewer-head strong { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-photo-viewer-panel img { width: 100%; max-height: calc(100vh - 112px); object-fit: contain; border-radius: 8px; background: #111; }
.case-wizard-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.case-return-link { color: var(--accent); font-size: 14px; text-decoration: none; white-space: nowrap; }
.case-return-link:hover { text-decoration: underline; }
.case-step-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.case-step-text { color: var(--muted); font-size: 14px; }
.case-step-text.is-current { color: var(--accent); font-weight: 700; }
.case-step-separator { color: #a5aaa2; }
.case-wizard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.case-wizard-main,
.case-summary-panel { min-width: 0; }
.case-summary-panel { align-self: start; }
.case-draft-box-action { margin-top: 12px; }
.case-draft-box-action form { margin: 0; }
.case-draft-box-action button { width: 100%; border-color: var(--line); background: #fff; color: var(--text); }
.case-draft-box-action button:hover { border-color: var(--accent); color: var(--accent); }
.case-draft-state { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.case-summary-list { display: grid; gap: 8px; }
.case-summary-list dt { margin: 0; }
.case-summary-list dd { padding-bottom: 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.case-step-form { display: grid; gap: 16px; }
.case-patient-search { max-width: 520px; margin-bottom: 16px; }
.case-selected-patient { display: flex; align-items: baseline; gap: 10px; border: 1px solid #bdd8d1; border-radius: 8px; padding: 10px 12px; background: #f2faf7; }
.case-selected-patient span { color: var(--muted); font-size: 13px; }
.case-record-list { display: grid; gap: 10px; }
.case-record-item { display: grid; grid-template-columns: auto 18px minmax(0, 1fr); gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; }
.case-record-item input { margin-top: 3px; }
.case-record-body { display: grid; gap: 5px; min-width: 0; }
.case-record-title { border: 0; border-radius: 0; padding: 0; background: transparent; color: var(--accent); text-align: left; font-weight: 700; }
.case-record-body small,
.case-record-body > span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.case-form-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.case-report-edit-form textarea { resize: vertical; line-height: 1.6; }
.case-photo-selection { display: grid; gap: 18px; }
.case-photo-stage-block { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; }
.case-photo-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.case-photo-stage-head h2 { margin: 0; }
.case-photo-stage-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.case-selected-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.case-selected-photo-card { display: grid; gap: 7px; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fbfbf8; }
.case-selected-photo-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; background: #f4f4ef; }
.case-selected-photo-controls { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.case-selected-photo-controls .button-link { width: 100%; }
.case-selected-main-control { display: flex; align-items: center; gap: 5px; min-height: 22px; }
.case-selected-photo-note { min-height: 22px; line-height: 22px; }
.case-stage-empty { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.case-modal-panel.case-photo-picker-panel { width: min(1040px, calc(100vw - 48px)); }
.case-photo-picker-groups { display: grid; gap: 12px; }
.case-photo-picker-group { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.case-photo-picker-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; background: #fbfbf8; }
.case-photo-picker-group-head strong { font-size: 14px; line-height: 1.35; }
.case-photo-picker-group-head span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.case-photo-picker-scroll { padding: 10px 10px 12px; border-top: 1px solid var(--line); }
.case-photo-group-list { display: grid; gap: 10px; }
.case-photo-group { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.case-photo-group summary { cursor: pointer; list-style: none; padding: 10px 12px; background: #fbfbf8; }
.case-photo-group summary::-webkit-details-marker { display: none; }
.case-photo-group summary span { display: grid; gap: 3px; }
.case-photo-group summary strong { font-size: 14px; line-height: 1.35; }
.case-photo-group summary small { color: var(--muted); font-size: 12px; }
.case-photo-group .case-photo-scroll { padding: 10px 10px 12px; border-top: 1px solid var(--line); }
.case-photo-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(156px, 180px); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.case-photo-select-card { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.case-photo-picker-card { position: relative; cursor: pointer; }
.case-photo-picker-card input { position: absolute; inset-block-start: 10px; inset-inline-start: 10px; z-index: 1; width: 18px; height: 18px; }
.case-photo-picker-card.is-pending { border-color: var(--accent); background: #f2faf7; box-shadow: inset 0 0 0 1px var(--accent); }
.case-photo-picker-card.is-selected { opacity: .48; cursor: not-allowed; background: #f4f4ef; }
.case-photo-picker-card.is-selected img { filter: grayscale(.25); }
.case-photo-select-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; background: #f4f4ef; }
.case-photo-select-controls { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.case-photo-select-controls span { display: flex; align-items: center; gap: 5px; }
.case-photo-picker-card.is-selected .case-photo-select-controls span { color: var(--accent); font-weight: 700; }
.case-photo-picker-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fbfbf8; }
.case-preview-shell { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: #fffefa; }
.case-publish-actions { margin-top: 16px; }
.case-draft-row { grid-template-columns: 1.5fr .7fr .9fr .8fr 1fr; }
.case-draft-row > div { min-width: 0; overflow-wrap: anywhere; }
.case-draft-row span { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.case-draft-list .case-draft-edit-button { background: var(--accent); border-color: var(--accent); color: #fff; }
.case-draft-list .case-draft-edit-button:hover { background: #285d5a; border-color: #285d5a; color: #fff; }
.case-modal[hidden] { display: none; }
.case-modal { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; padding: 24px; }
.case-modal-backdrop { position: absolute; inset: 0; border: 0; border-radius: 0; background: rgba(31,33,28,.35); }
.case-modal-panel { position: relative; z-index: 1; width: min(880px, calc(100vw - 48px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: #fffefa; box-shadow: 0 20px 60px rgba(31,33,28,.22); }
.case-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fbfbf8; }
.case-modal-body { overflow: auto; padding: 16px; display: grid; gap: 12px; }
.case-record-detail-section { border-top: 1px solid var(--line); padding-top: 12px; }
.case-record-detail-section p,
.case-record-tooth-group p { margin: 0; line-height: 1.7; }
.case-record-tooth-group { border-left: 3px solid #bdd8d1; padding: 8px 10px; background: #f6faf8; }
@media (max-width: 980px) {
  body.has-sidebar { overflow: auto; }
  .app-frame { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .content-frame { height: auto; display: block; overflow: visible; }
  .has-sidebar .shell { overflow: visible; }
  .sidenav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-page, .has-sidebar .dashboard-page { height: auto; overflow: visible; }
  .dashboard-list-panel, .dashboard-detail-panel { display: block; }
  .dashboard-patient-list { max-height: min(58vh, 620px); }
  .dashboard-summary-row, .dashboard-grid, .detail-layout, .patient-overview-body, .patient-overview-grid.summary-grid, .patient-tag-columns, .patient-impression-row, .timeline-layout, .settings-layout, .settings-grid, .form-grid, .photo-upload-grid, .photo-upload-grid.two, .photo-preview-grid, .photo-preview-grid.oral-preview-grid, .status-card-grid, .status-steps, .lingjian-sync-metrics, .lingjian-api-call-metrics, .lingjian-monitor-grid, .case-search-grid, .case-card-grid, .case-wizard-layout, .case-detail-hero, .case-basic-grid, .case-photo-stage-entry-row { grid-template-columns: 1fr; }
  .photo-preview-grid.treatment-photo-selected-grid,
  .photo-preview-grid.existing-treatment-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .table-row, .table-row.followup-row, .table-row.user-row, .table-row.platform-parameter-row, .table-row.platform-clinic-row, .table-row.platform-lingjian-row, .table-row.platform-source-row, .table-row.lingjian-sync-run-row, .table-row.lingjian-snapshot-row, .table-row.lingjian-data-issue-row, .table-row.lingjian-api-call-row, .table-row.case-draft-row { grid-template-columns: 1fr; min-width: 0; gap: 6px; align-items: start; }
  .table-head { display: none; }
  .panel-head, .section-title-row, .case-photo-stage-head, .case-photo-picker-group-head { align-items: flex-start; flex-direction: column; }
  .compact-filter-bar { flex-wrap: wrap; }
  .inline-actions { justify-content: flex-start; }
  .tag-category-row { flex-direction: column; }
  .settings-modal { padding: 10px; }
  .settings-modal-panel { width: calc(100vw - 20px); max-height: calc(100vh - 20px); padding: 14px; }
  .statusbar { min-height: 0; align-items: stretch; flex-direction: column; padding: 12px 16px; }
  .global-patient-search { width: 100%; }
  .shell { padding: 16px; }
  .case-library-head,
  .case-wizard-topline { align-items: flex-start; flex-direction: column; }
  .case-drawer { width: min(100vw, calc(100vw - 10px)); }
  .case-photo-scroll { grid-auto-columns: minmax(132px, 46vw); }
  .case-form-actions { justify-content: flex-start; flex-wrap: wrap; }
  .patient-card, .patient-overview, .settings-nav { position: static; }
  .patient-detail-page, .has-sidebar .patient-detail-page { height: calc(100vh - 52px); margin: -16px auto; }
  .timeline-layout { min-height: 0; }
  .timeline-rail { border-right: 0; border-bottom: 1px solid var(--line); grid-auto-flow: column; grid-auto-columns: minmax(160px, 1fr); overflow-x: auto; padding: 0 0 10px; }
  .timeline-scroll { overflow: auto; padding-right: 0; }
  .timeline-summary { grid-template-columns: 1fr; gap: 4px; }
  .timeline-entry-content { grid-template-columns: 1fr; gap: 8px; }
  .timeline-entry-body { padding: 0; }
  .patient-timeline-metrics { justify-content: flex-start; }
  .patient-timeline-metrics span { min-width: 0; text-align: left; }
  .charge-modal { padding: 10px; }
  .charge-modal-panel { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .charge-order-card header { align-items: flex-start; flex-direction: column; }
}
.report-markdown-body { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: #fbfbf8; color: var(--text); line-height: 1.7; font-size: 14px; overflow-wrap: anywhere; }
.report-markdown-body h2,
.report-markdown-body h3,
.report-markdown-body h4 { margin: 16px 0 8px; line-height: 1.35; color: var(--text); }
.report-markdown-body h2:first-child,
.report-markdown-body h3:first-child,
.report-markdown-body h4:first-child { margin-top: 0; }
.report-markdown-body p { margin: 6px 0; }
.report-markdown-list-item span { display: inline-block; min-width: 28px; color: var(--muted); }
.report-markdown-table-wrap { overflow-x: auto; margin: 10px 0 14px; }
.report-markdown-body table { width: 100%; min-width: 640px; border-collapse: collapse; background: #fff; }
.report-markdown-body th,
.report-markdown-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.report-markdown-body th { background: #f2f2ec; font-weight: 700; }
.timeline-markdown-body { border: 0; border-radius: 0; padding: 0; background: transparent; font-size: 13px; line-height: 1.65; }
.timeline-markdown-body .report-markdown-table-wrap { margin: 8px 0 10px; }
.timeline-markdown-body table { min-width: 520px; }
.markdown-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.markdown-editor-pane { min-width: 0; display: grid; gap: 8px; }
.markdown-editor-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.markdown-editor-textarea { min-height: 520px; font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; line-height: 1.65; resize: vertical; }
.markdown-editor-preview { min-height: 520px; }
@media (max-width: 980px) {
  .markdown-editor { grid-template-columns: 1fr; }
  .markdown-editor-textarea,
  .markdown-editor-preview { min-height: 360px; }
}


.deal-radar-page { max-width: 1320px; }
.deal-radar-filter { align-items: end; margin: 0; flex: 0 0 auto; }
.deal-radar-filter input[type="date"] { min-width: 168px; }
.deal-radar-meta { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 10px 0 14px; }
.deal-radar-meta span { color: var(--muted); }
.deal-radar-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.deal-radar-metrics div { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: white; }
.deal-radar-metrics div.is-active { border-color: #bdd8d1; background: #e8f4f1; }
.deal-radar-metrics strong { display: block; font-size: 26px; line-height: 1.1; }
.deal-radar-metrics span { color: var(--muted); font-size: 13px; }
.deal-radar-summary { border: 1px solid #bdd8d1; border-radius: 8px; padding: 14px; background: #f3f9f7; }
.deal-radar-summary h2 { margin-bottom: 6px; }
.deal-radar-summary p { margin: 0; color: #31433e; }
.deal-radar-list { display: grid; gap: 10px; }
.deal-radar-card { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: white; }
.deal-radar-score { width: 58px; height: 58px; border-radius: 8px; display: grid; place-items: center; align-content: center; background: #e8f4f1; color: #174f44; }
.deal-radar-score strong { font-size: 22px; line-height: 1; }
.deal-radar-score span { font-size: 11px; color: #477268; }
.deal-radar-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.deal-radar-title h3 { margin: 0; font-size: 16px; }
.deal-radar-title > span:not(.status-tag) { color: var(--muted); font-size: 12px; }
.deal-radar-content p { margin: 6px 0; color: #3d4541; }
.deal-radar-card-title { font-weight: 700; color: var(--text) !important; }
.deal-radar-meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.deal-radar-meta-grid div { min-width: 0; border: 1px solid #eceee8; border-radius: 8px; padding: 8px; background: #fbfbf8; }
.deal-radar-meta-grid span { display: block; margin-bottom: 2px; color: var(--muted); font-size: 11px; }
.deal-radar-meta-grid strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.deal-radar-reminder { border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; padding: 9px 10px; margin: 10px 0; background: #f3f8f7; }
.deal-radar-reminder strong { display: block; margin-bottom: 4px; font-size: 13px; }
.deal-radar-reminder p { margin: 0; }
.deal-radar-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; justify-content: flex-start; min-width: 88px; }
.deal-radar-detail-btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #bdd8d1; border-radius: 6px; padding: 7px 12px; background: #f3f8f7; color: var(--accent); font: inherit; font-size: 13px; line-height: 1.2; cursor: pointer; white-space: nowrap; }
.deal-radar-detail-btn:hover { background: #e8f4f1; }
.deal-radar-drawer-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(31, 33, 28, .26); opacity: 0; transition: opacity .18s ease; }
.deal-radar-drawer-overlay.is-open { opacity: 1; }
.deal-radar-drawer-overlay[hidden] { display: none; }
.deal-radar-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 81; width: min(620px, calc(100vw - 28px)); background: #fffefa; border-left: 1px solid #dfe4dc; box-shadow: -18px 0 40px rgba(31, 33, 28, .18); transform: translateX(100%); transition: transform .2s ease; display: flex; flex-direction: column; }
.deal-radar-drawer.is-open { transform: translateX(0); }
.deal-radar-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px 16px; border-bottom: 1px solid #eceee8; background: #fbfbf8; }
.deal-radar-drawer-head h3 { margin: 0 0 4px; font-size: 18px; line-height: 1.35; }
.deal-radar-drawer-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.deal-radar-drawer-close { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid #d8ded8; border-radius: 50%; background: white; color: #52615b; cursor: pointer; font-size: 0; line-height: 1; flex: 0 0 auto; }
.deal-radar-drawer-close::before,
.deal-radar-drawer-close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 13px; height: 1.5px; border-radius: 999px; background: currentColor; transform-origin: center; }
.deal-radar-drawer-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.deal-radar-drawer-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.deal-radar-drawer-body { overflow-y: auto; padding: 20px 26px 26px; }
.deal-radar-detail-block { border: 0; border-bottom: 1px solid #eceee8; border-radius: 0; padding: 0 0 16px; background: transparent; margin-bottom: 16px; }
.deal-radar-detail-block h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 9px; font-size: 14px; line-height: 1.4; }
.deal-radar-detail-block p { margin: 0; color: #3d4541; font-size: 14px; line-height: 1.65; }
.deal-radar-detail-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e8f4f1; color: #174f44; line-height: 1; flex: 0 0 auto; }
.deal-radar-detail-icon svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.deal-radar-detail-icon.is-script { background: #eef4fb; color: #334b69; }
.deal-radar-detail-icon.is-strength { background: #fff7dc; color: #7d5700; }
.deal-radar-detail-icon.is-relation { background: #f1f4e6; color: #536122; }
.deal-radar-detail-icon.is-evidence { background: #fff2e8; color: #8a4b10; }
.deal-radar-detail-icon.is-focus { background: #f3eefb; color: #5b4a75; }
.deal-radar-detail-icon.is-caution { background: #fff0ed; color: #9f2a21; }
.deal-radar-detail-strength { display: grid; justify-items: start; gap: 8px; }
.deal-radar-detail-strength p { margin: 0; }
.deal-radar-evidence-list { display: grid; gap: 6px; }
.deal-radar-evidence-item { position: relative; border: 0; border-radius: 0; padding: 4px 0 4px 14px; background: transparent; color: #31433e; font-size: 14px; line-height: 1.6; }
.deal-radar-evidence-item::before { content: ""; position: absolute; left: 1px; top: 14px; width: 5px; height: 5px; border-radius: 50%; background: #7ba99d; }
.deal-radar-evidence-item strong { display: block; margin-bottom: 2px; color: var(--text); }
.deal-radar-evidence-item span { color: var(--muted); font-size: 12px; }
.deal-radar-detail-note { margin: 14px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
@media (max-width: 860px) {
  .deal-radar-filter { width: 100%; }
  .deal-radar-card { grid-template-columns: 48px minmax(0, 1fr); }
  .deal-radar-actions { grid-column: 2; flex-direction: row; justify-content: flex-start; }
}

.button-row { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.secondary-link.is-disabled { opacity: .45; pointer-events: none; }
.status-tag.is-warning { border-color: #ead19b; background: #fff7dc; color: #7d5700; }
.message-inline { margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.message-inline.is-success { border-color: #a7d7b4; background: #eefaf1; color: #256c37; }
.message-inline.is-warning { border-color: #ead19b; background: #fff7dc; color: #7d5700; }
.message-inline.is-danger { border-color: #efb9b1; background: #fff0ed; color: #a93429; }
.account-alerts { display: grid; gap: 8px; margin: 14px 0; }
.account-metric-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.account-usage-row { grid-template-columns: 1fr 1fr 1fr; }
.account-recharge-row { grid-template-columns: 1fr .8fr .8fr 1fr 1.3fr .8fr; }
.account-table .table-row > *,
.billing-account-table .table-row > *,
.billing-drawer-table .table-row > *,
.billing-recharge-list .table-row > *,
.billing-usage-list .table-row > * { min-width: 0; overflow-wrap: anywhere; }
.simple-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.platform-billing-page { max-width: 1500px; margin: 0 auto; }
.billing-metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.billing-metric-grid div { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fbfbf8; }
.billing-metric-grid span { display: block; color: var(--muted); font-size: 12px; }
.billing-metric-grid strong { display: block; margin-top: 5px; font-size: 20px; line-height: 1.2; }
.billing-filter-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 14px; }
.billing-filter-tabs a { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: white; color: var(--text); text-decoration: none; font-size: 13px; }
.billing-filter-tabs a.is-active { border-color: var(--accent); background: #e8f4f1; color: var(--accent); font-weight: 700; }
.billing-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.billing-layout.has-drawer { grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); }
.billing-list-pane { min-width: 0; }
.billing-account-row { grid-template-columns: minmax(180px, 1.2fr) minmax(120px, .9fr) .75fr .85fr .85fr .95fr .95fr; min-width: 1040px; color: var(--text); text-decoration: none; }
.billing-account-row small { display: block; margin-top: 3px; color: var(--muted); }
.billing-account-table { overflow-x: auto; }
.billing-drawer { position: sticky; top: 0; max-height: calc(100vh - 114px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fffefa; padding: 16px; box-shadow: 0 16px 34px rgba(31, 33, 28, .1); }
.billing-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.billing-drawer-head h2 { margin: 0 0 4px; }
.billing-drawer-head p { margin: 0; color: var(--muted); font-size: 12px; }
.compact-form { display: grid; gap: 8px; }
.compact-form p { display: grid; gap: 4px; margin: 0; }
.compact-form label { color: var(--muted); font-size: 12px; }
.compact-form input,
.compact-form select,
.compact-form textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: white; }
.compact-form .helptext { color: var(--muted); font-size: 12px; }
.compact-form ul.errorlist { margin: 0; padding-left: 18px; color: #a93429; font-size: 12px; }
.billing-drawer-table { margin-top: 10px; }
.billing-recharge-row { grid-template-columns: 1fr .7fr .7fr .8fr 1.2fr; }
.billing-recharge-list-row { grid-template-columns: 1fr 1.1fr .8fr .7fr .8fr .8fr 1.1fr .8fr; min-width: 1120px; }
.billing-usage-list-row { grid-template-columns: 1fr 1.2fr 1fr 1fr 1fr; min-width: 780px; }
.billing-recharge-list,
.billing-usage-list { overflow-x: auto; }
@media (max-width: 1100px) {
  .billing-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .billing-layout.has-drawer { grid-template-columns: 1fr; }
  .billing-drawer { position: static; max-height: none; }
  .account-metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .billing-metric-grid,
  .account-metric-row { grid-template-columns: 1fr; }
  .simple-pagination { justify-content: flex-start; flex-wrap: wrap; }
}

/* Clinic account billing V2 */
.billing-page-v2 { width: min(1480px, 100%); margin: 0 auto; display: grid; gap: 14px; }
.billing-page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 58px; }
.billing-page-head h1 { margin: 0; font-size: 22px; line-height: 1.2; }
.billing-page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.billing-segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: max-content; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.billing-segmented a,
.billing-segmented button { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); padding: 5px 9px; text-decoration: none; white-space: nowrap; font-size: 13px; line-height: 1.35; }
.billing-segmented .is-active { color: #fff; background: var(--accent); border-color: var(--accent); }
.billing-metrics-v2 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.billing-metrics-v2.is-drawer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.billing-metrics-v2.is-owner { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.billing-metrics-v2 article { min-width: 0; min-height: 98px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 13px; display: grid; align-content: space-between; gap: 8px; }
.billing-metrics-v2 span { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; }
.billing-metrics-v2 strong { display: block; color: var(--text); font-size: 22px; line-height: 1.1; overflow-wrap: anywhere; }
.billing-metrics-v2 small { display: block; color: var(--muted); font-size: 12px; }
.billing-metrics-v2 .is-green { background: linear-gradient(180deg, #fff, #edf7f4); border-color: #c6ded8; }
.billing-metrics-v2 .is-blue { background: linear-gradient(180deg, #fff, #eef5ff); border-color: #c8d9ef; }
.billing-metrics-v2 .is-amber { background: linear-gradient(180deg, #fff, #fff7e5); border-color: #ead49c; }
.billing-metrics-v2 .is-rose { background: linear-gradient(180deg, #fff, #fff1ee); border-color: #efc3bb; }
.billing-panel-v2 { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 16px 34px rgba(31, 33, 28, .08); }
.billing-panel-v2.is-inner { box-shadow: none; }
.billing-panel-head-v2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); background: #fbfbf8; }
.billing-panel-head-v2 h2,
.billing-panel-head-v2 h3 { margin: 0; font-size: 16px; line-height: 1.25; }
.billing-panel-head-v2 p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.billing-table-wrap { overflow-x: auto; background: #fff; }
.billing-table-v2 { width: 100%; min-width: 980px; border-collapse: collapse; }
.billing-table-v2.is-compact { min-width: 660px; }
.billing-table-v2.is-usage { min-width: 760px; }
.billing-table-v2.is-owner-usage { min-width: 560px; }
.billing-table-v2.is-owner-recharge { min-width: 1040px; }
.billing-table-v2 th,
.billing-table-v2 td { padding: 10px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.billing-table-v2 th { color: var(--muted); background: #f4f7f6; font-size: 12px; font-weight: 650; }
.billing-table-v2 tbody tr:last-child td { border-bottom: 0; }
.billing-click-row { cursor: pointer; }
.billing-click-row:hover { background: #fbfdfc; }
.billing-cell-title { display: grid; gap: 3px; min-width: 0; }
.billing-cell-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billing-cell-title span { color: var(--muted); font-size: 12px; }
.billing-tag { display: inline-flex; align-items: center; justify-content: center; width: fit-content; max-width: 100%; min-height: 24px; border-radius: 7px; padding: 3px 8px; font-size: 12px; white-space: nowrap; color: var(--accent); background: #e8f4f1; }
.billing-tag.is-green { color: #287a4a; background: #e5f4eb; }
.billing-tag.is-blue { color: #356f9d; background: #e8f0f7; }
.billing-tag.is-amber { color: #9b641f; background: #fff2dc; }
.billing-tag.is-rose { color: #af423c; background: #fdebe8; }
.billing-tag.is-muted { color: var(--muted); background: #eef1f0; }
.billing-empty { color: var(--muted); text-align: center; padding: 24px 12px !important; }
.billing-pager-v2 { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 14px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); background: #fff; }
.billing-pager-v2 a,
.billing-pager-v2 span.is-disabled { min-height: 28px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px; text-decoration: none; color: var(--text); background: #fff; }
.billing-pager-v2 span.is-disabled { color: var(--muted); background: #f2f5f4; }
.billing-alert-v2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-left-width: 5px; border-radius: 8px; background: #fff; padding: 14px 16px; box-shadow: 0 10px 28px rgba(31, 33, 28, .08); }
.billing-alert-v2 strong { font-size: 16px; line-height: 1.4; }
.billing-alert-v2 span { color: #5f625b; font-size: 14px; line-height: 1.55; }
.billing-alert-v2.is-amber { border-color: #d9a84e; background: #fff6dc; }
.billing-alert-v2.is-rose { border-color: #d86e60; background: #fff0ed; }
.billing-alert-v2.is-rose strong { color: #9f2f26; }
.billing-alert-v2.is-amber strong { color: #7b4e14; }
.billing-drawer-backdrop-v2 { position: fixed; inset: 0; z-index: 80; background: rgba(31, 33, 28, .28); text-decoration: none; }
.billing-drawer-backdrop-v2[hidden] { display: none; }
  .billing-drawer-v2 { position: fixed; inset: 0 0 0 auto; z-index: 100; width: min(640px, 100vw); background: #fff; border-left: 1px solid var(--line); box-shadow: -18px 0 56px rgba(31, 33, 28, .16); display: grid; grid-template-rows: auto minmax(0, 1fr); }
  .billing-drawer-v2.is-open { display: grid; }
  .billing-drawer-v2[hidden] { display: none; }
  .billing-drawer-head-v2 { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: #fbfbf8; padding: 14px; }
  .billing-drawer-head-v2 h2 { margin: 0; font-size: 18px; line-height: 1.3; }
  .billing-drawer-head-v2 p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
  .billing-drawer-actions-v2 { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
  .billing-drawer-body-v2 { min-height: 0; overflow: auto; display: grid; align-content: start; gap: 14px; padding: 14px; }
.billing-action-grid-v2 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.billing-action-grid-v2 button,
.billing-panel-head-v2 button,
.billing-modal-foot-v2 button { min-height: 34px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--text); padding: 6px 10px; cursor: pointer; }
.billing-action-grid-v2 .primary,
.billing-modal-foot-v2 .primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.billing-icon-close { position: relative; flex: 0 0 auto; display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid #d8ded8; border-radius: 50%; background: #fff; color: #52615b; cursor: pointer; font-size: 0; line-height: 1; text-decoration: none; }
.billing-icon-close::before,
.billing-icon-close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 13px; height: 1.5px; border-radius: 999px; background: currentColor; transform-origin: center; }
.billing-icon-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.billing-icon-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.billing-modal-backdrop-v2 { position: fixed; inset: 0; z-index: 90; background: rgba(31, 33, 28, .34); }
.billing-modal-v2 { position: fixed; left: 50%; top: 50%; z-index: 91; width: min(680px, calc(100vw - 28px)); max-height: calc(100vh - 36px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 24px 80px rgba(31, 33, 28, .22); transform: translate(-50%, -50%); }
.billing-modal-v2[hidden],
.billing-modal-backdrop-v2[hidden] { display: none; }
.billing-modal-head-v2 { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: #fbfbf8; padding: 14px; }
.billing-modal-head-v2 h2 { margin: 0; font-size: 17px; }
.billing-modal-head-v2 p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.billing-modal-body-v2 { display: grid; gap: 12px; padding: 14px; }
.billing-form-grid-v2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.billing-form-grid-v2 label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.billing-form-grid-v2 label.is-wide { grid-column: 1 / -1; }
.billing-form-grid-v2 input,
.billing-form-grid-v2 select,
.billing-form-grid-v2 textarea { width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--text); padding: 7px 9px; }
.billing-form-grid-v2 textarea { min-height: 76px; }
.billing-form-grid-v2 .billing-checkbox-v2 { grid-auto-flow: column; grid-template-columns: auto 1fr; align-items: center; justify-content: start; color: var(--text); }
.billing-form-grid-v2 input[type="checkbox"] { width: auto; min-height: 0; }
.billing-modal-foot-v2 { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 1260px) {
  .billing-metrics-v2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .billing-metrics-v2.is-owner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .billing-page-head,
  .billing-panel-head-v2 { align-items: flex-start; flex-direction: column; }
  .billing-segmented { width: 100%; grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .billing-drawer-v2 { width: 100vw; }
  .billing-action-grid-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .billing-metrics-v2,
  .billing-metrics-v2.is-owner,
  .billing-metrics-v2.is-drawer,
  .billing-form-grid-v2 { grid-template-columns: 1fr; }
  .billing-segmented { grid-template-columns: 1fr; }
  .billing-modal-v2 { width: calc(100vw - 20px); }
}
