/* Overlays: confirm modal and slide-over sheets (forms and detail drawers). */
dialog { color: var(--text); background: var(--surface-raised); border: 1px solid var(--border-strong); padding: 0; box-shadow: var(--shadow-pop); }
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(2px); }
dialog.modal { width: min(460px, calc(100vw - 32px)); border-radius: var(--r-xl); }
dialog.modal[open] { animation: pop-in 140ms var(--ease); }
dialog.sheet {
  position: fixed; inset: 0 0 0 auto; margin: 0; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw);
  border-radius: var(--r-xl) 0 0 var(--r-xl); border-right: 0;
}
dialog.sheet.wide { width: min(720px, 100vw); }
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-in 220ms var(--ease); }
@keyframes sheet-in { from { transform: translateX(32px); opacity: 0; } }
dialog.sheet form, dialog.sheet .sheet-inner { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 24px 14px; }
.dialog-head h2 { font-size: 20px; }
.dialog-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.dialog-body { padding: 8px 24px 24px; overflow-y: auto; flex: 1; display: grid; gap: 18px; align-content: start; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-2); }
dialog.sheet .tabs { padding: 0 24px; }
.detail-grid { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px 16px; }
.detail-grid dt { color: var(--muted); font-size: 13px; }
.detail-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.perm-group { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--border); }
.perm-group:first-child { border-top: 0; }
.perm-group h3 { color: var(--muted); font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.perm-group .check span.desc { color: var(--muted); }
.pill-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-toggles button { min-height: 34px; border-radius: 999px; padding: 0 14px; font: 500 12px/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; box-shadow: none; }
.pill-toggles button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.checklist { display: grid; gap: 4px; max-height: 280px; overflow: auto; padding: 6px; border: 1px solid var(--control-border); border-radius: var(--r); }
.checklist .check { padding: 8px 10px; border-radius: var(--r-sm); }
.checklist .check:hover { background: var(--surface-2); }

@media (max-width: 640px) { dialog.sheet, dialog.sheet.wide { width: 100vw; border-radius: 0; } .detail-grid { grid-template-columns: 1fr; gap: 2px 0; } .detail-grid dd { margin-bottom: 10px; } }
