.fixture {
  min-width: 0;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--dialog-overlay-bg);
}

.overlay[data-state="open"] {
  animation: dialog-fade-open 90ms ease-out;
}

.content {
  --dialog-scrollbar-offset: 10px;
  --dialog-scroll-fade-size: 14px;

  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 90;
  display: grid;
  width: min(380px, calc(100vw - 32px));
  min-width: 0;
  max-height: calc(100vh - var(--titlebar-safe-area-top) - var(--space-lg));
  gap: var(--space-4);
  margin-top: calc(var(--titlebar-safe-area-top) / 2);
  overflow: auto;
  padding: var(--space-4);
  border: 1px solid var(--composer-glass-border);
  border-radius: var(--radius-panel);
  background: var(--composer-glass-bg);
  color: var(--text-primary);
  box-shadow:
    var(--composer-glass-shadow),
    inset 0 1px 0 var(--composer-glass-highlight);
  outline: none;
  scrollbar-color: color-mix(in srgb, var(--line-strong) 70%, transparent)
    transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  transform: translate(-50%, -50%);
  -webkit-backdrop-filter: var(--composer-glass-filter);
  backdrop-filter: var(--composer-glass-filter);
  -webkit-mask-image:
    linear-gradient(
      to bottom,
      transparent 0,
      var(--text-primary) var(--dialog-scroll-fade-size),
      var(--text-primary) calc(100% - var(--dialog-scroll-fade-size)),
      transparent 100%
    ),
    linear-gradient(var(--text-primary), var(--text-primary));
  -webkit-mask-position:
    0 0,
    right top;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size:
    calc(100% - var(--dialog-scrollbar-offset)) 100%,
    var(--dialog-scrollbar-offset) 100%;
  mask-image:
    linear-gradient(
      to bottom,
      transparent 0,
      var(--text-primary) var(--dialog-scroll-fade-size),
      var(--text-primary) calc(100% - var(--dialog-scroll-fade-size)),
      transparent 100%
    ),
    linear-gradient(var(--text-primary), var(--text-primary));
  mask-position:
    0 0,
    right top;
  mask-repeat: no-repeat;
  mask-size:
    calc(100% - var(--dialog-scrollbar-offset)) 100%,
    var(--dialog-scrollbar-offset) 100%;
}

.content[data-state="open"] {
  animation: dialog-open 90ms ease-out;
}

.content[data-project-ledger-modal="true"] {
  top: calc(var(--titlebar-height, 0px) + var(--space-4));
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100vh - var(--titlebar-height, 0px) - 32px);
  overflow: hidden;
  background: var(--surface-raised);
  transform: translateX(-50%);
  -webkit-mask-image: none;
  mask-image: none;
}

.content[data-project-ledger-modal="true"][data-state="open"] {
  animation: none;
}

.header {
  display: grid;
  gap: var(--space-2);
  padding-right: var(--space-6);
}

.footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.title {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--typo-panel-title-size);
  font-weight: var(--typo-panel-title-weight);
  line-height: var(--typo-panel-title-line-height);
}

.description {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-3);
  line-height: var(--line-height-body);
}

.close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
}

.content::-webkit-scrollbar {
  width: 8px;
}

.content::-webkit-scrollbar-track {
  background: transparent;
}

.content::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--line-strong) 70%, transparent);
  background-clip: content-box;
}

@keyframes dialog-fade-open {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes dialog-open {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
