.kbk-newdb-archive {
  --archive-blue: #0088b8;
  --archive-blue-dark: #006688;
  --archive-blue-soft: #eaf8fd;
  --archive-ink: #122033;
  --archive-text: #344054;
  --archive-muted: #667085;
  --archive-line: #dce5ec;
  --archive-soft: #f7fafc;
  --archive-radius: 16px;
  background: #fff;
  color: var(--archive-text);
  font-family: var(--font, "Sarabun", system-ui, sans-serif);
}

.archive-library-head {
  padding: 30px 0 24px;
  border-bottom: 1px solid #edf2f5;
  background: linear-gradient(180deg, #fff 0%, #fbfdfe 100%);
}

.archive-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-top: 18px;
}

.archive-heading-copy {
  min-width: 0;
  max-width: 820px;
}

.archive-heading-eyebrow {
  margin: 0 0 6px;
  color: var(--archive-blue);
  font-size: .76rem;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.archive-heading-copy h1 {
  margin: 0;
  color: var(--archive-ink);
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.18;
  letter-spacing: -.03em;
}

.archive-heading-description {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--archive-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.archive-count-badge {
  flex: 0 0 auto;
  margin-top: 6px;
  padding: 9px 13px;
  border: 1px solid #d9e5ec;
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font-size: .82rem;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(17, 52, 71, .05);
  white-space: nowrap;
}

.archive-quick-answer {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-top: 17px;
  color: #536273;
  font-size: .92rem;
  line-height: 1.65;
}

.archive-quick-answer strong {
  flex: 0 0 auto;
  color: var(--archive-ink);
}

.archive-toolbar {
  display: grid;
  grid-template-columns: minmax(270px, 1.65fr) minmax(155px, .8fr) minmax(165px, .8fr) minmax(150px, .72fr) auto;
  gap: 11px;
  align-items: end;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--archive-line);
  border-radius: var(--archive-radius);
  background: #fff;
  box-shadow: 0 9px 28px rgba(22, 50, 69, .055);
}

.archive-search,
.archive-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
}

.archive-field-label {
  color: #344054;
  font-size: .77rem;
  line-height: 1.3;
  font-weight: 800;
}

.archive-search__control {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #ccd8e1;
  border-radius: 10px;
  background: #fff;
  color: #78909f;
}

.archive-search__icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  font-size: 1rem;
}

.archive-search__control:focus-within,
.archive-field select:focus {
  border-color: var(--archive-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 136, 184, .12);
}

.archive-search input,
.archive-field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  color: #1f2d3d;
  font: inherit;
  font-size: .91rem;
}

.archive-search input {
  min-height: auto;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.archive-field select {
  padding: 0 34px 0 11px;
  border: 1px solid #ccd8e1;
  border-radius: 10px;
  outline: none;
  background: #fff;
}

.archive-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.archive-submit {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--archive-blue);
  border-radius: 10px;
  background: var(--archive-blue);
  color: #fff;
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.archive-submit:hover,
.archive-submit:focus-visible {
  border-color: var(--archive-blue-dark);
  background: var(--archive-blue-dark);
}

.archive-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #ccd8e1;
  border-radius: 10px;
  background: #fff;
  color: #475467;
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.archive-reset:hover,
.archive-reset:focus-visible {
  border-color: #9fb2bf;
  color: var(--archive-blue-dark);
}

.archive-feed-section {
  padding: 18px 0 70px;
}

.archive-results-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  color: var(--archive-muted);
  font-size: .83rem;
}

.archive-results-row strong {
  color: var(--archive-ink);
  font-weight: 800;
}

.archive-category-chips {
  display: flex;
  gap: 8px;
  width: 100%;
  margin: 0 0 24px;
  padding: 0 0 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.archive-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #d5e0e7;
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font-size: .8rem;
  line-height: 1;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}

.archive-chip:hover,
.archive-chip:focus-visible {
  border-color: #8bc8dc;
  color: var(--archive-blue-dark);
}

.archive-chip.is-active {
  border-color: var(--archive-blue);
  background: var(--archive-blue);
  color: #fff;
  box-shadow: 0 5px 14px rgba(0, 136, 184, .16);
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.archive-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--archive-line);
  border-radius: var(--archive-radius);
  background: #fff;
  box-shadow: 0 7px 22px rgba(16, 44, 61, .045);
  transition: transform .17s ease, border-color .17s ease, box-shadow .17s ease;
}

.archive-card:hover {
  transform: translateY(-2px);
  border-color: #bfd1dc;
  box-shadow: 0 13px 30px rgba(16, 44, 61, .085);
}

.archive-card__media {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid #edf2f5;
  background: #eef3f6;
  text-decoration: none;
}

.archive-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #f5f7f9;
}

