.g8-tool {
  max-width: 1180px;
}

.g8-tool * {
  box-sizing: border-box;
}

.g8-tool .g8-intro-text {
  margin: 0 0 14px 0;
  font-size: 1.08rem;
  line-height: 1.65;
  color: #243240;
}

.g8-tool .g8-note-box {
  margin: 0 0 16px 0;
  padding: 14px 16px;
  border: 1px solid #e7d893;
  border-radius: 16px;
  background: #fff9dc;
  line-height: 1.55;
}

.g8-tool .g8-message {
  margin: 0 0 14px 0;
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.5;
}

.g8-tool .g8-message-error {
  border: 1px solid #efc2c2;
  background: #fff1f1;
  color: #8f1d1d;
}

.g8-tool .g8-message-info {
  border: 1px solid #cfe1ef;
  background: #f4f9fd;
  color: #234563;
}

.g8-tool #g8Form {
  margin: 0;
}

.g8-tool .g8-block,
.g8-tool .g8-result-box {
  margin: 0 0 14px 0;
  padding: 14px;
  border: 1px solid #d9e2ea;
  border-radius: 16px;
  background: #fbfdff;
}

.g8-tool .g8-label-top {
  margin: 0 0 12px 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.45;
  color: #10253d;
}

.g8-tool .g8-options {
  display: grid;
  gap: 10px;
}

.g8-tool .g8-options-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.g8-tool .g8-options-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.g8-tool .g8-options-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.g8-tool .g8-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #d7e0e8;
  border-radius: 14px;
  background: #ffffff;
  cursor: pointer;
  line-height: 1.45;
}

.g8-tool .g8-option input {
  margin-top: 3px;
  flex: 0 0 auto;
}

.g8-tool .g8-option span {
  min-width: 0;
}

.g8-tool .g8-metrics-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.g8-tool .g8-metric-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.g8-tool .g8-metric-field label {
  display: block;
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
}

.g8-tool .g8-metric-field .narzedzie-input {
  width: 100%;
  max-width: none;
  margin: 0;
}

.g8-tool .g8-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0 0;
}

.g8-tool .g8-actions .narzedzie-button {
  margin: 0;
}

.g8-tool .g8-button-secondary {
  background: #eef4f8;
  color: #12395c;
}

.g8-tool .g8-button-light {
  background: #f3f5f7;
  color: #243240;
}

.g8-tool .g8-result-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.g8-tool .g8-result-kicker {
  font-size: 0.95rem;
  font-weight: 700;
  color: #4b6176;
}

.g8-tool .g8-result-score {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  color: #122438;
}

.g8-tool .g8-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  background: #edf4f7;
  color: #1a415e;
  text-align: center;
}

.g8-tool .g8-status-badge.is-alert {
  background: #fff1f1;
  color: #8f1d1d;
}

.g8-tool .g8-status-badge.is-ok {
  background: #eef9f0;
  color: #126330;
}

.g8-tool .g8-interpretation {
  margin: 0 0 14px 0;
  line-height: 1.55;
}

.g8-tool .g8-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.g8-tool .g8-mini-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #d7e0e8;
  border-radius: 14px;
  background: #ffffff;
}

.g8-tool .g8-mini-card span {
  font-weight: 700;
}

.g8-tool .g8-breakdown-title {
  margin: 0 0 10px 0;
  font-size: 1rem;
  font-weight: 700;
}

.g8-tool .g8-breakdown {
  margin: 0;
  padding: 0;
  list-style: none;
}

.g8-tool .g8-breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #e5edf3;
}

.g8-tool .g8-breakdown li:last-child {
  border-bottom: none;
}

.g8-tool .is-invalid,
.g8-tool .narzedzie-input.is-invalid {
  border: 2px solid #d84e4e !important;
}

.g8-tool .is-block-invalid {
  border-color: #efc2c2;
  background: #fffafa;
}

.g8-pdf-desktop-note {
  display: none;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #cfe1ef;
  border-radius: 12px;
  background: #f4f9fd;
  color: #234563;
  line-height: 1.45;
}

@media (max-width: 1080px) {
  .g8-tool .g8-options-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .g8-tool .g8-options-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .g8-tool .g8-metrics-fields,
  .g8-tool .g8-result-head,
  .g8-tool .g8-mini-grid {
    grid-template-columns: 1fr;
  }

  .g8-tool .g8-result-head {
    gap: 10px;
  }

  #g8Print {
    display: none !important;
  }

  .g8-pdf-desktop-note {
    display: block;
  }  
  
}

@media (max-width: 640px) {
  .g8-tool .g8-intro-text {
    font-size: 1rem;
    line-height: 1.55;
  }

  .g8-tool .g8-note-box,
  .g8-tool .g8-block,
  .g8-tool .g8-result-box {
    padding: 12px;
    border-radius: 14px;
  }

  .g8-tool .g8-label-top {
    font-size: 0.98rem;
  }

  .g8-tool .g8-options-2,
  .g8-tool .g8-options-3,
  .g8-tool .g8-options-4 {
    grid-template-columns: 1fr;
  }

  .g8-tool .g8-options-compact-mobile-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .g8-tool .g8-option {
    padding: 10px 11px;
  }

  .g8-tool .g8-actions {
    flex-direction: column;
  }

  .g8-tool .g8-actions .narzedzie-button {
    width: 100%;
    margin: 0;
  }

  .g8-tool .g8-result-score {
    font-size: 1.7rem;
  }
}

@media (max-width: 420px) {
  .g8-tool .g8-options-compact-mobile-2 {
    grid-template-columns: 1fr;
  }
}
