body {
  margin: 0;
  background: #f3f5f7;
  color: #202734;
  font-family: Arial, Helvetica, sans-serif;
}

.vrf-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px;
}

.vrf-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.vrf-topbar h1,
.vrf-map h2,
.vrf-box h2 {
  margin: 0;
}

.vrf-topbar h1 {
  font-size: 26px;
}

.vrf-topbar p {
  margin: 5px 0 0;
  color: #5d6978;
}

.vrf-downloads {
  display: flex;
  gap: 8px;
}

.vrf-downloads a,
.vrf-map-tools button,
.vrf-primary,
.vrf-generate {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  min-height: 38px;
  padding: 9px 13px;
  text-decoration: none;
}

.vrf-downloads a,
.vrf-primary {
  background: #176b5d;
  color: #fff;
}

.vrf-generate {
  width: 100%;
  background: #244a8f;
  color: #fff;
}

.vrf-generate:disabled {
  cursor: default;
  opacity: 0.45;
}

.vrf-map-tools button {
  background: #e6ebf1;
  color: #253044;
}

.vrf-alert {
  background: #fff1f0;
  border: 1px solid #e5aaa3;
  border-radius: 8px;
  color: #8b1d12;
  font-weight: 700;
  margin-bottom: 12px;
  padding: 12px 14px;
}

.vrf-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.vrf-map,
.vrf-box {
  background: #fff;
  border: 1px solid #d9dee7;
  border-radius: 8px;
}

.vrf-map {
  min-width: 0;
  padding: 14px;
}

.vrf-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.vrf-map-head span {
  color: #657285;
  display: block;
  margin-top: 4px;
}

.vrf-map-tools {
  display: flex;
  gap: 8px;
}

.vrf-canvas-wrap {
  align-items: center;
  aspect-ratio: 1.45;
  background: #141920;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

#preview-canvas {
  image-rendering: auto;
  max-height: 100%;
  max-width: 100%;
}

.vrf-empty {
  color: #dce3ec;
  left: 50%;
  max-width: 300px;
  position: absolute;
  text-align: center;
  top: 50%;
  transform: translate(-50%, -50%);
}

.vrf-legend {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-top: 12px;
}

.vrf-legend-item {
  align-items: center;
  border: 1px solid #dfe4ec;
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: 18px 72px 1fr;
  min-height: 34px;
  padding: 7px;
}

.vrf-legend-item span,
.swatch {
  border-radius: 4px;
  display: inline-block;
  height: 18px;
  width: 18px;
}

.vrf-legend-item em {
  color: #5d6978;
  font-style: normal;
  text-align: right;
}

.vrf-controls {
  display: grid;
  gap: 12px;
}

.vrf-box {
  padding: 14px;
}

.vrf-box h2 {
  font-size: 17px;
  margin-bottom: 12px;
}

.vrf-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.vrf-field,
.vrf-slider {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.vrf-field span,
.vrf-slider span {
  color: #344054;
  font-weight: 700;
}

.vrf-field input,
.vrf-field select,
.vrf-dose input {
  border: 1px solid #bfc7d5;
  border-radius: 6px;
  min-height: 36px;
  padding: 7px 8px;
}

.vrf-slider {
  grid-template-columns: 74px 1fr 76px;
  align-items: center;
}

.vrf-slider input {
  width: 100%;
}

.vrf-slider output {
  color: #5d6978;
  text-align: right;
}

.vrf-dose-table {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.vrf-dose {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 18px 1fr 96px;
}

.c1 { background: #d7191c; }
.c2 { background: #fdae61; }
.c3 { background: #a6d96a; }
.c4 { background: #1a9641; }

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

  .vrf-topbar,
  .vrf-map-head {
    align-items: stretch;
    flex-direction: column;
  }
}
