:root {
  font-family: "Yu Gothic UI", "Meiryo", sans-serif;
  color: #243b45;
  background: #f4f7f8;
  font-size: 14px;
  font-synthesis: none;
  --brand: #177b77;
  --line: #dce6e8;
  --muted: #71828a;
  --danger: #b1433b;
  /* Service identity colors: BRAIN red, WeSmile blue, でんぐらむ yellow, DXP green. */
  --brain-bg: #fdeceb;
  --brain-fg: #b42318;
  --wesmile-bg: #e6effc;
  --wesmile-fg: #1a5fb4;
  --dengram-bg: #fff3b0;
  --dengram-fg: #6b5500;
  --dxp-bg: #e2f4e6;
  --dxp-fg: #1b6f34;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid #cfdddd;
  background: white;
  color: #34545d;
  border-radius: 7px;
  padding: 9px 14px;
  transition: background 0.15s;
}
button:hover {
  background: #ecf5f4;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #47aaa3;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
button.primary:hover {
  background: #126963;
}
button.text-button {
  border: 0;
  padding: 4px 0;
  color: var(--brand);
  background: transparent;
}
a {
  color: #11776f;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}
h2 {
  font-size: 25px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
h3 {
  font-size: 16px;
  margin-bottom: 15px;
}
p {
  line-height: 1.8;
}
small,
.muted {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 9px;
}
.app-header {
  height: 74px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  font-size: 23px;
  font-weight: 800;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 12px;
  width: 172px;
  flex-shrink: 0;
}
.brand span {
  font-size: 16px;
  color: #253f47;
  letter-spacing: 0.07em;
}
.header-title {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
}
.mode-switch {
  display: flex;
  padding: 3px;
  background: #eff4f4;
  border-radius: 8px;
  gap: 4px;
}
.mode-switch button {
  border: 0;
  background: transparent;
  font-size: 12px;
}
.mode-switch button.active {
  background: white;
  box-shadow: 0 1px 4px #18363b18;
  color: var(--brand);
  font-weight: 700;
}
.app-shell {
  display: flex;
  min-height: calc(100vh - 74px);
}
.sidebar {
  width: 222px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 32px 20px;
  position: sticky;
  top: 74px;
  height: calc(100vh - 74px);
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar nav button {
  text-align: left;
  border: 0;
  padding: 13px 16px;
  font-weight: 600;
  background: transparent;
}
.sidebar nav button span {
  display: block;
  font-weight: 400;
  font-size: 10px;
  color: #8ba0a6;
  margin-top: 3px;
}
.sidebar nav button.active {
  background: #eaf4f2;
  color: #10786e;
}
.sidebar-foot {
  position: absolute;
  bottom: 25px;
  font-size: 11px;
  color: #69808a;
  line-height: 1.9;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #299987;
  margin-right: 7px;
}
.workspace {
  min-width: 0;
  flex: 1;
}
#notice {
  padding: 10px 30px;
  background: #e9f2f0;
  color: #4b716e;
  font-size: 11px;
  line-height: 1.7;
}
#notice.demo {
  background: #fff4d9;
  color: #876b31;
}
main {
  padding: 30px;
  max-width: 1720px;
  margin: auto;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.page-heading p:last-child {
  margin-bottom: 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 5px;
  background: #e8f2ef;
  color: #237365;
  font-size: 11px;
  line-height: 1.4;
  margin: 2px 3px 2px 0;
  white-space: normal;
}
.pill.warning,
.demo-badge {
  background: #fff1d8;
  color: #93672c;
}
.pill.danger {
  background: #fbe9e7;
  color: var(--danger);
}
.pill.neutral {
  background: #f0f3f5;
  color: #657b86;
}
.service-BRAIN {
  background: var(--brain-bg);
  color: var(--brain-fg);
}
.service-WeSmile {
  background: var(--wesmile-bg);
  color: var(--wesmile-fg);
}
.service-でんぐらむ {
  background: var(--dengram-bg);
  color: var(--dengram-fg);
}
.service-DXP {
  background: var(--dxp-bg);
  color: var(--dxp-fg);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 22px;
}
.metrics button {
  padding: 16px 19px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  color: #71838a;
  font-size: 11px;
  position: relative;
}
.metrics strong {
  font-size: 28px;
  display: block;
  color: #2c434b;
  margin-top: 8px;
  font-weight: 650;
}
.metrics button.active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.filters,
.inline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.filters {
  margin: 17px 0;
}
.filters input[type="search"] {
  min-width: 230px;
  flex: 1;
}
.filters select {
  max-width: 190px;
}
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-pills button.active {
  color: var(--brand);
  background: #e7f3ef;
  border-color: #acd3c7;
}
.filter-pills strong {
  margin-left: 7px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  background: #f7f9fa;
  color: #778b94;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 17px 15px;
  border-bottom: 1px solid #eef2f3;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.7;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.clinic-table td:first-child {
  min-width: 195px;
}
.clinic-table td:nth-child(4) {
  min-width: 90px;
  max-width: 120px;
}
.clinic-table td:nth-child(5) {
  min-width: 190px;
  max-width: 290px;
}
.clinic-table td:nth-child(6) {
  min-width: 165px;
}
.clinic-link {
  font-size: 14px;
  font-weight: 700;
  color: #274951;
}
.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.empty {
  padding: 60px 20px;
  text-align: center;
  border: 1px dashed #c9d9dd;
  border-radius: 10px;
  color: var(--muted);
  background: #fff;
}
.empty h3 {
  color: #4e6974;
}
.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 13px;
  align-items: center;
  margin: 18px 0;
  font-size: 12px;
  color: var(--muted);
}
.card,
section {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 18px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h3 {
  margin: 0;
}
.row {
  padding: 14px 0;
  border-bottom: 1px solid #edf2f3;
  line-height: 1.8;
}
.row:last-child {
  border: 0;
}
.row p {
  margin: 7px 0;
}
.row-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.detail-nav {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin: 22px 0;
  overflow: auto;
}
.detail-nav button {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 13px 18px;
  white-space: nowrap;
}
.detail-nav button.active {
  border-bottom-color: var(--brand);
  color: var(--brand);
  font-weight: 700;
}
.overview-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 20px;
}
.overview-grid > div {
  min-width: 0;
}
.summary-text {
  font-size: 17px;
  line-height: 1.9;
  white-space: pre-wrap;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 15px;
}
.service-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}
.service-card p {
  margin: 12px 0;
}
.service-card footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}
.facts {
  margin: 12px 0;
}
.facts > div {
  display: grid;
  grid-template-columns: minmax(115px, 0.8fr) minmax(0, 1.6fr);
  gap: 15px;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f3;
}
.facts dt {
  font-size: 12px;
  color: var(--muted);
}
.facts dd {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.timeline {
  border-left: 2px solid #dfece8;
  padding-left: 22px;
  margin-left: 5px;
}
.timeline .row {
  position: relative;
}
.timeline .row:before {
  content: "";
  width: 8px;
  height: 8px;
  background: #6ba79b;
  border: 3px solid white;
  border-radius: 50%;
  position: absolute;
  left: -28px;
  top: 22px;
}
.task-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}
.task-card .task-content {
  flex: 1;
}
.task-card h4 {
  margin: 8px 0;
  font-size: 14px;
}
.due-overdue {
  color: var(--danger);
  font-weight: 600;
}
.tabs-note {
  background: #f4f8f7;
  border-radius: 7px;
  padding: 12px;
  font-size: 12px;
  color: #65847d;
}
.service-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 15px 0;
}
input,
select,
textarea {
  padding: 10px 11px;
  border: 1px solid #ccdadd;
  border-radius: 6px;
  color: #2c4951;
  background: white;
  max-width: 100%;
}
textarea {
  resize: vertical;
  min-height: 95px;
}
label {
  display: block;
  font-size: 12px;
  color: #5c737c;
  margin: 13px 0;
  line-height: 1.6;
}
label > input:not([type="checkbox"]),
label > select,
label > textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  color: #2c4951;
  font-size: 14px;
}
.required {
  color: #a24a40;
  font-size: 10px;
  margin-left: 5px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.form-grid label.wide {
  grid-column: 1/-1;
}
.form-section {
  margin: 20px 0;
  padding: 16px;
  background: #f8fafb;
  border-radius: 8px;
}
.form-section h3 {
  font-size: 14px;
  margin: 0 0 10px;
}
.form-section summary {
  cursor: pointer;
  font-weight: 600;
}
.check-label {
  display: flex;
  gap: 7px;
  align-items: center;
}
.check-label input {
  width: auto;
}
dialog {
  width: 800px;
  max-width: 95vw;
  max-height: 90vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 25px;
  box-shadow: 0 20px 80px #122c4933;
}
dialog::backdrop {
  background: #1d354560;
}
.calendar-current,
.calendar-review,
.calendar-pending-writes {
  background: #f1f7f7;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
  overflow-wrap: anywhere;
}
.calendar-current {
  position: sticky;
  top: -25px;
  z-index: 2;
}
.calendar-review dt {
  margin-top: 12px;
  color: #526777;
}
.calendar-review dd {
  margin: 5px 0;
}
.dialog-actions {
  z-index: 3;
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  position: sticky;
  bottom: -25px;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 18px 0 8px;
  margin-top: 20px;
}
.editor-current {
  position: sticky;
  top: -25px;
  z-index: 2;
  background: #f1f7f7;
  border: 1px solid #d1e2e2;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 18px 0;
  box-shadow: 0 3px 12px #1738430a;
}
.editor-current h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #235b60;
}
.editor-current-values {
  margin: 0;
  max-height: 160px;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 12px;
}
.editor-current-values dt {
  color: #60797e;
  font-size: 12px;
  margin-bottom: 4px;
}
.editor-current-values dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.7;
}
.editor-current-meta,
.editor-current-empty {
  font-size: 12px;
  color: #60797e;
  margin: 5px 0 10px;
}
.editor-input-title {
  font-size: 14px;
  margin: 18px 0 12px;
}
.editor-conflict {
  padding: 12px 16px;
  border: 1px solid #efd19a;
  background: #fff8e9;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}
.editor-conflict p {
  margin: 0 0 8px;
}
@media (max-height: 650px) {
  .editor-current-values {
    max-height: 100px;
  }
}
.error,
#error {
  color: #b3463d;
  white-space: pre-wrap;
  line-height: 1.8;
}
.success {
  color: #287965;
}
.warning-text {
  color: #946c37;
  font-size: 12px;
}
#toast {
  display: none;
  position: fixed;
  right: 28px;
  bottom: 25px;
  background: #214e48;
  color: white;
  padding: 15px 23px;
  border-radius: 9px;
  z-index: 99;
  box-shadow: 0 6px 30px #173e4033;
  max-width: 80vw;
}
#toast.show {
  display: block;
}
.import-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.import-intro .card p {
  font-size: 12px;
  color: var(--muted);
}
.import-table td {
  min-width: 150px;
}
.import-table td:first-child {
  min-width: 50px;
}
.import-table td:nth-child(4) {
  max-width: 280px;
}
.import-table select {
  min-width: 180px;
  max-width: 230px;
}
.review-bar {
  background: #f0f7f4;
  margin-top: 16px;
}
.review-bar label {
  max-width: 750px;
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.source-card {
  border-left: 3px solid #9baed4;
}
.source-card h4 {
  margin-bottom: 10px;
}
details summary {
  cursor: pointer;
  line-height: 1.7;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.mobile-only {
  display: none;
}
@media (min-width: 1600px) {
  .clinic-table td:nth-child(5) {
    max-width: 350px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 178px;
    padding: 25px 12px;
  }
  .brand {
    width: 140px;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    gap: 8px;
  }
  .metrics button {
    padding: 13px 11px;
  }
  .import-intro {
    grid-template-columns: 1fr;
  }
  main {
    padding: 22px;
  }
}
@media (max-width: 760px) {
  .app-header {
    height: auto;
    min-height: 65px;
    padding: 12px 15px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .header-title {
    display: none;
  }
  .brand {
    flex: 1;
    font-size: 20px;
  }
  .brand span {
    font-size: 13px;
  }
  .mode-switch button {
    font-size: 11px;
    padding: 8px;
  }
  .app-shell {
    display: block;
  }
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
  }
  .sidebar > .eyebrow,
  .sidebar-foot {
    display: none;
  }
  .sidebar nav {
    flex-direction: row;
  }
  .sidebar nav button {
    flex: 1;
    padding: 9px;
    text-align: center;
    font-size: 12px;
  }
  .sidebar nav button span {
    display: none;
  }
  .workspace {
    width: 100%;
  }
  #notice {
    padding: 9px 15px;
  }
  main {
    padding: 18px 14px;
  }
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .metrics button strong {
    font-size: 24px;
  }
  .page-heading {
    align-items: start;
    gap: 10px;
  }
  h2 {
    font-size: 22px;
  }
  .form-grid,
  .compare-grid {
    grid-template-columns: 1fr;
  }
  .overview-grid {
    gap: 0;
  }
  .card,
  section {
    padding: 18px;
  }
  .filters select {
    flex: 1;
  }
  .detail-nav button {
    padding: 11px;
    font-size: 12px;
  }
  .facts > div {
    grid-template-columns: 1fr 1.5fr;
  }
  dialog {
    padding: 20px;
  }
  .review-bar {
    position: static;
  }
  .clinic-table th:nth-child(7),
  .clinic-table td:nth-child(7) {
    display: none;
  }
}
/* Narrow desktop panels keep every business field visible without horizontal scrolling. */
@media (max-width: 1250px) {
  .clinic-table,
  .clinic-table tbody {
    display: block;
    min-width: 0;
    width: 100%;
  }
  .clinic-table thead {
    display: none;
  }
  .clinic-table tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: "clinic clinic rank" "services contracts contracts" "summary summary summary" "action meeting checked";
    padding: 18px;
    gap: 18px;
    border-bottom: 1px solid var(--line);
  }
  .clinic-table td:nth-child(n) {
    display: block;
    padding: 0;
    border: 0;
    min-width: 0;
    max-width: none;
  }
  .clinic-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
  }
  .clinic-table td:nth-child(1) {
    grid-area: clinic;
  }
  .clinic-table td:nth-child(2) {
    grid-area: services;
  }
  .clinic-table td:nth-child(3) {
    grid-area: contracts;
  }
  .clinic-table td:nth-child(4) {
    grid-area: rank;
  }
  .clinic-table td:nth-child(5) {
    grid-area: summary;
  }
  .clinic-table td:nth-child(6) {
    grid-area: action;
  }
  .clinic-table td:nth-child(7) {
    grid-area: meeting;
    display: block;
  }
  .clinic-table td:nth-child(8) {
    grid-area: checked;
    display: block;
  }
  .clinic-table .clinic-link {
    font-size: 17px;
  }
  .clinic-table .clamp {
    -webkit-line-clamp: 3;
  }
}
@media (max-width: 760px) {
  .clinic-table tbody tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "clinic clinic" "services services" "contracts contracts" "rank rank" "summary summary" "action meeting" "checked checked";
    gap: 14px;
    padding: 16px;
  }
  .clinic-table td:nth-child(7) {
    display: block;
  }
  .clinic-table .clinic-link {
    font-size: 16px;
  }
}
/* Clinic matching keeps source records separate while making comparisons visible. */
.identity-principle {
  background: #e9f3ee;
  border-left: 4px solid var(--accent, #28684d);
  padding: 20px 24px;
  margin: 0 0 24px;
  border-radius: 4px 10px 10px 4px;
}
.identity-principle p {
  margin: 8px 0 0;
  line-height: 1.8;
}
.identity-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.identity-source-grid .card {
  margin: 0;
}
.identity-upload {
  margin: 18px 0;
}
.identity-upload label,
.identity-review form > label {
  display: block;
  margin-bottom: 14px;
}
.identity-upload textarea,
.identity-review textarea {
  width: 100%;
}
.identity-metrics {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  color: var(--muted);
}
.identity-metrics strong {
  color: var(--ink, #22332b);
  font-size: 20px;
  margin-left: 8px;
}
.identity-record {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 14px;
  background: #fff;
}
.identity-record.selected {
  border-color: #39775e;
  box-shadow: 0 0 0 1px #39775e;
}
.identity-record-head {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-bottom: 15px;
}
.identity-record-head .check-line {
  margin: 0 auto 0 0;
  font-size: 16px;
}
.identity-record-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 14px;
}
.identity-facts {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
  font-size: 13px;
  margin: 16px 0;
}
.identity-facts dt {
  color: var(--muted);
}
.identity-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.identity-peer {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.identity-peer button {
  margin-top: 8px;
}
.identity-review {
  border-top: 4px solid #39775e;
}
.identity-floating {
  position: sticky;
  bottom: 16px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 20px;
  border: 1px solid #39775e;
  border-radius: 10px;
  background: #f0f8f3;
  box-shadow: 0 4px 18px #18372822;
  margin-bottom: 20px;
}
#identity-selection {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
#identity-error {
  color: #a7332d;
  white-space: pre-wrap;
}
#identity-message {
  color: #276443;
  white-space: pre-wrap;
}
[hidden] {
  display: none !important;
}
.sync-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: #eaf3ef;
  border-radius: 10px;
  font-size: 13px;
}
.directory-view .page-heading {
  margin-bottom: 12px;
}
.directory-view {
  padding-top: 18px;
}
.directory-view .page-heading .eyebrow {
  display: none;
}
.directory-view .sync-summary {
  padding: 8px 12px;
  margin-bottom: 8px;
}
.directory-view .metrics {
  margin-bottom: 10px;
  gap: 8px;
}
.directory-view .metrics button {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.directory-view .metrics strong {
  font-size: 23px;
  margin-top: 0;
}
.directory-view .detail-nav {
  margin-bottom: 12px;
}
.directory-view .detail-nav button {
  padding: 8px 14px;
}
.directory-view .filters {
  gap: 8px;
  margin: 12px 0;
}
.directory-view .filters input[type="search"] {
  min-width: 190px;
}
.directory-view .filters select {
  max-width: 145px;
}
.directory-service small,
.contract-period > span,
.contract-period > small {
  display: block;
}
.directory-service,
.directory-contract {
  min-height: 48px;
}
.directory-service + .directory-service,
.directory-contract + .directory-contract {
  margin-top: 12px;
}
.directory-service small,
.contract-period {
  margin-top: 4px;
}
.contract-service-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.contract-period > span {
  font-variant-numeric: tabular-nums;
}
@media (min-width: 1251px) {
  .clinic-table .services-cell {
    min-width: 130px;
  }
  .clinic-table .contracts-cell {
    min-width: 210px;
  }
}
button.clinic-link {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  border-radius: 0;
  color: #245d46;
  font-weight: 700;
  cursor: pointer;
}
button.clinic-link:hover {
  text-decoration: underline;
  background: transparent;
}
.sync-summary span {
  color: var(--muted);
  flex: 1;
}
.nav-settings {
  margin-top: 24px;
}
.nav-settings summary {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
}
#clinic-create label {
  display: block;
  margin-bottom: 14px;
}
#clinic-create textarea {
  width: 100%;
}
#create-error {
  color: #a7332d;
}
.clinic-detail-view {
  padding-top: 18px;
}
.clinic-detail-view .page-heading {
  margin: 12px 0;
}
.clinic-detail-view .eyebrow {
  display: none;
}
.clinic-detail-view .detail-nav {
  margin-bottom: 12px;
  flex-wrap: wrap;
  overflow: visible;
  gap: 4px;
}
.clinic-detail-view .detail-nav button {
  padding: 10px 12px;
}
.pinned-brief {
  border-left: 3px solid #c49b45;
  background: #fffdf6;
  padding: 14px;
  margin: 10px 0;
}
.pinned-brief p {
  white-space: pre-wrap;
  font-size: 13px;
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.clinic-at-glance {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.8fr;
  gap: 12px;
  margin: 20px 0;
}
.clinic-at-glance > div {
  background: #eaf4f2;
  border: 1px solid #d6e9e4;
  padding: 14px 18px;
  border-radius: 9px;
}
.clinic-at-glance span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 7px;
}
.clinic-at-glance strong {
  font-size: 14px;
  font-weight: 600;
}
.clinic-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(290px, 1fr);
  gap: 22px;
  align-items: start;
}
.clinic-main,
.clinic-aside {
  min-width: 0;
}
.clinic-main section,
.clinic-aside section {
  margin-bottom: 20px;
}
.clinic-aside .section-head {
  flex-wrap: wrap;
}
.clinic-aside .facts > div {
  grid-template-columns: 78px minmax(0, 1fr);
}
.clinic-aside p {
  overflow-wrap: anywhere;
}
.record-launch {
  border: 1px dashed #72a89b;
  background: #f3faf7;
}
.record-launch p {
  color: var(--muted);
  font-size: 13px;
}
.record-launch button:first-child {
  background: var(--brand);
  color: white;
}
.summary-text,
.activity-body,
.activity-outcome p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.85;
}
.summary-stamp {
  margin-top: 16px;
  margin-bottom: 0;
}
.activity-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 20px;
  margin: 14px 0;
}
.activity-card.is-pinned {
  border-left: 4px solid #c49b45;
  background: #fffefa;
}
.activity-card h4 {
  font-size: 16px;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.activity-meta {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}
.activity-meta time {
  color: #506d76;
  margin-right: 6px;
  font-size: 12px;
  font-weight: 600;
}
.activity-people {
  display: flex;
  gap: 8px 22px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 12px;
  color: #527078;
}
.activity-people strong {
  font-weight: 500;
  color: var(--muted);
  margin-right: 5px;
}
.activity-purpose {
  font-size: 13px;
  background: #f2f6f7;
  padding: 9px 12px;
  border-radius: 5px;
}
.activity-outcome {
  background: #f0f8f4;
  border-radius: 6px;
  padding: 12px;
  margin-top: 14px;
  font-size: 13px;
}
.activity-outcome p {
  margin: 6px 0 0;
}
.activity-card footer {
  border-top: 1px solid #edf1f2;
  padding-top: 10px;
  margin-top: 15px;
}
.activity-card footer .inline {
  margin-top: 9px;
  gap: 18px;
  font-size: 12px;
}
.activity-card details {
  margin-top: 10px;
}
.activity-card details summary {
  cursor: pointer;
  color: var(--brand);
  font-size: 13px;
}
.activity-card details .activity-body {
  margin-top: 12px;
}
.activity-excerpt {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.reply-context {
  padding: 10px 12px;
  margin: 12px 0;
  border-left: 3px solid #b0c9d1;
  background: #f0f5f7;
  font-size: 12px;
}
.activity-highlight {
  outline: 3px solid #47aaa3;
  outline-offset: 3px;
}
.activity-toolbar {
  padding: 14px 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 16px;
}
.activity-toolbar .filters {
  margin-top: 0;
}
.activity-list {
  max-width: 1100px;
}
.empty-note {
  line-height: 1.9;
  color: var(--muted);
  padding: 15px 0;
}
.row-note-button {
  display: block;
  margin-top: 7px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--brand);
}
.last-contact {
  display: block;
  padding-top: 10px;
}
dialog.activity-editor {
  width: min(850px, 95vw);
}
dialog.activity-editor textarea[name="body"] {
  min-height: 200px;
}
@media (max-width: 1150px) {
  .clinic-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .clinic-aside {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}
@media (max-width: 760px) {
  .clinic-aside,
  .clinic-at-glance {
    grid-template-columns: 1fr;
  }
  .activity-card {
    padding: 15px;
  }
  .clinic-at-glance {
    gap: 7px;
  }
}
@media (max-width: 760px) {
  .identity-record-body {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .identity-source-grid {
    grid-template-columns: 1fr;
  }
  .identity-metrics {
    gap: 12px;
  }
}
/* Membership status is visible before opening source details. */
.membership-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 750;
  background: #eef2f5;
  color: #425168;
}
.membership-operating {
  background: #e3f4ec;
  color: #136343;
}
.membership-paused {
  background: #fff1d6;
  color: #875309;
}
.membership-ended {
  background: #eeeef3;
  color: #545467;
}
.membership-conflict {
  background: #fde8e6;
  color: #a13227;
}
.membership-cell {
  min-width: 210px;
}
.membership-cell small,
.membership-period-short {
  display: block;
  margin-top: 7px;
}
.membership-period-short {
  font-size: 12px;
  line-height: 1.6;
}
.membership-banner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  background: #fff;
  border: 1px solid #d8e5e2;
  border-left: 4px solid #2c7a69;
  border-radius: 10px;
  padding: 18px 22px;
  margin: 6px 0 20px;
}
.membership-banner > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.membership-banner > div:last-child {
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.membership-banner .eyebrow {
  margin: 0;
}
.membership-counts {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.membership-counts > span {
  font-weight: 700;
  margin-right: 4px;
}
.membership-counts button {
  padding: 9px 12px;
  font-size: 12px;
}
.membership-counts strong {
  margin-left: 8px;
  font-size: 16px;
}
.membership-counts .active {
  background: #1b6657;
  color: white;
  border-color: #1b6657;
}
.membership-current {
  padding: 18px;
  background: #f5f9f8;
  border-radius: 8px;
  margin: 18px 0;
}
.membership-current > div {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.membership-period-line {
  font-size: 19px;
  font-weight: 650;
}
.membership-workspace h4 {
  margin-top: 24px;
}
.membership-period-card h4 {
  margin: 0;
}
.membership-period-card,
.membership-source {
  margin-top: 14px;
}
.membership-revisions {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e1e7e5;
}
.membership-revisions summary {
  cursor: pointer;
  color: #3a655b;
}
.membership-service-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
}
.preserve-lines {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 800px) {
  .membership-banner {
    flex-direction: column;
  }
  .membership-banner > div:last-child {
    align-items: flex-start;
  }
}
.membership-insights {
  border: 1px solid #ead9ae;
  background: #fffdf7;
}
.insight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
}
.insight-row + .insight-row {
  border-top: 1px solid #eee4ce;
}
.insight-row p {
  margin: 5px 0 0;
  color: #666452;
  font-size: 13px;
}
.insight-row button {
  flex-shrink: 0;
}
.membership-excerpt blockquote {
  margin: 12px 0;
  padding: 10px 16px;
  border-left: 3px solid #b7cdc7;
  background: #f7f9f8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.membership-caption {
  font-size: 13px;
  font-weight: 700;
  color: #3a655b;
}
.other-membership {
  padding: 18px;
  margin-top: 18px;
  border: 1px solid #dce6e2;
  border-radius: 8px;
  background: #fff;
}
.other-membership > summary {
  cursor: pointer;
  font-weight: 650;
}
:root {
  --brain-surface: #f4f8fb;
}
.brain-overview {
  border-left: 4px solid #55869b;
}
.brain-highlights {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
.brain-highlights > div {
  padding: 10px 14px;
  background: var(--brain-surface);
  border-radius: 8px;
}
.brain-highlights span {
  font-size: 12px;
  color: #466576;
  font-weight: 700;
}
.brain-highlights p {
  margin: 5px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
}
.brain-source-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 14px 18px;
  margin: 10px 0;
  border: 1px solid #dce5e9;
  border-radius: 10px;
  background: white;
}
.brain-source-status small,
.brain-source-status p {
  flex-basis: 100%;
  margin: 0;
}
.brain-source-status.warning {
  background: #fff8e9;
}
.brain-filters {
  margin: 22px 0 14px;
}
.brain-report-list {
  display: grid;
  gap: 18px;
}
.brain-report {
  background: white;
  border: 1px solid #dce5e9;
  border-radius: 12px;
  padding: 22px;
}
.brain-report h3 {
  margin: 12px 0 6px;
}
.brain-report summary {
  cursor: pointer;
  padding: 10px 0;
  font-weight: 600;
}
.brain-field {
  padding: 12px 0;
  border-bottom: 1px solid #edf0f2;
}
.brain-field h4 {
  color: #526a75;
  margin: 0 0 8px;
}
.brain-report-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}
.brain-versions {
  margin-top: 12px;
}
.brain-list-link {
  display: block;
  font-size: 12px;
  text-align: left;
  margin-top: 6px;
}
.cs-input-guide,
.cs-cutover {
  padding: 16px 20px;
  background: #eaf5f1;
  border: 1px solid #cfe5dc;
  border-radius: 10px;
  margin: 16px 0;
}
.cs-input-guide p,
.cs-cutover p {
  margin: 8px 0 12px;
  line-height: 1.7;
}

/* Daily work has a small set of entry points; source maintenance is secondary. */
.action-brief {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.action-brief > button {
  display: block;
  text-align: left;
  font-weight: 600;
  margin: 4px 0;
}
.action-brief > small {
  display: block;
}
.directory-view .metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.sidebar nav .nav-settings {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
}
.directory-results {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0;
  font-size: 13px;
}
.directory-results small {
  display: block;
}
.more-filters {
  background: #eaf1f2;
  border-radius: 10px;
  padding: 4px 16px;
}
.more-filters label {
  display: grid;
  gap: 6px;
  font-size: 12px;
}
.directory-view .more-filters select {
  max-width: none;
}
.directory-view .directory-search input {
  flex: 1;
}
.management-grid,
.overview-top {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: start;
}
.management-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.management-back {
  margin-bottom: 18px;
}
.identity-attention {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  background: #fff6e7;
  border: 1px solid #ecd0a0;
  border-left: 4px solid #d69639;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.identity-attention p {
  margin: 5px 0 0;
  font-size: 13px;
}
.sidebar button .nav-review-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 7px;
  border-radius: 5px;
  background: #fff0d8;
  color: #855412;
  font-size: 11px;
}
.wesmile-connection .section-head h3 {
  margin: 0;
}
.connection-clear {
  color: #3b7468;
  font-size: 13px;
}
.connection-details {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 20px;
}
.connection-details > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}
.provenance-details,
.completed-actions,
.brain-source-details {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 14px 18px;
  margin-bottom: 20px;
}
.provenance-details > summary,
.completed-actions > summary,
.brain-source-details > summary {
  cursor: pointer;
  font-size: 13px;
}
.provenance-details[open] > summary,
.completed-actions[open] > summary,
.brain-source-details[open] > summary {
  margin-bottom: 16px;
}
.clinic-detail-view .detail-primary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 18px 0 0;
  gap: 0;
}
.clinic-detail-view .detail-primary button {
  border-radius: 0;
  padding: 13px 8px;
}
.detail-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 18px;
}
.detail-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.detail-secondary button {
  font-size: 12px;
  padding: 7px 9px;
  border-color: transparent;
  background: transparent;
}
.detail-secondary button.active {
  color: #126963;
  background: #e5f2ef;
  font-weight: 700;
}
.service-brief {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.service-brief > span:nth-child(2) {
  flex: 1;
}
.brain-history-heading {
  margin-bottom: 14px;
}
.brain-history-heading h3,
.brain-history-heading p {
  margin-bottom: 7px;
}
.clinic-detail-view .page-heading > .primary {
  flex-shrink: 0;
}
@media (max-width: 1000px) {
  .overview-top,
  .management-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}
@media (max-width: 760px) {
  .clinic-detail-view .detail-primary {
    display: flex;
    overflow-x: auto;
  }
  .clinic-detail-view .detail-primary button {
    flex: 0 0 auto;
    padding-inline: 16px;
    white-space: nowrap;
  }
  .sidebar nav .nav-settings {
    margin: 0;
    border: 0;
  }
  .directory-view .metrics button {
    flex-direction: column;
    align-items: start;
    font-size: 11px;
  }
  .clinic-detail-view .page-heading {
    flex-wrap: wrap;
  }
  .directory-results {
    align-items: start;
  }
  .directory-results select {
    max-width: 130px;
  }
}
/* Monthly counts and optional notes, with provenance kept behind Details. */
.patient-toolbar {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 18px 0;
}
.patient-toolbar label {
  display: flex;
  gap: 8px;
  align-items: center;
}
.patient-toolbar input {
  width: 100px;
}
.patient-total {
  font-size: 22px;
  font-weight: 650;
  color: #174c63;
}
.patient-total small {
  display: block;
  color: #637785;
  font-size: 12px;
  font-weight: 400;
}
.patient-months {
  width: 100%;
  table-layout: fixed;
}
.patient-months thead th:nth-child(1) {
  width: 60px;
}
.patient-months thead th:nth-child(2) {
  width: 115px;
}
.patient-months thead th:nth-child(4) {
  width: 140px;
}
.patient-months td,
.patient-months th {
  vertical-align: top;
  padding: 9px 14px;
}
.patient-months input[type="number"] {
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.patient-months textarea {
  width: 100%;
  min-height: 44px;
  height: 44px;
  resize: vertical;
}
.patient-months textarea:focus {
  min-height: 64px;
}
.patient-row-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 42px;
}
.patient-row-tools .patient-feedback {
  margin: 0;
  font-size: 11px;
}
.patient-details-row > td {
  background: #f7fafb;
}
.patient-details-row .patient-history {
  max-height: 300px;
  overflow: auto;
}
.patient-details-row .patient-provisional {
  margin: 0 0 10px;
}
.patient-status:empty {
  display: none;
}
.patient-count {
  font-size: 18px;
  font-weight: 650;
}
.patient-status {
  display: block;
  margin-top: 5px;
  color: #746247;
  font-size: 12px;
}
.patient-future {
  color: #8898a3;
  background: #fafbfc;
}
.patient-note {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.patient-feedback {
  margin: 5px 0 0;
  font-size: 12px;
  color: #486b5b;
}
.patient-feedback:empty {
  display: none;
}
.patient-feedback[role="alert"] {
  color: #a3392c;
}
.patient-provenance {
  margin-top: 8px;
  font-size: 13px;
}
.patient-provenance summary {
  cursor: pointer;
  color: #34687f;
}
.patient-months td:last-child:has(.patient-provenance[open]) {
  overflow-wrap: anywhere;
}
.patient-provisional {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
}
.patient-provisional input {
  width: auto;
}
.patient-evidence {
  border-left: 3px solid #dce7ec;
  padding: 8px 10px;
  margin: 10px 0;
  overflow-wrap: anywhere;
}
.patient-evidence p {
  margin: 6px 0;
  white-space: pre-wrap;
}
.patient-evidence pre {
  white-space: pre-wrap;
  font: inherit;
  max-height: 240px;
  overflow: auto;
}
.patient-evidence small {
  color: #637785;
}
.patient-evidence a {
  display: inline-block;
  margin-top: 6px;
}
.patient-source-info {
  padding: 18px 0;
  font-size: 13px;
  color: #637785;
}
.patient-source-info summary {
  cursor: pointer;
}
.patient-conflict {
  background: #fff4e5;
  padding: 12px;
  margin-top: 10px;
  border-radius: 8px;
}
.patient-conflict p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.patient-workspace .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 700px) {
  .patient-months {
    min-width: 530px;
  }
  .patient-months thead th:nth-child(1) {
    width: 45px;
  }
  .patient-months thead th:nth-child(2) {
    width: 95px;
  }
  .patient-months thead th:nth-child(4) {
    width: 85px;
  }
  .patient-toolbar {
    gap: 18px;
  }
  .patient-total {
    font-size: 18px;
  }
}
:root {
  --auth-border: #dce5e7;
}
[hidden] {
  display: none !important;
}
.account {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  font-size: 13px;
}
.account small {
  display: block;
  color: #62777d;
}
.account button {
  font-size: 12px;
}
.auth-screen .sidebar,
.auth-screen .mode-switch,
.auth-screen .header-title,
.auth-screen #notice {
  display: none;
}
.auth-screen .app-shell {
  display: block;
}
.auth-screen .workspace {
  margin: 0 auto;
  max-width: 640px;
  padding: 56px 20px;
}
.auth-card {
  padding: 36px;
  border: 1px solid var(--auth-border);
  border-radius: 18px;
  background: white;
  box-shadow: 0 12px 40px #172f3710;
}
.auth-card h1 {
  font-size: 24px;
  line-height: 1.5;
}
.auth-card p {
  line-height: 1.8;
}
.auth-card .primary {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
}
#auth-error,
.staff-error {
  color: #ac3737;
}
.session-expired {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  padding: 18px 24px;
  background: #fff1cd;
  box-shadow: 0 -2px 18px #0002;
}
.session-expired a {
  font-weight: bold;
  margin: 0 12px;
}
.staff-clinic-options {
  max-height: 200px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--auth-border);
}
.staff-dialog fieldset {
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  margin: 20px 0;
  padding: 16px;
}
.staff-dialog legend {
  font-weight: 600;
  padding: 0 6px;
}
.staff-role-guide table {
  min-width: 720px;
}
.staff-role-guide th:first-child {
  width: 130px;
  white-space: nowrap;
}
.staff-role-guide td {
  line-height: 1.75;
  white-space: normal;
  vertical-align: top;
}
.staff-role-description,
.staff-permission-preview {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f2f8f7;
  margin: 16px 0;
}
.staff-role-description h3,
.staff-permission-preview h3 {
  margin-bottom: 8px;
}
.staff-role-description p,
.staff-permission-preview p {
  margin-bottom: 6px;
}
.staff-scope-help {
  margin: 12px 0 0;
  font-size: 13px;
  color: #526970;
}
.staff-row-actions {
  display: flex;
  gap: 8px;
}
button.danger-text {
  color: #a5362e;
}
button.danger-button {
  background: #a5362e;
  color: white;
  border-color: #a5362e;
}
.staff-delete-dialog {
  max-width: 560px;
}
.staff-dialog .check-line {
  margin: 5px 0;
}
.staff-conflict {
  background: #fff6dc;
  padding: 0 12px;
}
@media (max-width: 720px) {
  .account small {
    display: none;
  }
  .account {
    font-size: 12px;
    gap: 6px;
  }
  .auth-card {
    padding: 24px;
  }
}
/* WeSmile memo history and conflict comparison */
.ws-toolbar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.ws-toolbar label {
  min-width: 230px;
  flex: 1;
}
.ws-record {
  padding: 20px;
  margin: 16px 0;
}
.ws-record pre,
.ws-editor pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.7;
}
.ws-record summary {
  cursor: pointer;
  line-height: 1.7;
}
.ws-history {
  margin-top: 16px;
  border-top: 1px solid #d9e5e8;
  padding-top: 12px;
}
.ws-history > div {
  padding: 12px;
  margin-top: 12px;
  background: #f5f8f9;
}
.ws-preview {
  border-left: 3px solid #78b6b3;
  padding: 8px 16px;
  margin: 12px 0;
}
.ws-preview p {
  white-space: pre-wrap;
  margin-bottom: 0;
}
.ws-editor {
  width: min(850px, calc(100vw - 48px));
  max-height: 90vh;
  overflow: auto;
}
.ws-editor .ws-current {
  background: #f3f7f8;
  padding: 16px;
  margin-bottom: 20px;
}
.ws-editor textarea {
  width: 100%;
  box-sizing: border-box;
}
.ws-editor-error,
.ws-message {
  color: #945318;
  white-space: pre-wrap;
}
.member-field {
  min-width: 0;
}
.member-field > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.member-other {
  margin-top: 10px;
}
.member-field .member-other[hidden] {
  display: none;
}
.ws-editor .editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.identity-queue-table th:first-child {
  min-width: 210px;
}
.identity-queue-table td {
  white-space: normal;
}
.identity-help,
.identity-source-settings {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--border, #d3dfe5);
  border-radius: 8px;
}
.identity-help dt {
  font-weight: 700;
  margin-top: 12px;
}
.identity-help dd {
  margin: 4px 0;
}
.identity-reason {
  padding: 10px;
  background: #fff8e8;
  border-radius: 6px;
}
.identity-record {
  scroll-margin-top: 24px;
}
.identity-record:focus {
  outline: 2px solid #137f7c;
  outline-offset: 3px;
}

