/*
  BMHA Organization Chart
  ใช้กับหน้า About/about1.php
  จุดสำคัญ: ส่วนอธิบดี -> รองอธิบดี -> ผอ. -> รอง ผอ. จัดกลางด้วย 3 คอลัมน์
  โดยมี spacer ซ้ายถ่วงน้ำหนักให้เท่ากับ panel ที่ปรึกษาขวา
*/

.bmha-org-chart-card {
  overflow: hidden;
}

.bmha-org-modern {
  position: relative;
  margin-top: 22px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(66, 143, 157, 0.18);
  background:
    radial-gradient(circle at 8% 8%, rgba(244, 180, 45, 0.14), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(70, 183, 198, 0.14), transparent 30%),
    linear-gradient(180deg, #f9fcfd 0%, #eef8fa 100%);
}

.bmha-org-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  padding: 12px 14px;
  border: 1px dashed rgba(38, 105, 122, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.bmha-org-toolbar--tools-only {
  justify-content: flex-end;
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  background: transparent;
}

.bmha-org-note {
  font-size: 0.9rem;
  color: #4f6d7a;
  line-height: 1.55;
}

.bmha-org-note strong {
  color: #073d58;
}

.bmha-org-tool-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bmha-org-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: #2f6677;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(33, 86, 101, 0.16);
  transition: transform 0.18s ease, background 0.18s ease;
}

.bmha-org-tool-btn:hover {
  background: #255464;
  transform: translateY(-1px);
}

/* ===== Toggle switch: เปิด/ปิดทุกกลุ่ม ===== */
.bmha-org-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.bmha-org-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bmha-org-switch-track {
  position: relative;
  width: 58px;
  height: 30px;
  flex: 0 0 58px;
  border-radius: 999px;
  background: #dbe8ed;
  border: 1px solid rgba(47, 102, 119, 0.18);
  box-shadow: inset 0 2px 5px rgba(20, 64, 78, 0.12);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.bmha-org-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(20, 64, 78, 0.22);
  transition: transform 0.18s ease;
}

.bmha-org-switch input:checked+.bmha-org-switch-track {
  background: #2f6677;
  box-shadow: inset 0 2px 5px rgba(20, 64, 78, 0.16), 0 8px 18px rgba(47, 102, 119, 0.18);
}

.bmha-org-switch input:checked+.bmha-org-switch-track .bmha-org-switch-thumb {
  transform: translateX(28px);
}

.bmha-org-switch-label {
  color: #073d58;
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

.bmha-org-switch input:focus-visible+.bmha-org-switch-track {
  outline: 3px solid rgba(63, 164, 185, 0.25);
  outline-offset: 3px;
}

/* ===== ส่วนบนของผัง: แก้ปัญหาอธิบดี/รอง/ผอ. เอียง ===== */
.bmha-org-top-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(420px, 560px) minmax(250px, 320px);
  gap: 24px;
  align-items: start;
  justify-content: center;
  margin-top: 8px;
  margin-bottom: 0;
}

.bmha-org-top-spacer {
  min-height: 1px;
}

.bmha-org-main-chain {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  justify-content: center;
  justify-self: center;
  align-self: center;
  transform: translateY(28px);
}

.bmha-org-chain-list {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bmha-org-person-card {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #d5e8ee;
  box-shadow: 0 12px 28px rgba(24, 72, 86, 0.08);
}

.bmha-org-person-card--green {
  border-color: #94d1bf;
  background: linear-gradient(180deg, #f5fffb 0%, #edf9f5 100%);
}

.bmha-org-person-card--teal {
  border-color: #8bd5dc;
  background: linear-gradient(180deg, #f3feff 0%, #eefbfd 100%);
}

.bmha-org-person-card--blue {
  border-color: #9bcaf1;
  background: linear-gradient(180deg, #f4fbff 0%, #eef7fe 100%);
}

.bmha-org-person-card--violet {
  border-color: #c4c6f4;
  background: linear-gradient(180deg, #fbfaff 0%, #f3f3fe 100%);
}

.bmha-org-person-text {
  min-width: 0;
}

.bmha-org-person-role {
  margin: 0 0 2px;
  color: #0b7288;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
}

.bmha-org-person-name {
  margin: 0;
  color: #073d58;
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.35;
}

.bmha-org-person-position {
  margin: 2px 0 0;
  color: #5c7683;
  font-size: 0.84rem;
  line-height: 1.35;
}

.bmha-org-chain-line {
  position: relative;
  width: 2px;
  height: 50px;
  background: #8fd3de;
}

.bmha-org-chain-line::before,
.bmha-org-chain-line::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: #3fa4b9;
  box-shadow: 0 0 0 4px rgba(63, 164, 185, 0.12);
}

.bmha-org-chain-line::before {
  top: -3px;
}

.bmha-org-chain-line::after {
  bottom: -3px;
}

.bmha-org-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #5da5b5 0%, #2c7f92 100%);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 6px 15px rgba(35, 99, 115, 0.16);
}

.bmha-org-avatar--main {
  width: 68px;
  height: 68px;
  flex-basis: 68px;
}

.bmha-org-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== ที่ปรึกษากรม: แยกออกจากสายบังคับบัญชาหลัก ===== */
.bmha-org-advisors {
  width: 100%;
  max-width: 320px;
  justify-self: end;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(52, 123, 140, 0.18);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(24, 72, 86, 0.08);
}

.bmha-org-advisors-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(40, 105, 122, 0.24);
}

.bmha-org-advisors-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #0e7b8e;
  background: #e9f8fa;
}

.bmha-org-advisors h3 {
  margin: 0;
  color: #073d58;
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.3;
}

.bmha-org-advisors p {
  margin: 2px 0 0;
}

.bmha-org-advisors-head p {
  color: #6f8490;
  font-size: 0.84rem;
}

.bmha-org-advisor-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bmha-org-advisor-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(40, 105, 122, 0.24);
}

.bmha-org-advisor-section-title {
  margin: 0 0 10px;
  color: #073d58;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
}

.bmha-org-advisor-item--bureau {
  background: #fff8e8;
  border-color: rgba(223, 155, 40, 0.28);
}

.bmha-org-advisor-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: 15px;
  border: 1px solid #dcecf0;
  background: #f8fcfd;
}

