/* A modal built on the dialog element, so the browser keeps focus inside it
   and Escape closes it. A project row opens two: one with a field, and a small
   one that asks before deleting. On a phone it becomes a sheet at the bottom
   of the screen. Sizes are in em, 1em to the em at the usual 1.2308em. */
.dh-dialog-demo {
  --accent: var(--dh-accent, #2563ff);
  --line: color-mix(in srgb, var(--dh-fg, #171717) 9%, transparent);
  --ring: 0 0 0 1px var(--line), 0 1px 2px color-mix(in srgb, var(--dh-fg, #171717) 10%, transparent);
  width: 30.7692em;
  max-width: 100%;
  color: var(--dh-fg, #171717);
  font-size: 0.8125em;
  line-height: 1.5385em;
  text-align: left;
}
.dh-dialog-card {
  display: flex;
  align-items: center;
  gap: 0.6154em;
  padding: 0.7692em 0.7692em 0.7692em 0.9231em;
  border-radius: 0.9231em;
  background: var(--dh-raised, #fff);
  box-shadow: var(--ring);
}
/* The project's picture: a small accent tile that thins out into dots. */
.dh-dialog-card > i {
  flex: none;
  width: 2.4615em;
  height: 2.4615em;
  border-radius: 0.6154em;
  background: linear-gradient(color-mix(in srgb, var(--accent) 82%, #000), var(--accent));
  -webkit-mask-image: linear-gradient(#000 30%, transparent), radial-gradient(circle, #000 0.085em, transparent 0.108em);
  mask-image: linear-gradient(#000 30%, transparent), radial-gradient(circle, #000 0.085em, transparent 0.108em);
  -webkit-mask-size: auto, 0.308em 0.308em;
  mask-size: auto, 0.308em 0.308em;
}
.dh-dialog-card > p {
  display: grid;
  flex: 1;
  min-width: 0;
  margin: 0 0 0 0.1538em;
}
.dh-dialog-card b {
  overflow: hidden;
  font-weight: 500;
  line-height: 1.3846em;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dh-dialog-card span {
  overflow: hidden;
  color: var(--dh-muted, #5c5c5c);
  font-size: 0.9231em;
  line-height: 1.2308em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dh-dialog-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  height: 2.4615em;
  padding: 0 0.9231em;
  border: 0;
  border-radius: 0.6154em;
  background: var(--dh-raised, #fff);
  color: var(--dh-fg, #171717);
  font: inherit;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: var(--ring);
  transition: transform 150ms cubic-bezier(0.23, 1, 0.32, 1);
}
.dh-dialog-btn[data-tone="quiet-danger"] {
  color: #d92d20;
}
.dh-dialog-btn:is([data-tone="primary"], [data-tone="danger"]) {
  --fill: var(--accent);
  background: linear-gradient(color-mix(in srgb, var(--fill) 84%, #fff), var(--fill));
  color: var(--dh-on-accent, #fff);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), 0 0 0 1px color-mix(in srgb, var(--fill) 78%, #000), 0 1px 2px color-mix(in srgb, var(--dh-fg, #171717) 22%, transparent);
}
.dh-dialog-btn[data-tone="danger"] {
  --fill: #d92d20;
  color: #fff;
}
.dh-dialog-btn:active {
  transform: scale(0.97);
}
.dh-dialog-demo :is(button, input):focus-visible {
  outline: 2px solid var(--dh-faint, #8a8a8a);
  outline-offset: 1px;
}

.dh-dialog {
  overflow: hidden;
  width: 29.2308em;
  max-width: calc(100% - 2.4615em);
  padding: 0;
  border: 0;
  border-radius: 1.0769em;
  background: var(--dh-raised, #fff);
  color: var(--dh-fg, #171717);
  font-size: 1em;
  line-height: 1.5385em;
  text-align: left;
  box-shadow: var(--ring), 0 14px 28px -14px rgb(0 0 0 / 0.35);
}
.dh-dialog[data-size="small"] {
  width: 26.1538em;
}
.dh-dialog[open] {
  animation: dh-dialog-in 240ms cubic-bezier(0.23, 1, 0.32, 1) both;
}
.dh-dialog::backdrop {
  background: rgb(0 0 0 / 0.3);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: dh-dialog-fade 240ms cubic-bezier(0.23, 1, 0.32, 1) both;
}
.dh-dialog[data-closing] {
  animation: dh-dialog-out 200ms cubic-bezier(0.23, 1, 0.32, 1) both;
}
.dh-dialog[data-closing]::backdrop {
  animation: dh-dialog-fade 200ms cubic-bezier(0.23, 1, 0.32, 1) reverse both;
}
.dh-dialog header {
  padding: 1.0769em 1.2308em 1.0769em;
}
.dh-dialog h2 {
  margin: 0;
  font-size: 1.0769em;
  font-weight: 500;
  line-height: 1.5385em;
  letter-spacing: -0.015em;
}
.dh-dialog p {
  margin: 0.1538em 0 0;
  color: var(--dh-muted, #5c5c5c);
}
.dh-dialog label {
  display: grid;
  gap: 0.3846em;
  padding: 0 1.2308em 1.2308em;
}
.dh-dialog label span {
  color: var(--dh-muted, #5c5c5c);
  font-size: 0.8462em;
  line-height: 1.2308em;
}
.dh-dialog input {
  min-width: 0;
  height: 2.4615em;
  padding: 0 0.7692em;
  border: 0;
  border-radius: 0.5385em;
  background: var(--dh-well, #ededeb);
  color: inherit;
  font: inherit;
  outline: none;
  transition: box-shadow 150ms cubic-bezier(0.23, 1, 0.32, 1);
}
.dh-dialog-demo .dh-dialog input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--dh-faint, #8a8a8a);
}
.dh-dialog footer {
  display: flex;
  justify-content: space-between;
  gap: 0.6154em;
  padding: 0.7692em 0.9231em;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--dh-fg, #171717) 3%, var(--dh-raised, #fff));
}

/* A sheet on a phone: it rises from the bottom, and the confirm goes on top. */
@media (max-width: 480px) {
  .dh-dialog,
  .dh-dialog[data-size="small"] {
    width: 100%;
    max-width: none;
    margin-bottom: 0;
    border-radius: 1.0769em 1.0769em 0 0;
  }
  .dh-dialog[open] {
    animation-name: dh-dialog-up;
    animation-duration: 320ms;
  }
  .dh-dialog[data-closing] {
    animation-name: dh-dialog-down;
  }
  .dh-dialog footer {
    flex-direction: column-reverse;
    padding: 0.9231em 1.2308em max(0.9231em, env(safe-area-inset-bottom));
  }
  .dh-dialog footer .dh-dialog-btn,
  .dh-dialog input {
    height: 3.3846em;
  }
  .dh-dialog input {
    font-size: 1rem;
  }
}

@keyframes dh-dialog-in {
  from {
    opacity: 0;
    transform: translateY(0.9231em) scale(0.98);
    filter: blur(4px);
  }
}
@keyframes dh-dialog-out {
  to {
    opacity: 0;
    transform: translateY(0.4615em) scale(0.98);
    filter: blur(4px);
  }
}
@keyframes dh-dialog-up {
  from {
    transform: translateY(100%);
  }
}
@keyframes dh-dialog-down {
  to {
    transform: translateY(100%);
  }
}
@keyframes dh-dialog-fade {
  from {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dh-dialog[open] {
    animation: dh-dialog-fade 200ms both;
  }
  .dh-dialog[data-closing] {
    animation: dh-dialog-fade 150ms reverse both;
  }
  .dh-dialog-btn,
  .dh-dialog input {
    transition: none;
  }
}
