html:has(#demo-dialog[open]) {
  overflow: hidden;
}

#demo-dialog {
  box-sizing: border-box;
  width: min(1100px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 24px;
  background: #fff;
  color: #101318;
  font: 16px/1.5 Arial, sans-serif;
  overscroll-behavior: contain;
}

#demo-dialog::backdrop {
  background: rgb(16 19 24 / 65%);
}

#demo-dialog .demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

#demo-title {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.5px;
}

#demo-dialog button {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #ccc;
  border-radius: 24px;
  background: #f4f4f4;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

#demo-dialog :focus-visible {
  outline: 2px solid #101318;
  outline-offset: 3px;
}

#demo-calendar {
  width: 100%;
  min-height: min(560px, 60dvh);
}

#demo-dialog .demo-fallback {
  margin: 16px 0 0;
  font-size: 14px;
}

#demo-dialog a {
  color: inherit;
  text-decoration: underline;
}

@media (max-width: 600px) {
  #demo-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    padding: 16px;
    border-radius: 16px;
  }
}