.archive-card__placeholder {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  color: #81909c;
  background: linear-gradient(145deg, #eef4f6, #f8fbfc);
  font-size: .88rem;
  font-weight: 700;
  text-align: center;
}

.archive-card__placeholder-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #c9d7df;
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
  color: var(--archive-blue);
  font-size: 1.15rem;
}

.archive-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 17px;
}

.archive-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 23px;
  margin-bottom: 9px;
}

.archive-card__category {
  min-width: 0;
  max-width: 62%;
  overflow: hidden;
  color: var(--archive-blue-dark);
  font-size: .73rem;
  line-height: 1.3;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-card__date {
  flex: 0 0 auto;
  color: #7a8995;
  font-size: .72rem;
  line-height: 1.3;
  white-space: nowrap;
}

.archive-card__title {
  min-height: calc(1.45em * 2);
  margin: 0;
  color: var(--archive-ink);
  font-size: 1.08rem;
  line-height: 1.45;
  font-weight: 800;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.archive-card__title a {
  color: inherit;
  text-decoration: none;
}

.archive-card__title a:hover,
.archive-card__title a:focus-visible {
  color: var(--archive-blue-dark);
}

.archive-card__excerpt {
  min-height: calc(1.65em * 3);
  margin: 10px 0 0;
  color: #667583;
  font-size: .89rem;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.archive-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #edf2f5;
}

.archive-card__read {
  flex: 0 0 auto;
  color: var(--archive-blue-dark);
  font-size: .86rem;
  font-weight: 800;
  text-decoration: none;
}

.archive-card__read:hover,
.archive-card__read:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.archive-card__author {
  min-width: 0;
  overflow: hidden;
  color: #87939e;
  font-size: .72rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-empty {
  display: grid;
  gap: 6px;
  padding: 46px 24px;
  border: 1px dashed #c9d7df;
  border-radius: var(--archive-radius);
  background: var(--archive-soft);
  color: var(--archive-muted);
  text-align: center;
}

.archive-empty strong {
  color: var(--archive-ink);
}

.archive-progressive-next,
.archive-noscript-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.archive-js-enabled .archive-progressive-next {
  display: none;
}

.archive-load-status {
  min-height: 1.3em;
  margin: 16px 0 0;
  color: #7a8995;
  font-size: .8rem;
  line-height: 1.4;
  text-align: center;
}

.archive-sentinel {
  width: 100%;
  height: 1px;
  margin-top: 12px;
}

.archive-loading {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.archive-loading[hidden] {
  display: none !important;
}

.archive-skeleton {
  min-height: 350px;
  overflow: hidden;
  border: 1px solid var(--archive-line);
  border-radius: var(--archive-radius);
  background: #fff;
}

.archive-skeleton::before,
.archive-skeleton span {
  content: "";
  display: block;
  background: linear-gradient(90deg, #edf2f4 25%, #f9fbfc 37%, #edf2f4 63%);
  background-size: 400% 100%;
  animation: archive-shimmer 1.15s ease-in-out infinite;
}

.archive-skeleton::before {
  height: 190px;
}

.archive-skeleton span {
  height: 14px;
  margin: 18px 18px 0;
  border-radius: 999px;
}

.archive-skeleton span:nth-child(2) { width: 76%; }
.archive-skeleton span:nth-child(3) { width: 58%; }

@keyframes archive-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (max-width: 1180px) {
  .archive-toolbar {
    grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(140px, .75fr));
  }

  .archive-toolbar__actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

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

  .archive-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-search {
    grid-column: 1 / -1;
  }

  .archive-toolbar__actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .archive-library-head {
    padding: 24px 0 20px;
  }

  .archive-heading-row {
    display: grid;
    gap: 12px;
    margin-top: 14px;
  }

  .archive-heading-copy h1 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
  }

  .archive-count-badge {
    width: fit-content;
    margin-top: 0;
  }

  .archive-quick-answer {
    display: grid;
    gap: 3px;
  }

  .archive-toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 18px;
    padding: 13px;
  }

  .archive-search,
  .archive-field,
  .archive-toolbar__actions {
    grid-column: 1;
  }

  .archive-toolbar__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .archive-submit,
  .archive-reset {
    width: 100%;
  }

  .archive-feed-section {
    padding-top: 15px;
  }

  .archive-results-row {
    align-items: flex-start;
  }

  .archive-grid,
  .archive-loading {
    grid-template-columns: minmax(0, 1fr);
    gap: 17px;
  }

  .archive-card__body {
    padding: 16px;
  }

  .archive-card__title {
    font-size: 1.04rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .archive-card,
  .archive-chip {
    transition: none;
  }

  .archive-skeleton::before,
  .archive-skeleton span {
    animation: none;
  }
}
