.jcpt-one-lib-entry-rail {
  width: min(1180px, calc(100% - 32px));
  margin: 12px auto 14px;
  box-sizing: border-box;
}

.jcpt-one-lib-entry-rail * {
  box-sizing: border-box;
}

.jcpt-one-lib-entry {
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(47, 117, 143, 0.24);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfd 100%);
  box-shadow: 0 8px 22px rgba(22, 66, 86, 0.08);
  color: #18364f;
  box-sizing: border-box;
}

.jcpt-one-lib-entry * {
  box-sizing: border-box;
}

.jcpt-one-lib-entry__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.jcpt-one-lib-entry__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.jcpt-one-lib-entry__title strong {
  font-size: 18px;
  line-height: 1.35;
  color: #0d4961;
}

.jcpt-one-lib-entry__title span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #e7f5f4;
  color: #08655f;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.jcpt-one-lib-entry__note {
  margin: 4px 0 0;
  color: #486276;
  font-size: 13px;
  line-height: 1.6;
}

.jcpt-one-lib-entry__snapshot {
  flex: 0 0 auto;
  max-width: 420px;
  padding: 7px 10px;
  border-radius: 12px;
  background: #f1f7fb;
  color: #36566b;
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.jcpt-one-lib-entry__watch {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(0, 1.4fr);
  gap: 10px;
  align-items: center;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 125, 43, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, #fffaf1 0%, #fffdf8 100%);
}

.jcpt-one-lib-entry__watch-title {
  color: #744b10;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.45;
}

.jcpt-one-lib-entry__watch-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.jcpt-one-lib-entry__watch-stats span {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(180, 125, 43, 0.2);
  border-radius: 10px;
  background: #fff;
  color: #6d5638;
  font-size: 11.5px;
  line-height: 1.25;
  text-align: center;
}

.jcpt-one-lib-entry__watch-stats b {
  display: block;
  margin-bottom: 2px;
  color: #8a4517;
  font-size: 15px;
  line-height: 1.1;
}

.jcpt-one-lib-entry__search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.jcpt-one-lib-entry__input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(42, 103, 128, 0.28);
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
  color: #18364f;
  font-size: 14px;
  outline: none;
}

.jcpt-one-lib-entry__input:focus {
  border-color: rgba(0, 132, 127, 0.58);
  box-shadow: 0 0 0 3px rgba(0, 132, 127, 0.12);
}

.jcpt-one-lib-entry__btn {
  min-height: 44px;
  border: 1px solid rgba(24, 88, 116, 0.24);
  border-radius: 12px;
  padding: 0 16px;
  background: #fff;
  color: #0d4961;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.jcpt-one-lib-entry__btn.primary {
  border-color: #087a78;
  background: #087a78;
  color: #fff;
}

.jcpt-one-lib-entry__btn:hover {
  filter: brightness(0.98);
}

.jcpt-one-lib-entry__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.jcpt-one-lib-entry__chip {
  border: 1px solid rgba(18, 112, 120, 0.24);
  border-radius: 999px;
  background: #f4fbfb;
  color: #0b6563;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.jcpt-one-lib-entry__result {
  display: none;
  margin-top: 12px;
  border: 1px solid rgba(45, 104, 132, 0.18);
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}

.jcpt-one-lib-entry__result.is-visible {
  display: block;
}

.jcpt-one-lib-entry__result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #f3f8fb;
  border-bottom: 1px solid rgba(45, 104, 132, 0.14);
}

.jcpt-one-lib-entry__status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #edf3f7;
  color: #31546a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.jcpt-one-lib-entry__status.ok {
  background: #e5f6ee;
  color: #11633a;
}

.jcpt-one-lib-entry__status.maybe {
  background: #fff4db;
  color: #805313;
}

.jcpt-one-lib-entry__status.review {
  background: #fff0e5;
  color: #8a4517;
}

.jcpt-one-lib-entry__status.none {
  background: #f0f3f6;
  color: #5b6f7e;
}

.jcpt-one-lib-entry__status.risk {
  background: #fde7df;
  color: #9a3412;
}

.jcpt-one-lib-entry__result-body {
  padding: 12px;
  color: #2d4c62;
  font-size: 13px;
  line-height: 1.65;
}

.jcpt-one-lib-entry__audit-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid #087a78;
  border-radius: 0 10px 10px 0;
  background: #eef8f7;
  color: #244b5f;
}

.jcpt-one-lib-entry__disclaimer {
  margin-top: 8px;
  color: #6b7f8e;
}

.jcpt-one-lib-entry__items {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.jcpt-one-lib-entry__item {
  padding: 10px 12px;
  border: 1px solid rgba(42, 103, 128, 0.16);
  border-radius: 12px;
  background: #fbfdfe;
}

.jcpt-one-lib-entry__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 7px;
}

.jcpt-one-lib-entry__pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef4f7;
  color: #31546a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.jcpt-one-lib-entry__pill.ok {
  background: #e5f6ee;
  color: #11633a;
}

.jcpt-one-lib-entry__pill.abolished,
.jcpt-one-lib-entry__pill.replace {
  background: #fde7df;
  color: #9a3412;
}

.jcpt-one-lib-entry__pill.amendment {
  background: #fff4db;
  color: #805313;
}

.jcpt-one-lib-entry__pill.limit {
  background: #eef0ff;
  color: #3e4b91;
}

