    .modal { animation: modalPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
    @keyframes modalPop { from { transform: scale(0.96) translateY(12px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

    .ds-modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 50;
      background: rgb(15 23 42 / 0.38);
      backdrop-filter: blur(2px);
    }
    .ds-modal-backdrop.hidden { display: none !important; }
    .ds-modal-layer {
      position: fixed;
      inset: 0;
      z-index: 60;
      display: flex;
      align-items: flex-start;
      justify-content: center;
      padding: var(--ds-space-10) var(--ds-space-6) var(--ds-space-8);
      pointer-events: none;
      /* Visual viewport height when keyboard is open (set by bugReport / draft JS) */
      --ds-modal-max-h: min(100dvh, var(--ds-vvh, 100dvh));
    }
    .ds-modal-layer.hidden { display: none !important; }
    /* Must come after base .ds-modal-layer / .ds-modal-backdrop or stack z-index loses */
    .ds-modal-backdrop.ds-modal-backdrop--stack { z-index: 75; }
    .ds-modal-layer.ds-modal-layer--stack { z-index: 80; }
    .ds-modal-layer > .ds-modal-card { pointer-events: auto; }
    .ds-modal-card {
      display: flex;
      flex-direction: column;
      width: 100%;
      min-width: 0;
      max-height: calc(var(--ds-modal-max-h) - var(--ds-space-10) - var(--ds-space-8));
      background: var(--ds-surface);
      border: 1px solid var(--ds-border);
      border-radius: var(--ds-radius-lg);
      overflow: hidden;
      box-shadow:
        0 24px 48px rgb(15 23 42 / 0.1),
        0 0 0 0.5px rgb(15 23 42 / 0.04);
    }
    .ds-modal--wide { max-width: min(72rem, calc(100vw - 3rem)); }
    .ds-modal--review { max-width: min(44rem, calc(100vw - 3rem)); }
    .ds-modal--confirm { max-width: min(24rem, calc(100vw - 3rem)); }
    /* Multi-field forms (O3 bug report) — wider than confirm, still centered */
    .ds-modal--form { max-width: min(28rem, calc(100vw - 3rem)); }
    /* ADR-003 / D3c conflict — compare strip + short diff */
    .ds-modal--conflict { max-width: min(28rem, calc(100vw - 3rem)); }
