.xkk-calculator,
.xkk-calculator * {
  box-sizing: border-box;
}

.xkk-calculator {
  --xkk-primary: #121c2f;
  --xkk-accent: #d6a12c;
  --xkk-text: #172033;
  --xkk-muted: #667085;
  --xkk-line: #d9dee7;
  --xkk-soft: #f5f7fa;
  --xkk-white: #ffffff;
  font-family: inherit;
  color: var(--xkk-text);
  width: 100%;
  margin: 24px auto;
}

.xkk-hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: stretch;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--xkk-line);
  border-left: 5px solid var(--xkk-accent);
  border-radius: 18px;
  background: #ffffff;
  color: var(--xkk-text);
}

.xkk-hero h2 {
  margin: 0;
  color: var(--xkk-primary);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.xkk-subtitle {
  max-width: 780px;
  margin: 14px 0 0;
  color: var(--xkk-muted);
  font-size: 16px;
  line-height: 1.65;
}

.xkk-hero-badge {
  min-width: 210px;
  padding: 18px 20px;
  border: 1px solid var(--xkk-line);
  border-radius: 16px;
  background: var(--xkk-soft);
  align-self: center;
}

.xkk-hero-badge span {
  display: block;
  margin-bottom: 8px;
  color: var(--xkk-muted);
  font-size: 13px;
}

.xkk-hero-badge strong {
  color: var(--xkk-primary);
  font-size: 28px;
  line-height: 1;
}

.xkk-info-card,
.xkk-card,
.xkk-results,
.xkk-stats details {
  border: 1px solid var(--xkk-line);
  border-radius: 16px;
  background: var(--xkk-white);
  box-shadow: none;
}

.xkk-info-card {
  margin: 20px 0;
  padding: 20px 22px;
  color: var(--xkk-muted);
  font-size: 16px;
  line-height: 1.7;
  background: #fbfcfd;
}

.xkk-info-card p:last-child {
  margin-bottom: 0;
}

.xkk-grid,
.xkk-wizard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.7fr);
  gap: 20px;
  align-items: start;
}

.xkk-wizard-card {
  min-height: 420px;
}

.xkk-wizard-head {
  margin-bottom: 18px;
}

.xkk-progress {
  margin: 0 0 24px;
  padding: 16px;
  border: 1px solid var(--xkk-line);
  border-radius: 14px;
  background: #fbfcfd;
}

.xkk-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--xkk-muted);
  font-size: 14px;
  font-weight: 750;
}

.xkk-progress-top strong {
  color: var(--xkk-primary);
}

.xkk-progress-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf3;
}

.xkk-progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: var(--xkk-accent);
  transition: width 0.24s ease;
}

.xkk-wizard-steps {
  position: relative;
}

.xkk-wizard-step {
  animation: xkkFadeStep 0.18s ease both;
}

