.paper {
  width: 100%;
  flex: 1;
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 14%),
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 28px 28px, 28px 28px, auto;
  color: var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-paper);
  padding: 22px 28px 72px;
  position: relative;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.paper::before {
  content: "";
  position: absolute;
  inset: 10px auto 14px 0;
  width: 6px;
  border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--page-color, var(--cyan)) 78%, #083344);
  opacity: 0.9;
}

.paper-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.colors {
  display: flex;
  gap: 6px;
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
}

.color-dot.is-on {
  border-color: var(--ink);
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.12;
  margin: 0 0 14px;
  border: 0;
  background: transparent;
  width: 100%;
  color: var(--ink);
  caret-color: var(--cyan);
}

.page-title::placeholder {
  color: rgba(12, 21, 32, 0.28);
}

.page-body {
  position: relative;
  flex: 1 0 auto;
  min-height: 12rem;
}

.blocks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.block {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 4px;
  align-items: start;
  border-radius: 10px;
}

.block:hover .block-handle,
.block:focus-within .block-handle {
  opacity: 1;
}

.block-handle {
  opacity: 0;
  width: 24px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: grab;
  border-radius: 8px;
}

.block-handle:active {
  cursor: grabbing;
}

.block.is-dragging {
  opacity: 0.45;
}

.text-block,
.check-label,
.hardcopy figcaption {
  font-family: var(--font-write);
  font-size: 1.12rem;
  line-height: 1.55;
  min-height: 1.55em;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
}

.text-block[data-empty="true"]::before,
.check-label[data-empty="true"]::before,
.hardcopy figcaption[data-empty="true"]::before {
  content: attr(data-placeholder);
  color: rgba(12, 21, 32, 0.32);
  pointer-events: none;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 4px;
}

.check {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  margin-top: 4px;
  border-radius: 6px;
  border: 1.5px solid rgba(12, 21, 32, 0.32);
  background: rgba(255, 255, 255, 0.4);
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
}

.check svg {
  opacity: 0;
  width: 14px;
  height: 14px;
}

.check.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.check.is-on svg {
  opacity: 1;
}

.check-label {
  flex: 1;
  padding-top: 2px;
}

.check-row.is-done .check-label {
  text-decoration: line-through;
  color: var(--ink-soft);
}

.hardcopy {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  background: #f7f9fd;
  padding: 6px 8px 6px;
  box-shadow: 0 10px 22px rgba(12, 24, 48, 0.12);
  pointer-events: auto;
  touch-action: none;
  max-width: none;
}

.hardcopy.is-on {
  box-shadow: 0 0 0 2px var(--cyan), 0 12px 24px rgba(12, 24, 48, 0.16);
  z-index: 20;
}

.hardcopy-grab {
  height: 14px;
  margin: 0 0 4px;
  border-radius: 4px;
  background: repeating-linear-gradient(
    90deg,
    rgba(12, 21, 32, 0.18) 0 2px,
    transparent 2px 6px
  );
  background-size: 8px 4px;
  background-position: center;
  background-repeat: repeat-x;
  cursor: grab;
}

.hardcopy-grab:active {
  cursor: grabbing;
}

.hardcopy-media {
  display: block;
  line-height: 0;
}

.hardcopy img,
.hardcopy iframe {
  width: 100%;
  height: auto;
  background: #dce6f2;
  min-height: 48px;
  pointer-events: none;
}

.hardcopy[data-kind="pdf"] iframe {
  height: var(--media-h, 280px);
  border: 0;
  background: #fff;
  pointer-events: auto;
}

.hardcopy figcaption {
  margin-top: 6px;
  font-size: 0.92rem;
  min-height: 1.4em;
  pointer-events: auto;
}

.stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.resize-handle {
  position: absolute;
  width: 11px;
  height: 11px;
  background: var(--cyan);
  border: 1px solid #fff;
  opacity: 0;
  pointer-events: none;
}

.hardcopy.is-on .resize-handle {
  opacity: 1;
  pointer-events: auto;
}

.resize-handle[data-c="nw"] {
  left: -5px;
  top: -5px;
  cursor: nwse-resize;
}

.resize-handle[data-c="ne"] {
  right: -5px;
  top: -5px;
  cursor: nesw-resize;
}

.resize-handle[data-c="sw"] {
  left: -5px;
  bottom: -5px;
  cursor: nesw-resize;
}

.resize-handle[data-c="se"] {
  right: -5px;
  bottom: -5px;
  cursor: nwse-resize;
}

.floater-kill {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: 0;
  background: rgba(8, 14, 24, 0.55);
  color: #e8f4ff;
  border-radius: 6px;
  opacity: 0;
  z-index: 2;
}

.hardcopy:hover .floater-kill,
.hardcopy.is-on .floater-kill {
  opacity: 1;
}

.block-kill {
  position: absolute;
  right: 0;
  top: 0;
  opacity: 0;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
}

.block:hover .block-kill,
.block:focus-within .block-kill {
  opacity: 1;
}

@media print {
  .atmosphere,
  .rail,
  .studio-bar,
  .dock,
  .block-handle,
  .block-kill,
  .floater-kill,
  .resize-handle,
  .hardcopy-grab,
  .menu-toggle {
    display: none !important;
  }

  html,
  body {
    height: auto;
    overflow: visible;
  }

  body,
  .studio,
  .sheet-wrap,
  .app {
    background: white;
    display: block;
    height: auto;
    overflow: visible;
  }

  .paper {
    box-shadow: none;
    width: 100%;
    height: auto;
  }
}

@media (max-width: 860px) {
  .paper {
    padding: 18px 16px 64px;
  }
}
