:root {
  color-scheme: light;
  --ink: #10273a;
  --muted: #5c6c79;
  --paper: #f5f7f8;
  --card: #ffffff;
  --line: #d8e0e5;
  --accent: #f5a623;
  --accent-ink: #6a4100;
  --blue: #0d6682;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button, input, select { font: inherit; }

.shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 64px 0 90px; }
.library-nav { display:flex; justify-content:space-between; gap:20px; padding-bottom:24px; border-bottom:1px solid var(--line); font-size:.86rem; font-weight:800; }
.library-nav a { color:var(--ink); text-decoration:none; }
.library-nav a:hover { color:var(--blue); }
.intro { padding: 34px 0 50px; max-width: 980px; }
.eyebrow { margin: 0 0 12px; color: var(--blue); font-weight: 800; font-size: .78rem; letter-spacing: .16em; }
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -.035em; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(3rem, 8vw, 6.5rem); font-weight: 500; }
h1 em { color: var(--blue); font-weight: 500; }
.lede { max-width: 740px; margin: 26px 0 0; color: var(--muted); font-size: 1.1rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 38px; background: var(--line); border: 1px solid var(--line); }
.stats div { display: flex; flex-direction: column; padding: 18px 20px; background: var(--card); }
.stats strong { font-family: Georgia, "Times New Roman", serif; font-size: 2rem; }
.stats span { color: var(--muted); font-size: .82rem; }
.library { padding-top: 42px; border-top: 1px solid var(--line); }
.library-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.library-heading h2 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 500; }
.result-count { margin: 0 0 7px; color: var(--muted); }
.filters { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 14px; margin: 28px 0 16px; padding: 20px; background: #0f293a; color: white; }
.filters label { display: flex; flex-direction: column; gap: 7px; font-size: .78rem; font-weight: 800; letter-spacing: .04em; }
.filters input[type="search"], .filters select { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid #71818d; border-radius: 0; color: var(--ink); background: white; }
.filters input:focus, .filters select:focus, .filters button:focus { outline: 3px solid #f8bd51; outline-offset: 2px; }
.filters .check { grid-column: 1 / span 2; flex-direction: row; align-items: center; min-height: 42px; font-size: .9rem; }
.filters .check input { width: 20px; height: 20px; accent-color: var(--accent); }
.filters button { grid-column: 5; padding: 10px 16px; border: 1px solid #8b9aa4; color: white; background: transparent; cursor: pointer; }
.active-note { min-height: 25px; margin: 0 0 14px; color: var(--muted); font-size: .88rem; }
.results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.resource-card { min-width: 0; padding: 22px; border: 1px solid var(--line); background: var(--card); }
.card-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.card-meta { margin: 0; color: var(--blue); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pair-badge { flex: none; padding: 4px 7px; color: #25442c; background: #e6f3e9; font-size: .7rem; font-weight: 800; }
.resource-card h3 { margin-top: 16px; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; }
.tag { padding: 4px 7px; border: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.documents { display: grid; gap: 8px; }
.document { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.document a { color: var(--blue); font-weight: 800; text-decoration: none; }
.document a:hover { text-decoration: underline; }
.document .disabled { color: #81909b; }
.empty { padding: 60px 20px; border: 1px solid var(--line); background: white; text-align: center; }
.empty h3 { font-family: Georgia, "Times New Roman", serif; font-size: 1.7rem; }
.empty p { margin-bottom: 0; color: var(--muted); }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; }
.pagination button { min-width: 42px; min-height: 42px; border: 1px solid var(--line); background: white; color: var(--ink); cursor: pointer; }
.pagination button[aria-current="page"] { color: white; background: var(--blue); border-color: var(--blue); }

@media (max-width: 980px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .search-field { grid-column: 1 / -1; }
  .filters .check, .filters button { grid-column: auto; }
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 660px) {
  .shell { width: min(100% - 24px, 1180px); padding-top: 34px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-heading { align-items: start; flex-direction: column; }
  .filters, .results { grid-template-columns: 1fr; }
  .filters .search-field, .filters .check, .filters button { grid-column: auto; }
}
