:root {
  --text: #222;
  --muted: #666;
  --border: #dedede;
  --blue: #2257b4;
  --blue-hover: #153e8d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: white;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  top: -70px;
  left: 12px;
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--border);
  z-index: 10;
}
.skip-link:focus { top: 10px; }

.shell { max-width: 1100px; margin: 0 auto; min-height: 100vh; padding: 0 28px; display: flex; flex-direction: column; }
.site-header { height: 68px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eee; }
.brand { font-size: 23px; font-weight: bold; color: #222; text-decoration: none; letter-spacing: -.7px; }
.brand span { color: var(--blue); }
.header-right { display: flex; align-items: center; gap: 24px; font-size: 13px; }
.header-right a { text-decoration: none; }
.header-right a:hover { text-decoration: underline; }
.course-name { color: var(--muted); }

.hero { margin: 130px auto 28px; text-align: center; }
.hero h1 { margin: 0; font-size: clamp(42px, 7vw, 64px); font-weight: bold; letter-spacing: -2.5px; color: #222; }
.hero p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.search-section { width: 100%; max-width: 650px; margin: 0 auto; }
#search-form { position: relative; }
.search-input-wrap { display: flex; align-items: center; min-height: 52px; border: 1px solid #bbb; border-radius: 7px; background: white; overflow: hidden; }
.search-input-wrap:focus-within { border-color: #4b7cce; box-shadow: 0 0 0 2px rgba(34, 87, 180, .09); }
.search-icon { display: block; width: 19px; height: 19px; flex: 0 0 19px; margin-left: 15px; color: #888; }
.search-input-wrap input { min-width: 0; flex: 1; padding: 12px; border: 0; outline: none; background: transparent; font-size: 15px; }
.search-input-wrap input::placeholder { color: #888; }
.search-button { align-self: stretch; border: 0; border-left: 1px solid #ddd; border-radius: 0; padding: 0 23px; background: #f4f5f7; color: #222; font-size: 14px; }
.search-button:hover { background: #e8edf5; }
.suggestions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 17px; font-size: 13px; }
.suggestions > span { color: #777; margin-right: 2px; }
.suggestions button { border: 1px solid #ddd; border-radius: 4px; padding: 5px 9px; color: #3c4b61; background: #f9f9f9; }
.suggestions button:hover { background: #f1f3f6; }
.home-notice { text-align: center; margin: 20px 0 0; color: #777; font-size: 12px; }

.about { max-width: 650px; width: 100%; margin: 115px auto 50px; padding-top: 22px; border-top: 1px solid #eee; }
.about h2 { font-size: 17px; margin: 0 0 10px; font-weight: 600; }
.about p { color: #666; font-size: 13px; line-height: 1.7; margin: 8px 0; }
.footer { margin-top: auto; min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid #eee; color: #888; font-size: 12px; }

.shell.compact .hero { display: none; }
.shell.compact .search-section { max-width: 820px; margin-top: 30px; }
.shell.compact .suggestions, .shell.compact .home-notice, .shell.compact .about { display: none; }
.results-section { width: 100%; max-width: 820px; margin: 30px auto 60px; }
.results-topline { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 20px; }
.results-topline h2 { font-size: 17px; font-weight: 600; margin: 0; }
#results-summary { font-size: 12px; color: #777; }
.data-notice { font-size: 12px; color: #757575; margin: 0 0 28px; }
.spellcheck-suggestion { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.spellcheck-link { border: 0; padding: 0; background: transparent; color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.spellcheck-link:hover { color: var(--blue-hover); }
.result-card { margin: 0 0 27px; padding: 0; max-width: 750px; }
.result-url { display: block; color: #5b665c; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; margin-bottom: 2px; }
.result-title { color: var(--blue); font-weight: normal; font-size: 19px; line-height: 1.45; text-decoration: none; }
.result-title:hover { color: var(--blue-hover); text-decoration: underline; }
.result-snippet { color: #555; font-size: 13px; line-height: 1.65; margin: 4px 0 0; }
.no-results { border: 1px solid #eee; background: #fafafa; padding: 19px; border-radius: 5px; }
.no-results strong { display: block; margin-bottom: 5px; font-size: 14px; }
.no-results p { color: #666; font-size: 13px; margin: 0; }
.busy-indicator { color: #666; font-size: 13px; }
.results-view-toggle { display: inline-flex; gap: 4px; padding: 3px; margin: 0 0 16px; border: 1px solid #e1e5eb; background: #f7f8fa; border-radius: 6px; }
.view-mode-button { border: 0; border-radius: 4px; padding: 7px 13px; font-size: 12px; color: #505c70; background: transparent; }
.view-mode-button:hover:not([aria-pressed="true"]) { background: #e8edf5; }
.view-mode-button[aria-pressed="true"] { color: #fff; background: var(--blue); font-weight: 600; }
.infinite-scroll-controls { text-align: center; margin: 32px 0 0; }
#infinite-scroll-status { margin: 0 0 12px; color: #666; font-size: 13px; }
.load-more-button { border: 1px solid #c8d3e5; border-radius: 5px; background: #fff; color: var(--blue); padding: 10px 16px; font-size: 13px; }
.load-more-button:hover:not(:disabled) { background: #f2f5fa; }
.load-more-button:disabled { opacity: .55; cursor: default; }
#infinite-scroll-sentinel { height: 1px; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 32px 0 0; font-size: 13px; }
.pagination .page-button { min-width: 38px; padding: 8px 11px; border: 1px solid #d6d6d6; color: #333; background: #fff; border-radius: 4px; }
.pagination .page-button:hover:not(:disabled) { background: #f2f5fa; border-color: #b9c8de; }
.pagination .page-button[aria-current="page"] { color: #fff; background: var(--blue); border-color: var(--blue); font-weight: 600; opacity: 1; }
.pagination .page-button:disabled:not([aria-current="page"]) { opacity: .4; cursor: default; }
.pagination .page-ellipsis { color: #777; padding: 0 3px; }
.keyword-highlight { background: #fff1b8; color: inherit; border-radius: 2px; padding: 0 1px; }


@media (max-width: 640px) {
  .shell { padding: 0 17px; }
  .site-header { height: 61px; }
  .course-name { display: none; }
  .hero { margin-top: 95px; }
  .search-input-wrap { min-height: 48px; }
  .search-icon { margin-left: 11px; }
  .search-input-wrap input { padding: 10px; }
  .search-button { padding: 0 13px; }
  .about { margin-top: 80px; }
  .shell.compact .search-section { margin-top: 19px; }
  .results-section { margin-top: 22px; }
  .results-topline { display: block; }
  #results-summary { display: block; margin-top: 4px; }
  .result-title { font-size: 18px; }
  .footer { flex-wrap: wrap; padding: 15px 0; }
  .pagination { gap: 5px; }
  .pagination .page-button { min-width: 34px; padding: 7px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.autocomplete-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.autocomplete-list li {
  padding: 4px 8px;
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  color: #56606e;
  background: #fafafa;
  font-size: 12px;
  cursor: pointer;
  max-width: 100%;
}
.autocomplete-list li[aria-selected="true"], .autocomplete-list li:hover {
  background: #f0f3f7;
}
