.rk-calculator {
  --rk-orange: #f58200;
  --rk-orange-soft: #ffb234;
  --rk-orange-pale: #fff3df;
  --rk-ink: #171717;
  --rk-navy: #070a3f;
  --rk-muted: #6f6f6f;
  --rk-line: #ece6dc;
  --rk-card: #ffffff;
  --rk-paper: #fbf8f2;
  --rk-dark: #25211e;
  --rk-shadow: 0 18px 46px rgba(23, 23, 23, 0.08);
  --rk-radius: 14px;
  box-sizing: border-box;
  color: var(--rk-ink);
  font-family: "Montserrat", Arial, sans-serif;
  margin: 24px auto 72px;
  max-width: 1140px;
  padding: 0 16px;
}

.rk-calculator *,
.rk-calculator *::before,
.rk-calculator *::after {
  box-sizing: border-box;
}

.rk-summary__header h3,
.rk-modal__header h3 {
  color: inherit !important;
  font-family: "Montserrat", Arial, sans-serif !important;
  margin: 0;
}

.rk-layout {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) 300px;
}

.rk-sections {
  display: grid;
  gap: 14px;
}

.rk-section,
.rk-summary__card,
.rk-modal__dialog {
  background: var(--rk-card);
  border: 1px solid var(--rk-line);
  border-radius: var(--rk-radius);
  box-shadow: var(--rk-shadow);
  overflow: hidden;
}

.rk-section__header {
  align-items: center;
  background: #fff;
  border: 0;
  border-left: 5px solid var(--rk-orange);
  cursor: pointer;
  display: grid;
  gap: 14px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 70px;
  padding: 16px 20px 16px 18px;
  text-align: left;
  width: 100%;
}

.rk-section__header:hover {
  background: #fffaf2;
}

