.sjcalc {
  --sjcalc-surface: #f7f7f7;
  --sjcalc-ink: #333;
  --sjcalc-muted: #737373;
  --sjcalc-line: #dedede;
  --sjcalc-green: #76bc21;
  --sjcalc-green-dark: #5d9817;
  --sjcalc-green-soft: #edf7df;
  --sjcalc-warning: #fff7dd;
  --sjcalc-warning-line: #dfba43;
  --sjcalc-danger: #a12828;
  color: var(--sjcalc-ink);
  font-family: "PT Root UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.sjcalc,
.sjcalc * { box-sizing: border-box; }

.sjcalc button,
.sjcalc input,
.sjcalc select { font: inherit; }

.sjcalc button,
.sjcalc input,
.sjcalc select,
.sjcalc a { -webkit-tap-highlight-color: transparent; }

.sjcalc__notice {
  padding: 12px 20px;
  border-bottom: 1px solid var(--sjcalc-warning-line);
  background: var(--sjcalc-warning);
  color: #5f4a0d;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}

.sjcalc__container {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.sjcalc__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 12px;
  color: var(--sjcalc-muted);
  font-size: 14px;
}

.sjcalc__breadcrumb a { color: inherit; text-decoration: none; }
.sjcalc__breadcrumb a:hover { color: var(--sjcalc-green-dark); }

.sjcalc__title {
  margin: 0;
  max-width: 760px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.03;
  letter-spacing: -1.6px;
  font-weight: 600;
}

.sjcalc__lead {
  max-width: 760px;
  margin: 18px 0 34px;
  color: #5a5a5a;
  font-size: 19px;
}

.sjcalc .calculator {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: 34px;
  align-items: start;
  padding-bottom: 64px;
}

.sjcalc .panel {
  border: 1px solid var(--sjcalc-line);
  background: #fff;
}

.sjcalc .panel__head {
  padding: 24px 26px;
  border-bottom: 1px solid var(--sjcalc-line);
}

.sjcalc .panel__head h2 {
  margin: 0 0 4px;
  font-size: 23px;
  line-height: 1.2;
  font-weight: 600;
}

.sjcalc .panel__head p { margin: 0; color: var(--sjcalc-muted); }
.sjcalc .panel__body { padding: 26px; }

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

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

.sjcalc .type-picker {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.sjcalc .type-picker legend {
  margin-bottom: 10px;
  padding: 0;
  font-weight: 500;
}

.sjcalc .type-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.sjcalc .type-option { position: relative; min-width: 0; }

.sjcalc .type-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sjcalc .type-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 1px solid #bababa;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}

.sjcalc .type-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: var(--sjcalc-surface);
  border-bottom: 1px solid var(--sjcalc-line);
}

.sjcalc .type-card__name {
  flex: 1;
  display: block;
  padding: 11px 12px 12px;
  font-size: 14px;
  line-height: 1.3;
}

.sjcalc .type-option input:checked + .type-card {
  border-color: var(--sjcalc-green-dark);
  box-shadow: 0 0 0 2px rgba(118, 188, 33, .2);
}

.sjcalc .type-option input:focus-visible + .type-card {
  outline: 3px solid rgba(118, 188, 33, .3);
  outline-offset: 2px;
}

.sjcalc .type-option input:disabled + .type-card {
  cursor: not-allowed;
  opacity: .64;
}

.sjcalc .type-card__status {
  display: block;
  margin-top: 5px;
  color: var(--sjcalc-muted);
  font-size: 12px;
}

.sjcalc .field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 500;
}

.sjcalc .field label small {
  color: var(--sjcalc-muted);
  font-size: 13px;
  font-weight: 400;
}

.sjcalc .input-wrap { position: relative; }

.sjcalc .field input {
  width: 100%;
  min-height: 52px;
  padding: 12px 58px 12px 14px;
  border: 1px solid #bababa;
  border-radius: 0;
  background: #fff;
  color: var(--sjcalc-ink);
  outline: none;
}

.sjcalc .field input:hover { border-color: #858585; }
.sjcalc .field input:focus {
  border-color: var(--sjcalc-green-dark);
  box-shadow: 0 0 0 2px rgba(118, 188, 33, .18);
}

.sjcalc .unit {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--sjcalc-muted);
  pointer-events: none;
}

.sjcalc .quick-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.sjcalc .chip {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #b8b8b8;
  border-radius: 0;
  background: #fff;
  color: var(--sjcalc-ink);
  cursor: pointer;
}

.sjcalc .chip:hover,
.sjcalc .chip:focus-visible {
  border-color: var(--sjcalc-green-dark);
  color: var(--sjcalc-green-dark);
  outline: none;
}

.sjcalc .benefit {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  background: var(--sjcalc-green-soft);
  border: 1px solid #c6e49e;
}

.sjcalc .benefit__mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--sjcalc-green);
  color: #fff;
  font-weight: 700;
}

.sjcalc .benefit strong { display: block; margin-bottom: 2px; }
.sjcalc .benefit p { margin: 0; color: #526144; font-size: 14px; }

.sjcalc .link-button {
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--sjcalc-green-dark);
  cursor: pointer;
}

