.page-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 16px;
  background: #f7f4eb;
  border-bottom: 1px solid #e6e1d3;
  color: #2c2a29;
  font-size: 12px;
}
.page-tools button,
#pageSetupDialog button {
  border: 1px solid #b8afa1;
  border-radius: 7px;
  padding: 8px 12px;
  background: #fffdf8;
  color: #2c2a29;
  font: inherit;
  cursor: pointer;
}
.page-tools button[aria-pressed="true"],
#pageSetupDialog button[type="submit"] {
  background: #8c2d38;
  color: white;
  border-color: #8c2d38;
}
.page-tools button:focus-visible,
#pageSetupDialog :focus-visible {
  outline: 3px solid #8c2d38;
  outline-offset: 3px;
}
#pageSizeLabel {
  font-weight: 700;
  margin-right: auto;
}
#pageToolStatus {
  flex-basis: 100%;
  font-size: 11px;
}
#pageToolStatus:empty {
  display: none;
}
.studio-focus .app-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}
.studio-focus .left-panel,
.studio-focus .right-panel {
  display: none !important;
}
#printSafeGuides {
  position: absolute;
  border: 2px dashed #8c2d38;
  z-index: 5;
  pointer-events: none;
  box-sizing: border-box;
}
#printSafeGuides[hidden] {
  display: none;
}
#printSafeGuides span {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 3px 6px;
  background: #fffdf8e8;
  color: #64202a;
  font: 12px/1.3 sans-serif;
}
.freehand-crop-overlay {
  width: 100% !important;
  height: 100% !important;
}
#pageSetupDialog {
  width: min(540px, 92vw);
  max-height: 88dvh;
  overflow: auto;
  padding: 24px;
  border: 1px solid #b8afa1;
  border-radius: 16px;
  background: #fdfbf7;
  color: #2c2a29;
}
#pageSetupDialog::backdrop {
  background: #221b1866;
}
#pageSetupDialog p {
  margin: 14px 0;
  font-size: 13px;
  line-height: 1.5;
}
#pageSetupDialog label {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-size: 13px;
  font-weight: 600;
}
#pageSetupDialog input,
#pageSetupDialog select {
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid #b8afa1;
  border-radius: 6px;
  background: white;
  color: #2c2a29;
}
.page-dimensions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
#pageSetupError {
  color: #8c2d38;
}
@media (max-width: 640px) {
  .app-grid {
    grid-template-rows: auto minmax(0, 1fr);
  }
  .page-tools {
    padding: 6px 10px;
    gap: 6px;
  }
  #pageToolStatus {
    max-height: 32px;
    overflow: auto;
  }
}