.rk-section__icon {
  align-items: center;
  background: linear-gradient(135deg, var(--rk-orange), var(--rk-orange-soft));
  border-radius: 12px;
  color: #fff;
  display: flex;
  font-size: 20px;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.rk-section__title {
  color: var(--rk-navy);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.rk-section__subtotal {
  background: var(--rk-orange-pale);
  border-radius: 999px;
  color: var(--rk-orange);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 12px;
  white-space: nowrap;
}

.rk-section__body {
  border-top: 1px solid var(--rk-line);
  display: none;
}

.rk-section.is-open .rk-section__body {
  display: block;
}

.rk-item {
  align-items: center;
  background: #fff;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 54px 124px 78px;
  min-height: 66px;
  padding: 14px 18px;
}

.rk-item:nth-child(even) {
  background: #fffdf8;
}

.rk-item + .rk-item {
  border-top: 1px solid var(--rk-line);
}

.rk-item__name {
  color: var(--rk-ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.rk-item__desc {
  color: var(--rk-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  margin-top: 4px;
}

.rk-item__unit {
  color: var(--rk-ink);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.rk-item__total {
  color: var(--rk-ink);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.rk-item__total.is-active {
  color: var(--rk-orange);
}

.rk-calculator .rk-qty {
  align-items: center;
  background: #f7f1e8;
  border: 1px solid #e6d8c5;
  border-radius: 999px;
  display: grid;
  grid-template-columns: 34px 42px 34px;
  height: 38px;
  overflow: hidden;
  padding: 0 !important;
  width: 110px;
}

.rk-calculator .rk-qty input {
  appearance: textfield;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--rk-ink) !important;
  display: block !important;
  font-family: "Montserrat", Arial, sans-serif !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  height: 38px !important;
  line-height: 38px !important;
  min-height: 0 !important;
  outline: 0;
  padding: 0 !important;
  text-align: center !important;
  width: 42px !important;
}

.rk-calculator .rk-qty input::-webkit-outer-spin-button,
.rk-calculator .rk-qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.rk-calculator .rk-qty__btn {
  align-items: center;
  appearance: none !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--rk-orange) !important;
  cursor: pointer;
  display: flex;
  font-family: "Montserrat", Arial, sans-serif !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  height: 38px !important;
  justify-content: center;
  line-height: 1 !important;
  margin: 0 !important;
  min-height: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  position: relative;
  text-decoration: none !important;
  transition: background 0.18s ease, color 0.18s ease;
  width: 34px !important;
}

.rk-calculator .rk-qty__btn span {
  color: inherit !important;
  display: block !important;
  font: inherit !important;
  line-height: 1 !important;
  pointer-events: none;
}

.rk-calculator .rk-qty__btn::before,
.rk-calculator .rk-qty__btn::after {
  display: none !important;
}

.rk-calculator .rk-qty__btn:hover {
  background: var(--rk-orange) !important;
  color: #fff !important;
}

.rk-summary {
  position: sticky;
  top: 24px;
}

.rk-summary__card {
  border-radius: 16px;
}

.rk-summary__header {
  background:
    linear-gradient(135deg, rgba(245, 130, 0, 0.16), transparent 40%),
    var(--rk-dark);
  color: #fff;
  padding: 22px 20px;
}

.rk-summary__header h3 {
  color: #fff !important;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.rk-summary__header p {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 500;
  margin: 6px 0 0;
}

.rk-summary__total,
.rk-breakdown,
.rk-actions,
.rk-summary__note {
  padding: 18px 18px;
}

.rk-summary__label {
  color: var(--rk-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.rk-summary__amount {
  color: var(--rk-orange);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.rk-summary__vat {
  color: var(--rk-muted);
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
}

.rk-breakdown {
  border-bottom: 1px solid var(--rk-line);
  border-top: 1px solid var(--rk-line);
  display: grid;
  gap: 11px;
}

.rk-breakdown__row,
.rk-modal__summary-row {
  align-items: center;
  display: flex;
  font-size: 12px;
  gap: 12px;
  justify-content: space-between;
}

.rk-breakdown__label {
  align-items: center;
  color: var(--rk-muted);
  display: inline-flex;
  font-weight: 600;
  gap: 8px;
  min-width: 0;
}

.rk-breakdown__row strong {
  color: var(--rk-ink);
  font-weight: 800;
  white-space: nowrap;
}

.rk-breakdown__dot {
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  height: 7px;
  width: 7px;
}

.rk-actions {
  display: grid;
  gap: 10px;
}

.rk-btn {
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  min-height: 48px;
  padding: 13px 18px;
  text-align: center;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.rk-btn:hover {
  transform: translateY(-1px);
}

.rk-btn--primary {
  background: var(--rk-orange);
  color: #fff;
}

.rk-btn--primary:hover {
  background: #df7300;
}

.rk-btn--secondary {
  background: #fff;
  border: 1px solid var(--rk-line);
  color: var(--rk-ink);
}

.rk-btn--secondary:hover {
  border-color: var(--rk-orange);
}

.rk-summary__note {
  color: var(--rk-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.65;
  margin: 0;
}

.rk-modal[hidden] {
  display: none;
}

.rk-modal {
  inset: 0;
  position: fixed;
  z-index: 99999;
}

.rk-modal__backdrop {
  background: rgba(23, 23, 23, 0.62);
  inset: 0;
  position: absolute;
}

.rk-modal__dialog {
  left: 50%;
  max-height: calc(100vh - 48px);
  max-width: 660px;
  overflow: auto;
  position: relative;
  top: 24px;
  transform: translateX(-50%);
  width: calc(100% - 32px);
}

.rk-modal__header,
.rk-modal__body,
.rk-modal__footer {
  padding: 20px 22px;
}

.rk-modal__header {
  align-items: center;
  background: var(--rk-dark);
  color: #fff;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.rk-modal__header h3 {
  color: #fff !important;
  font-size: 22px;
  font-weight: 800;
}

.rk-modal__header p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 500;
  margin: 5px 0 0;
}

.rk-icon-btn {
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 24px;
  height: 36px;
  justify-content: center;
  line-height: 1;
  width: 36px;
}

.rk-modal__summary {
  border-bottom: 1px solid var(--rk-line);
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 18px;
}

.rk-modal__summary-row {
  font-size: 13px;
}

.rk-modal__summary-row--total {
  color: var(--rk-orange);
  font-size: 16px;
  font-weight: 800;
}

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

.rk-field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.rk-field span {
  color: var(--rk-ink);
  font-size: 12px;
  font-weight: 800;
}

.rk-field input,
.rk-field textarea {
  background: var(--rk-paper);
  border: 1px solid var(--rk-line);
  border-radius: 10px;
  color: var(--rk-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  outline: 0;
  padding: 13px 14px;
  width: 100%;
}

.rk-field input:focus,
.rk-field textarea:focus {
  border-color: var(--rk-orange);
  box-shadow: 0 0 0 3px rgba(245, 130, 0, 0.14);
}

.rk-field input.is-invalid,
.rk-field textarea.is-invalid {
  border-color: #d64545;
}

.rk-modal__footer {
  border-top: 1px solid var(--rk-line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.rk-toast {
  background: var(--rk-dark);
  border-radius: 999px;
  bottom: 24px;
  box-shadow: 0 14px 32px rgba(23, 23, 23, 0.22);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  left: 50%;
  opacity: 0;
  padding: 13px 18px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 24px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100000;
}

.rk-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

  .rk-summary {
    position: static;
  }
}

@media (max-width: 720px) {
  .rk-calculator {
    margin: 18px auto 42px;
    padding: 0 14px;
  }

  .rk-sections {
    gap: 12px;
  }

  .rk-section {
    border-radius: 13px;
  }

  .rk-section__header {
    border-left: 0;
    gap: 12px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    min-height: 76px;
    padding: 14px 16px;
  }

  .rk-section__icon {
    border-radius: 10px;
    font-size: 18px;
    height: 38px;
    width: 38px;
  }

  .rk-section__title {
    font-size: 16px;
    line-height: 1.2;
  }

  .rk-section__subtotal {
    font-size: 11px;
    justify-self: end;
    padding: 7px 10px;
  }

  .rk-item {
    align-items: start;
    gap: 8px 12px;
    grid-template-columns: minmax(0, 1fr) 110px;
    min-height: 74px;
    padding: 14px 12px;
  }

  .rk-item__name {
    font-size: 13px;
    line-height: 1.25;
  }

  .rk-item__desc {
    font-size: 11px;
    line-height: 1.35;
    margin-top: 4px;
  }

  .rk-item__unit {
    display: none;
  }

  .rk-item__total {
    display: none;
    grid-column: 1 / -1;
    margin-top: -2px;
    text-align: right;
  }

  .rk-item__total.is-active {
    display: block;
  }

  .rk-calculator .rk-qty {
    grid-template-columns: 32px 38px 32px;
    height: 34px;
    justify-self: end;
    width: 102px;
  }

  .rk-calculator .rk-qty input {
    font-size: 13px !important;
    height: 34px !important;
    line-height: 34px !important;
    width: 38px !important;
  }

  .rk-calculator .rk-qty__btn {
    font-size: 16px !important;
    height: 34px !important;
    width: 32px !important;
  }

  .rk-layout {
    gap: 16px;
  }

  .rk-summary__header h3 {
    font-size: 20px;
  }

  .rk-summary__amount {
    font-size: 30px;
  }

  .rk-form__row {
    grid-template-columns: 1fr;
  }

  .rk-modal__footer {
    flex-direction: column-reverse;
  }
}
