.MyDlg.kash-message-dialog {
    --message-ink: #243148;
    --message-line: #dfe5ed;
    --message-accent: #4f2edc;
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    height: 100dvh;
    min-height: 0;
    padding: 16px;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    overflow: auto;
    background: #17203380;
    box-shadow: none;
    color: var(--message-ink);
    font: 400 17px/1.5 system-ui, -apple-system, sans-serif;
    text-align: start;
}

.kash-message-dialog > .MyDlgPanel {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 560px;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--message-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 60px #17203340;
}

.kash-message-dialog > .MyDlgPanel > .MyDlgHead {
    flex: none;
    min-height: 0;
    padding: 20px 24px 8px;
}

.kash-message-dialog > .MyDlgPanel > .MyDlgHead > .MyDlgTitle {
    display: block;
    width: auto;
    padding: 0;
    font: 650 21px/1.35 system-ui, -apple-system, sans-serif;
}

.kash-message-dialog > .MyDlgPanel > .MyDlgBody {
    min-height: 0;
    max-height: none;
    width: auto;
    margin: 0;
    padding: 8px 24px 20px;
    overflow: auto;
    overscroll-behavior: contain;
    overflow-wrap: anywhere;
    font: inherit;
}

.kash-message-dialog > .MyDlgPanel > .MyDlgActions {
    display: flex;
    flex: none;
    justify-content: flex-end;
    gap: 12px;
    padding: 4px 24px 20px;
}

.kash-message-dialog > .MyDlgPanel > .MyDlgActions > input {
    appearance: none;
    box-sizing: border-box;
    width: auto;
    min-width: 144px;
    height: auto;
    min-height: 56px;
    margin: 0;
    padding: 12px 22px;
    /* The shared dialog stylesheet removes action borders with !important. */
    border: 1px solid #b8c3d2 !important;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
    color: var(--message-ink);
    font: 650 17px/1.3 system-ui, -apple-system, sans-serif;
    text-shadow: none;
    cursor: pointer;
    touch-action: manipulation;
}

.kash-message-dialog > .MyDlgPanel > .MyDlgActions > .greenBtn {
    border-color: var(--message-accent) !important;
    background: var(--message-accent);
    color: #fff;
}

@media (hover: hover) {
    .kash-message-dialog > .MyDlgPanel > .MyDlgActions > input:hover { background: #eef2f7; }
    .kash-message-dialog > .MyDlgPanel > .MyDlgActions > .greenBtn:hover { background: #4021be; }
}

.kash-message-dialog > .MyDlgPanel > .MyDlgActions > input:active { background: #e2e8f0; }
.kash-message-dialog > .MyDlgPanel > .MyDlgActions > .greenBtn:active { background: #35199e; }

.kash-message-dialog > .MyDlgPanel > .MyDlgBody > .promptForm {
    float: none;
    width: auto;
    margin: 16px 0 0;
    padding: 0;
    border: 0;
    background: none;
}

.kash-message-dialog .promptForm > fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.kash-message-dialog #TXTDLGPrompt {
    box-sizing: border-box;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 10px 13px;
    border: 1px solid #b8c3d2;
    border-radius: 9px;
    background: #fff;
    box-shadow: none;
    color: var(--message-ink);
    font: inherit;
}

.kash-message-dialog #TXTDLGPrompt:focus { border-color: var(--message-accent); }
.kash-message-dialog #TXTDLGPrompt:focus-visible,
.kash-message-dialog > .MyDlgPanel > .MyDlgActions > input:focus-visible {
    outline: 2px solid var(--message-accent);
    outline-offset: 3px;
}

@media (max-width: 640px), (max-height: 480px) {
    /* Keep the input and actions high on screen when the soft keyboard opens. */
    .kash-message-dialog.kash-message-prompt { align-items: flex-start; }
    .kash-message-dialog > .MyDlgPanel > .MyDlgHead { padding: 16px 16px 6px; }
    .kash-message-dialog > .MyDlgPanel > .MyDlgBody { padding: 8px 16px 16px; }
    .kash-message-dialog > .MyDlgPanel > .MyDlgActions { padding: 4px 16px 16px; }
    .kash-message-dialog > .MyDlgPanel > .MyDlgActions > input {
        flex: 1 1 0;
        min-width: 0;
        min-height: 60px;
        padding-inline: 10px;
    }
}

@media print {
    .MyDlg.kash-message-dialog { display: none; }
}
