/* One scrolling content area, with native top-layer blocking on every screen. */
html[data-overlay-open]{overscroll-behavior:none}
#modal:not([open]),dialog.sheet:not([open]){display:none!important}
#modal [hidden],dialog.sheet [hidden]{display:none!important}
#modal[open]{
  position:fixed;inset:0;display:flex;flex-direction:column;width:min(840px,calc(100vw - 48px));
  max-width:calc(100vw - 48px);height:fit-content;max-height:calc(100dvh - 48px);margin:auto;
  padding:0;border:1px solid #e5e9f2;border-radius:22px;background:#fff;color:var(--ink,#202944);
  overflow:hidden;box-shadow:0 30px 100px #14233d38;isolation:isolate;
}
#modal::backdrop,dialog.sheet::backdrop{background:rgba(21,30,47,.58);backdrop-filter:blur(3px);overscroll-behavior:none}
#modal>.modal-heading{
  position:relative;inset:auto;flex:none;display:flex;justify-content:space-between;align-items:center;gap:16px;
  margin:0;padding:20px 24px;background:#fff;border-bottom:1px solid #edf0f5;border-radius:0;z-index:1;
}
#modal>.modal-heading h2{margin:0;min-width:0;font-size:18px;line-height:1.45;color:#192943}
#modal>.modal-heading .icon-button{flex:none;display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:#f4f6fa;color:#617086;padding:0;font-size:25px}
#modal>.modal-body{flex:1 1 auto;min-width:0;min-height:0;padding:22px 24px;overflow-y:auto;overflow-x:hidden;background:#fff;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable;overflow-wrap:anywhere}
#modal>.modal-actions{flex:none;display:flex;justify-content:flex-end;align-items:center;gap:10px;flex-wrap:wrap;padding:16px 24px;background:#fff;border-top:1px solid #edf0f5}
#modal>.modal-actions:empty{display:none}
#modal .modal-body>.mk-prize-list{max-height:none;overflow:visible}
#modal .modal-body .mk-prize-list{max-height:none;overflow-x:auto;overflow-y:visible}
#modal .mk-prize-list thead th{position:static}
#modal .modal-body form{min-width:0}
#modal .modal-body :is(input,textarea,select){max-width:100%}
#modal .modal-body img{max-width:100%}
#modal .modal-body .table-wrap{max-width:100%;overflow-x:auto}
#modal .form-error:empty{display:none}
#modal .form-error{padding:10px 12px;border-radius:10px;background:#fff1ef;color:#b94235}
#modal .shot-view img{max-height:calc(100dvh - 200px)}
dialog.sheet[open]{
  position:fixed;inset:auto 0 0;display:block;width:min(100%,620px);max-width:100%;height:fit-content;
  max-height:calc(100dvh - max(env(safe-area-inset-top,0px),16px));margin:0 auto;padding:0;border:0;
  border-radius:24px 24px 0 0;background:#fff;color:var(--ink,#192943);overflow:hidden;box-shadow:0 -12px 60px #14233d26;
}
dialog.sheet .sheet-body{display:flex;flex-direction:column;width:100%;height:fit-content;max-height:calc(100dvh - max(env(safe-area-inset-top,0px),16px));padding:0;overflow:hidden;border-radius:inherit;background:#fff}
dialog.sheet .sheet-header{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 18px 14px;border-bottom:1px solid #e9edf3;background:#fff}
dialog.sheet .sheet-header>.m-sheet-head{position:static;display:flex;align-items:center;justify-content:space-between;gap:12px;flex:1;min-width:0;margin:0;padding:0;border:0;background:#fff}
dialog.sheet .sheet-header :is(h3,b){margin:0;font-size:18px;line-height:1.45;overflow-wrap:anywhere}
dialog.sheet .sheet-header button{min-width:48px;min-height:38px;flex:none;padding:0 12px;border-radius:12px;background:#f1f4f8;color:#43516a;font-size:13px;font-weight:700}
dialog.sheet .sheet-content{flex:1 1 auto;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;padding:16px 18px calc(env(safe-area-inset-bottom,0px) + 20px);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;overflow-wrap:anywhere}
dialog.sheet .sheet-content :is(input,textarea,select){max-width:100%}
dialog.sheet .sheet-content .m-edit{max-width:100%;min-width:0}
dialog.sheet .sheet-content img{max-width:100%}
dialog.sheet .sheet-footer{flex:none;padding:12px 18px calc(env(safe-area-inset-bottom,0px) + 14px);background:#fff;border-top:1px solid #e9edf3}
dialog.sheet .sheet-footer>.sheet-buttons{margin:0}
dialog.sheet .sheet-footer button{min-height:46px}
#modal:focus,dialog.sheet:focus{outline:none}
@media(max-width:760px){
 #modal[open]{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - env(safe-area-inset-top,0px) - 16px);border-radius:20px}
 #modal>.modal-heading{padding:16px}
 #modal>.modal-heading h2{font-size:17px}
 #modal>.modal-body{padding:16px;scrollbar-gutter:auto}
 #modal>.modal-actions{padding:12px 16px calc(env(safe-area-inset-bottom,0px) + 12px)}
 #modal>.modal-actions .button{flex:1;min-height:44px}
 #modal .mk-prize-grid{grid-template-columns:minmax(0,1fr)}
}
@media(prefers-reduced-motion:reduce){#modal,dialog.sheet{scroll-behavior:auto}}


/* Unified native dialog shell. Feature styles can add a class, while this
   higher-specificity frame keeps every modal at the same quality bar. */
#modal.modal-shell[open]{
  width:min(760px,calc(100vw - 48px));
  max-width:calc(100vw - 48px);
  max-height:min(88dvh,calc(100dvh - 48px));
  border:1px solid #dfe5ee;
  border-radius:18px;
  box-shadow:0 26px 80px rgba(28,43,67,.20),0 4px 18px rgba(28,43,67,.06);
}
#modal.modal-shell.modal-size-compact[open]{width:min(560px,calc(100vw - 48px))}
#modal.modal-shell:is(.modal-size-detail,.modal-size-wide,.modal-size-table)[open]{width:min(1040px,calc(100vw - 48px))}
#modal.modal-shell.modal-size-table[open]{width:min(1160px,calc(100vw - 40px))}
#modal.modal-shell::backdrop{background:rgba(19,29,45,.48);backdrop-filter:blur(4px)}
#modal.modal-shell>.modal-heading{
  min-height:68px;padding:16px 22px;
  background:linear-gradient(180deg,#fff 0%,#fbfcfe 100%);
  border-bottom:1px solid #e8edf4;
}
#modal.modal-shell>.modal-heading h2{
  display:flex;align-items:center;gap:11px;
  font-size:18px;font-weight:700;letter-spacing:-.1px;color:#1c2d46;
}
#modal.modal-shell>.modal-heading h2::before{
  content:"";display:block;width:4px;height:20px;flex:none;border-radius:5px;background:#e8bd35;
}
#modal.modal-shell>.modal-heading .icon-button{
  width:34px;height:34px;border:1px solid #e7ebf1;border-radius:10px;
  background:#f7f9fc;color:#64748a;font-size:22px;line-height:1;transition:background .16s,border-color .16s,color .16s,transform .16s;
}
#modal.modal-shell>.modal-heading .icon-button:hover{background:#fff7dc;border-color:#efd58b;color:#805f13;transform:translateY(-1px)}
#modal.modal-shell>.modal-heading .icon-button:focus-visible{outline:3px solid rgba(72,103,213,.22);outline-offset:2px}
#modal.modal-shell>.modal-body{
  padding:20px 22px 24px;background:#f8fafc;
  scrollbar-width:thin;scrollbar-color:#c8d1df transparent;
}
#modal.modal-shell>.modal-body::-webkit-scrollbar{width:9px}
#modal.modal-shell>.modal-body::-webkit-scrollbar-track{background:transparent}
#modal.modal-shell>.modal-body::-webkit-scrollbar-thumb{background:#c8d1df;border:3px solid #f8fafc;border-radius:9px}
#modal.modal-shell>.modal-actions{
  min-height:66px;padding:13px 22px;background:#fff;border-top:1px solid #e7ecf3;
}
#modal.modal-shell>.modal-actions:empty{display:none}
#modal.modal-shell>.modal-actions .button{min-height:37px;border-radius:9px}
#modal.modal-shell>.modal-actions .button.primary{box-shadow:0 4px 12px rgba(55,82,188,.12)}
#modal.modal-shell .dialog-form{gap:16px}
#modal.modal-shell .dialog-form>p:first-child{margin-top:0}
#modal.modal-shell .dialog-form> :is(.notice,.mk-inline-error,.form-error){margin-left:0;margin-right:0}
#modal.modal-shell .detail-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:16px 18px;margin:0 0 14px;background:#fff;border:1px solid #e4eaf2;border-radius:12px}
#modal.modal-shell .detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
#modal.modal-shell .detail-grid-wide{grid-template-columns:minmax(0,1.35fr) minmax(260px,.65fr)}
#modal.modal-shell .detail-grid-full{grid-column:1/-1}
#modal.modal-shell .detail-section{min-width:0;padding:16px 18px;background:#fff;border:1px solid #e4eaf2;border-radius:12px;box-shadow:0 1px 2px rgba(33,53,83,.02)}
#modal.modal-shell .detail-section.full{grid-column:1/-1}
#modal.modal-shell .detail-section>h3{margin:0 0 12px;font-size:13px;font-weight:700;color:#2d4664}
#modal.modal-shell .detail-section>h3::after{content:"";display:block;width:26px;height:2px;margin-top:7px;border-radius:2px;background:#edc955}
#modal.modal-shell .detail-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:#71829a;font-size:11px}
#modal.modal-shell .detail-meta>*{display:inline-flex;align-items:center;min-height:25px;padding:3px 8px;border:1px solid #e5eaf1;border-radius:7px;background:#f8fafc}
#modal.modal-shell .detail-kv{display:grid;grid-template-columns:minmax(82px,.38fr) minmax(0,1fr);gap:10px 15px;margin:0;font-size:12px;line-height:1.65}
#modal.modal-shell .detail-kv dt{color:#8b99ac}
#modal.modal-shell .detail-kv dd{min-width:0;color:#415873;overflow-wrap:anywhere}
#modal.modal-shell .detail-stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
#modal.modal-shell .detail-stat{padding:12px 13px;background:#f8fafc;border:1px solid #e6ebf2;border-radius:9px}
#modal.modal-shell .detail-stat small{display:block;color:#8b9aac;font-size:10px}
#modal.modal-shell .detail-stat strong{display:block;margin-top:5px;color:#2b4665;font-size:17px;font-variant-numeric:tabular-nums}
#modal.modal-shell .detail-note{padding:11px 13px;background:#fff9e8;border:1px solid #f3e4ae;border-radius:9px;color:#7b6831;font-size:11px;line-height:1.7}
#modal.modal-shell .detail-table{width:100%;border-collapse:separate;border-spacing:0;overflow:hidden;border:1px solid #e4eaf2;border-radius:10px;background:#fff;font-size:11px}
#modal.modal-shell .detail-table th{padding:10px 12px;background:#f7f9fc;color:#7c8ca3;font-weight:600;text-align:left;border-bottom:1px solid #e4eaf2;white-space:nowrap}
#modal.modal-shell .detail-table td{padding:11px 12px;color:#4b607a;border-bottom:1px solid #eef1f5;vertical-align:top}
#modal.modal-shell .detail-table tr:last-child td{border-bottom:0}
@media(max-width:760px){
 #modal.modal-shell[open],#modal.modal-shell:is(.modal-size-detail,.modal-size-wide,.modal-size-table)[open]{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:16px}
 #modal.modal-shell>.modal-heading{min-height:60px;padding:13px 16px}
 #modal.modal-shell>.modal-heading h2{font-size:16px}
 #modal.modal-shell>.modal-body{padding:14px 16px 18px}
 #modal.modal-shell>.modal-actions{padding:11px 16px calc(env(safe-area-inset-bottom,0px) + 11px)}
 #modal.modal-shell>.modal-actions .button{flex:1;min-width:110px}
 #modal.modal-shell .detail-grid,#modal.modal-shell .detail-grid-wide{grid-template-columns:minmax(0,1fr)}
 #modal.modal-shell .detail-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
