/* v12.4.17: ortak modal ve alt pencere mizanpajı. */
.sheet { min-width:0; }
.sheet-head,.sheet-body,.sheet-foot { min-width:0; }
.sheet-head h3 { min-width:0;overflow-wrap:anywhere; }
.sheet.modal { max-width:760px; }
.sheet.modal .sheet-body { overflow-wrap:anywhere; }
.sheet-foot { flex-wrap:wrap;align-items:stretch; }
.sheet-foot > .btn { min-width:44px;min-height:44px;white-space:normal;line-height:1.35; }

@media (max-width:767px) {
  .sheet.modal {
    width:calc(100% - 16px);
    max-height:calc(100dvh - var(--safe-t) - var(--safe-b) - 16px);
    margin:0 8px max(8px,var(--safe-b));
    padding-bottom:0;
    border-radius:22px;
  }
  .sheet.modal.full,.sheet.modal.tall {
    width:100%;
    margin:0;
    border-radius:22px 22px 0 0;
  }
}

@media (max-width:520px) {
  .sheet-head { padding-left:16px;padding-right:10px; }
  .sheet-body { padding-left:16px;padding-right:16px; }
  .sheet-foot {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    padding:10px 16px calc(10px + var(--safe-b));
  }
  .sheet-foot > .btn { width:100%;min-width:0;margin:0; }
  .sheet-foot > .btn:only-child,
  .sheet-foot > .btn:last-child:nth-child(odd),
  .sheet-foot > :not(.btn) { grid-column:1 / -1; }
  .sheet.modal .kpi-grid { grid-template-columns:minmax(0,1fr)!important; }
  .sheet.modal .li { min-width:0; }
  .sheet.modal .li-main { min-width:0; }
}

@media (max-width:380px) {
  .sheet-foot { grid-template-columns:minmax(0,1fr); }
  .sheet-foot > * { grid-column:1!important; }
  .sheet-head h3 { font-size:16px; }
}

@media (max-height:500px) and (orientation:landscape) {
  .sheet.modal { max-height:calc(100dvh - 12px);margin-bottom:6px; }
  .sheet.modal .sheet-body { padding-top:8px;padding-bottom:10px; }
  .sheet-foot { padding-top:8px;padding-bottom:max(8px,var(--safe-b)); }
}

@media (min-width:2200px) {
  .sheet.modal { max-width:900px; }
  .sheet.modal .sheet-body { font-size:16px; }
}

@media (prefers-reduced-motion:reduce) {
  .sheet-wrap.open .sheet.modal { transition:none!important; }
}

@media (forced-colors:active) {
  .sheet.modal,.sheet-foot { border:1px solid CanvasText; }
}