.sjcalc .link-button[hidden] { display: none; }

.sjcalc .disclaimer {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 16px;
  background: var(--sjcalc-surface);
  color: #5e5e5e;
  font-size: 14px;
}

.sjcalc .sjcalc-result {
  position: sticky;
  top: 18px;
  border-top: 4px solid var(--sjcalc-green);
}

.sjcalc .preview {
  height: 230px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,255,255,.25)), repeating-linear-gradient(0deg, transparent 0 19px, rgba(0,0,0,.025) 20px), #f0f1ef;
  border: 1px solid var(--sjcalc-line);
  overflow: hidden;
}

.sjcalc #gridPreview {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 7px rgba(0,0,0,.12));
}

.sjcalc .price-label { color: var(--sjcalc-muted); font-size: 14px; }

.sjcalc .price {
  margin: 2px 0 4px;
  font-size: clamp(38px, 5vw, 54px);
  line-height: 1;
  letter-spacing: -1.7px;
  font-weight: 600;
}

.sjcalc .price-note { margin: 0 0 22px; color: var(--sjcalc-muted); font-size: 14px; }

.sjcalc .breakdown {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--sjcalc-line);
}

.sjcalc .breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--sjcalc-line);
}

.sjcalc .breakdown span:first-child { color: #5a5a5a; }
.sjcalc .breakdown strong { white-space: nowrap; font-weight: 500; }
.sjcalc .breakdown .positive { color: var(--sjcalc-green-dark); }

.sjcalc .specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 24px;
  border: 1px solid var(--sjcalc-line);
}

.sjcalc .spec {
  min-height: 74px;
  padding: 12px 14px;
  border-right: 1px solid var(--sjcalc-line);
}

.sjcalc .spec:last-child { border-right: 0; }
.sjcalc .spec small { display: block; color: var(--sjcalc-muted); margin-bottom: 3px; }
.sjcalc .spec strong { font-size: 18px; font-weight: 500; }

.sjcalc .primary {
  width: 100%;
  min-height: 54px;
  padding: 13px 18px;
  border: 1px solid var(--sjcalc-green);
  border-radius: 0;
  background: var(--sjcalc-green);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.sjcalc .primary:hover { background: var(--sjcalc-green-dark); border-color: var(--sjcalc-green-dark); }
.sjcalc .primary:focus-visible { outline: 3px solid rgba(118,188,33,.3); outline-offset: 2px; }

.sjcalc .copy-status {
  min-height: 21px;
  margin: 8px 0 0;
  color: var(--sjcalc-green-dark);
  text-align: center;
  font-size: 14px;
}

.sjcalc .wide-message {
  display: none;
  padding: 18px;
  border: 1px solid var(--sjcalc-warning-line);
  background: var(--sjcalc-warning);
}

.sjcalc .wide-message h3 { margin: 0 0 6px; font-size: 20px; }
.sjcalc .wide-message p { margin: 0; }
.sjcalc .sjcalc-result.is-wide .result-normal { display: none; }
.sjcalc .sjcalc-result.is-wide .wide-message { display: block; }

.sjcalc .error {
  display: none;
  margin-top: 8px;
  color: var(--sjcalc-danger);
  font-size: 13px;
}

.sjcalc .field.has-error input { border-color: var(--sjcalc-danger); }
.sjcalc .field.has-error .error { display: block; }

@media (max-width: 900px) {
  .sjcalc .calculator { grid-template-columns: 1fr; }
  .sjcalc .sjcalc-result { position: static; }
}

@media (max-width: 620px) {
  .sjcalc__container { width: min(calc(100% - 24px), 1240px); }
  .sjcalc__notice { padding-inline: 12px; }
  .sjcalc__title { font-size: 34px; letter-spacing: -1px; }
  .sjcalc__lead { margin-bottom: 24px; font-size: 17px; }
  .sjcalc .calculator { gap: 20px; }
  .sjcalc .panel__head,
  .sjcalc .panel__body { padding: 20px; }
  .sjcalc .field-grid { grid-template-columns: 1fr; }
  .sjcalc .benefit,
  .sjcalc .disclaimer,
  .sjcalc .type-picker { grid-column: auto; }
  .sjcalc .type-options { grid-template-columns: 1fr; }
  .sjcalc .type-card { display: grid; grid-template-columns: 112px 1fr; }
  .sjcalc .type-card img {
    height: 88px;
    aspect-ratio: auto;
    border-right: 1px solid var(--sjcalc-line);
    border-bottom: 0;
  }
  .sjcalc .type-card__name { align-self: center; }
  .sjcalc .benefit { grid-template-columns: auto 1fr; }
  .sjcalc .benefit .link-button { grid-column: 1 / -1; width: fit-content; }
  .sjcalc .preview { height: 190px; }
  .sjcalc .specs { grid-template-columns: 1fr; }
  .sjcalc .spec { min-height: auto; border-right: 0; border-bottom: 1px solid var(--sjcalc-line); }
  .sjcalc .spec:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .sjcalc input,
  .sjcalc button,
  .sjcalc a { transition: border-color .15s ease, color .15s ease, background-color .15s ease; }
}
