.image-grayscale-page .tool-workbench {
  width: min(100% - 48px, 1440px);
}

.image-grayscale-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 22px;
  align-items: start;
}

.image-grayscale-preview-card,
.image-grayscale-panel,
.image-grayscale-preview-grid article,
.image-grayscale-upload {
  border: 1px solid rgba(119, 145, 202, .18);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 18px 46px rgba(47, 85, 155, .09);
}

.image-grayscale-preview-card {
  display: grid;
  gap: 18px;
  border-radius: 24px;
  padding: 18px;
}

.image-grayscale-upload {
  display: grid;
  min-height: 116px;
  place-items: center;
  gap: 6px;
  border-style: dashed;
  border-radius: 20px;
  color: #213a67;
  background:
    radial-gradient(circle at 50% 0%, rgba(34, 114, 255, .08), transparent 42%),
    rgba(255, 255, 255, .92);
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.image-grayscale-upload:hover {
  border-color: rgba(34, 114, 255, .38);
  box-shadow: 0 22px 52px rgba(40, 96, 198, .13);
  transform: translateY(-1px);
}

.image-grayscale-upload input {
  display: none;
}

.image-grayscale-upload .upload-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #1682ff, #7458ff);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 14px 26px rgba(57, 106, 240, .2);
}

.image-grayscale-upload b {
  max-width: 90%;
  overflow: hidden;
  color: #081733;
  font-size: 17px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-grayscale-upload em {
  color: #7686a8;
  font-size: 13px;
  font-style: normal;
  font-weight: 650;
}

.image-grayscale-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.image-grayscale-preview-grid article {
  display: grid;
  min-height: 470px;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(45deg, rgba(103, 128, 174, .08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(103, 128, 174, .08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(103, 128, 174, .08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(103, 128, 174, .08) 75%),
    #fbfdff;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  background-size: 28px 28px;
  grid-template-rows: auto minmax(0, 1fr);
}

.image-grayscale-preview-grid header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(125, 148, 194, .14);
  color: #26436f;
  background: rgba(255, 255, 255, .74);
  font-size: 14px;
  font-weight: 800;
}

.image-grayscale-preview-grid img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 620px;
  padding: 14px;
  object-fit: contain;
  box-sizing: border-box;
}

.image-grayscale-preview-grid p {
  display: grid;
  margin: 0;
  min-height: 300px;
  place-items: center;
  color: #8a97b5;
  font-size: 15px;
  font-weight: 760;
}

.image-grayscale-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  color: #607196;
  background: linear-gradient(135deg, rgba(235, 244, 255, .9), rgba(255, 255, 255, .92));
  font-size: 13px;
  font-weight: 700;
}

.image-grayscale-info b {
  color: #0f2348;
  white-space: nowrap;
}

.image-grayscale-panel {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 18px;
  border-radius: 24px;
  padding: 20px;
}

.image-grayscale-panel section {
  display: grid;
  gap: 12px;
}

.image-grayscale-panel h2 {
  margin: 0;
  color: #081733;
  font-size: 16px;
  font-weight: 850;
}

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

.grayscale-mode {
  display: grid;
  gap: 4px;
  min-height: 70px;
  padding: 12px;
  border: 1px solid rgba(117, 145, 202, .18);
  border-radius: 16px;
  color: #263d66;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.grayscale-mode:hover {
  border-color: rgba(41, 111, 246, .32);
  transform: translateY(-1px);
}

.grayscale-mode.active {
  border-color: rgba(43, 115, 255, .45);
  background: linear-gradient(135deg, rgba(36, 124, 255, .12), rgba(121, 89, 255, .11));
  box-shadow: 0 14px 28px rgba(47, 96, 196, .12);
}

.grayscale-mode b {
  color: #0d1b38;
  font-size: 14px;
  font-weight: 820;
}

.grayscale-mode span {
  color: #7483a4;
  font-size: 12px;
  font-weight: 650;
}

.image-grayscale-controls {
  padding: 14px;
  border-radius: 18px;
  background: rgba(245, 248, 255, .78);
}

.image-grayscale-controls label {
  display: grid;
  gap: 9px;
}

.image-grayscale-controls label + label {
  margin-top: 14px;
}

.image-grayscale-controls label.muted {
  opacity: .62;
}

.image-grayscale-controls span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #40557e;
  font-size: 13px;
  font-weight: 760;
}

.image-grayscale-controls b {
  color: #1767e8;
}

.image-grayscale-controls input[type="range"] {
  width: 100%;
  accent-color: #247cff;
}

.image-grayscale-format {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.image-grayscale-format button {
  height: 40px;
  border: 1px solid rgba(117, 145, 202, .18);
  border-radius: 14px;
  color: #28416d;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.image-grayscale-format button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #1682ff, #7458ff);
  box-shadow: 0 12px 24px rgba(52, 103, 229, .18);
}

.image-grayscale-download {
  height: 48px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #1678ff, #6e5dff);
  box-shadow: 0 18px 34px rgba(46, 102, 230, .2);
  font-size: 15px;
  font-weight: 840;
  cursor: pointer;
  transition: filter .2s ease, transform .2s ease;
}

.image-grayscale-download:hover:not(:disabled) {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.image-grayscale-download:disabled {
  opacity: .48;
  cursor: not-allowed;
}

@media (max-width: 980px) {
  .image-grayscale-page .tool-workbench {
    width: min(100% - 24px, 1440px);
  }

  .image-grayscale-layout,
  .image-grayscale-preview-grid {
    grid-template-columns: 1fr;
  }

  .image-grayscale-panel {
    position: static;
  }
}
