.gridpaper-app {
  padding-bottom: 0;
}

.tool-layout {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  min-height: calc(100vh - 130px);
}

.controls {
  align-self: start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  padding-top: 18px;
}

.tool-title {
  display: grid;
  gap: 8px;
}

.tool-title h1 {
  font-size: clamp(42px, 8vw, 74px);
}

label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 7px;
}

select,
input,
button,
.actions a {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--fg);
  font: inherit;
  min-height: 40px;
}

select,
input[type="number"] {
  padding: 0 10px;
}

input[type="color"] {
  padding: 4px;
}

input[type="range"] {
  accent-color: var(--accent);
}

.pair {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

button,
.actions a {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: center;
  text-decoration: none;
}

.preview-shell {
  align-content: start;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    color-mix(in oklab, var(--surface), var(--fg) 3%);
  background-size: 28px 28px;
  display: grid;
  gap: 12px;
  justify-items: center;
  min-width: 0;
  overflow: auto;
  padding: 20px;
}

.paper-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  justify-self: start;
}

#preview {
  background: #fff;
  box-shadow:
    0 1px 2px rgba(16, 22, 26, 0.12),
    0 18px 46px rgba(16, 22, 26, 0.18);
  display: block;
  max-height: calc(100vh - 210px);
  max-width: 100%;
}

@media (max-width: 860px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }

  #preview {
    max-height: none;
    width: 100%;
  }
}

@media print {
  @page {
    margin: 0;
  }

  body {
    background: white;
  }

  .site-nav,
  .controls,
  .paper-meta {
    display: none;
  }

  .tool-page,
  .tool-layout,
  .preview-shell {
    display: block;
    margin: 0;
    max-width: none;
    min-height: 0;
    padding: 0;
  }

  #preview {
    box-shadow: none;
    height: 100vh;
    max-height: none;
    max-width: none;
    width: 100vw;
  }
}
