.library-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.card-social-actions {
  position: static;
  grid-column: 1;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(40px, 1fr));
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px 10px;
  border-top: 1px solid #e5ebe8;
}

.card-social-actions button {
  position: relative;
  z-index: 4;
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 6px;
  border: 1px solid #d9e3de;
  border-radius: 999px;
  background: #f8fbf9;
  color: #53615b;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.card-social-actions button:hover {
  background: #eef5f2;
  color: #105346;
}

.card-social-actions .card-like,
.card-social-actions .card-dislike {
  width: 100%;
  color: #324c42;
}

.card-social-actions .card-like {
  border-color: #bddbcf;
  background: #edf8f3;
}

.card-social-actions .card-dislike {
  background: #faf8f6;
  color: #66584f;
}

.card-social-actions button:focus-visible {
  outline: 3px solid #176b5a;
  outline-offset: 1px;
}

.card-social-actions button:disabled {
  cursor: wait;
  opacity: .58;
}

.card-social-actions .card-like[aria-pressed="true"] {
  border-color: #176b5a;
  background: #176b5a;
  color: #fff;
}

.card-social-actions .card-dislike[aria-pressed="true"] {
  border-color: #7b5f50;
  background: #7b5f50;
  color: #fff;
}

.card-social-actions .card-save[aria-pressed="true"] {
  background: #fff0f3;
  color: #a12e4e;
}

.card-like-count {
  min-width: 1ch;
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.card-dislike-count {
  min-width: 1ch;
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.card-social-actions .card-copy,
.card-social-actions .card-share {
  width: 100%;
  padding: 0;
  border-color: transparent;
  background: transparent;
  font-size: 15px;
}

.card-social-actions .card-share { display: inline-flex; }
.card-social-actions .card-share svg,
.card-social-actions .card-copy svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-social-actions .card-copy .card-action-label,
.card-social-actions .card-share .card-action-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.card-social-actions .card-save {
  position: absolute;
  top: 7px;
  right: 58px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  box-shadow: 0 4px 10px rgba(22,33,28,.1);
  font-size: 17px;
}

.card-social-actions .card-like .card-action-label,
.card-social-actions .card-dislike .card-action-label,
.card-social-actions .card-save .card-action-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.community-card-meta .card-helpfulness {
  display: none;
}

.library-card .list-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  overflow: hidden;
}

.card-tag {
  min-width: 0;
  max-width: 50%;
  min-height: 28px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid #dfe7e3;
  border-radius: 999px;
  background: #f6f9f7;
  color: #53615b;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-tag:hover { border-color:#9fc9b9; background:#edf7f2; color:#105346; }
.card-tag:focus-visible { outline:3px solid #176b5a; outline-offset:1px; }

.community-card-meta { justify-content:space-between; }
.card-view-count {
  display:inline-flex;
  align-items:center;
  gap:3px;
  margin-left:auto;
  color:#6a7771;
  font-size:11px;
  font-variant-numeric:tabular-nums;
  font-weight:800;
}
.card-view-count svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.7; }

.endorsement-badge {
  cursor: help;
  white-space: nowrap;
}

.endorsement-badge:focus-visible {
  outline: 2px solid #176b5a;
  outline-offset: 2px;
}

.library-card {
  min-height: 232px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 52px 1fr auto;
  border-radius: 16px;
}

.library-card::after {
  inset: 0 0 auto;
  width: auto;
  height: 3px;
}

.list-open {
  position: absolute;
  inset: 7px 9px auto auto;
  z-index: 4;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid #dbe4df;
  border-radius: 50%;
  background: var(--card-tint);
  color: transparent;
  font-size: 0;
}

.list-open::before { display: none; }
.list-open::after {
  content: "→";
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 50%;
  background: transparent;
  color: #17211d;
  font-size: 15px;
}

.list-icon.card-visual {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 52px;
  min-height: 52px;
  flex-direction: row;
  justify-content: flex-start;
  gap: 8px;
  padding: 7px 108px 7px 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.card-visual-icon { width: 36px; height: 36px; border-radius: 11px; font-size: 18px; }
.card-visual-label { min-width:0; max-width:54px; padding:4px 8px; overflow:hidden; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }

.library-card .list-main {
  grid-column: 1;
  grid-row: 2;
  padding: 12px 12px 8px;
  min-width:0;
  max-width:100%;
}

.library-card .list-main h3 { min-height: 43px; font-size: 15px; line-height: 1.42; }
.library-card .list-main > p { min-height: 36px; margin-top: 5px; font-size: 11.5px; line-height: 1.55; }
.library-card .community-card-meta { min-height: 25px; padding-top: 6px; font-size: 12px; }
.community-card-meta .card-author { font-size: 12px; }
.community-card-meta .card-author .endorsement-badge { font-size: 11px; }

@media (max-width: 620px) {
  .library-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .library-card {
    min-height: 218px;
    grid-template-columns: 1fr;
    grid-template-rows: 48px 1fr auto;
    border-radius: 14px;
  }

  .list-icon.card-visual {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: 48px;
    min-height: 48px;
    flex-direction: row;
    padding: 6px 102px 6px 7px;
  }

  .card-visual-icon { width: 34px; height: 34px; font-size: 17px; }
  .card-visual-label { display:none; }
  .library-card .list-main { grid-column: 1; grid-row: 2; padding: 9px 9px 6px; }
  .library-card .list-main h3 { min-height: 61px; font-size: 14px; -webkit-line-clamp: 3; }
  .library-card .list-main > p { display: none; }
  .library-card .community-card-meta { margin-top: 4px; }

  .card-social-actions {
    grid-column: 1;
    padding: 6px 7px 8px;
  }

  .card-social-actions button {
    min-width: 44px;
    min-height: 44px;
    padding: 0 5px;
    font-size: 11px;
  }

  .card-social-actions .card-save {
    top: 5px;
    right: 55px;
    height: 44px;
  }

  .card-social-actions .card-copy,
  .card-social-actions .card-share { display: none; }

  .card-social-actions .card-share { display: inline-flex; }

  .card-social-actions { grid-template-columns: repeat(3, minmax(44px, 1fr)); }
  .list-open { top:5px; right:7px; bottom:auto; }
  .card-tag { max-width:calc(50% - 3px); min-height:26px; padding:0 6px; font-size:9px; }
}

@media (min-width:621px) and (max-width:820px) {
  .library-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width:359px) {
  .library-list { grid-template-columns: 1fr; }
  .library-card { min-height: 206px; }
  .library-card .list-main h3 { min-height: 43px; -webkit-line-clamp: 2; }
  .library-card .list-main > p { display: -webkit-box; }
}
