.tool-state [hidden],
.purchase-dialog[hidden] { display: none !important; }
.purchase-dialog {
    width: min(680px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 0;
    border-radius: 22px;
    color: #12233f;
    background: #fff;
    box-shadow: 0 24px 80px rgba(1, 13, 35, 0.42);
}
.purchase-dialog::backdrop { background: rgba(3, 14, 34, 0.76); backdrop-filter: blur(4px); }
.purchase-dialog form { max-height: calc(100dvh - 32px); overflow-y: auto; padding: clamp(22px, 4vw, 36px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-head h2 { margin: 4px 0 12px; line-height: 1.15; }
.dialog-close { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; border: 1px solid #c8d3e2; border-radius: 999px; background: #f5f8fc; color: #12233f; font-size: 26px; cursor: pointer; }
.confirmation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
.confirmation-grid > div { min-width: 0; padding: 14px; border: 1px solid #d8e0eb; border-radius: 14px; background: #f7f9fc; }
.confirmation-grid dt { color: #5a687d; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.confirmation-grid dd { margin: 6px 0 0; overflow-wrap: anywhere; font-weight: 700; }
.dialog-warning { display: grid; gap: 5px; padding: 14px 16px; border-left: 4px solid #b7791f; background: #fff8e8; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.dialog-actions .button { min-height: 46px; }
.report-only-note { margin: -4px 0 16px; padding: 11px 13px; border-radius: 10px; background: #eef5ff; color: #27476f; }
#fixForm :disabled:not([name="report_only"]) { cursor: not-allowed; opacity: 0.58; }
@media (max-width: 520px) {
    .purchase-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 16px; }
    .purchase-dialog form { max-height: calc(100dvh - 20px); padding: 20px 16px; }
    .confirmation-grid { grid-template-columns: 1fr; }
    .dialog-actions { flex-direction: column-reverse; }
    .dialog-actions .button { width: 100%; min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) { .purchase-dialog::backdrop { backdrop-filter: none; } }