@keyframes xkkFadeStep {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.xkk-step-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.xkk-step-meta > span {
  color: var(--xkk-muted);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.xkk-help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--xkk-line);
  border-radius: 999px;
  background: #fbfcfd;
  color: var(--xkk-primary);
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.xkk-help-button:hover,
.xkk-help-button:focus-visible {
  background: var(--xkk-primary);
  color: #ffffff;
  border-color: var(--xkk-primary);
  outline: none;
}

.xkk-wizard-field {
  grid-template-columns: minmax(0, 1fr) minmax(140px, 180px);
  align-items: stretch;
  padding: clamp(18px, 3vw, 24px);
  min-height: 168px;
}

.xkk-field-copy {
  display: grid;
  align-content: center;
  gap: 9px;
}

.xkk-field-copy strong {
  color: var(--xkk-primary);
  font-size: clamp(18px, 2.3vw, 24px);
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.xkk-field-copy small {
  color: var(--xkk-muted);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 500;
}

.xkk-wizard-field input {
  align-self: center;
  min-height: 58px;
  font-size: 22px;
}

.xkk-field input.is-error {
  border-color: #b42318;
  background: #fff7f7;
}

.xkk-step-warning {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid #f3b3ae;
  border-radius: 10px;
  background: #fff7f7;
  color: #b42318;
  font-weight: 750;
}

.xkk-wizard-nav {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(180px, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.xkk-wizard-nav .xkk-button {
  width: 100%;
  margin: 0;
}

.xkk-wizard-nav .xkk-button[hidden] {
  display: none;
}

.xkk-calculator.is-calculated .xkk-summary-card {
  border-color: rgba(214, 161, 44, 0.55);
}

.xkk-help-modal-box {
  width: min(560px, 100%);
}

.xkk-help-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(214, 161, 44, 0.16);
  color: var(--xkk-primary);
  font-weight: 950;
  font-size: 20px;
}

.xkk-card {
  padding: clamp(20px, 3vw, 28px);
}

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

.xkk-card-head,
.xkk-results-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.xkk-card-head h3,
.xkk-results-head h3 {
  margin: 0;
  color: var(--xkk-primary);
  font-size: 22px;
  letter-spacing: -0.02em;
}

.xkk-card-head p {
  margin: 4px 0 0;
  color: var(--xkk-muted);
  line-height: 1.55;
}

.xkk-step {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(214, 161, 44, 0.16);
  color: var(--xkk-primary);
  font-weight: 900;
  font-size: 13px;
}

.xkk-fields {
  display: grid;
  gap: 12px;
}

.xkk-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 14px;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid var(--xkk-line);
  border-radius: 12px;
  background: #ffffff;
}

.xkk-field span {
  font-weight: 650;
  line-height: 1.35;
}

.xkk-field input,
.xkk-lead-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--xkk-line);
  border-radius: 10px;
  background: #fff;
  color: var(--xkk-text);
  font: inherit;
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.xkk-field input {
  padding: 10px 12px;
  text-align: right;
  font-weight: 800;
}

.xkk-lead-form input {
  margin-top: 7px;
  padding: 10px 12px;
}

.xkk-field input:focus,
.xkk-lead-form input:focus {
  border-color: var(--xkk-primary);
  background: #fbfcfd;
}

.xkk-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  margin: 18px 0 0;
  padding: 12px 18px;
  border: 1px solid var(--xkk-primary);
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.xkk-button:hover,
.xkk-button:focus-visible {
  background: #ffffff;
  color: var(--xkk-primary);
  border-color: var(--xkk-primary);
  outline: none;
}

.xkk-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.xkk-button-primary,
.xkk-button-secondary {
  background: var(--xkk-primary);
  color: #ffffff;
}

.xkk-button-ghost {
  background: #ffffff;
  color: var(--xkk-primary);
  border-color: var(--xkk-line);
}

.xkk-button-ghost:hover,
.xkk-button-ghost:focus-visible {
  background: var(--xkk-primary);
  color: #ffffff;
  border-color: var(--xkk-primary);
}

.xkk-summary-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 24px;
  border: 1px dashed var(--xkk-line);
  border-radius: 12px;
  color: var(--xkk-muted);
  text-align: center;
  background: #fbfcfd;
}

.xkk-summary {
  display: grid;
  gap: 14px;
}

.xkk-metric {
  padding: 18px;
  border-radius: 12px;
  background: #fbfcfd;
  border: 1px solid var(--xkk-line);
}

.xkk-metric span {
  display: block;
  color: var(--xkk-muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.xkk-metric strong {
  color: var(--xkk-primary);
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1;
}

.xkk-metric-strong {
  background: var(--xkk-primary);
}

.xkk-metric-strong span,
.xkk-metric-strong strong {
  color: #fff;
}

.xkk-actions .xkk-button {
  margin-top: 10px;
}

.xkk-results {
  margin-top: 20px;
  padding: clamp(18px, 3vw, 26px);
}

.xkk-results-head {
  justify-content: space-between;
  align-items: center;
}

.xkk-results-head > div {
  display: flex;
  gap: 14px;
  align-items: center;
}

.xkk-small-link {
  border: 0;
  background: transparent;
  color: var(--xkk-primary);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.xkk-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.xkk-result-table,
.xkk-stat-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--xkk-line);
  border-radius: 12px;
  background: #fff;
}

.xkk-result-table th,
.xkk-result-table td,
.xkk-stat-table th,
.xkk-stat-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--xkk-line);
  vertical-align: top;
  text-align: left;
  font-size: 14px;
}

