.protected-access-dialog {
  width: min(820px, calc(100% - 32px));
  max-height: 90vh;
  margin: auto;
  padding: 0;
  border: 2px solid #9b7745;
  border-radius: 16px;
  background: #fffaf0;
  color: #342719;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  font-family: Georgia, "Times New Roman", serif;
}

.protected-access-dialog::backdrop {
  background: rgba(25, 18, 11, 0.72);
  backdrop-filter: blur(3px);
}

.protected-access-dialog__panel {
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 30px 34px 28px;
}

.protected-access-dialog__close-icon {
  position: absolute;
  top: 12px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #9b7745;
  border-radius: 50%;
  background: #fffaf0;
  color: #5f421f;
  font: 700 30px/1 Arial, sans-serif;
  cursor: pointer;
}

.protected-access-dialog__heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 42px;
  margin-bottom: 20px;
}

.protected-access-dialog__lock {
  flex: 0 0 auto;
  font-size: 30px;
  line-height: 1;
}

.protected-access-dialog__heading h2 {
  margin: 0;
  color: #6b3d1f;
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.2;
}

.protected-access-dialog__content {
  font-size: 17px;
  line-height: 1.62;
}

.protected-access-dialog__content p {
  margin: 0 0 16px;
}

.protected-access-dialog__content ul {
  margin: 0 0 18px;
  padding-left: 26px;
}

.protected-access-dialog__content li {
  margin: 0 0 7px;
}

.protected-access-dialog__warning {
  padding: 14px 16px;
  border-left: 5px solid #9b3428;
  border-radius: 8px;
  background: #fff0ec;
}

.protected-access-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(107, 61, 31, 0.25);
}

.protected-access-dialog__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  box-sizing: border-box;
  padding: 11px 20px;
  border: 1px solid #6b4b25;
  border-radius: 999px;
  font: 700 16px/1.25 Georgia, "Times New Roman", serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.protected-access-dialog__button--secondary {
  background: #fffaf0;
  color: #6b4b25;
}

.protected-access-dialog__button--primary {
  background: #6b4b25;
  color: #ffffff;
}

.protected-access-dialog__button:hover,
.protected-access-dialog__button:focus-visible,
.protected-access-dialog__close-icon:hover,
.protected-access-dialog__close-icon:focus-visible {
  outline: 3px solid #d4af37;
  outline-offset: 2px;
}

.protected-family-data-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #6b3d1f;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.protected-family-data-trigger:hover,
.protected-family-data-trigger:focus-visible {
  color: #9b3428;
  outline: 3px solid #d4af37;
  outline-offset: 3px;
  border-radius: 3px;
}

.protected-access-notice {
  display: flex;
  justify-content: center;
  margin: 0 0 18px;
  text-align: center;
}

.protected-access-notice .protected-family-data-trigger {
  padding: 10px 16px;
  border: 1px solid #9b7745;
  border-radius: 999px;
  background: #fffaf0;
  box-shadow: 0 2px 8px rgba(55, 45, 25, 0.12);
  text-decoration: none;
}

.branch-diagram-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 32px 0 24px;
  padding: 18px 20px;
  border: 1px solid #c8b78f;
  border-radius: 12px;
  background: #fffaf0;
  box-shadow: 0 3px 12px rgba(55, 45, 25, 0.08);
  text-align: left;
}

.branch-diagram-link h2 {
  margin: 0 0 6px;
  color: #4a3618;
  font-size: 1.18rem;
}

.branch-diagram-link p {
  margin: 0;
  color: #403a31;
  line-height: 1.55;
}

.branch-diagram-link__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 9px;
  background: #5b4727;
  color: #ffffff !important;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.15);
}

.branch-diagram-link__button:hover,
.branch-diagram-link__button:focus-visible {
  background: #3f301a;
  outline: 3px solid #d4af37;
  outline-offset: 2px;
  text-decoration: none;
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .protected-access-dialog {
    width: calc(100% - 18px);
    max-height: 94vh;
  }

  .protected-access-dialog__panel {
    max-height: 94vh;
    padding: 24px 18px 20px;
  }

  .protected-access-dialog__heading {
    align-items: flex-start;
    padding-right: 38px;
  }

  .protected-access-dialog__content {
    font-size: 16px;
    line-height: 1.55;
  }

  .protected-access-dialog__actions {
    flex-direction: column-reverse;
  }

  .protected-access-dialog__button {
    width: 100%;
  }

  .branch-diagram-link {
    align-items: stretch;
    flex-direction: column;
  }

  .branch-diagram-link__button {
    width: 100%;
    box-sizing: border-box;
  }
}
