/* canvas-creation.html — Canvas Resolution Lab */

.doc-cres {
  margin: 1.05rem 0 0;
  border-radius: 16px;
  border: 1px solid rgba(94, 180, 255, 0.26);
  background: linear-gradient(168deg,
      rgba(16, 22, 42, 0.82) 0%,
      rgba(10, 14, 28, 0.72) 48%,
      rgba(18, 14, 36, 0.78) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.42) inset,
    0 12px 38px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.doc-cres__stage {
  padding: 0.75rem 0.9rem 0.85rem;
  background: radial-gradient(110% 85% at 50% 12%,
      rgba(46, 231, 242, 0.06) 0%,
      transparent 52%),
    rgba(5, 8, 18, 0.52);
  border-bottom: 1px solid rgba(110, 150, 210, 0.14);
}

.doc-cres__split {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 0.85rem;
  align-items: start;
}

.doc-cres__preview-wrap {
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(110, 150, 210, 0.18);
  background: rgba(5, 10, 22, 0.55);
  padding: 0.65rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.doc-cres__preview-inner {
  position: relative;
  line-height: 0;
  max-width: 100%;
}

.doc-cres__preview-inner canvas[data-cres-canvas] {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 8px 28px rgba(0, 0, 0, 0.45);
}

.doc-cres__badge {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
  z-index: 2;
  padding: 0.28rem 0.5rem;
  border-radius: 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  pointer-events: none;
  border: 1px solid rgba(120, 190, 255, 0.22);
  background: rgba(10, 14, 28, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.doc-cres__badge.is-sharp {
  color: rgba(120, 255, 190, 0.95);
  border-color: rgba(80, 220, 150, 0.35);
}

.doc-cres__badge.is-soft {
  color: rgba(255, 180, 120, 0.95);
  border-color: rgba(255, 140, 80, 0.35);
}

.doc-cres__badge.is-neutral {
  color: rgba(190, 200, 230, 0.92);
  border-color: rgba(140, 160, 210, 0.28);
}

.doc-cres__panel {
  border-radius: 14px;
  border: 1px solid rgba(94, 200, 255, 0.14);
  background: rgba(8, 14, 28, 0.55);
  padding: 0.65rem 0.7rem 0.75rem;
}

.doc-cres__panel-title {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(190, 208, 240, 0.9);
}

.doc-cres__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.doc-cres__preset {
  flex: 1 1 auto;
  min-width: 7.5rem;
  border-radius: 10px;
  border: 1px solid rgba(110, 150, 210, 0.22);
  background: rgba(5, 10, 22, 0.72);
  color: rgba(210, 228, 255, 0.92);
  padding: 0.4rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.doc-cres__preset:hover {
  border-color: rgba(94, 200, 255, 0.4);
}

.doc-cres__preset.is-active {
  border-color: rgba(46, 231, 242, 0.45);
  background: rgba(46, 231, 242, 0.1);
  box-shadow: 0 0 16px rgba(46, 231, 242, 0.08);
}

.doc-cres__toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding: 0.5rem 0.55rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 140, 80, 0.2);
  background: rgba(255, 100, 50, 0.06);
}

.doc-cres__toggle-row:has(input:not(:checked)) {
  border-color: rgba(80, 220, 150, 0.18);
  background: rgba(80, 220, 150, 0.05);
}

.doc-cres__toggle-row input {
  margin-top: 0.15rem;
  accent-color: #2ee7f2;
}

.doc-cres__toggle-label {
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(200, 215, 240, 0.9);
}

.doc-cres__sliders {
  display: grid;
  gap: 0.5rem;
}

.doc-cres__row {
  display: grid;
  grid-template-columns: 5.2rem 1fr 3.2rem;
  gap: 0.45rem;
  align-items: center;
}

.doc-cres__row.is-muted {
  opacity: 0.45;
  pointer-events: none;
}

.doc-cres__lbl {
  font-size: 0.74rem;
  color: rgba(190, 208, 240, 0.84);
}

.doc-cres__lbl code {
  font-size: 0.68rem;
}

.doc-cres__range {
  width: 100%;
  accent-color: #2ee7f2;
}

.doc-cres__out {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 800;
  color: rgba(130, 235, 255, 0.95);
  text-align: right;
  white-space: nowrap;
}

.doc-cres__checks {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(110, 150, 210, 0.12);
  display: grid;
  gap: 0.4rem;
}

.doc-cres__check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: rgba(190, 208, 240, 0.88);
}

.doc-cres__check input {
  accent-color: #b56cff;
}

.doc-cres__metrics {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(110, 150, 210, 0.12);
  background: rgba(5, 8, 18, 0.22);
}

.doc-cres__metrics-title {
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(150, 185, 230, 0.75);
}

.doc-cres__metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem 0.75rem;
}

.doc-cres__metric {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.doc-cres__metric-k {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(150, 185, 230, 0.65);
}

.doc-cres__metric-v {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  color: rgba(210, 228, 255, 0.95);
}

.doc-cres__metric-v.is-warn {
  color: rgba(255, 175, 110, 0.98);
}

.doc-cres__metric-v.is-ok {
  color: rgba(120, 255, 190, 0.95);
}

.doc-cres__caption {
  margin: 0;
  padding: 0.75rem 0.9rem 0.85rem;
  font-size: 0.82rem;
  line-height: 1.52;
  color: rgba(165, 188, 228, 0.82);
  border-top: 1px solid rgba(110, 150, 210, 0.1);
}

@media (max-width: 1040px) {
  .doc-cres__split {
    grid-template-columns: 1fr;
  }

  .doc-cres__metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .doc-cres__row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .doc-cres__out {
    text-align: left;
  }

  .doc-cres__metrics-grid {
    grid-template-columns: 1fr;
  }

  .doc-cres__presets {
    flex-direction: column;
  }
}
