:root {
  --surface: rgba(250, 251, 248, 0.94);
  --surface-strong: #ffffff;
  --text-main: #1f2b22;
  --text-muted: #58665c;
  --brand: #2e5d3e;
  --brand-strong: #1f472f;
  --line: rgba(46, 93, 62, 0.2);
  --shadow: 0 20px 44px rgba(9, 16, 12, 0.22);
  --radius-lg: 20px;
  --radius-md: 12px;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background-color: #eef3ee;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(88, 123, 93, 0.16) 0 2px, transparent 2.5px),
    radial-gradient(circle at 78% 26%, rgba(109, 138, 112, 0.14) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at 35% 72%, rgba(83, 116, 88, 0.12) 0 2.2px, transparent 2.8px),
    repeating-radial-gradient(circle at 82% 78%, rgba(69, 104, 75, 0.08) 0 2px, transparent 2px 12px),
    linear-gradient(160deg, #edf3ec 0%, #f6faf5 48%, #ecf2ea 100%);
  background-size: 220px 220px, 280px 280px, 260px 260px, 380px 380px, cover;
  background-position: 0 0, 60px 40px, 120px 140px, 40px 80px, center;
  background-repeat: repeat, repeat, repeat, repeat, no-repeat;
  background-attachment: fixed;
}

.tlf-page {
  max-width: 1040px;
  margin: 28px auto 0;
  padding: 0 20px;
}

.tlf-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 30px;
}

.tlf-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  color: #163526;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.tlf-header {
  position: sticky;
  top: 0;
  z-index: 120;
  backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(249, 252, 249, 0.96), rgba(242, 248, 243, 0.9));
  border-bottom: 1px solid rgba(37, 72, 51, 0.14);
}

.tlf-header__inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.tlf-header__brand {
  color: #163526;
  text-decoration: none;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.35rem, 2.3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.tlf-header__brand:hover {
  text-decoration: none;
  color: #10301f;
}

.tlf-header__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tlf-header__nav a {
  color: #234a33;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(37, 72, 51, 0.18);
  background: rgba(255, 255, 255, 0.8);
  transition: all 140ms ease;
}

.tlf-header__nav a:hover {
  background: rgba(224, 236, 226, 0.95);
  border-color: rgba(37, 72, 51, 0.28);
}

.tlf-header__search {
  display: grid;
  grid-template-columns: minmax(180px, 240px) auto;
  gap: 0;
}

.tlf-header__search-input {
  border: 1px solid rgba(37, 72, 51, 0.24);
  border-right: 0;
  border-radius: 999px 0 0 999px;
  padding: 8px 12px;
  font-size: 0.92rem;
  line-height: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.9);
}

.tlf-header__search-input:focus {
  outline: none;
  border-color: rgba(37, 72, 51, 0.5);
}

.tlf-header__search-button {
  border: 1px solid rgba(37, 72, 51, 0.24);
  border-radius: 0 999px 999px 0;
  padding: 8px 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1a3f2b;
  background: rgba(232, 243, 234, 0.95);
  cursor: pointer;
}

.tlf-header__search-button:hover {
  background: rgba(214, 232, 217, 0.95);
}

.tlf-footer {
  border-top: 1px solid rgba(37, 72, 51, 0.14);
  background: linear-gradient(180deg, rgba(247, 251, 247, 0.97), rgba(240, 247, 241, 0.96));
  margin-top: 40px;
}

.tlf-footer__inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 20px 26px;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  color: #2c3c33;
  font-size: 0.94rem;
  line-height: 1.45;
}

.tlf-footer a {
  color: #1e4b33;
  text-decoration: none;
}

.tlf-footer a:hover {
  text-decoration: underline;
}

.tlf-footer__credits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.tlf-footer__designer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tlf-footer__designer img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.tlf-footer__pipe {
  opacity: 0.6;
}

.page-shell {
  max-width: 1040px;
  margin: 36px auto 0;
  padding: 0 20px 160px;
  animation: fadeSlideIn 420ms ease-out;
}

.hero-panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
  padding: 34px 34px 30px;
}

.hero-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 700;
  color: #163526;
  letter-spacing: 0.2px;
}

