.psq-dialog {
  box-sizing: border-box;
  width: min(44rem, calc(100vw - 24px));
  max-width: 100vw;
  max-height: min(90dvh, 62rem);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #becbcf;
  border-radius: 10px;
  background: #fff;
  color: #152d36;
  box-shadow: 0 12px 48px #102b3840;
}
.psq-dialog:not([open]), .psq-form [hidden] { display: none !important; }
.psq-dialog::backdrop { background: #0c222c6b; }
.psq-dialog .psq-bar {
  position: sticky; inset: 0 0 auto; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 20px; background: #fff; border-bottom: 1px solid #d8e0e2;
}
.psq-bar h2 { margin: 0; font: inherit; font-weight: 700; font-size: 1.25rem; line-height: 1.25; }
.psq-body { padding: 18px 20px; }
.psq-body form { box-sizing: border-box; width: 100%; max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; }
.psq-body form > :is(h2,h3):first-child { display: none; }
.psq-float, .psq-inline, .psq-add, .psq-close, .psq-remove {
  font: inherit; font-size: 14px; font-weight: 650; line-height: 1.3;
  cursor: pointer; border: 1px solid #567079; border-radius: 5px;
  background: white; color: #163643; padding: 9px 14px;
}
.psq-float, .psq-inline { background: #164d65; border-color: #164d65; color: #fff; }
.psq-float {
  position: fixed; z-index: 55;
  right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom));
  padding: 12px 18px; box-shadow: 0 3px 14px #17364130;
}
.psq-close { margin-inline-start: auto; }
.psq-add { justify-self: start; margin-block: 8px 2px; color: #164d65; }
.psq-remove { float: right; padding: 5px 9px; margin-bottom: 6px; }
.psq-rows { display: grid; gap: 12px; min-width: 0; }
.psq-form .psq-row {
  min-width: 0; margin: 0; padding: 10px 14px 14px; border: 1px solid #c9d5d8;
  border-radius: 6px; background: #f8fbfb; color: #162e37;
}
.psq-row > legend { padding: 0 6px; font-size: 16px; font-weight: 700; }
.psq-form .psq-row > .psp-fields { padding: 0; margin: 10px 0 0; border: 0; background: transparent; }
.psq-grid, .psq-extra { display: grid; clear: both; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 12px; }
.psq-grid > label:first-child, .psq-extra > label:last-child { grid-column: 1 / -1; }
.psq-extra { margin-top: 10px; }
.psq-form .psq-row label { display: grid; min-width: 0; gap: 4px; margin: 0; font-size: 14px; }
.psq-form .psq-row :is(input,select,textarea) {
  box-sizing: border-box; min-width: 0; width: 100%; min-height: 40px;
  padding: 7px 9px; border: 1px solid #a2b4ba; border-radius: 3px; background: white; color: #152d36;
}
.psq-form .psq-row input[type=file] { font-size: 13px; }
.psq-hint { font-size: 13px; line-height: 1.4; color: #42565e; margin: 4px 0 14px; }
.psq-form .psq-add:disabled, .psq-form .psq-remove:disabled { opacity: .55; }
.psq-dialog :focus-visible, .psq-float:focus-visible, .psq-inline:focus-visible { outline: 2px solid #18799e; outline-offset: 2px; }
@media (max-width: 580px) {
  .psq-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .psq-dialog .psq-bar, .psq-body { padding: 10px 12px; }
  .psq-form .psq-row { padding: 8px 9px 10px; }
  .psq-extra { grid-template-columns: 1fr; }
  .psq-float { padding: 10px 13px; }
}
