/* Shared frame, heading, and actions for report overlays. */
:root {
  --dialog-small: 360px;
  --dialog-standard: 480px;
  --dialog-large: 560px;
  --dialog-gutter: 16px;
  --dialog-padding: 20px;
  --dialog-limit: 80dvh;
  --dialog-header-height: 56px;
  --dialog-border: #e1e5ec;
  --dialog-divider: #e8ecf1;
  --dialog-shadow: 0 18px 56px rgba(17,24,39,.18);
}

#overlayRoot .guide-dialog-mask,
.admin-rewrite-a #overlay,
#overlay > .mask {
  background: rgba(17,24,39,.48);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
#overlayRoot .guide-dialog-sheet,
.admin-rewrite-a .modal,
#overlay > .sheet {
  --dialog-width: var(--dialog-standard);
  width: min(var(--dialog-width), calc(100vw - 2 * var(--dialog-gutter)));
  max-height: var(--dialog-limit);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--dialog-border);
  background: #fff;
  box-shadow: var(--dialog-shadow);
}
#overlayRoot .guide-dialog-sheet:not(.guide-dialog-sheet--form),
#overlay > .dialog-sheet {--dialog-width:var(--dialog-small)}
.admin-rewrite-a .calendar-modal,
#overlay > .calendar-sheet {--dialog-width:var(--dialog-large)}
#overlay > .sheet {left:50%;right:auto;top:50%;bottom:auto;transform:translate(-50%,-50%)}

.admin-rewrite-a .drawer {
  width: min(var(--dialog-large),100vw);
  display: flex;
  flex-direction: column;
  border-left-color: var(--dialog-border);
}
.admin-rewrite-a .drawer-head,
.admin-rewrite-a .modal-head,
#overlay > .sheet > .sheet-head,
#overlayRoot .guide-dialog-head {
  flex: 0 0 var(--dialog-header-height);
  height: var(--dialog-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 0 var(--dialog-padding);
  border-bottom: 1px solid var(--dialog-divider);
}
.admin-rewrite-a :is(.modal-head,.drawer-head) b,
#overlay > .sheet > .sheet-head h3,
#overlay > .dialog-sheet h3,
#overlayRoot :is(.guide-dialog-copy,.guide-dialog-head) h3 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}
.admin-rewrite-a .drawer-close,
#overlay > .sheet .close-btn,
#overlayRoot .guide-dialog-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #667085;
  cursor: pointer;
}
.admin-rewrite-a .drawer-close svg,
#overlay > .sheet .close-btn svg,
#overlayRoot .guide-dialog-close svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  fill: none;
}
.admin-rewrite-a .drawer-close:hover,
#overlay > .sheet .close-btn:hover,
#overlayRoot .guide-dialog-close:hover {background:#f3f5f8;color:#c7000b}

.admin-rewrite-a :is(.drawer-body,.modal-body),
#overlay > .sheet .sheet-scroll,
#overlay > .dialog-sheet .dialog-copy,
#overlayRoot .guide-dialog-copy {
  flex: 1;
  min-height: 0;
  height: auto;
  padding: var(--dialog-padding);
  overflow: auto;
  overscroll-behavior: contain;
}
.admin-rewrite-a .calendar-panel {min-height:0;overflow:auto;overscroll-behavior:contain}
.admin-rewrite-a .calendar-presets {flex-shrink:0}
#overlay > .editor-sheet .sheet-scroll {padding:0}
#overlay > .editor-sheet .editor-date-panel {grid-template-columns:minmax(0,1fr)}
#overlay > .dialog-sheet .dialog-copy p,
#overlayRoot .guide-dialog-copy p {margin:8px 0 0;color:#667085;font-size:13px;font-weight:400;line-height:1.6}
#overlayRoot .guide-dialog-head + .guide-dialog-copy > :first-child {margin-top:0}
#overlayRoot .guide-dialog-sheet--form form {display:flex;flex-direction:column;max-height:var(--dialog-limit)}
#overlayRoot .guide-dialog-sheet--notice {height:min(var(--dialog-limit),520px)}
#overlayRoot .guide-dialog-sheet--notice form {height:100%}
#overlayRoot .guide-dialog-sheet--notice .guide-dialog-copy {overflow:hidden}

#overlayRoot .guide-dialog-actions,
#overlay > .sheet :is(.sheet-actions,.dialog-actions) {
  flex-shrink: 0;
  margin: 0;
  padding: 12px var(--dialog-padding) var(--dialog-padding);
  gap: 10px;
  border-top: 1px solid var(--dialog-divider);
  background: #fff;
}
#overlayRoot .guide-dialog-actions button,
#overlay > .sheet :is(.sheet-actions,.dialog-actions) .btn {
  height: 44px;
  border: 1px solid #d8dee7;
  background: #fff;
  color: #344054;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}
#overlayRoot button.guide-dialog-confirm,
#overlay > .sheet :is(.sheet-actions,.dialog-actions) :is(.btn.primary,.btn.danger) {border-color:#c7000b;background:#c7000b;color:#fff}
.admin-rewrite-a .drawer .focus-config-footer {border-top-color:var(--dialog-divider)}
.admin-rewrite-a .drawer .focus-config-footer .primary-btn {height:44px;font-size:14px;font-weight:650}
@media(max-width:520px) {
  :root {--dialog-padding:16px;--dialog-header-height:52px}
}

#overlayRoot .guide-dialog-field>span{font-size:13px;font-weight:600;color:#667085}
#overlayRoot .guide-dialog-field input,#overlayRoot .guide-dialog-field select,#overlayRoot .guide-dialog-input{font-size:14px;font-weight:500;color:#111827;border-color:#d8dee7}
#overlayRoot .guide-dialog-field small{font-size:12px;font-weight:400;line-height:1.6}
#overlayRoot .guide-dialog-confirm:disabled{opacity:.5;cursor:wait}
#overlayRoot .guide-dialog-sheet--notice .notice-text{padding:16px;border:1px solid #e1e5ec;border-radius:12px;background:#f7f8fa;color:#344054;font-size:14px;font-weight:400;line-height:1.85;outline:none;box-shadow:none;scrollbar-width:thin;scrollbar-color:#cbd2dc transparent}
#overlayRoot .guide-dialog-sheet--notice .notice-text:focus{border-color:#d8dee7;outline:none;box-shadow:none}
