.theses-api {
  margin-bottom: 3rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid #fde68a;
  border-radius: 1.25rem;
  background: linear-gradient(145deg, #fffbeb 0%, #fff 48%, #f8fafc 100%);
  box-shadow: 0 18px 45px rgba(120, 53, 15, .09);
  color: #1f2937;
}

.theses-api__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }
.theses-api__eyebrow { margin: 0 0 .35rem; color: #b45309; font-size: .75rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.theses-api__title { margin: 0; color: #111827; font-family: "Playfair Display", Georgia, serif; font-size: clamp(1.65rem, 3vw, 2.25rem); font-weight: 700; line-height: 1.15; }
.theses-api__intro { max-width: 46rem; margin: .65rem 0 0; color: #64748b; line-height: 1.65; }
.theses-api__count { flex: 0 0 auto; padding: .65rem .9rem; border: 1px solid #fcd34d; border-radius: 999px; background: #fff; color: #92400e; font-size: .82rem; font-weight: 800; }

.theses-api__form { position: relative; display: grid; gap: 1rem; margin-top: 1.75rem; padding: clamp(1rem, 2.4vw, 1.35rem); overflow: hidden; border: 1px solid #dbe3ee; border-radius: 1rem; background: rgba(255, 255, 255, .96); box-shadow: 0 12px 28px rgba(15, 39, 66, .07); }
.theses-api__form::before { position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, #0b4f7d, #d99b23); content: ""; }
.theses-api__field { display: grid; gap: .4rem; }
.theses-api__label { color: #334155; font-size: .74rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.theses-api__input { width: 100%; height: 2.75rem; padding: 0 .85rem; border: 1px solid #cbd5e1; border-radius: .7rem; background: #fff; color: #0f172a; outline: none; }
.theses-api__input:focus { border-color: #0b5f91; box-shadow: 0 0 0 3px rgba(14, 116, 144, .14); }
.theses-api__query-control { position: relative; display: block; }
.theses-api__search-icon { position: absolute; z-index: 1; top: 50%; left: 1rem; color: #0b5f91; font-family: Georgia, serif; font-size: 1.65rem; line-height: 1; transform: translateY(-54%) rotate(-15deg); pointer-events: none; }
.theses-api__input--query { height: 3.55rem; padding-left: 3rem; border-color: #9fb6c9; border-radius: .85rem; font-size: 1rem; }
.theses-api__input--query::placeholder { color: #7b8da1; }
.theses-api__filters { display: grid; grid-template-columns: minmax(8rem, .35fr) minmax(12rem, .65fr) auto; align-items: end; gap: .85rem; }
.theses-api__select { padding-right: 2.25rem; cursor: pointer; }
.theses-api__form-actions { display: flex; align-items: center; gap: .6rem; }

.theses-api__submit,
.theses-api__page-button,
.theses-api__link { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .65rem 1rem; border: 1px solid #92400e; border-radius: .7rem; background: #92400e; color: #fff; font-weight: 750; text-decoration: none; cursor: pointer; transition: background .2s ease, transform .2s ease; }
.theses-api__submit { border-color: #0b4f7d; background: #0b4f7d; white-space: nowrap; }
.theses-api__reset { min-height: 2.75rem; padding: .65rem .85rem; border: 0; background: transparent; color: #526579; font-weight: 750; text-decoration: underline; text-underline-offset: .2rem; cursor: pointer; }
.theses-api__reset[hidden] { display: none; }
.theses-api__submit:hover,
.theses-api__page-button:hover:not(:disabled),
.theses-api__link:hover { background: #78350f; transform: translateY(-1px); }
.theses-api__submit:hover { background: #073e63; }
.theses-api__reset:hover { color: #0b4f7d; }
.theses-api__submit:focus-visible,
.theses-api__reset:focus-visible,
.theses-api__page-button:focus-visible,
.theses-api__link:focus-visible { outline: 3px solid rgba(217, 155, 35, .45); outline-offset: 2px; }

.theses-api__status { min-height: 1.5rem; margin: 1rem 0; color: #64748b; font-size: .86rem; }
.theses-api__status--error { padding: .85rem 1rem; border-radius: .75rem; background: #fef2f2; color: #b91c1c; }
.theses-api__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.theses-api__card { display: flex; min-width: 0; flex-direction: column; padding: 1.15rem; border: 1px solid #e2e8f0; border-radius: 1rem; background: #fff; box-shadow: 0 6px 18px rgba(15, 23, 42, .06); }
.theses-api__meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .8rem; }
.theses-api__chip { max-width: 100%; overflow: hidden; padding: .25rem .5rem; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: .68rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.theses-api__card-title { margin: 0; color: #0f172a; font-family: "Playfair Display", Georgia, serif; font-size: 1.06rem; font-weight: 700; line-height: 1.35; }
.theses-api__author { margin: .6rem 0 0; color: #b45309; font-size: .82rem; font-weight: 750; }
.theses-api__detail { margin: .35rem 0 0; color: #64748b; font-size: .76rem; }
.theses-api__summary { display: -webkit-box; margin: .8rem 0 1rem; overflow: hidden; color: #475569; font-size: .82rem; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.theses-api__actions { display: flex; align-items: center; gap: .75rem; margin-top: auto; }
.theses-api__link { min-height: 2.25rem; padding: .45rem .7rem; font-size: .75rem; }
.theses-api__doi { min-width: 0; overflow: hidden; color: #475569; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.theses-api__pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.5rem; }
.theses-api__page-button { min-height: 2.4rem; padding: .45rem .8rem; font-size: .78rem; }
.theses-api__page-button:disabled { border-color: #cbd5e1; background: #e2e8f0; color: #94a3b8; cursor: not-allowed; }
.theses-api__page-label { color: #475569; font-size: .78rem; font-weight: 700; }

@media (max-width: 900px) {
  .theses-api__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theses-api__filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theses-api__form-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 640px) {
  .theses-api__header,
  .theses-api__pagination { align-items: stretch; flex-direction: column; }
  .theses-api__count { align-self: flex-start; }
  .theses-api__filters,
  .theses-api__grid { grid-template-columns: 1fr; }
  .theses-api__form-actions { grid-column: auto; flex-direction: column-reverse; align-items: stretch; }
  .theses-api__reset { width: 100%; }
  .theses-api__page-label { order: -1; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .theses-api__submit,
  .theses-api__page-button,
  .theses-api__link { transition: none; }
}
