@layer components {
  /* ======================
   * DIALOG
   * ======================
   * Native HTML dialog component styling.
   */
  .dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: min(90vw, 32rem);
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background-color: var(--color-canvas);
    box-shadow: var(--shadow-lg);
    padding: 0;
  }

  .dialog::backdrop {
    background-color: oklch(0% 0 0 / 50%);
  }

  .dialog__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-block-end: 1px solid var(--color-border);
    background-color: var(--color-surface);
  }

  .dialog__title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0;
  }

  .dialog__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  .dialog__close:hover {
    background-color: var(--color-surface-hover);
    color: var(--color-text);
  }

  .dialog__body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .dialog__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--inline-space-sm);
    padding: 1rem 1.5rem;
    border-block-start: 1px solid var(--color-border);
    background-color: var(--color-surface);
  }
}
