.task-scratchpad-toolbar__expand {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--task-rule-strong) 76%, var(--task-gold));
  border-radius: 8px;
  background: var(--task-paper);
  color: var(--task-ink);
}

.task-scratchpad-toolbar__expand:hover {
  background: var(--task-blue-soft);
}

body.task-scratchpad-expanded {
  overflow: hidden;
}

.task-scratchpad.is-expanded {
  --scratchpad-expanded-aspect: 2;
  position: fixed;
  z-index: 1300;
  inset: 14px;
  width: auto;
  height: auto;
  min-height: 0;
  display: flex;
  padding: 18px;
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--task-rule-strong) 72%, var(--task-gold));
  border-radius: 19px;
  background: var(--task-paper);
  box-shadow: 0 26px 80px rgba(21, 39, 65, .28);
}

.task-scratchpad.is-expanded::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: rgba(20, 36, 59, .34);
  content: "";
  backdrop-filter: blur(3px);
}

.task-scratchpad.is-expanded .task-scratchpad__header,
.task-scratchpad.is-expanded .task-scratchpad-toolbar {
  flex: 0 0 auto;
}

.task-scratchpad.is-expanded .task-scratchpad-canvas {
  width: min(100%, calc((100dvh - 188px) * var(--scratchpad-expanded-aspect)));
  min-height: 0;
  flex: 0 0 auto;
  align-self: center;
  aspect-ratio: var(--scratchpad-expanded-aspect);
  margin: 10px auto 0;
  border: 1px solid var(--task-rule-strong);
  border-radius: 12px;
}

.task-scratchpad.is-expanded .task-scratchpad__status {
  position: static;
  width: auto;
  height: auto;
  min-height: 28px;
  margin: 0;
  padding: 9px 4px 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

@media (max-width: 720px) {
  .task-scratchpad.is-expanded {
    inset: 6px;
    padding: 10px;
    border-radius: 14px;
  }

  .task-scratchpad.is-expanded .task-scratchpad-canvas {
    width: min(100%, calc((100dvh - 178px) * var(--scratchpad-expanded-aspect)));
  }
}