.hero-subtitle {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.45;
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.meta-pill {
  background: linear-gradient(160deg, #edf4ec, #f7faf5);
  border: 1px solid var(--line);
  color: #264a34;
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 600;
  font-size: 0.96rem;
}

.search-terms {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 1rem;
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.badge-pill {
  line-height: 1.25;
  padding: 6px 12px;
  font-size: 0.9rem;
  background-color: #f0f5ef;
  border: 1px solid #c8d9cd;
  color: #1f462e;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 180ms ease;
}

.badge-pill:hover {
  transform: translateY(-1px);
  background: #e5efe2;
  border-color: #9bb9a4;
}

.input-container {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  margin-top: 22px;
}

.search-input {
  width: 100%;
  min-width: 0;
  padding: 13px 15px;
  font-size: 1rem;
  border: 1px solid #c6d4ca;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search-input:focus {
  border-color: #5e8f70;
  box-shadow: inset 0 0 0 1px #5e8f70;
}

.search-button {
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(150deg, var(--brand), var(--brand-strong));
  color: #fff;
  border: 1px solid var(--brand-strong);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}

.search-button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.ui-autocomplete-loading {
  background: white url("images/ui-anim_basic_16x16.gif") right center no-repeat;
}

.results-panel {
  margin-top: 20px;
  background: var(--surface-strong);
  border-radius: 14px;
  border: 1px solid #d8e4db;
  padding: 10px 14px;
  min-height: 88px;
}

ul.searchresult {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ui-menu-item {
  margin: 0;
  padding: 13px 4px;
  border-bottom: 1px solid #e8efe9;
  line-height: 1.55;
}

.ui-menu-item:last-child {
  border-bottom: 0;
}

.ui-all a {
  color: #234d34;
  text-decoration: none;
}

.ui-all a:hover {
  text-decoration: underline;
}

#selected {
  color: var(--text-muted);
  font-style: italic;
  padding: 8px 4px;
}

.tlf-section {
  margin-top: 18px;
  color: #2f3f35;
  line-height: 1.55;
}

.tlf-section h2 {
  margin: 20px 0 8px;
  font-family: "Fraunces", Georgia, serif;
  color: #183927;
  font-size: 1.3rem;
}

.tlf-section a,
.tlf-bib-links a,
.tlf-entry a,
.tlf-block a,
.tlf-intro a {
  color: #1f4b33;
  text-decoration: none;
}

.tlf-section a:hover,
.tlf-bib-links a:hover,
.tlf-entry a:hover,
.tlf-block a:hover,
.tlf-intro a:hover {
  text-decoration: underline;
}

.tlf-bib-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tlf-empty {
  color: #58665c;
  font-style: italic;
}

.tlf-centerlines {
  margin-top: 16px;
  text-align: center;
  color: #253b2d;
  line-height: 1.45;
}

.tlf-centerlines p {
  margin: 2px 0;
  font-weight: 700;
}

.tlf-entry {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(34, 68, 48, 0.16);
  color: #2f3f35;
  line-height: 1.65;
  word-break: break-word;
}

.tlf-entry strong {
  color: #153625;
}

.tlf-grid {
  margin-top: 18px;
  display: grid;
  gap: 14px;
  color: #2f3f35;
  line-height: 1.6;
}

.tlf-block {
  border: 1px solid rgba(34, 68, 48, 0.14);
  background: #f7fbf7;
  border-radius: 12px;
  padding: 14px;
}

.tlf-block h2 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  color: #153625;
  font-family: "Fraunces", Georgia, serif;
}

.tlf-intro {
  margin-top: 16px;
  color: #2f3f35;
  line-height: 1.65;
  font-size: 1.03rem;
}

.tlf-libraries {
  margin-top: 26px;
  border-top: 1px solid rgba(34, 68, 48, 0.16);
  padding-top: 18px;
}

.tlf-libraries h2 {
  margin: 0 0 12px;
  font-family: "Fraunces", Georgia, serif;
  color: #153625;
  font-size: 1.35rem;
}

.tlf-libraries ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.55;
  color: #2f3f35;
  columns: 2;
  column-gap: 36px;
}

.tlf-libraries li {
  break-inside: avoid;
  margin-bottom: 4px;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .tlf-libraries ul {
    columns: 1;
  }
}

@media (max-width: 768px) {
  .page-shell,
  .tlf-page {
    margin-top: 24px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero-panel,
  .tlf-card {
    padding: 20px 18px;
  }

  .input-container {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .search-input,
  .search-button {
    border-radius: var(--radius-md);
  }
}

@media (max-width: 720px) {
  .tlf-header__inner,
  .tlf-footer__inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .tlf-footer__inner {
    font-size: 0.9rem;
  }

  .tlf-header__search {
    grid-template-columns: 1fr auto;
    width: 100%;
    order: 3;
  }
}