/* One comparison at a time. Source configuration stays below the daily task. */
.simple-matching {
  max-width: 1080px;
  margin: 0 auto;
}
.match-progress {
  padding: 12px 16px;
  background: #edf5f5;
  border-radius: 8px;
}
.match-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}
.match-card {
  border: 1px solid #ccdddd;
  border-radius: 12px;
  background: #fff;
  padding: 24px;
  min-width: 0;
}
.match-card h3 {
  font-size: 1.35rem;
  margin: 8px 0 24px;
  line-height: 1.5;
}
.match-card dl {
  display: grid;
  grid-template-columns: 3em 1fr;
  gap: 18px 12px;
}
.match-card dt {
  color: #536b78;
}
.match-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.match-card details {
  margin-top: 12px;
}
.match-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 24px 0 12px;
  flex-wrap: wrap;
}
.match-actions button {
  min-width: 180px;
  padding: 15px 24px;
  font-size: 1.05rem;
}
.match-evidence {
  text-align: center;
  color: #526e7b;
}
#match-notice:not(:empty) {
  background: #e6f5ee;
  padding: 14px;
  border-radius: 8px;
}
#match-error:not(:empty) {
  background: #fff0ef;
  color: #9f3535;
  padding: 16px;
  border-radius: 8px;
}
#match-error button {
  display: block;
  margin-top: 12px;
}
.eng-counts,
.eng-filters,
.eng-facts,
.eng-paging {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.eng-counts .active {
  background: #dff3f1;
  border-color: #147d7b;
  color: #155b59;
}
.eng-filters {
  margin: 24px 0 12px;
  align-items: end;
}
.eng-filters label {
  flex: 1;
  min-width: 220px;
}
.eng-filters select {
  max-width: 100%;
}
.eng-paging {
  justify-content: flex-end;
  margin: 16px 0;
}
.eng-facts .pill {
  white-space: normal;
}
.match-card label,
.eng-upload label,
[data-consult] label {
  display: block;
  margin: 14px 0;
}
.match-card select,
.match-card input,
.eng-filters select,
.eng-filters input,
.eng-upload input,
[data-consult] textarea {
  width: 100%;
}
.match-card select[size] {
  min-height: 130px;
}
.eng-secondary,
.eng-upload {
  margin: 24px 0;
  border-top: 1px solid #d9e3e8;
  padding: 20px 0;
}
.eng-secondary summary,
.eng-upload summary {
  cursor: pointer;
  font-weight: 600;
}
.eng-confirmed {
  padding: 14px;
  background: #edf6f4;
  border-left: 3px solid #147d7b;
  margin: 12px 0;
}
.eng-ai-settings {
  border-top: 1px solid #d9e3e8;
  margin-top: 16px;
  padding-top: 16px;
}
.eng-ai-settings summary {
  cursor: pointer;
  font-weight: 600;
}
.eng-ai-settings label {
  display: block;
  margin: 14px 0;
}
.eng-ai-settings input {
  display: block;
  width: 100%;
  max-width: 720px;
  margin-top: 6px;
}
.eng-ai-settings li {
  margin: 8px 0;
}
#eng-ai-progress:not(:empty) {
  padding: 12px;
  background: #edf6f4;
}
.eng-management {
  padding: 22px;
  border: 1px solid #d9e3e8;
  border-radius: 10px;
  margin-top: 18px;
  background: white;
}
#eng-error:not(:empty) {
  background: #fff0ef;
  color: #9f3535;
  padding: 16px;
  border-radius: 8px;
}
#eng-notice:not(:empty) {
  background: #e6f5ee;
  padding: 14px;
  border-radius: 8px;
}
.eng-history details {
  margin: 12px 0;
}
.eng-overview {
  margin-bottom: 20px;
}
.eng-overview .section-heading,
.eng-consult-status {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.eng-consult-status {
  margin: 18px 0;
}
.eng-summary-table td:first-child {
  min-width: 220px;
  max-width: 520px;
}
.eng-summary-table .pill {
  white-space: nowrap;
}
.pill.eng-yes {
  background: #dff3ea;
  color: #176847;
  font-weight: 600;
}
.eng-customer {
  padding: 22px;
  border: 1px solid #d9e3e8;
  border-radius: 10px;
  margin: 24px 0;
  background: white;
}
.eng-customer summary {
  font-weight: 600;
  cursor: pointer;
}
.eng-customer label {
  display: block;
  margin: 14px 0;
}
.eng-customer input:not([type="checkbox"]),
.eng-customer textarea {
  width: 100%;
}
.match-history,
#match-advanced {
  border-top: 1px solid #d9e3e8;
  padding: 18px 0;
  margin-top: 20px;
}
@media (max-width: 700px) {
  .match-pair {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .match-card {
    padding: 16px;
  }
  .match-actions button {
    min-width: 130px;
    flex: 1;
  }
}
/* Clinic directory: multi-service filter with any / all / only and a contract basis. */
.service-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.service-filter-label,
.service-options .option-label {
  font-size: 12px;
  color: var(--muted);
}
.service-chip {
  border-radius: 999px;
  padding: 8px 13px;
  white-space: nowrap;
}
.service-chip[data-dir-service="BRAIN"] {
  --chip-bg: var(--brain-bg);
  --chip-fg: var(--brain-fg);
}
.service-chip[data-dir-service="WeSmile"] {
  --chip-bg: var(--wesmile-bg);
  --chip-fg: var(--wesmile-fg);
}
.service-chip[data-dir-service="でんぐらむ"] {
  --chip-bg: var(--dengram-bg);
  --chip-fg: var(--dengram-fg);
}
.service-chip[data-dir-service="DXP"] {
  --chip-bg: var(--dxp-bg);
  --chip-fg: var(--dxp-fg);
}
.service-chip[aria-pressed="true"] {
  background: var(--chip-bg);
  color: var(--chip-fg);
  border-color: var(--chip-fg);
  font-weight: 650;
}
.service-chip[aria-pressed="true"]:hover {
  filter: brightness(0.96);
}
.service-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: -4px 0 12px;
}
.option-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.service-only-filter {
  margin: 0;
  padding: 7px 0;
  font-size: 13px;
  cursor: pointer;
}
.service-only-filter input {
  flex-shrink: 0;
  accent-color: var(--brand);
}
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid #cfdddd;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}
.segmented button {
  border: 0;
  border-radius: 0;
  padding: 7px 12px;
  font-size: 13px;
}
.segmented button + button {
  border-left: 1px solid #cfdddd;
}
.segmented button:focus-visible {
  outline-offset: -3px;
}
.segmented button[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
}
.service-filter-missing {
  margin: -6px 0 12px;
  font-size: 12px;
}
/* BRAIN chart business information, kept separate from confirmed CS fields. */
.brain-basic-shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.brain-basic-source + .brain-basic-source {
  border-top: 1px solid var(--line, #dbe6e8);
  padding-top: 20px;
  margin-top: 20px;
}
.brain-basic-meta {
  color: var(--muted, #6a8290);
  font-size: 12px;
}
.brain-basic-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  margin: 0;
}
.brain-basic-fields > div {
  padding: 12px 0;
  border-bottom: 1px solid var(--line, #dbe6e8);
  min-width: 0;
}
.brain-basic-fields .wide {
  grid-column: 1 / -1;
}
.brain-basic-fields dt {
  color: var(--muted, #6a8290);
  font-size: 12px;
  margin-bottom: 6px;
}
.brain-basic-fields dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
@media (max-width: 700px) {
  .brain-basic-fields {
    grid-template-columns: 1fr;
  }
}

/* Compare existing clinic records before a cross-service merge. */
.merge-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 16px 0;
}
.merge-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #f8fbfc;
  overflow-wrap: anywhere;
}
.merge-card h3 {
  margin-top: 0;
}
.merge-pair label {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.merge-pair select {
  width: 100%;
}
.merge-dialog {
  width: min(960px, 94vw);
  max-height: 90vh;
  overflow: auto;
}
.merge-confirm {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
}
.merge-confirm input {
  width: auto;
}
@media (max-width: 700px) {
  .merge-pair {
    grid-template-columns: 1fr;
  }
}

/* Recorded owners are evidence, independent of confirmed assignment changes. */
.assignment-current {
  display: flex;
  gap: 14px 30px;
  flex-wrap: wrap;
  padding: 8px 0 18px;
}
.assignment-current > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.assignment-person {
  border-top: 1px solid var(--line, #dbe6e8);
}
.assignment-person > summary {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(190px, 1fr) auto;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  padding: 14px 4px;
  list-style: none;
}
.assignment-person > summary > span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}
.assignment-period small,
.assignment-evidence small {
  display: block;
  color: var(--muted, #6a8290);
}
.assignment-evidence {
  list-style: none;
  padding: 0 12px 12px;
  margin: 0;
}
.assignment-evidence li {
  display: grid;
  grid-template-columns: 160px minmax(140px, 1fr) minmax(180px, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line, #dbe6e8);
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.assignment-changes,
.assignment-review {
  margin-top: 20px;
}
@media (max-width: 760px) {
  .assignment-person > summary,
  .assignment-evidence li {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}
/* 2026-09-27 UI review: pieces for the approved layout and wording changes. */
.pill.caution {
  background: #fff0db;
  color: #9a5300;
  border: 1px solid #f1c27d;
}
.pill.caution.strong {
  background: #ffe6da;
  color: #a23a12;
  border-color: #f0a37e;
}
.help {
  display: inline-block;
  position: relative;
  vertical-align: middle;
}
.help > summary {
  list-style: none;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #b9ccce;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.help > summary::-webkit-details-marker {
  display: none;
}
.help[open] > p {
  position: absolute;
  z-index: 20;
  top: 26px;
  left: 0;
  width: min(320px, 70vw);
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 6px 24px #173e4022;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.7;
  color: #34545d;
}
.section-head .help,
.section-heading .help {
  margin-right: auto;
}
.service-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin: 4px 0 18px;
}
.service-strip-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  align-content: start;
}
.service-strip-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.service-strip-head small {
  color: var(--muted);
}
.service-strip-item .text-button {
  justify-self: start;
  font-size: 12px;
}
.contract-period {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
}
.contract-period > small {
  color: var(--muted);
}
.contract-status {
  color: #1d5f4f;
  font-size: 13px;
}
.contract-period .warning-text {
  font-size: 13px;
}
.directory-service {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-height: 0;
}
.directory-service-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.directory-service-body .directory-owner {
  color: #34545d;
}
.clinic-area {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.checked-cell {
  white-space: nowrap;
}
.choice-chips {
  grid-column: 1 / -1;
  border: 0;
  padding: 0;
  margin: 13px 0 4px;
  min-width: 0;
}
.choice-chips legend {
  font-size: 12px;
  color: #5c737c;
  padding: 0;
  margin-bottom: 6px;
}
.choice-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.choice-chip {
  position: relative;
  margin: 0;
}
.choice-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.choice-chip span {
  display: inline-flex;
  border: 1px solid #cfdddd;
  border-radius: 999px;
  padding: 6px 14px;
  background: #fff;
  color: #34545d;
  font-size: 13px;
}
.choice-chip input:checked + span {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}
.choice-chip input:focus-visible + span {
  outline: 3px solid #47aaa3;
  outline-offset: 2px;
}
.fixed-choice {
  font-size: 13px;
  margin: 10px 0;
}
.fixed-choice strong {
  margin-right: 8px;
  color: #5c737c;
  font-weight: 500;
}
.field-notice {
  background: #eaf2fd;
  border: 1px solid #b9d0f3;
  color: #1a4f94;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  margin: 0 0 10px;
}
.current-summary {
  display: grid;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: #34545d;
  white-space: pre-wrap;
}
.current-summary strong {
  font-size: 11px;
  color: var(--muted);
}
.check-label.is-disabled {
  opacity: 0.5;
}
.editor-current {
  position: static;
}
.editor-current[hidden] {
  display: none;
}
.editor-current > details > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #235b60;
}
.editor-current > details[open] > summary {
  margin-bottom: 8px;
}
.action-brief {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.action-brief-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.action-brief-body > button {
  text-align: left;
  font-weight: 600;
}
.action-brief > .complete-button,
.complete-button {
  flex-shrink: 0;
  display: inline-flex;
  margin: 0;
  padding: 4px 10px;
  font-size: 12px;
  border-color: #acd3c7;
  color: var(--brand);
}
.complete-button:hover {
  background: #e7f3ef;
}
.cell-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}
.meeting-brief .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.meeting-done {
  font-size: 12px;
  padding: 5px 10px;
  border-color: var(--brand);
  color: var(--brand);
}
.service-nav {
  justify-content: space-between;
  align-items: center;
}
.service-nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.service-nav-tabs button.active {
  background: #e7f3ef;
  border-color: #acd3c7;
  color: var(--brand);
}
.service-subhead {
  margin: 18px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: #34545d;
}
.compact-facts > div {
  grid-template-columns: minmax(110px, 160px) minmax(0, 1fr);
  gap: 12px;
  padding: 6px 0;
}
.work-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.work-table th,
.work-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 13px;
}
.work-table th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  background: #f7fafa;
}
.work-table td:first-child {
  white-space: nowrap;
}
.work-table .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.work-service-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.work-service-chips .service-chip:not([data-dir-service]) {
  --chip-bg: #e7f3ef;
  --chip-fg: var(--brand);
}
.toast-action {
  margin-left: 14px;
  padding: 4px 12px;
  background: #fff;
  color: #214e48;
  border: 0;
  font-weight: 700;
}
.toast-action:hover {
  background: #e7f3ef;
}
.work-table .row-actions button,
.meeting-brief .row-actions button {
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.complete-button {
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.my-meetings {
  max-width: 1160px;
  margin: 0 auto;
}
.my-meetings > section,
.my-meetings > details {
  background: #fff;
  border: 1px solid #dce6e9;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
}
.my-meeting-table td {
  vertical-align: top;
  padding: 18px 16px;
}
.my-meeting-table small {
  display: block;
  margin-top: 6px;
  color: #587178;
}
.calendar-connection {
  border-left: 4px solid #167b7f !important;
}
.calendar-event {
  border: 1px solid #d9e4e7;
  border-radius: 12px;
  padding: 22px;
  margin-top: 18px;
}
.calendar-event h4 {
  font-size: 17px;
  margin: 0;
}
.calendar-event p {
  line-height: 1.7;
}
.calendar-event .pill {
  white-space: nowrap;
}
.calendar-ai,
.calendar-saved {
  padding: 14px 16px;
  background: #eff7f7;
  border-radius: 9px;
}
.calendar-ai p {
  margin: 6px 0;
}
.calendar-ai small {
  color: #52666b;
}
.calendar-share-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.calendar-share-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}
.calendar-share-form input,
.calendar-share-form select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.calendar-form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
.calendar-form-error {
  color: #a83c26;
  margin: 0;
}
.calendar-other > summary {
  font-weight: 650;
  cursor: pointer;
}
.my-meetings [data-calendar-message] {
  color: #12666a;
  font-weight: 600;
}
@media (max-width: 700px) {
  .calendar-form-grid {
    grid-template-columns: 1fr;
  }
  .my-meetings > section {
    padding: 16px;
  }
  .calendar-event {
    padding: 14px;
  }
  .calendar-event .section-head {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }
}
.assignment-candidates {
  margin-top: 24px;
  padding: 18px;
  background: #f5f9fa;
  border: 1px solid #dce6e9;
  border-radius: 12px;
}
.assignment-candidates > summary {
  font-weight: 650;
  cursor: pointer;
}
.assignment-candidates .table-wrap {
  max-height: 440px;
  overflow: auto;
  margin: 14px 0;
}
.assignment-candidates input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #167b7f;
}
/* 2026-09-28 UI review (round 2). */
.pill.ok,
.pill.positive {
  background: #e3f4ea;
  color: #1d7a4b;
}
/* Header: open any clinic by name. */
.header-search {
  position: relative;
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-search input {
  flex: 1;
  min-width: 0;
}
.header-search kbd {
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
}
.header-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px #122c4926;
  padding: 6px;
  display: grid;
  gap: 2px;
}
.header-results p {
  margin: 8px 10px;
}
.header-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 8px 10px;
  border-radius: 7px;
}
.header-result:hover,
.header-result:focus-visible {
  background: #eef5f4;
}
.header-result small {
  color: var(--muted);
  white-space: nowrap;
}
.auth-screen .header-search {
  display: none;
}
/* Directory: labels never break inside a word; MTG time and owner stay visible. */
.clinic-table .pill {
  white-space: nowrap;
}
.meeting-compact {
  margin: 4px 0 8px;
}
.meeting-compact small {
  display: block;
  color: #587178;
}
/* Personal work page. */
.my-work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.my-work-block {
  background: #fff;
  border: 1px solid #dce6e9;
  border-radius: 14px;
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 10px;
}
.my-work-block .section-head {
  margin: 0;
}
.my-work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.my-work-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef3f4;
}
.my-work-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.my-work-when {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.my-work-what {
  flex: 1 1 200px;
}
.my-work-list small {
  color: #587178;
}
.my-work-actions {
  margin-left: auto;
}
.my-meeting-table .cell-tags {
  margin-top: 6px;
}
.my-meeting-table .actions-cell {
  white-space: nowrap;
}
.my-work-block > .text-button {
  justify-self: start;
}
/* Calendar status on one line once connected. */
.calendar-connection.compact {
  padding: 16px 24px;
}
.calendar-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.calendar-status-line h3 {
  margin: 0;
}
.calendar-settings {
  margin-top: 10px;
}
.calendar-settings > summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 600;
}
/* Candidate cards: two lines, the form opens only when needed. */
.calendar-event {
  padding: 16px 18px;
  margin-top: 12px;
}
.calendar-event-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}
.calendar-event-when {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.calendar-event-status {
  color: #93672c;
  font-weight: 600;
  margin: 6px 0 0;
}
.calendar-event .calendar-ai {
  margin: 8px 0 0;
  padding: 8px 12px;
}
.calendar-event-actions {
  margin-top: 10px;
}
/* The Google part of the MTG form, and deleting at the bottom. */
.google-option {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f9f9;
  padding: 12px 14px;
  margin-top: 14px;
}
.google-meeting-fields {
  margin-top: 8px;
}
.editor-danger {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  border-top: 1px dashed var(--line);
  margin-top: 18px;
  padding-top: 12px;
}
.editor-danger .text-button {
  color: var(--danger);
}
.editor-danger small {
  color: var(--muted);
}
/* Calendar editor: the saved MTG is one line and never covers the fields. */
.calendar-current {
  position: static;
  padding: 10px 14px;
  margin: 12px 0;
}
.calendar-time-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.clinic-picker form {
  display: grid;
  gap: 12px;
}
.clinic-picker label {
  display: grid;
  gap: 6px;
}
/* Contracts: one line each; details on demand. */
.contract-summary > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  cursor: pointer;
  list-style: none;
}
.contract-summary > summary::-webkit-details-marker {
  display: none;
}
.contract-more {
  margin-left: auto;
  color: var(--brand);
  font-size: 13px;
}
.contract-summary[open] .contract-more {
  display: none;
}
.contract-summary[open] > summary {
  margin-bottom: 8px;
}
.ai-connection {
  margin-bottom: 18px;
}
/* 2026-09-28 UI review (round 3). */
/* 閉じる keeps the draft; discarding it is a quiet link after the buttons. */
.dialog-actions .discard-draft {
  margin-left: auto;
  color: #a7332d;
  font-size: 13px;
}
/* The sales-contact tick sits right under the record type. */
.sales-contact-line .form-grid {
  margin-top: -4px;
}
[data-same-meeting-title] {
  margin: 0 0 12px;
  font-size: 13px;
}
/* Tabs without a second row (状況 etc.) keep their distance from the content. */
.detail-primary + #detail-content {
  padding-top: 18px;
}
/* Held MTGs waiting for a record span the whole dashboard. */
.my-work-record {
  grid-column: 1 / -1;
  border-color: #f1c27d;
  background: #fffaf2;
  scroll-margin-top: 90px;
}
#app .my-meeting-table .overdue-link {
  display: block;
  color: #9a5300;
  font-size: 13px;
  text-align: left;
}
.header-results .header-results-label {
  margin: 4px 10px 2px;
  font-size: 12px;
  color: var(--muted);
}
/* Reference table, folded like a section card. */
.staff-role-guide {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 16px 22px;
  margin-bottom: 18px;
}
.staff-role-guide > summary {
  cursor: pointer;
  font-weight: 700;
}
.staff-role-guide[open] > summary {
  margin-bottom: 12px;
}
/* The per-business memo stays small: two lines to type, one quiet line to read. */
textarea.compact-memo {
  min-height: 0;
}
.service-memo {
  margin: 2px 0 10px;
  font-size: 13px;
  color: #56696f;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.service-memo span {
  margin-right: 8px;
  font-weight: 700;
  color: #34545d;
}

