:root {
  color-scheme: light;
  --ink: #6a4934;
  --muted: #876955;
  --line: #e9d2b1;
  --soft: #fbf7f0;
  --paper: #ffffff;
  --accent: #7a5233;
  --accent-strong: #b68554;
  --green: #7a5233;
  --shadow: 0 8px 40px rgba(122, 82, 51, .12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(122, 82, 51, .1), transparent 34%),
    linear-gradient(315deg, rgba(182, 133, 84, .12), transparent 38%),
    var(--soft);
}

.app {
  position: relative;
  width: min(2048px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.siteBack {
  position: absolute;
  top: 4px;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}

.siteBack:hover {
  color: var(--accent-strong);
}

.siteBack span:first-child {
  font-size: 17px;
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, .95fr) minmax(360px, .9fr) minmax(420px, 1.15fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.controls {
  padding: 24px;
}

.optionPanel {
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.mark {
  display: block;
  width: 38px;
  height: 52px;
  object-fit: contain;
  flex: 0 0 auto;
}

h1 {
  margin: 0;
  font-family: "Noto Sans", "Segoe UI", Arial, sans-serif;
  font-size: clamp(24px, 2vw, 32px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0;
  color: var(--accent);
}

h2 {
  margin: 6px 0 18px;
  font-family: "Noto Sans", "Segoe UI", Arial, sans-serif;
  font-size: clamp(21px, 1.7vw, 27px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0;
  color: var(--accent);
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

p a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label,
legend,
.fieldLabel {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

select,
input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}

select:focus,
input:focus,
button:focus {
  outline: 3px solid rgba(122, 82, 51, .25);
  outline-offset: 2px;
}

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

.bandWrap {
  display: grid;
  gap: 8px;
}

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

.bandIndicator {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--muted);
  font-weight: 500;
  text-align: center;
}

.bandIndicator.active {
  border-color: var(--accent);
  background: rgba(233, 210, 177, .45);
  color: var(--accent-strong);
}

.bandIndicator.limitFlash {
  animation: widthLimitFlash .9s ease;
}

@keyframes widthLimitFlash {
  0%,
  100% {
    border-color: var(--accent);
    background: rgba(233, 210, 177, .45);
    color: var(--accent-strong);
  }

  35% {
    border-color: var(--accent-strong);
    background: var(--accent);
    color: #fff;
  }
}

.metrics div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #fbf7f0;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
}

.resultHead span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  display: block;
  margin-top: 0;
  font-size: 20px;
  text-align: right;
}

fieldset {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.options {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.option {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 30px;
}

.option input[type="checkbox"],
.option input[type="radio"] {
  min-height: 22px;
  width: 22px;
  accent-color: var(--accent);
}

.optionName {
  color: var(--ink);
  font-weight: 600;
}

.optionMeta {
  color: var(--muted);
  font-size: 13px;
}

.result {
  position: sticky;
  top: 24px;
  padding: 22px;
}

.resultHead {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.resultActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

#total {
  display: block;
  margin-top: 3px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  padding: 10px 14px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

#copy {
  position: relative;
  overflow: hidden;
  min-height: 50px;
  padding: 16px 36px;
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 1px;
}

#copy:hover {
  background: rgba(233, 210, 177, .45);
}

#orderOpen::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .2), transparent);
  transition: left .5s ease;
}

#orderOpen:hover::before {
  left: 100%;
}

#orderOpen {
  position: relative;
  overflow: hidden;
  min-height: 50px;
  padding: 16px 36px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 1px;
}

#orderOpen:hover {
  background: #60413b;
}

button:disabled {
  cursor: wait;
  opacity: .65;
}

.buttonSecondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.buttonSecondary:hover {
  background: rgba(233, 210, 177, .45);
}

.notice {
  display: none;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(233, 210, 177, .45);
  color: var(--green);
  font-weight: 650;
}

.notice.show {
  display: block;
}

.breakdown {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.resultTotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7f0;
}

.resultTotal span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
}

.resultTotal strong {
  font-size: 22px;
  text-align: right;
}

.line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 2px 0 6px 0;
  border-bottom: 1px solid var(--line);
}

.line:last-child {
  border-bottom: 0;
}

.line b {
  display: block;
  font-size: 15px;
}

.line small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.line strong {
  white-space: nowrap;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.open {
  display: flex;
}

.modalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(61, 43, 31, .45);
}

.modalDialog {
  position: relative;
  width: min(100%, 520px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 60px rgba(61, 43, 31, .22);
  padding: 22px;
}

.modalHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modalHead h2 {
  margin: 0;
}

.modalTitle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modalLogo {
  display: block;
  width: 28px;
  height: 38px;
  object-fit: contain;
  flex: 0 0 auto;
}

.modalClose {
  min-height: 34px;
  width: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}

.orderForm {
  display: grid;
  gap: 14px;
}

.privacyConsent {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.privacyConsent input {
  min-height: 22px;
  width: 22px;
  margin: 0;
  accent-color: var(--accent);
}

.privacyConsent a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  resize: vertical;
  background: white;
  color: var(--ink);
  font: inherit;
}

textarea:focus {
  outline: 3px solid rgba(122, 82, 51, .25);
  outline-offset: 2px;
}

.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.orderStatus {
  min-height: 20px;
  margin: 0;
  font-size: 14px;
}

@media (max-width: 1240px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .result {
    grid-column: 1 / -1;
    position: static;
  }
}

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

  .optionPanel {
    height: auto !important;
  }

  .grid.two,
  .metrics {
    grid-template-columns: 1fr;
  }

  .resultHead {
    align-items: stretch;
    flex-direction: column;
  }

  .resultActions {
    justify-content: stretch;
  }

  .resultActions button {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .app {
    width: min(100% - 20px, 2048px);
    padding: 36px 0 10px;
  }

  .siteBack {
    top: 8px;
  }

  .controls,
  .optionPanel,
  .result {
    padding: 16px;
  }

  .brand {
    align-items: flex-start;
  }

  .mark {
    flex: 0 0 auto;
  }

  .option {
    grid-template-columns: 22px 1fr;
  }

  .optionMeta {
    grid-column: 2;
  }
}
