/* HITUNE Design System — Dialog & Overlay Master v1 */
.ht-overlay{background:var(--ht-master-overlay-bg);backdrop-filter:blur(var(--ht-master-overlay-blur))}
.ht-dialog{box-sizing:border-box;width:min(var(--ht-master-dialog-width),calc(100% - 24px));max-height:calc(100dvh - 30px);overflow:auto;padding:var(--ht-master-dialog-pad);border:1px solid var(--ht-master-dialog-border);border-radius:var(--ht-master-dialog-radius);background:var(--ht-master-dialog-bg);color:var(--ht-master-text-primary);box-shadow:var(--ht-master-dialog-shadow)}
dialog.ht-dialog::backdrop{background:var(--ht-master-overlay-bg);backdrop-filter:blur(var(--ht-master-overlay-blur))}
.ht-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding-bottom:12px;border-bottom:1px solid var(--ht-master-surface-border)}
.ht-dialog-title{margin:0;font-size:calc(var(--ht-master-type-body-size)*1.5);line-height:1.2;font-family:var(--ht-master-type-body);font-weight:var(--ht-master-type-weight-bold)}
.ht-dialog-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:9px;padding-top:14px}


/* Canonical guided-workflow dialog behavior. */
body:has(dialog.ht-dialog--workflow[open]){overflow:hidden}
.ht-dialog.ht-dialog--workflow{
  width:min(var(--ht-master-dialog-width),calc(100vw - 28px));
  max-height:min(92dvh,860px);
  margin:auto;
  padding:0;
  overflow:hidden;
  overscroll-behavior:contain;
  border-radius:var(--ht-master-dialog-radius);
}
.ht-dialog--workflow .ht-dialog-frame{
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  width:100%;
  max-height:min(92dvh,860px);
  min-height:0;
  overflow:hidden;
  border-radius:inherit;
}
.ht-dialog--workflow .ht-dialog-scroll{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.ht-dialog--workflow .ht-dialog-sticky-actions{
  position:sticky;
  bottom:0;
  z-index:4;
  background:var(--ht-master-dialog-bg);
  box-shadow:0 -10px 18px color-mix(in srgb,var(--ht-master-dialog-bg) 92%,transparent);
}
@media(max-width:700px){
  .ht-dialog.ht-dialog--workflow{
    width:min(94vw,var(--ht-master-dialog-width));
    max-width:94vw;
    max-height:94dvh;
    margin:auto;
    border-radius:var(--ht-master-dialog-radius);
  }
  .ht-dialog--workflow .ht-dialog-frame{max-height:94dvh}
}