.xkk-result-table th,
.xkk-stat-table th,
.xkk-result-table tfoot td,
.xkk-stat-table tfoot td {
  background: #f2f4f7;
  color: var(--xkk-primary);
  font-weight: 850;
}

.xkk-result-table tbody tr:nth-child(even) td,
.xkk-stat-table tbody tr:nth-child(even) td {
  background: #fbfcfd;
}

.xkk-number,
.xkk-result-table th:nth-child(3),
.xkk-result-table th:nth-child(4),
.xkk-result-table tfoot td:nth-child(3),
.xkk-result-table tfoot td:nth-child(4),
.xkk-stat-table td:not(:first-child),
.xkk-stat-table th:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}

.xkk-muted-cell {
  color: transparent;
}

.xkk-stats {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.xkk-stats details {
  padding: 0;
  overflow: hidden;
}

.xkk-stats summary {
  cursor: pointer;
  padding: 17px 20px;
  font-weight: 850;
  color: var(--xkk-primary);
  background: #fbfcfd;
}

.xkk-stats .xkk-table-wrap {
  padding: 18px;
}

.xkk-source-note {
  margin: 0 18px 18px;
  color: var(--xkk-muted);
  font-size: 13px;
}

.xkk-source-note a {
  color: var(--xkk-primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.xkk-highlight-row td {
  background: var(--xkk-primary) !important;
  color: #fff;
  font-weight: 850;
}

.xkk-modal[hidden] {
  display: none !important;
}

.xkk-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 22px;
}

.xkk-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 28, 47, 0.68);
}

.xkk-modal-box {
  position: relative;
  width: min(680px, 100%);
  max-height: min(720px, 92vh);
  overflow: auto;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--xkk-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: none;
}

.xkk-modal-box h3 {
  margin: 0 36px 8px 0;
  color: var(--xkk-primary);
  font-size: 26px;
  letter-spacing: -0.03em;
}

.xkk-modal-box p {
  color: var(--xkk-muted);
  line-height: 1.6;
}

.xkk-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--xkk-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--xkk-text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.xkk-modal-close:hover {
  background: var(--xkk-primary);
  color: #ffffff;
  border-color: var(--xkk-primary);
}

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

.xkk-lead-form label {
  display: block;
  color: var(--xkk-text);
  font-weight: 700;
}

.xkk-form-status {
  margin: 12px 0 0;
  min-height: 22px;
  font-weight: 700;
}

.xkk-form-status.is-error {
  color: #b42318;
}

.xkk-form-status.is-success {
  color: #067647;
}

.xkk-form-status.is-info {
  color: var(--xkk-primary);
}

.xkk-modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .xkk-hero,
  .xkk-grid,
  .xkk-wizard-layout {
    grid-template-columns: 1fr;
  }

  .xkk-hero {
    display: grid;
  }

  .xkk-hero-badge,
  .xkk-summary-card {
    position: static;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .xkk-calculator {
    margin: 18px auto;
  }

  .xkk-hero,
  .xkk-card,
  .xkk-results,
  .xkk-info-card {
    border-radius: 14px;
  }

  .xkk-field,
  .xkk-wizard-field,
  .xkk-lead-grid {
    grid-template-columns: 1fr;
  }

  .xkk-field input {
    text-align: left;
  }

  .xkk-wizard-nav {
    grid-template-columns: 1fr;
  }

  .xkk-wizard-field {
    min-height: auto;
  }

  .xkk-result-table,
  .xkk-stat-table {
    min-width: 760px;
  }

  .xkk-results-head {
    display: grid;
    gap: 10px;
  }
}

/* v1.0.6 - subtelniejszy przycisk pomocy i precyzyjne centrowanie ikon */
.xkk-help-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid #cfd6e2;
  border-radius: 999px;
  background: #ffffff;
  color: var(--xkk-primary);
  box-shadow: none;
  font-size: 0 !important;
  line-height: 1 !important;
}

.xkk-help-button::before {
  content: "?";
  display: block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  transform: translateY(-0.5px);
}

