/* Shared OnRay confirmation, prompt and system notice surface. */
.system-dialog-input-wrap[hidden]{display:none!important}
.system-dialog{width:min(440px,calc(100vw - 32px));padding:0;border:0;border-radius:16px;background:transparent;color:#2d382e;box-shadow:0 26px 90px rgba(19,29,20,.3);overflow:visible}.system-dialog::backdrop{background:rgba(22,31,23,.54);backdrop-filter:blur(5px)}.system-dialog-shell{position:relative;padding:30px 30px 24px;border:1px solid #e0e7d8;border-radius:16px;background:linear-gradient(180deg,#fff 0%,#f8fbf4 100%)}.system-dialog-close{position:absolute;top:14px;right:14px;width:30px;height:30px;padding:0;border:1px solid #e0e7d8;border-radius:50%;background:#fff;color:#788375;font-size:21px;line-height:26px;cursor:pointer}.system-dialog-close:hover{border-color:#b6cd91;color:#425c37;background:#f3f8ec}.system-dialog-icon{width:38px;height:38px;display:grid;place-items:center;margin:0 auto 14px;border:1px solid #d7e6b8;border-radius:50%;background:#f0f7df;color:#668d32;font:800 18px/1 "DM Mono",monospace}.system-dialog-kicker{margin:0 0 7px;color:#91aa5b;font:9px "DM Mono",monospace;letter-spacing:1.2px;text-align:center}.system-dialog h2{margin:0;color:#2e3b30;font-size:20px;letter-spacing:-.7px;text-align:center}.system-dialog-message{margin:12px 0 20px;color:#758174;font-size:12px;line-height:1.75;text-align:center;white-space:pre-wrap}.system-dialog-input-wrap{display:block;margin:0 0 20px;color:#697668;font-size:11px}.system-dialog-input-wrap span{display:block;margin-bottom:6px}.system-dialog-input-wrap input{width:100%;box-sizing:border-box;height:39px;padding:0 11px;border:1px solid #dce5d5;border-radius:7px;outline:0;color:#344134;background:#fff;font:12px inherit}.system-dialog-input-wrap input:focus{border-color:#9dbf61;box-shadow:0 0 0 3px rgba(157,191,97,.14)}.system-dialog-actions{display:flex;justify-content:flex-end;gap:9px}.system-dialog-actions button{min-width:84px;height:36px;padding:0 14px;border-radius:7px;font-size:11px;font-weight:700;cursor:pointer}.system-dialog-secondary{border:1px solid #dbe3d7;background:#fff;color:#71806f}.system-dialog-primary{border:1px solid #b8d477;background:#d9f580;color:#30451f}.system-dialog-primary:hover{background:#e4fb9a}.system-dialog-secondary:hover{background:#f5f8f2}
dialog.leave-confirm-dialog{width:min(440px,calc(100vw - 32px));padding:0;border:1px solid #cbd4c8;border-radius:16px;background:#fff;color:#202a22;box-shadow:0 26px 90px rgba(10,18,12,.42);overflow:visible;isolation:isolate}.leave-confirm-dialog::backdrop{background:rgba(13,19,15,.7);backdrop-filter:blur(4px) saturate(.72)}.leave-confirm-dialog{color:#202a22;text-align:center}.leave-confirm-dialog:before{content:"!";position:absolute;z-index:1;top:30px;left:50%;width:38px;height:38px;display:grid;place-items:center;transform:translateX(-50%);border:1px solid #c7d99c;border-radius:50%;background:#eff8d7;color:#4f6c20;font:800 18px/38px "DM Mono",monospace}.leave-confirm-dialog h2{margin:0;padding:84px 30px 0;color:#1f2921;font-size:20px;font-weight:850}.leave-confirm-dialog p{margin:12px 30px 20px;color:#4e5a50;font-size:12px;line-height:1.75}.leave-confirm-dialog>div:last-child{display:flex;justify-content:flex-end;gap:9px;padding:0 30px 24px}.leave-confirm-dialog button{min-width:84px;height:36px;padding:0 14px;border-radius:7px;font-size:11px;font-weight:780;cursor:pointer}.leave-confirm-dialog #cancelLeave{color:#37443a;border:1px solid #cbd4c8;background:#fff}.leave-confirm-dialog #confirmLeave{color:#27351d;border:1px solid #a9c35a;background:#d9f580}.leave-confirm-icon{display:none}.toast{right:24px!important;bottom:24px!important;max-width:min(380px,calc(100vw - 32px))!important;padding:13px 16px!important;border:1px solid rgba(214,232,180,.7)!important;border-radius:10px!important;color:#eff7e8!important;background:#2c3b2e!important;box-shadow:0 16px 40px rgba(20,31,20,.2)!important;font-size:11px!important;line-height:1.55!important}
@media(max-width:600px){.system-dialog-shell{padding:28px 20px 20px}.leave-confirm-dialog h2{padding-left:20px;padding-right:20px}.leave-confirm-dialog p{margin-left:20px;margin-right:20px}.leave-confirm-dialog>div:last-child{padding-left:20px;padding-right:20px}.toast{right:12px!important;bottom:12px!important}}
.leave-confirm-dialog{position:relative}
.leave-dialog-close{position:absolute;top:14px;right:14px;z-index:2;width:30px;height:30px;padding:0;border:1px solid #dfe3dc;border-radius:50%;background:#fff;color:#687462;font-size:21px;line-height:26px;cursor:pointer}
.leave-dialog-close:hover{border-color:#b6cd91;background:#f3f8ec;color:#425c37}

/* High-contrast safety layer for every shared modal surface. */
dialog[open]{opacity:1;color-scheme:light}
dialog[open]::backdrop{background:rgba(13,19,15,.68);backdrop-filter:blur(4px) saturate(.72)}
.system-dialog-shell,
dialog.leave-confirm-dialog,
dialog.account-menu-dialog,
.help-dialog,
.modal,
.video-preview-dialog,
.batch-video-preview-dialog,
.product-dialog,
.project-history-dialog,
.approval-modal,
.viral-prompt-dialog,
.commerce-dialog-shell,
.commerce-preview-shell,
.commerce-supply-dialog-shell{opacity:1;color:#202a22;background-color:#fff;border-color:#cbd4c8}
.system-dialog h2,
.leave-confirm-dialog h2,
dialog.account-menu-dialog h2,
.help-dialog h2,
.product-dialog h2,
.project-history-dialog h2,
.approval-modal h2,
.commerce-dialog-shell h2,
.commerce-preview-shell h2,
.commerce-supply-dialog-shell h2{color:#1f2921}
.system-dialog-message,
.leave-confirm-dialog p,
dialog.account-menu-dialog p,
.help-dialog p,
.product-dialog p,
.project-history-dialog p,
.approval-modal p,
.commerce-dialog-shell p,
.commerce-preview-shell p,
.commerce-supply-dialog-shell p{color:#4e5a50}
.system-dialog input,
.system-dialog textarea,
.system-dialog select,
dialog.account-menu-dialog input,
dialog.account-menu-dialog textarea,
dialog.account-menu-dialog select,
.help-dialog input,
.help-dialog textarea,
.help-dialog select,
.product-dialog input,
.product-dialog textarea,
.product-dialog select,
.approval-modal input,
.approval-modal textarea,
.approval-modal select,
.commerce-dialog-shell input,
.commerce-dialog-shell textarea,
.commerce-dialog-shell select{color:#263229;background:#fff;border-color:#bfc9bd}
.leave-dialog-close,.system-dialog-close{display:grid!important;place-items:center;width:30px!important;min-width:30px!important;height:30px!important;padding:0!important;border:1px solid #cbd4c8!important;border-radius:50%!important;background:#fff!important;color:#263229!important;line-height:1!important}

/* Compact dialog rhythm: preserve readable type while reducing oversized surfaces. */
.system-dialog,
dialog.leave-confirm-dialog{
  width:min(390px,calc(100vw - 32px));
  max-height:calc(100dvh - 32px);
}
.system-dialog-shell{padding:24px 24px 20px;border-radius:13px}
.system-dialog-icon{width:34px;height:34px;margin-bottom:11px;font-size:16px}
.system-dialog h2,.leave-confirm-dialog h2{font-size:18px}
.system-dialog-message{margin:10px 0 16px;line-height:1.65}
.system-dialog-actions button,.leave-confirm-dialog button{height:34px}
.leave-confirm-dialog:before{top:23px;width:34px;height:34px;font-size:16px;line-height:34px}
.leave-confirm-dialog h2{padding:70px 24px 0}
.leave-confirm-dialog p{margin:10px 24px 16px;line-height:1.65}
.leave-confirm-dialog>div:last-child{padding:0 24px 20px}

dialog.account-menu-dialog{
  width:min(420px,calc(100vw - 32px));
  max-height:min(610px,calc(100dvh - 32px));
}
dialog.account-menu-dialog>header{min-height:66px;padding:18px 58px 13px 19px}
dialog.account-menu-dialog .account-menu-modal-body{padding:16px 19px 19px}

.help-dialog{
  width:min(700px,calc(100vw - 32px));
  max-height:calc(100dvh - 32px);
  overflow:auto;
  border-radius:12px;
}
.help-dialog-heading{padding:19px 22px 14px}
.help-dialog-heading h2{font-size:21px}
.help-dialog-grid>section,.help-contact{padding:18px 22px}

.commerce-dialog{
  width:min(680px,calc(100vw - 32px));
  max-height:calc(100dvh - 32px);
}
.commerce-dialog-shell{
  max-height:calc(100dvh - 32px);
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  border-radius:13px;
}
.commerce-dialog-shell>header{padding:15px 18px}
.commerce-dialog-body{max-height:none;padding:15px 18px;overflow:auto}
.commerce-dialog-shell>footer{padding:11px 18px}

.product-dialog{width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto}
.product-dialog form>header{padding:16px 18px}
.product-dialog #productColumnOptions{padding:16px;gap:7px}
.product-dialog footer{padding:0 16px 16px}

.approval-modal{width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto}
.approval-modal form{padding:19px}
.member-access-modal{width:min(620px,calc(100vw - 32px))}
.member-access-modal form{max-height:calc(100dvh - 32px)}

.viral-prompt-dialog{
  width:min(640px,calc(100vw - 32px));
  max-height:min(660px,calc(100dvh - 32px));
}
.viral-prompt-dialog-heading{padding:15px 17px 11px}
.viral-prompt-dialog .viral-prompt-grid{max-height:calc(100dvh - 170px);padding:10px 16px 16px}

.video-preview-dialog,.batch-video-preview-dialog{
  width:min(500px,calc(100vw - 32px));
  max-height:calc(100dvh - 32px);
}
.video-preview-heading,.batch-video-preview-heading{padding:14px 16px 11px}
.video-preview-stage,.batch-video-preview-stage{min-height:220px;padding:14px}
.video-preview-stage video,.batch-video-preview-stage video{max-height:60dvh}

.project-history-dialog{
  width:min(920px,calc(100vw - 32px));
  max-height:min(760px,calc(100dvh - 32px));
}
.project-history-heading{min-height:64px;padding:11px 18px}
.project-history-body{max-height:calc(min(760px,calc(100dvh - 32px)) - 64px);padding:16px 18px 22px}

@media(max-width:760px){
  .system-dialog,
  dialog.leave-confirm-dialog,
  dialog.account-menu-dialog,
  .help-dialog,
  .commerce-dialog,
  .product-dialog,
  .approval-modal,
  .member-access-modal,
  .viral-prompt-dialog,
  .video-preview-dialog,
  .batch-video-preview-dialog,
  .project-history-dialog{
    width:calc(100dvw - 20px);
    max-width:calc(100dvw - 20px);
    max-height:calc(100dvh - 20px);
    box-sizing:border-box;
    margin:auto;
  }
  .system-dialog-shell,.commerce-dialog-shell{max-height:calc(100dvh - 20px)}
  .help-dialog-grid{grid-template-columns:1fr}
  .help-dialog-grid>section{border-right:0;border-bottom:1px solid #e7eae4}
  .help-dialog-heading,.help-dialog-grid>section,.help-contact{padding-left:16px;padding-right:16px}
  .commerce-dialog-shell>header,.commerce-dialog-body,.commerce-dialog-shell>footer{padding-left:14px;padding-right:14px}
  .commerce-dialog-options{grid-template-columns:1fr}
  .member-setting-grid,.capability-editor>div{grid-template-columns:1fr}
  .project-history-heading{min-height:58px;padding:10px 14px}
  .project-history-body{max-height:calc(100dvh - 78px);padding:12px}
  .video-preview-stage,.batch-video-preview-stage{min-height:190px;padding:10px}
  .video-preview-stage video,.batch-video-preview-stage video{max-height:58dvh}
}

@media(max-width:420px){
  .system-dialog,
  dialog.leave-confirm-dialog,
  dialog.account-menu-dialog,
  .help-dialog,
  .commerce-dialog,
  .product-dialog,
  .approval-modal,
  .member-access-modal,
  .viral-prompt-dialog,
  .video-preview-dialog,
  .batch-video-preview-dialog,
  .project-history-dialog{
    width:calc(100dvw - 12px);
    max-width:calc(100dvw - 12px);
    max-height:calc(100dvh - 12px);
    border-radius:10px;
  }
  .system-dialog-shell{padding:22px 16px 16px;border-radius:10px}
  .system-dialog-close,.leave-dialog-close{top:10px;right:10px}
  .system-dialog-actions,.leave-confirm-dialog>div:last-child{gap:7px}
  .system-dialog-actions button,.leave-confirm-dialog button{min-width:0;flex:1;padding:0 9px}
  .leave-confirm-dialog h2{padding-left:16px;padding-right:16px}
  .leave-confirm-dialog p{margin-left:16px;margin-right:16px}
  .leave-confirm-dialog>div:last-child{padding-left:16px;padding-right:16px}
  dialog.account-menu-dialog>header{padding-left:16px}
  dialog.account-menu-dialog .account-menu-modal-body{padding:14px 16px 16px}
  .commerce-dialog-assets{grid-template-columns:repeat(2,minmax(0,1fr))}
  .approval-modal form{padding:16px}
  .video-preview-actions,.batch-video-preview-actions{padding:10px 12px}
}
