.window[data-page="paint"] {
  width: min(720px, calc(100vw - 14px));
  height: min(700px, calc(100vh - 58px));
}

.application-content,
.paint-app {
  display: flex;
  flex: 1;
  min-height: 0;
}

.paint-app {
  flex-direction: column;
  background: #e8edf2;
}

.paint-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 62px;
  padding: 8px 12px;
  border-bottom: 1px solid #aab9c5;
  background: linear-gradient(#fff, #e7edf3 52%, #d5e0e9);
  box-shadow: inset 0 1px #fff;
  flex-shrink: 0;
}

.paint-tool {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #354b5d;
  font-size: 11px;
}

.paint-color input {
  width: 36px;
  height: 32px;
  padding: 2px;
  border: 1px solid #869eaf;
  background: #fff;
}

.paint-size {
  min-width: 215px;
}

.paint-size input {
  width: 115px;
}

.paint-size output {
  width: 34px;
  color: #61788a;
  font-size: 10px;
}

.paint-eraser,
.paint-submit button {
  min-height: 30px;
  padding: 6px 13px;
  border: 1px solid #879cae;
  border-radius: 3px;
  background: linear-gradient(#fff, #dce7ef);
  box-shadow: inset 0 0 0 1px #fff;
  color: #304b60;
  font-size: 11px;
}

.paint-eraser:hover,
.paint-submit button:hover:not(:disabled) {
  border-color: #4c8daf;
  background: linear-gradient(#faffff, #c8e4f2);
}

.paint-eraser.active {
  border-color: #4d91ba;
  background: linear-gradient(#b9dcf0, #e8f7ff);
  box-shadow: inset 0 1px 4px #4e7e9a55;
}

.paint-workspace {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background-color: #aeb8c1;
  background-image: linear-gradient(45deg, #a8b2bb 25%, transparent 25%), linear-gradient(-45deg, #a8b2bb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #a8b2bb 75%), linear-gradient(-45deg, transparent 75%, #a8b2bb 75%);
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
  background-size: 10px 10px;
}

.paint-canvas-frame {
  width: 512px;
  height: 512px;
  border: 1px solid #687783;
  background: #fff;
  box-shadow: 0 2px 8px #26333d66;
}

.paint-canvas-frame canvas {
  display: block;
  width: 512px;
  height: 512px;
  cursor: crosshair;
  touch-action: none;
}

.paint-submit {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(140px, 1fr);
  align-items: end;
  gap: 10px;
  padding: 9px 12px;
  border-top: 1px solid #aab9c5;
  background: linear-gradient(#f8fafb, #e2e9ee);
  flex-shrink: 0;
}

.paint-submit label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #526979;
  font-size: 10px;
}

.paint-submit input {
  min-width: 0;
  height: 30px;
  padding: 5px 8px;
  border: 1px solid #9dafbb;
  background: #fff;
  font: 11px "Segoe UI", sans-serif;
}

.paint-submit button:disabled {
  opacity: 0.65;
}

.paint-message {
  align-self: center;
  min-width: 0;
  margin: 0;
  color: #427043;
  font-size: 10px;
  line-height: 1.25;
}

.paint-message.error {
  color: #a1372d;
}

@container (max-width: 590px) {
  .paint-submit {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .paint-message {
    grid-column: 1 / -1;
  }
}

@container (max-width: 430px) {
  .paint-size {
    min-width: 0;
  }

  .paint-size input {
    width: 90px;
  }
}