.jcpt-one-lib-entry__item strong {
  display: block;
  color: #123a56;
  line-height: 1.45;
}

.jcpt-one-lib-entry__item small {
  display: block;
  margin-top: 4px;
  color: #5d7588;
  line-height: 1.5;
}

@media (min-width: 1880px) {
  .jcpt-one-lib-entry-rail {
    position: fixed;
    top: 214px;
    right: 18px;
    width: clamp(230px, calc((100vw - 1440px) / 2 - 18px), 310px);
    margin: 0;
    z-index: 36;
    pointer-events: none;
  }

  .jcpt-one-lib-entry-rail .jcpt-one-lib-entry {
    padding: 14px;
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(13, 61, 86, 0.16);
    pointer-events: auto;
  }

  .jcpt-one-lib-entry-rail .jcpt-one-lib-entry__top {
    display: block;
    margin-bottom: 10px;
  }

  .jcpt-one-lib-entry-rail .jcpt-one-lib-entry__title {
    align-items: flex-start;
    gap: 8px;
  }

  .jcpt-one-lib-entry-rail .jcpt-one-lib-entry__title strong {
    font-size: 17px;
  }

  .jcpt-one-lib-entry-rail .jcpt-one-lib-entry__note {
    font-size: 12.5px;
    line-height: 1.55;
  }

  .jcpt-one-lib-entry-rail .jcpt-one-lib-entry__snapshot {
    max-width: none;
    margin-top: 8px;
    text-align: left;
  }

  .jcpt-one-lib-entry-rail .jcpt-one-lib-entry__watch {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 9px;
  }

  .jcpt-one-lib-entry-rail .jcpt-one-lib-entry__watch-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .jcpt-one-lib-entry-rail .jcpt-one-lib-entry__watch-stats span {
    padding: 5px 6px;
  }

  .jcpt-one-lib-entry-rail .jcpt-one-lib-entry__search {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .jcpt-one-lib-entry-rail .jcpt-one-lib-entry__btn {
    width: 100%;
  }

  .jcpt-one-lib-entry-rail .jcpt-one-lib-entry__chips {
    gap: 6px;
  }

  .jcpt-one-lib-entry-rail .jcpt-one-lib-entry__chip {
    padding: 5px 9px;
  }

  .jcpt-one-lib-entry-rail .jcpt-one-lib-entry__result.is-visible {
    max-height: 360px;
    overflow: auto;
  }
}

@media (min-width: 2040px) {
  .jcpt-one-lib-entry-rail {
    top: 214px;
    right: 26px;
  }
}

@media (max-width: 760px) {
  .jcpt-one-lib-entry-rail {
    width: calc(100vw - 32px);
    max-width: 420px;
    margin: 10px 0 12px;
  }

  .jcpt-one-lib-entry {
    padding: 12px;
    border-radius: 14px;
  }

  .jcpt-one-lib-entry__top {
    display: block;
  }

  .jcpt-one-lib-entry__snapshot {
    max-width: none;
    margin-top: 8px;
    text-align: left;
  }

  .jcpt-one-lib-entry__watch {
    grid-template-columns: 1fr;
  }

  .jcpt-one-lib-entry__watch-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jcpt-one-lib-entry__search {
    grid-template-columns: 1fr;
  }

  .jcpt-one-lib-entry__btn {
    width: 100%;
  }

  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping > .merchant-card-logo {
    align-self: flex-start !important;
    flex: 0 1 auto !important;
    width: fit-content !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 34px !important;
    height: auto !important;
    padding: 7px 12px !important;
    border-radius: 999px !important;
    justify-content: flex-start !important;
    text-align: left !important;
    white-space: normal !important;
    word-break: keep-all;
    overflow-wrap: anywhere;
    line-height: 1.35 !important;
    letter-spacing: 0 !important;
    font-size: 13px !important;
  }

  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping > .merchant-card-body,
  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping > .merchant-card-side {
    width: 100% !important;
    min-width: 0 !important;
  }

  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .merchant-card-body {
    display: grid !important;
    gap: 8px !important;
  }

  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .merchant-card-head,
  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .merchant-card-head-tight {
    display: grid !important;
    gap: 7px !important;
  }

  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .merchant-card-head h3 {
    margin: 0 !important;
    font-size: 17px !important;
    line-height: 1.35 !important;
  }

  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .merchant-card-head p {
    display: -webkit-box !important;
    margin: 0 !important;
    overflow: hidden !important;
    color: #4b6678 !important;
    font-size: 12.5px !important;
    line-height: 1.55 !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .merchant-trust-row,
  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .merchant-meta-row,
  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .merchant-contact-row,
  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .merchant-reason-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 6px !important;
    min-height: 0 !important;
  }

  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .trust-pill,
  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .merchant-meta-row span,
  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .merchant-contact-row span,
  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .merchant-reason-chip {
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 28px !important;
    padding: 5px 9px !important;
    line-height: 1.35 !important;
  }

  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .merchant-card-side-shop {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 10px !important;
  }

  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .merchant-side-note,
  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .cta-button {
    grid-column: 1 / -1 !important;
  }

  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .ghost-button,
  .app-shell.portal-shell .market-results .merchant-card.merchant-card-shopping .pill-button {
    width: 100% !important;
    min-height: 44px !important;
    white-space: normal !important;
  }
}
