.main {
  padding-top: clamp(20px, 3.2vw, 40px);
  padding-bottom: 40px;
}

.systems {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.system {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 17px;
  padding: 22px;
}

.system .system-icon {
  grid-row: auto;
}

.system--wms {
  --tone: 14 128 104;
  --surface: #e9f8f3;
  --icon-top: #d3f6e9;
  --icon-bottom: #84d7bd;
  --ink: #104f45;
  --action: #136553;
}

.system--crm {
  --tone: 102 62 190;
  --surface: #f3edff;
  --icon-top: #ede3ff;
  --icon-bottom: #c3a3f7;
  --ink: #402373;
  --action: #563499;
}

.system--rent {
  --tone: 171 68 123;
  --surface: #ffedf8;
  --icon-top: #ffe2f4;
  --icon-bottom: #e9a5ce;
  --ink: #8b295d;
  --action: #8b295d;
}

.system--market {
  --tone: 167 120 21;
  --surface: #fff7dd;
  --icon-top: #fff2bd;
  --icon-bottom: #eac268;
  --ink: #614500;
  --action: #614500;
}

.system--carpool {
  --tone: 100 136 58;
  --surface: #f1f8e7;
  --icon-top: #e7f7cd;
  --icon-bottom: #b7d78c;
  --ink: #354e24;
  --action: #354e24;
}

.system-info h2 {
  font-size: clamp(23px, 2.3vw, 28px);
}

.system-info abbr {
  color: var(--action);
  font-size: 0.56em;
  letter-spacing: 0;
  white-space: nowrap;
  text-decoration: none;
}

.system-action {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.system-action button,
.system-sign-in,
.details-download,
.details-close {
  min-height: 44px;
  border: 1px solid rgb(var(--tone) / 27%);
  border-radius: 10px;
  font: inherit;
  font-weight: 680;
  cursor: pointer;
}

.system-action button {
  margin-right: auto;
  padding: 0 12px;
  color: var(--action);
  background: rgb(var(--tone) / 7%);
}

.system-sign-in,
.details-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  color: #fff;
  background: var(--action);
  text-decoration: none;
}

.details-download {
  color: var(--action);
  background: #fff;
}

.system-sign-in span {
  line-height: 1;
}

.system-action button:hover,
.details-download:hover,
.details-close:hover {
  background: rgb(var(--tone) / 14%);
}

.system-sign-in:hover {
  filter: brightness(0.9);
}

.system-action button:focus-visible,
.system-sign-in:focus-visible,
.details-download:focus-visible,
.details-close:focus-visible {
  outline: 3px solid #2658bf;
  outline-offset: 3px;
}

body:has(.system-details[open]) {
  overflow: hidden;
}

.system-details {
  width: min(560px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: clamp(18px, 4vw, 32px);
  overflow: hidden;
  color: inherit;
  border: 1px solid rgb(var(--tone) / 30%);
  border-radius: 24px;
  background: linear-gradient(150deg, var(--surface), #fff 48%);
  box-shadow: 0 20px 64px rgb(15 28 58 / 32%);
}

.system-details[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
}

.system-details.system--crm {
  width: min(680px, calc(100% - 28px));
}

.system-details::backdrop {
  background: rgb(14 25 49 / 55%);
}

.details-header,
.details-heading {
  display: flex;
  gap: 12px;
}

.details-header {
  align-items: flex-start;
  justify-content: space-between;
}

.details-heading {
  align-items: center;
}

.details-heading .system-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 13px;
}

.details-heading .system-icon svg {
  width: 25px;
  height: 25px;
}

.details-eyebrow {
  margin: 0 0 3px;
  color: var(--action);
  font-size: 12px;
  font-weight: 700;
}

.details-heading h2 {
  margin: 0;
  font-size: clamp(21px, 5vw, 30px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.details-heading h2:focus {
  outline: none;
}

.details-close {
  display: grid;
  width: 44px;
  place-items: center;
  color: var(--action);
  background: #fff;
}

.details-close svg {
  width: 19px;
  height: 19px;
}

.details-content {
  min-height: 0;
  padding: 2px 4px 2px 2px;
  overflow: auto;
  overscroll-behavior: contain;
}

.details-content:focus-visible {
  outline: 2px solid #2658bf;
  outline-offset: 2px;
}

.details-content > p {
  margin: 0 0 16px;
  color: #344763;
  line-height: 1.55;
}

.details-feature-groups section {
  padding-top: 14px;
  border-top: 1px solid rgb(var(--tone) / 22%);
}

.details-feature-groups section + section {
  margin-top: 18px;
}

.details-access {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgb(var(--tone) / 22%);
}

.system-details h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.details-features {
  margin: 0;
  padding: 0 0 0 19px;
  color: #344763;
  font-size: 14px;
  line-height: 1.5;
}

.details-features li + li {
  margin-top: 10px;
}

.details-features li::marker {
  color: var(--action);
}

.details-features strong {
  display: block;
  color: #162341;
}

.details-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgb(var(--tone) / 24%);
  font-size: 14px;
}

.directory-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 24px;
  width: min(1100px, calc(100% - 64px));
  margin-inline: auto;
  padding-block: 16px 24px;
  border-top: 1px solid rgb(36 62 111 / 14%);
  color: #42536f;
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
}

.directory-footer p {
  margin: 0;
}

.directory-footer a {
  color: #204a9b;
  font-weight: 680;
  text-underline-offset: 3px;
}

.directory-footer a:focus-visible {
  outline: 2px solid #2658bf;
  outline-offset: 3px;
}

@media (min-width: 1200px) {
  .systems {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .system {
    padding-inline: 18px;
  }

  .system-info h2 {
    font-size: 24px;
  }
}

@media (max-width: 1023px) {
  .systems {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .main {
    width: calc(100% - 36px);
  }

  .directory-footer {
    width: min(500px, calc(100% - 36px));
  }

  .systems {
    gap: 12px;
  }

  .system {
    gap: 10px;
    padding: 14px;
  }
}

@media (max-width: 640px) {
  .systems {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-info h2 {
    font-size: 19px;
    overflow-wrap: anywhere;
  }

  .system .system-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .system {
    padding: 12px;
  }

  .system-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .system-action button {
    width: 100%;
    margin: 0;
  }
}

@media (forced-colors: active) {
  .system-action button:focus-visible,
  .system-sign-in:focus-visible,
  .details-download:focus-visible,
  .details-close:focus-visible,
  .directory-footer a:focus-visible {
    outline-color: Highlight;
  }
}
