:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: #f4f1eb;
  color: #171717;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

.shell {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  min-height: 100vh;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
  background: #ffffff;
  border-right: 1px solid #d8d3ca;
}

.brand h1 {
  margin: 0 0 8px;
  font-size: 1.65rem;
  line-height: 1.15;
}

.brand p {
  margin: 0;
  color: #5f5a52;
  line-height: 1.45;
}

.form {
  display: grid;
  gap: 16px;
}

.input-row {
  display: grid;
  grid-template-columns: 70px 70px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 650;
  color: #2c2a26;
}

label span {
  font-size: 0.88rem;
}

input,
select,
button {
  width: 100%;
  min-height: 44px;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  border: 1px solid #bbb4a8;
  background: #fffdf9;
  color: #171717;
  padding: 0 12px;
}

input[maxlength="1"] {
  text-align: center;
  font-size: 1.6rem;
  padding: 0 8px;
}

.font-field {
  min-width: 0;
}

button {
  border: 0;
  background: #205f5f;
  color: #ffffff;
  font-weight: 750;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.status {
  min-height: 52px;
  padding: 12px;
  border-radius: 6px;
  background: #eef6f4;
  border: 1px solid #c9dfda;
  line-height: 1.35;
}

.status.bad {
  background: #fff1ee;
  border-color: #efc5bb;
  color: #8b1d14;
}

.status.good {
  background: #eef8ed;
  border-color: #bcdcb8;
  color: #1f6928;
}

.muted {
  color: #5f5a52;
}

.order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 6px;
  background: #d6452f;
  color: #ffffff;
  text-decoration: none;
  font-weight: 750;
}

.order.disabled {
  pointer-events: none;
  background: #b7b1a8;
}

.viewer-panel {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  background: #1d2327;
  overflow: hidden;
}

#viewer {
  width: 100%;
  height: 100vh;
}

.loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  background: rgba(29, 35, 39, 0.72);
  color: #ffffff;
  font-weight: 750;
  text-align: center;
}

.reset-view {
  position: absolute;
  top: 16px;
  right: 16px;
  width: auto;
  min-height: 38px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #171717;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.22);
}

.loader[hidden] {
  display: none;
}

.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border: 4px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .controls {
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid #d8d3ca;
  }

  .viewer-panel,
  #viewer {
    min-height: 30vh;
    height: 30vh;
  }

  .input-row {
    grid-template-columns: 64px 64px minmax(0, 1fr);
  }

  .brand h1 {
    font-size: 1.4rem;
  }
}