.xkk-help-button:hover,
.xkk-help-button:focus-visible {
  background: rgba(214, 161, 44, 0.12);
  border-color: var(--xkk-accent);
  color: var(--xkk-primary);
}

.xkk-modal-close {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 0 !important;
  line-height: 1 !important;
}

.xkk-modal-close::before {
  content: "\00d7";
  display: block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-1px);
}

.xkk-help-modal-box h3 {
  margin-right: 46px;
  font-size: clamp(21px, 3vw, 25px);
  line-height: 1.25;
}

.xkk-help-modal-box [data-xkk-help-text] {
  margin: 14px 0 0;
  color: #4b5565;
  font-size: 16px;
  line-height: 1.65;
  white-space: pre-line;
}


/* v1.0.7 - twardy reset ikon przycisków pod style Betheme */
.xkk-calculator button.xkk-help-button,
.xkk-calculator .xkk-step-meta button.xkk-help-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 34px !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid #cfd6e2 !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  background-image: none !important;
  color: var(--xkk-primary) !important;
  box-shadow: none !important;
  text-align: center !important;
  text-indent: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  vertical-align: middle !important;
  overflow: hidden !important;
}

.xkk-calculator button.xkk-help-button::before,
.xkk-calculator button.xkk-help-button::after {
  content: none !important;
  display: none !important;
}

.xkk-calculator button.xkk-help-button .xkk-icon-glyph {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-align: center !important;
  transform: translateY(-0.5px) !important;
  pointer-events: none !important;
}

.xkk-calculator button.xkk-help-button:hover,
.xkk-calculator button.xkk-help-button:focus-visible {
  background: rgba(214, 161, 44, 0.12) !important;
  border-color: var(--xkk-accent) !important;
  color: var(--xkk-primary) !important;
  outline: none !important;
}

.xkk-calculator button.xkk-modal-close,
.xkk-calculator .xkk-modal-box button.xkk-modal-close {
  -webkit-appearance: none !important;
  appearance: none !important;
  position: absolute !important;
  top: 18px !important;
  right: 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid #cfd6e2 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  background-image: none !important;
  color: var(--xkk-primary) !important;
  box-shadow: none !important;
  text-align: center !important;
  text-indent: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  overflow: hidden !important;
}

.xkk-calculator button.xkk-modal-close::before,
.xkk-calculator button.xkk-modal-close::after {
  content: none !important;
  display: none !important;
}

.xkk-calculator button.xkk-modal-close .xkk-close-glyph {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 26px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-align: center !important;
  transform: translateY(-1px) !important;
  pointer-events: none !important;
}

.xkk-calculator button.xkk-modal-close:hover,
.xkk-calculator button.xkk-modal-close:focus-visible {
  background: var(--xkk-primary) !important;
  border-color: var(--xkk-primary) !important;
  color: #ffffff !important;
  outline: none !important;
}

/* v1.0.8 - przycisk nowej kalkulacji */
.xkk-actions {
  display: grid;
  gap: 10px;
}

.xkk-actions .xkk-button {
  margin-top: 0;
}

.xkk-actions .xkk-button:first-child {
  margin-top: 10px;
}

.xkk-reset-button {
  background: #ffffff !important;
  color: var(--xkk-primary) !important;
  border-color: var(--xkk-line) !important;
}

.xkk-reset-button:hover,
.xkk-reset-button:focus-visible {
  background: var(--xkk-primary) !important;
  color: #ffffff !important;
  border-color: var(--xkk-primary) !important;
}

.xkk-results-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.xkk-results-reset {
  width: auto !important;
  min-height: 38px !important;
  margin: 0 !important;
  padding: 8px 14px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  background: #ffffff !important;
  color: var(--xkk-primary) !important;
  border-color: var(--xkk-line) !important;
}

.xkk-results-reset:hover,
.xkk-results-reset:focus-visible {
  background: var(--xkk-primary) !important;
  color: #ffffff !important;
  border-color: var(--xkk-primary) !important;
}

@media (max-width: 640px) {
  .xkk-results-tools {
    justify-content: flex-start;
  }

  .xkk-results-reset {
    width: 100% !important;
  }
}
