.anatomy-standalone,
.anatomy-v2-page {
  color: #28344b;
  font-family: "Open Sans", Arial, sans-serif;
}

.anatomy-standalone {
  min-height: 100vh;
  padding: 48px 3% 20px;
  background: #f1f2f6;
}

.anatomy-loading,
.anatomy-v2-loading,
.anatomy-v2-error {
  padding: 30px;
  color: #40506c;
}

.anatomy-standalone-fields {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 1.15fr .46fr 1.36fr;
  gap: 13px;
  padding: 19px 30px 24px;
  border-radius: 12px 12px 0 0;
  background: #fff;
  box-shadow: 0 3px 13px #253b5d12;
}

.anatomy-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.anatomy-field b { color: #ef5262; }

.anatomy-field select,
.anatomy-field textarea,
.anatomy-search-panel input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  border: 1px solid #d9dce5;
  border-radius: 3px;
  background: #fff;
  color: #323e57;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
}

.anatomy-field select { height: 33px; padding: 0 10px; }
.anatomy-field select:disabled { background: #f4f5f7; color: #a2a9b5; }
.anatomy-field textarea { min-height: 75px; padding: 8px 10px; resize: vertical; }
.anatomy-field select:focus-visible,
.anatomy-field textarea:focus-visible,
.anatomy-search-panel input:focus-visible,
.anatomy-standalone button:focus-visible,
.anatomy-v2-page button:focus-visible,
.anatomy-map-part:focus-visible { outline: 2px solid #3e6bff; outline-offset: 1px; }

.anatomy-patient-strip {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 12px;
  margin-top: 6px;
  padding: 13px 30px;
  min-height: 121px;
  background: linear-gradient(109deg, #6836ff 15%, #339ff7 81%);
  box-shadow: 0 4px 12px #5349a026;
  color: white;
  font-size: 16px;
}
.anatomy-patient-strip > div { display: flex; flex-direction: column; gap: 2px; }

.anatomy-workspace {
  display: grid;
  grid-template-columns: 20% minmax(0, 51%) minmax(300px, 29%);
  gap: 7px;
  min-height: 605px;
  margin-top: 7px;
}
.anatomy-workspace.search-closed { grid-template-columns: 20% minmax(0, 1fr); }
.anatomy-body-panel,
.anatomy-detail-panel,
.anatomy-search-panel { min-width: 0; background: white; }
.anatomy-body-panel { display: flex; justify-content: center; padding: 45px 12px 22px; }
.anatomy-body-map { width: min(100%, 260px); height: 600px; overflow: visible; }
.anatomy-body-map .anatomy-map-part,
.anatomy-body-map .anatomy-map-static { fill: #36a8dc; stroke: #fff; stroke-width: 3; }
.anatomy-body-map .anatomy-map-part { cursor: pointer; transition: fill .15s; }
.anatomy-body-map .anatomy-map-part:hover { fill: #228dc7; }
.anatomy-body-map .anatomy-map-marker { fill: #f22c26; stroke: #aa2232; stroke-width: 1; }
.anatomy-detail-panel { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.anatomy-empty-detail { width: 100%; min-height: 100%; }
.anatomy-mouth-diagram { display: block; width: 100%; max-width: 850px; min-height: 450px; }
.anatomy-mouth-leader line { stroke: #6b5276; stroke-width: 1.8; }
.anatomy-mouth-leader text { fill: #2d2d39; font-size: 13px; font-family: Arial, sans-serif; }
.anatomy-synthetic-detail { max-width: 580px; padding: 30px; font-size: 14px; line-height: 1.7; }
.anatomy-detail-orbit {
  display: grid; place-items: center; width: 180px; height: 180px; margin: 0 auto 22px;
  border: 16px solid #e5f6ff; border-radius: 50%;
  background: #36a8dc; color: white; font-size: 22px; font-weight: 700;
}
.anatomy-synthetic-detail h2 { text-align: center; }
.anatomy-synthetic-detail ul { padding-left: 22px; }
.anatomy-search-panel { padding: 17px 20px; }
.anatomy-search-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.anatomy-search-heading strong { font-size: 16px; }
.anatomy-search-heading > div { display: flex; gap: 4px; }
.anatomy-search-heading button {
  width: 26px; height: 25px; border: 0; background: transparent;
  color: #141821; font-size: 24px; line-height: 20px; cursor: pointer;
}
#anatomy-search-form { display: flex; }
#anatomy-search-form input { height: 32px; padding: 0 10px; }
#anatomy-search-form button {
  width: 33px; flex: 0 0 33px; border: 1px solid #d9dce5; border-left: 0;
  background: #fff; color: #8c94a2; font-size: 21px; cursor: pointer;
}
.anatomy-search-results { max-height: 510px; overflow: auto; padding-top: 12px; }
.anatomy-search-results p { color: #7f8ba0; font-size: 13px; }
.anatomy-search-results button {
  display: flex; flex-direction: column; gap: 3px; width: 100%;
  border: 0; border-bottom: 1px solid #e7eaf0; padding: 10px 3px;
  background: transparent; text-align: left; color: #2e3a50; cursor: pointer;
}
.anatomy-search-results button:hover { background: #f3f9fc; }
.anatomy-search-results small { color: #7a8495; }
.anatomy-reopen-search { margin-top: 8px; border: 0; background: #1973cb; color: #fff; padding: 8px 12px; cursor: pointer; }
.anatomy-local-note { margin: 13px 2px; color: #6e7b8c; font-size: 12px; }

.anatomy-v2-page { padding: 8px 28px 28px 0; }
.anatomy-v2-form { border: 0; border-bottom: 1px solid #e2e5eb; margin: 0 0 14px; padding: 0 0 20px; }
.anatomy-v2-form h2 {
  margin: 0 0 15px; font-size: 16px; font-weight: 600; line-height: 1.4;
}
.anatomy-v2-grid {
  display: grid;
  grid-template-columns: minmax(145px,1.25fr) minmax(145px,1.25fr)
    minmax(145px,1.25fr) minmax(90px,.6fr) minmax(125px,1.25fr)
    minmax(180px,1.25fr) 34px;
  align-items: start; gap: 8px;
}
.anatomy-v2-grid .anatomy-field { font-size: 13px; }
.anatomy-v2-grid .anatomy-field > span { min-height: 23px; }
.anatomy-v2-grid select { height: 33px; }
.anatomy-multi { position: relative; font-size: 13px; }
.anatomy-multi summary {
  min-height: 33px; padding: 7px 25px 6px 10px; border: 1px solid #d9d9d9;
  border-radius: 2px; background: #fff; color: #303642; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.anatomy-multi summary:focus-visible { outline: 2px solid #3e6bff; outline-offset: 1px; }
.anatomy-multi[data-empty="true"] summary { color: #a2a9b5; background: #f4f5f7; }
.anatomy-multi-options {
  position: absolute; z-index: 15; top: calc(100% + 2px); left: 0;
  min-width: 100%; max-height: 180px; overflow: auto; padding: 5px 0;
  border: 1px solid #d9d9d9; border-radius: 2px; background: #fff;
  box-shadow: 0 3px 8px #26334924;
}
.anatomy-multi-options label { display: flex; align-items: center; gap: 8px; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.anatomy-multi-options label:hover { background: #f3f8fd; }
.anatomy-multi-options input { accent-color: #0663ba; }
.anatomy-multi-options > span { display: block; padding: 5px 10px; color: #798697; }
.anatomy-save {
  display: grid; place-items: center; width: 33px; height: 33px; margin-top: 30px;
  border: 0; border-radius: 2px; background: #0663ba; color: white; cursor: pointer;
}
.anatomy-save:hover { background: #004f9b; }
.anatomy-save:disabled { opacity: .55; cursor: wait; }
.anatomy-save svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.anatomy-v2-added h2 { margin: 0 0 14px; font-size: 16px; text-align: center; font-weight: 500; }
.anatomy-v2-note { margin: 0 0 14px; color: #6e7b8c; font-size: 12px; text-align: center; }
.anatomy-v2-table-wrap { width: 100%; overflow-x: auto; background: #fff; }
.anatomy-v2-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.anatomy-v2-table-wrap th,
.anatomy-v2-table-wrap td { border-bottom: 1px solid #edf0f4; padding: 10px 12px; text-align: left; vertical-align: top; }
.anatomy-v2-table-wrap th { background: #f9fafc; font-weight: 600; white-space: nowrap; }
.anatomy-v2-table-wrap td:nth-child(6) { min-width: 180px; max-width: 280px; overflow-wrap: anywhere; }
.anatomy-v2-table-wrap td button { border: 1px solid #d2d8e3; border-radius: 4px; padding: 4px 9px; background: #fff; cursor: pointer; }
.anatomy-v2-table-wrap td button:hover { background: #f3f6fa; }
.anatomy-v2-empty { text-align: center !important; color: #778394; }
.anatomy-v2-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 11px; font-size: 12px; }
.anatomy-v2-pager button { border: 1px solid #d4dce8; border-radius: 4px; padding: 6px 10px; background: #fff; cursor: pointer; }
.anatomy-v2-pager button:disabled { opacity: .5; cursor: default; }

@media (max-width: 1120px) {
  .anatomy-standalone-fields { grid-template-columns: repeat(3,minmax(150px,1fr)); }
  .anatomy-workspace { grid-template-columns: 22% minmax(0, 1fr); }
  .anatomy-search-panel { grid-column: 1 / -1; }
  .anatomy-v2-grid { grid-template-columns: repeat(3,minmax(150px,1fr)); }
  .anatomy-save { margin-top: 30px; }
}
@media (max-width: 650px) {
  .anatomy-standalone { padding: 12px 8px; }
  .anatomy-standalone-fields { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 15px; }
  .anatomy-patient-strip { grid-template-columns: 1fr; padding: 15px; font-size: 13px; }
  .anatomy-workspace,.anatomy-workspace.search-closed { display: flex; flex-direction: column; }
  .anatomy-body-panel { padding-top: 15px; max-height: 340px; overflow: hidden; }
  .anatomy-body-map { width: 170px; }
  .anatomy-detail-panel { min-height: 300px; }
  .anatomy-mouth-diagram { min-height: 270px; }
  .anatomy-mouth-leader text { font-size: 10px; }
  .anatomy-v2-page { padding: 0 8px 20px; }
  .anatomy-v2-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .anatomy-diagnosis { grid-column: 1 / -1; }
}