.bmha-org-advisor-name {
  color: #073d58;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
}

.bmha-org-advisor-position {
  color: #6b818c;
  font-size: 0.8rem;
  line-height: 1.35;
}

/* ===== รองผู้อำนวยการสำนัก 5 คน: อยู่ระดับเดียวกัน ===== */
.bmha-org-deputy-directors {
  position: relative;
  margin-top: 0;
  padding-top: 84px;
  /* จุดนี้คือระยะจาก ผอ. ลงมาถึงเส้นแนวนอนของรอง ผอ. */
}

.bmha-org-deputy-trunk {
  position: absolute;
  left: 50%;
  top: -104px;
  /* fallback: JS จะคำนวณใหม่ให้ชนเส้นด้านบนแบบพอดี */
  width: 2px;
  height: 188px;
  /* fallback: JS จะคำนวณใหม่ให้ชนเส้นด้านบนแบบพอดี */
  transform: translateX(-50%);
  background: #9fc7d4;
  z-index: 0;
}

.bmha-org-deputy-trunk::before,
.bmha-org-deputy-trunk::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: #3fa4b9;
  box-shadow: 0 0 0 4px rgba(63, 164, 185, 0.13);
}

.bmha-org-deputy-trunk::before {
  top: -5px;
}

.bmha-org-deputy-trunk::after {
  bottom: -5px;
}

.bmha-org-deputy-head {
  position: absolute;
  left: 0;
  right: 0;
  top: 38px;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.bmha-org-deputy-head h3 {
  margin: 0;
  color: #073d58;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
}

.bmha-org-deputy-head p {
  margin: 0;
  color: #5c7683;
  font-size: 0.86rem;
  text-align: right;
}

.bmha-org-deputy-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  width: 100%;
  padding-top: 18px;
}

.bmha-org-deputy-grid::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: #9fc7d4;
}

.bmha-org-deputy-card {
  position: relative;
}

.bmha-org-deputy-card::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -18px;
  width: 2px;
  height: 18px;
  transform: translateX(-50%);
  background: #9fc7d4;
}

.bmha-org-deputy-card .bmha-org-person-card {
  max-width: none;
  height: 100%;
  align-items: flex-start;
  border-radius: 18px;
  padding: 14px;
}

.bmha-org-deputy-card .bmha-org-avatar--main {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
}

.bmha-org-deputy-card .bmha-org-person-role {
  font-size: 0.72rem;
}

.bmha-org-deputy-card .bmha-org-person-name {
  font-size: 0.94rem;
}

.bmha-org-deputy-card .bmha-org-person-position {
  font-size: 0.78rem;
}

/* ===== กลุ่มภารกิจ 1-6: ระดับเดียวกัน ===== */
.bmha-org-units {
  position: relative;
  margin-top: 0;
}

.bmha-org-branch {
  position: relative;
  height: 52px;
  margin: 0 2%;
}

.bmha-org-branch::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 52px;
  transform: translateX(-50%);
  background: #9fc7d4;
}

