dialog.confirmation-dialog {
    box-sizing: border-box;
    width: min(500px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 1px solid var(--border-strong, #73879b66);
    border-radius: 18px;
    background: var(--surface-1, var(--background-color-box, #1c2834));
    color: var(--text-primary, #edf3f9);
    box-shadow: 0 28px 80px #050b1566, 0 4px 16px #050b1533;
    color-scheme: inherit;
}

dialog.confirmation-dialog::backdrop { background: #080f1acc; backdrop-filter: blur(4px); }
dialog.confirmation-dialog[open] { animation: confirmation-enter 180ms ease-out; }
.confirmation-dialog [hidden] { display: none !important; }

.confirmation-content {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 16px;
    padding: 26px 24px 24px;
}
.confirmation-dialog .confirmation-icon {
    display: grid;
    place-items: center;
    align-self: center;
    color: var(--color-accent, #79b3ff);
    font-size: 52px;
    line-height: 1;
}
.confirmation-dialog h2 {
    margin: 0 0 7px;
    padding: 0;
    border: 0;
    font-size: 1.22rem;
    font-weight: 650;
    line-height: 1.35;
    letter-spacing: normal;
    text-transform: none;
    opacity: 1;
}
.confirmation-dialog p {
    margin: 0;
    color: var(--text-secondary, #b9c7d6);
    font-size: .94rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-line;
}
.confirmation-fields:not([hidden]), .confirmation-fields label:not([hidden]) {
    display: grid;
    gap: 8px;
}
.confirmation-fields:not([hidden]) { margin-top: 16px; gap: 14px; }
.confirmation-fields label { font-size: .9rem; font-weight: 500; }
.confirmation-dialog .confirmation-fields :is(input, textarea) {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--border-strong, #73879b66);
    border-radius: 6px;
    background: var(--background-color-input, #263644);
    color: inherit;
    font: inherit;
}
.confirmation-fields textarea { resize: vertical; }
.confirmation-fields :is(input, textarea):focus-visible { outline: 2px solid var(--color-accent, #79b3ff); }
.confirmation-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle, #73879b33);
    background: var(--surface-2, #71849d12);
}
.confirmation-dialog button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--border-strong, #73879b66);
    border-radius: 9px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.confirmation-dialog button:hover { background: var(--color-accent-10, #509aff1a); }
.confirmation-dialog button:focus-visible { outline: 2px solid var(--color-accent, #79b3ff); outline-offset: 3px; }
.confirmation-dialog .confirmation-close { min-height: 36px; width: 36px; padding: 0; border-color: transparent; font-size: 1.45rem; font-weight: 400; }
.confirmation-dialog .confirmation-accept { min-width: 100px; background: #2364b0; border-color: #5697e2; color: #fff; }
.confirmation-dialog .confirmation-accept:hover { background: #1d5599; }

@keyframes confirmation-enter {
    from { opacity: 0; transform: translateY(6px) scale(.99); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    dialog.confirmation-dialog[open] { animation: none; }
}
@media (max-width: 390px) {
    .confirmation-content { gap: 10px; padding: 20px 16px; }
    .confirmation-actions { padding-inline: 16px; }
    .confirmation-actions button { flex: 1; }
}

dialog.unsaved-changes-dialog {
    box-sizing:border-box; width:min(560px,calc(100vw - 32px)); max-width:none;
    min-width:0; max-height:calc(100dvh - 32px); margin:auto; padding:28px;
    overflow:auto; border:1px solid var(--border-strong,#6b7c8c80); border-radius:18px;
    background:var(--surface-1,#25313f); color:var(--text-primary,#e6eaf0);
    box-shadow:0 24px 80px #0005;
}
dialog.unsaved-changes-dialog::backdrop { background:#07142199; backdrop-filter:blur(3px); }
.unsaved-changes-dialog *, .unsaved-changes-dialog *::before, .unsaved-changes-dialog *::after { box-sizing:border-box; }
.unsaved-changes-dialog [hidden] { display:none !important; }
.unsaved-changes-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; }
.unsaved-changes-dialog .unsaved-changes-icon { display:grid; place-items:center; width:48px; height:48px; border-radius:13px; background:var(--color-accent-10,#3a8dca18); color:var(--color-accent,#3a8dca); font-size:30px; }
.unsaved-changes-dialog h2 { margin:0 0 12px; padding:0; border:0; font-size:1.5rem; line-height:1.25; text-transform:none; letter-spacing:normal; }
.unsaved-changes-dialog p { margin:0; line-height:1.55; overflow-wrap:anywhere; }
.unsaved-changes-dialog #unsaved-changes-help { margin-top:12px; font-size:.9rem; color:var(--text-secondary,#aebdce); }
.unsaved-changes-dialog button { display:inline-flex; align-items:center; justify-content:center; min-height:44px; max-width:100%; padding:10px 15px; border:1px solid var(--border-strong,#6b7c8c80); border-radius:10px; color:inherit; background:transparent; font:inherit; font-weight:600; cursor:pointer; white-space:normal; }
.unsaved-changes-dialog button:hover { background:var(--hover-bg,#3a8dca15); }
.unsaved-changes-dialog button:focus-visible { outline:3px solid var(--color-accent,#3a8dca); outline-offset:3px; }
.unsaved-changes-dialog .unsaved-changes-close { width:44px; padding:0; border:0; font-size:1.8rem; font-weight:400; }
.unsaved-changes-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:10px; margin-top:28px; }
.unsaved-changes-dialog .unsaved-changes-discard { border-color:#b96363; }
.unsaved-changes-dialog .unsaved-changes-save { background:var(--color-accent,#3a8dca); border-color:var(--color-accent,#3a8dca); color:#fff; }
.unsaved-changes-dialog .unsaved-changes-save:hover { filter:brightness(.93); }
@media(max-width:540px) {
    dialog.unsaved-changes-dialog { padding:22px; }
    .unsaved-changes-actions { flex-direction:column; align-items:stretch; }
    .unsaved-changes-actions > button { width:100%; }
}
