.model-item.compared {
  border-color: #dce9e3;
}

.compare-list-remove {
  display: grid;
  flex: 0 0 18px;
  place-items: center;
  width: 18px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  line-height: 1;
}

.compare-list-remove::before { content: "✓"; }
.model-item.compared:hover .compare-list-remove,
.compare-list-remove:focus-visible { color: #b65454; }
.model-item.compared:hover .compare-list-remove::before,
.compare-list-remove:focus-visible::before { content: "×"; font-size: 20px; }

.compare-list-main {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.compare-tray {
  position: fixed;
  z-index: 20;
  left: calc(50% + 152px);
  bottom: 22px;
  width: min(760px, calc(100vw - 384px));
  transform: translateX(-50%);
  border: 1px solid #dce7e1;
  border-radius: 12px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 14px 38px rgba(35, 57, 48, .14);
  backdrop-filter: blur(10px);
}

.compare-tray-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 13px 15px;
}

.compare-tray-inner > div:first-child strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.compare-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.compare-slot {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 42px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.compare-slot.empty {
  color: #929fa8;
  border-style: dashed;
  font-size: 11px;
}

.compare-slot-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
}

.compare-slot-remove {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #8a979f;
  font-size: 18px;
  line-height: 1;
}

.compare-picker {
  position: relative;
  display: flex;
  min-width: 0;
  height: 42px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.compare-picker.empty { border-style: dashed; }
.compare-picker:focus-within { border-color: #80b59d; background: #fff; }

.compare-picker-input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 11px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
}

.compare-picker-input::placeholder { color: #929fa8; font-weight: 400; }
.compare-picker-input:disabled { cursor: not-allowed; }

.compare-picker-remove {
  flex: 0 0 auto;
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: #8a979f;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.compare-picker-remove:hover { color: var(--text); }
.compare-picker-options {
  position: absolute;
  z-index: 30;
  bottom: calc(100% + 6px);
  left: 0;
  width: max(100%, 280px);
  max-height: min(300px, calc(100vh - 130px));
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgb(29 41 57 / 14%);
}

.compare-picker:nth-child(2) .compare-picker-options { right: 0; left: auto; }

.compare-picker-option {
  display: block;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #536672;
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

.compare-picker-option span,
.compare-picker-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-picker-option small { margin-top: 2px; color: #87949e; font-size: 10px; }
.compare-picker-option:hover,
.compare-picker-option:focus,
.compare-picker-option[aria-selected="true"] { background: var(--soft); color: var(--accent); }
.compare-picker-message { margin: 0; padding: 12px 8px; color: #91a09c; font-size: 11px; text-align: center; }

.compare-tray-actions {
  display: flex;
  gap: 7px;
}

.compare-page-head {
  margin-bottom: 25px;
}

.compare-model-heads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.compare-model-head {
  position: relative;
  min-width: 0;
  padding: 19px 44px 19px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.compare-model-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8a979f;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.compare-model-remove:hover,
.compare-model-remove:focus-visible {
  background: #f1f5f3;
  color: var(--text);
}

.compare-model-head h2 {
  margin: 6px 0 3px;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.compare-model-head p {
  margin: 0;
  color: #87949e;
  font-size: 11px;
}

.compare-summary {
  margin-top: 13px;
}

.compare-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.compare-summary-item {
  min-width: 0;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.compare-summary-item span {
  display: block;
  overflow: hidden;
  color: #84919b;
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-summary-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 7px;
}

.compare-summary-item strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.compare-value {
  color: var(--text);
  font-size: 14px;
  font-weight: 400 !important;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.compare-value.better,
.compare-summary-item strong.better {
  color: #208168;
  font-weight: 700 !important;
}

.compare-table th:first-child,
.compare-table td:first-child {
  width: 38%;
}

.compare-table td:first-child {
  font-size: 14px;
}

.compare-table th:nth-child(2),
.compare-table th:nth-child(3),
.compare-table td:nth-child(2),
.compare-table td:nth-child(3) {
  width: 31%;
  text-align: right;
}

.compare-table th {
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.45;
}

.compare-table td {
  font-size: 13px;
  line-height: 1.5;
}

body.compare-tray-open main {
  padding-bottom: 110px;
}

@media (min-width: 1600px) {
  .compare-tray { left: calc(50% + 165px); }
}

@media (max-width: 1100px) {
  .compare-tray {
    left: calc(50% + 135px);
    width: calc(100vw - 320px);
  }

  .compare-tray-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .compare-tray-inner > div:first-child {
    display: none;
  }

  .compare-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body.compare-tray-open main {
    padding-bottom: 140px;
  }

  .compare-tray {
    left: 50%;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .compare-tray-inner {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .compare-tray-actions {
    justify-content: flex-end;
  }

  .compare-model-heads {
    gap: 8px;
  }

  .compare-model-head {
    padding: 14px 38px 14px 12px;
  }

  .compare-model-remove {
    top: 7px;
    right: 6px;
  }

  .compare-model-head h2 {
    font-size: 14px;
  }

  .compare-summary-grid {
    grid-template-columns: 1fr;
  }

  .compare-summary-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
  }

  .compare-summary-item strong {
    font-size: 12px;
    text-align: right;
  }

  .compare-summary-values {
    min-width: 52%;
    margin-top: 0;
  }

  .compare-table th:first-child,
  .compare-table td:first-child {
    width: 40%;
  }

  .compare-table td:first-child {
    font-size: 12px;
  }

  .compare-table th,
  .compare-table td {
    padding-left: 9px;
    padding-right: 7px;
    font-size: 11px;
  }
}