.bmha-org-branch::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #9fc7d4;
}

.bmha-org-branch span {
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: #3fa4b9;
  box-shadow: 0 0 0 4px rgba(63, 164, 185, 0.13);
}

.bmha-org-units-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.bmha-org-kicker {
  display: inline-block;
  margin-bottom: 3px;
  color: #d09620;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bmha-org-units-head h3 {
  margin: 0;
  color: #073d58;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.35;
}

.bmha-org-units-head p {
  max-width: 460px;
  margin: 0;
  color: #5c7683;
  font-size: 0.86rem;
  text-align: right;
}

.bmha-org-groups-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.bmha-org-group-card {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(44, 112, 129, 0.14);
  background: #fff;
  box-shadow: 0 12px 28px rgba(24, 72, 86, 0.08);
  overflow: hidden;
}

.bmha-org-group-card::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -17px;
  width: 2px;
  height: 17px;
  transform: translateX(-50%);
  background: #9fc7d4;
}

.bmha-org-group-card summary {
  list-style: none;
}

.bmha-org-group-card summary::-webkit-details-marker {
  display: none;
}

.bmha-org-group-summary {
  cursor: pointer;
  padding: 12px;
}

.bmha-org-group-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 9px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(44, 112, 129, 0.14);
}

.bmha-org-group-no {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  background: var(--org-accent, #3b9fb4);
  box-shadow: 0 8px 18px rgba(24, 72, 86, 0.13);
}

.bmha-org-group-label {
  display: block;
  margin-bottom: 2px;
  color: var(--org-accent, #3b9fb4);
  font-size: 0.72rem;
  font-weight: 800;
}

.bmha-org-group-head h4 {
  margin: 0;
  color: #073d58;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
}

.bmha-org-chevron {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--org-accent, #3b9fb4);
  background: var(--org-soft, #eaf8fb);
  transition: transform 0.2s ease;
}

.bmha-org-group-card[open] .bmha-org-chevron {
  transform: rotate(180deg);
}

.bmha-org-group-roles {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 11px;
}

.bmha-org-role-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border-radius: 14px;
  background: var(--org-soft, #eef9fb);
}

.bmha-org-role-text {
  min-width: 0;
}

.bmha-org-role-label {
  margin: 0 0 2px;
  color: var(--org-accent, #3b9fb4);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
}

.bmha-org-role-name,
.bmha-org-member-name {
  margin: 0;
  color: #073d58;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.3;
}

.bmha-org-role-position,
.bmha-org-member-position {
  margin: 2px 0 0;
  color: #6c818b;
  font-size: 0.74rem;
  line-height: 1.28;
}

.bmha-org-group-toggle-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(44, 112, 129, 0.12);
  color: #526f7b;
  font-size: 0.8rem;
  font-weight: 700;
}

.bmha-org-group-toggle-hint strong {
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--org-accent, #3b9fb4);
  background: var(--org-soft, #eaf8fb);
  font-size: 0.76rem;
}

.bmha-org-member-list {
  padding: 0 12px 13px;
  background: #fff;
}

.bmha-org-member-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px dashed rgba(44, 112, 129, 0.14);
}

.bmha-org-empty {
  margin: 10px 0 0;
  color: #7c9099;
  font-size: 0.84rem;
}

.bmha-org-footnote {
  width: fit-content;
  max-width: 100%;
  margin: 18px auto 0;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid #c6dce4;
  background: rgba(255, 255, 255, 0.72);
  color: #5d7580;
  font-size: 0.88rem;
  text-align: center;
}

.bmha-org-footnote i {
  color: #2c7f92;
  margin-right: 6px;
}

.bmha-org-group-card--purple {
  --org-accent: #7d62cf;
  --org-soft: #f1ecff;
  border-color: rgba(125, 98, 207, 0.36);
}

.bmha-org-group-card--green {
  --org-accent: #31a878;
  --org-soft: #ecfbf3;
  border-color: rgba(49, 168, 120, 0.36);
}

.bmha-org-group-card--blue {
  --org-accent: #318cc4;
  --org-soft: #eef8ff;
  border-color: rgba(49, 140, 196, 0.34);
}

.bmha-org-group-card--orange {
  --org-accent: #df9b28;
  --org-soft: #fff7e8;
  border-color: rgba(223, 155, 40, 0.36);
}

.bmha-org-group-card--pink {
  --org-accent: #d26291;
  --org-soft: #fff0f6;
  border-color: rgba(210, 98, 145, 0.34);
}

.bmha-org-group-card--cyan {
  --org-accent: #26a1b1;
  --org-soft: #ecfbfd;
  border-color: rgba(38, 161, 177, 0.34);
}

@media (max-width: 1399.98px) {
  .bmha-org-groups-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bmha-org-branch {
    margin: 0 4%;
  }
}

@media (max-width: 1199.98px) {
  .bmha-org-deputy-directors {
    padding-top: 24px;
  }

  .bmha-org-deputy-trunk,
  .bmha-org-deputy-grid::before,
  .bmha-org-deputy-card::before {
    display: none;
  }

  .bmha-org-deputy-head {
    position: static;
    margin-bottom: 12px;
    pointer-events: auto;
  }

  .bmha-org-deputy-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 0;
  }

  .bmha-org-top-layout {
    grid-template-columns: 1fr;
  }

  .bmha-org-top-spacer {
    display: none;
  }

  .bmha-org-main-chain,
  .bmha-org-advisors {
    justify-self: center;
  }

  .bmha-org-advisors {
    max-width: 560px;
  }

  .bmha-org-branch {
    display: none;
  }

  .bmha-org-units {
    margin-top: 24px;
  }
}

@media (max-width: 991.98px) {

  .bmha-org-toolbar,
  .bmha-org-units-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .bmha-org-units-head p {
    text-align: left;
  }

  .bmha-org-groups-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .bmha-org-deputy-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .bmha-org-deputy-head p {
    text-align: left;
  }

  .bmha-org-deputy-grid {
    grid-template-columns: 1fr;
  }

  .bmha-org-modern {
    padding: 14px;
    border-radius: 20px;
  }

  .bmha-org-toolbar {
    border-radius: 16px;
  }

  .bmha-org-person-card {
    align-items: flex-start;
    border-radius: 20px;
  }

  .bmha-org-groups-grid {
    grid-template-columns: 1fr;
  }

  .bmha-org-footnote {
    border-radius: 18px;
  }
}


/* ===== Fullscreen org chart: ปุ่มขยายผังเต็มจอ ===== */
button.bmha-document-action.bmha-org-fullscreen-trigger {
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.bmha-org-fullscreen-trigger i {
  transition: transform 0.18s ease;
}

.bmha-org-fullscreen-trigger:hover i {
  transform: scale(1.05);
}

.bmha-org-chart-card:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  padding: 24px 30px 30px;
  border-radius: 0;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.bmha-org-chart-card:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  padding: 24px 30px 30px;
  border-radius: 0;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.bmha-org-chart-card:fullscreen .bmha-document-card-head,
.bmha-org-chart-card:-webkit-full-screen .bmha-document-card-head,
.bmha-org-chart-card.bmha-org-card-expanded .bmha-document-card-head {
  position: relative;
  top: auto;
  z-index: 50;
  flex: 0 0 auto;
  margin: -24px -30px 18px;
  padding: 20px 30px 16px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(48, 108, 124, 0.12);
  backdrop-filter: blur(12px);
}

.bmha-org-chart-card:fullscreen .bmha-org-modern,
.bmha-org-chart-card:-webkit-full-screen .bmha-org-modern,
.bmha-org-chart-card.bmha-org-card-expanded .bmha-org-modern {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding-bottom: 42px;
}

.bmha-org-chart-card:fullscreen .bmha-org-fullscreen-trigger,
.bmha-org-chart-card:-webkit-full-screen .bmha-org-fullscreen-trigger,
.bmha-org-chart-card.bmha-org-card-expanded .bmha-org-fullscreen-trigger {
  background: #0d7187;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(13, 113, 135, 0.22);
}

/* fallback สำหรับ browser ที่ไม่รองรับ Fullscreen API */
.bmha-org-chart-card.bmha-org-card-expanded {
  position: fixed;
  inset: 16px;
  z-index: 9999;
  max-width: none;
  width: auto;
  height: auto;
  margin: 0;
  padding: 24px 30px 30px;
  overflow: hidden;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 26px 80px rgba(7, 61, 88, 0.28);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

body.bmha-org-fullscreen-fallback {
  overflow: hidden;
}

@media (max-width: 767.98px) {

  .bmha-org-chart-card:fullscreen,
  .bmha-org-chart-card:-webkit-full-screen,
  .bmha-org-chart-card.bmha-org-card-expanded {
    inset: 0;
    padding: 16px;
    border-radius: 0;
  }

  .bmha-org-chart-card:fullscreen .bmha-document-card-head,
  .bmha-org-chart-card:-webkit-full-screen .bmha-document-card-head,
  .bmha-org-chart-card.bmha-org-card-expanded .bmha-document-card-head {
    margin: -16px -16px 14px;
    padding: 16px;
  }
}