.caas-configurator {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 4px;
}

@media (max-width: 600px) {
  .caas-configurator {
    padding: 0 4px; /* tighter on mobile */
  }
}

.caas-configurator {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.caas-configurator-header h2 {
  margin: 0 0 4px;
}

.caas-configurator-header p {
  margin: 0;
  color: #555;
}

.caas-configurator-body {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr);
  gap: 4px;

  /* NEW: make the whole body fill the viewport height */
  height: calc(100vh - 180px); /* adjust if header is taller */
}

@media (max-width: 900px) {
  .caas-configurator-body {
    grid-template-columns: 1fr;
  }
}

/* Grid of cards */
.caas-grid {
  display: grid;
  grid-template-columns: 1fr; /* one column only */
  gap: 4px;
}

@media (max-width: 600px) {
  .caas-grid {
    grid-template-columns: 1fr;
  }
}

.caas-card,
.caas-card * {
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Card */
.caas-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e3e4ea;
  padding: 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.caas-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center; /* was flex-start */
  gap: 0.5rem;
}

.caas-card-header h3 {
  margin: 0;
  font-size: 0.9rem;
}

.caas-card-category {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: #6b7280;
}

.caas-view-details {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

/* Make the tier a single horizontal row */
.caas-card-tiers {
  display: block !important;
}

.caas-tier {
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: auto !important;
  height: auto !important;

  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;

  gap: 0.5rem !important;
}

/* Remove header/body/footer stacking */
.caas-tier-header,
.caas-tier-body,
.caas-tier-footer {
  margin: 0 !important;
  padding: 0 !important;
}

/* Make artefact name normal text */
.caas-tier-name {
  text-transform: none !important;
  font-size: 0.9rem !important;
  letter-spacing: 0 !important;
}

/* Duration inline */
.caas-tier-duration {
  margin: 0 !important;
  font-size: 0.85rem !important;
}

/* Keep select button aligned */
.caas-tier-footer {
  text-align: right !important;
}

.caas-select-button {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  cursor: pointer;
  transition: all 0.15s ease;
}

.caas-select-button:hover:not(:disabled) {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.caas-select-button.caas-selected {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

/* Summary panel */
.caas-summary {
  position: sticky;
  top: 1rem; /* how far from the top it sticks */
  height: fit-content;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.caas-summary h3 {
  margin: 0;
  font-size: 1rem;
}

.caas-summary-list {
  max-height: 350px;
  overflow: auto;
  font-size: 0.85rem;
}

.caas-summary-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.caas-summary-items li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.caas-summary-items li:last-child {
  border-bottom: none;
}

.caas-summary-category {
  font-size: 0.75rem;
  color: #6b7280;
}

.caas-summary-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.caas-remove-item {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1rem;
  cursor: pointer;
}

.caas-summary-footer {
  border-top: 1px solid #e5e7eb;
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.caas-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}


.caas-download-button {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 999px;
  border: none;
  background: #0D2C58;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.caas-book-button {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 999px;
  border: none;
  background: #2563eb;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.caas-book-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.caas-book-button:not(:disabled):hover {
  background: #1d4ed8;
}

/* Modal */
.caas-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.caas-modal-open {
  display: block;
}

.caas-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.caas-modal-content {
  position: relative;
  max-width: 520px;
  margin: 10vh auto;
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  z-index: 1;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}

.caas-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
}

.caas-modal h3 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.caas-modal-meta {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: #6b7280;
}

.caas-modal h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.caas-modal-artefacts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

.caas-modal-artefacts-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.caas-modal-artefacts-list li:last-child {
  border-bottom: none;
}

/* CATEGORY WRAPPER CARD */
.caas-category-card {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
    background: #DAE7FA;
    border-radius: 12px;
    padding: 0.5rem;
    border: 1px solid #b9c9e0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    /* NEW SPACING BETWEEN CATEGORY CARDS */
    margin-bottom: 2rem;   /* space underneath each category */
}

.caas-category-container {
  display: block;
  overflow-y: auto;
  width: 100%;
}

.caas-category-container::-webkit-scrollbar {
  width: 8px;
}

.caas-category-container::-webkit-scrollbar-thumb {
  background: #c3d4ec;
  border-radius: 4px;
}

/* CATEGORY TITLE */
.caas-category-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

/* DISCIPLINE SUB‑CARDS (WHITE) */
.caas-card {
    background: #ffffff !important; /* white */
    border-radius: 8px;
    border: 1px solid #e3e4ea;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

@media (max-width: 900px) {

  .caas-configurator-body {
    grid-template-columns: 1fr;
    height: auto; /* remove fixed height on mobile */
  }

  .caas-summary {
    position: relative;
    top: 0;
    margin-bottom: 1.5rem;
  }

@media (max-width: 900px) {
  .caas-summary-floating-btn {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: #2563eb;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 999;
  }
}

@media (max-width: 900px) {
  .caas-select-button {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }

  .caas-tier {
    min-height: 130px;
  }
}

@media (max-width: 900px) {
  .caas-modal-content {
    width: 90%;
    margin: 5vh auto;
    max-height: 90vh;
    overflow-y: auto;
  }
}

.caas-card-duration {
  font-size: 0.75rem;
  color: #6b7280;
  margin-left: 0.5rem;
  white-space: nowrap;
}