.kq-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
  font-family: Arial, Helvetica, sans-serif;
  color: #111827;
}

.kq-form {
  display: block;
}

.kq-header {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 18px;
}

.kq-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.kq-logo {
  width: 135px;
  max-width: 135px;
  height: auto;
  display: block;
  object-fit: contain;
}

.kq-brand h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.kq-brand p {
  margin: 0;
  color: #4b5563;
  line-height: 1.5;
}

.kq-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

.kq-card h3 {
  margin: 0 0 16px;
  font-size: 20px;
}

.kq-grid-2,
.kq-grid-3,
.kq-grid-4 {
  display: grid;
  gap: 14px;
}

.kq-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kq-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kq-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kq-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.kq-field label {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

.kq-field input,
.kq-field select,
.kq-field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  color: #111827;
  background: #ffffff;
  box-sizing: border-box;
}

.kq-field textarea {
  resize: vertical;
  min-height: 88px;
}

.kq-field input:focus,
.kq-field select:focus,
.kq-field textarea:focus {
  outline: none;
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.kq-services-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.kq-services-head h3 {
  margin-bottom: 4px;
}

.kq-services-head p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.kq-add-btn,
.kq-submit-btn,
.kq-remove-line {
  border: 0;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.kq-add-btn:hover,
.kq-submit-btn:hover,
.kq-remove-line:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.kq-add-btn {
  background: #111827;
  color: #ffffff;
  border-radius: 12px;
  padding: 12px 16px;
  white-space: nowrap;
}

.kq-line {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
}

.kq-line-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.kq-line-top h4 {
  margin: 0;
  font-size: 17px;
}

.kq-remove-line {
  background: #fee2e2;
  color: #991b1b;
  border-radius: 10px;
  padding: 9px 12px;
}

.kq-line-total {
  min-height: 44px;
  border-radius: 12px;
  background: #111827;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 16px;
  box-sizing: border-box;
}

.kq-submit-wrap {
  position: sticky;
  bottom: 16px;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.14);
  backdrop-filter: blur(10px);
}

.kq-total-box {
  min-width: 220px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 10px 14px;
}

.kq-total-box span {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.kq-total-box strong {
  display: block;
  font-size: 24px;
  color: #111827;
  line-height: 1.1;
}

.kq-submit-btn {
  min-height: 54px;
  background: #111827;
  color: #ffffff;
  border-radius: 14px;
  padding: 14px 22px;
  font-size: 16px;
  white-space: nowrap;
}

.kq-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.kq-message {
  margin-top: 14px;
  border-radius: 12px;
  padding: 13px 15px;
  font-weight: 700;
}

.kq-message.success {
  background: #dcfce7;
  color: #166534;
}

.kq-message.error {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 900px) {
  .kq-grid-3,
  .kq-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kq-services-head {
    flex-direction: column;
  }

  .kq-add-btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .kq-wrapper {
    padding: 12px;
  }

  .kq-header,
  .kq-card,
  .kq-line {
    border-radius: 14px;
    padding: 16px;
  }

  .kq-brand {
    align-items: flex-start;
    gap: 14px;
  }

  .kq-logo {
    width: 92px;
    max-width: 92px;
  }

  .kq-brand h2 {
    font-size: 19px;
  }

  .kq-brand p {
    font-size: 13px;
  }

  .kq-grid-2,
  .kq-grid-3,
  .kq-grid-4 {
    grid-template-columns: 1fr;
  }

  .kq-line-top {
    align-items: flex-start;
  }

  .kq-remove-line {
    padding: 8px 10px;
    font-size: 13px;
  }

  .kq-submit-wrap {
    left: 10px;
    right: 10px;
    bottom: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
  }

  .kq-total-box {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    text-align: center;
  }

  .kq-total-box strong {
    font-size: 22px;
  }

  .kq-submit-btn {
    width: 100%;
    min-height: 56px;
    font-size: 15px;
    padding: 14px 16px;
  }
}

.kq-wrapper {
  background: #f5f6f8;
  padding-top: 24px;
  padding-bottom: 120px;
}

body:has(.kq-wrapper) {
  background: #f5f6f8 !important;
}

.kq-card,
.kq-header {
  background: #ffffff;
}

@media (max-width: 640px) {
  .kq-wrapper {
    padding-left: 14px;
    padding-right: 14px;
    padding-bottom: 130px;
  }
}