.membership-derived {
  border-left: 3px solid #167e7a;
  padding: 4px 16px;
  margin: 16px 0 24px;
  background: #f4faf9;
}
.membership-derived blockquote {
  margin: 8px 0;
  white-space: pre-wrap;
}
.membership-derived-periods {
  padding-left: 24px;
}
.membership-derived-periods li {
  padding: 8px 0;
}
.membership-derived-periods small {
  display: block;
  margin-top: 4px;
  color: #56696f;
}
/* Clinic register: all operational fields on the clinic's first page. */
.clinic-register {
  margin: 18px 0 24px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: white;
  padding: 20px;
}
.register-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  margin-bottom: 16px;
}
.register-heading h3 {
  margin: 0 0 6px;
}
.register-heading p {
  margin: 0;
}
.register-info-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
}
.register-info-grid section {
  min-width: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  border: 0;
}
.register-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
  margin: 0;
}
.register-facts div {
  min-width: 0;
}
.register-facts div:last-child {
  grid-column: 1 / -1;
}
.register-facts dt {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}
.register-facts dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.register-contracts {
  margin-top: 22px;
  padding: 0;
  border: 0;
  box-shadow: none;
}
.register-table-wrap {
  overflow-x: auto;
}
.register-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.register-table th,
.register-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}
.register-table thead {
  background: #f8fafc;
  color: #475569;
}
.register-table th[scope="row"] {
  min-width: 120px;
}
.register-table small {
  display: block;
  color: #64748b;
  font-size: 11px;
}
.register-availability {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.register-status {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  background: #f1f5f9;
  white-space: nowrap;
}
.register-status-active {
  background: #dcfce7;
  color: #166534;
}
.register-status-planned {
  background: #eff6ff;
  color: #1e40af;
}
.register-status-ended {
  background: #f3f4f6;
  color: #6b7280;
}
.register-editor {
  width: min(640px, calc(100vw - 32px));
}
.register-editor .check-label {
  flex-wrap: wrap;
}
.register-import {
  margin-top: 24px;
}
.register-import form {
  margin: 16px 0;
}
.register-import [hidden] {
  display: none !important;
}
.register-mapping {
  margin: 14px 0;
}
.register-mapping .form-grid {
  margin: 14px 0;
  max-height: 450px;
  overflow: auto;
}
@media (max-width: 760px) {
  .clinic-register {
    padding: 14px;
  }
  .register-heading {
    display: block;
  }
  .register-info-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .register-facts {
    gap: 12px;
  }
  .register-table {
    min-width: 700px;
  }
}
