:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #f3f6fb;
  --text: #1f2937;
  --muted: #667085;
  --muted-2: #8a94a6;
  --border: #e5e7eb;
  --border-strong: #d7dce5;
  --link: #1a4fd7;
  --link-hover: #123a9f;
  --url: #16803c;
  --button: #111827;
  --button-hover: #000000;
  --mark: #fff1a8;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 12px 28px rgba(16, 24, 40, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(26, 79, 215, 0.08), transparent 32rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 44%, var(--bg) 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }
a { color: inherit; }
button, input { font: inherit; }
mark { background: var(--mark); color: inherit; padding: 1px 4px; border-radius: 6px; }

.home-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px 80px;
}

.home-shell {
  width: min(760px, 100%);
  text-align: center;
}

.brand-block h1 {
  margin: 0;
  font-size: clamp(46px, 8vw, 82px);
  line-height: 0.98;
  font-weight: 760;
  letter-spacing: -3px;
  color: #101828;
}

.brand-block p {
  margin: 18px auto 30px;
  max-width: 620px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.home-search {
  width: min(680px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 9px 9px 9px 24px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.home-search:focus-within,
.header-search:focus-within {
  border-color: rgba(26, 79, 215, 0.35);
  box-shadow: 0 0 0 4px rgba(26, 79, 215, 0.08), var(--shadow-md);
}

.home-search input,
.header-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.home-search input { height: 46px; font-size: 17px; }
.home-search input::placeholder,
.header-search input::placeholder { color: #98a2b3; }

.home-search button,
.header-search button {
  border: 0;
  background: var(--button);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 650;
  letter-spacing: .01em;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

.home-search button { padding: 13px 26px; }
.header-search button { padding: 10px 18px; }
.home-search button:hover,
.header-search button:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
}

.quick-links {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-links a {
  color: #344054;
  text-decoration: none;
  background: rgba(255,255,255,.74);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}

.quick-links a:hover {
  border-color: var(--border-strong);
  background: #fff;
}

.search-page,
.transcript-page { min-height: 100vh; }

.search-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 34px;
  border-bottom: 1px solid rgba(229,231,235,.9);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
}

.site-name {
  color: #101828;
  text-decoration: none;
  font-size: 22px;
  font-weight: 760;
  white-space: nowrap;
  letter-spacing: -0.7px;
}

.header-search {
  width: min(780px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 7px 8px 7px 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.header-search input { height: 40px; font-size: 16px; }

.results-shell {
  max-width: 1080px;
  padding: 24px 32px 80px 176px;
}

.result-meta {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 18px;
}

.result-list {
  max-width: 820px;
  display: grid;
  gap: 18px;
}

.result-item {
  position: relative;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.result-item + .result-item::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 22px;
  right: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #dfe3ea, transparent);
}

.result-item:hover {
  transform: translateY(-2px);
  border-color: #d3d9e4;
  box-shadow: var(--shadow-md);
}

.result-title {
  display: inline-block;
  color: var(--link);
  font-size: 21px;
  line-height: 1.35;
  font-weight: 650;
  text-decoration: none;
  margin-bottom: 4px;
}

.result-title:hover { color: var(--link-hover); text-decoration: underline; }

.result-url {
  display: block;
  color: var(--url);
  font-size: 14px;
  line-height: 1.45;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.result-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted-2);
  font-size: 13px;
  margin: 6px 0 12px;
}

.result-subline span {
  display: inline-flex;
  align-items: center;
}

.result-subline span + span::before {
  content: "•";
  margin-right: 9px;
  color: #c2c8d0;
}

.match-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 12px 0 2px;
  border-top: 1px solid #eef1f5;
}

.match-row,
.transcript-line {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  align-items: start;
}

.match-row {
  padding: 7px 8px;
  border-radius: 12px;
}

.match-row:hover { background: var(--surface-soft); }

.time-link {
  color: var(--link);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.time-link:hover { text-decoration: underline; }

.match-text,
.line-text {
  color: #344054;
  line-height: 1.72;
  font-size: 15px;
}

.snippet {
  color: #344054;
  line-height: 1.7;
  margin: 10px 0 0;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.result-actions a,
.video-link,
.back-link {
  color: var(--link);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.result-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #dce4f5;
  border-radius: 999px;
  background: #f8fbff;
}

.result-actions a:hover,
.video-link:hover,
.back-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.empty-state,
.error-box {
  max-width: 720px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: #344054;
  line-height: 1.65;
  box-shadow: var(--shadow-sm);
}

.error-box {
  border-color: var(--border);
  background: #fff;
  color: #344054;
}

.pager {
  max-width: 820px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 0;
  color: var(--muted);
}

.pager a,
.pager span,
.pager strong {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
}

.pager a {
  color: var(--link);
  text-decoration: none;
  font-weight: 650;
}

.pager a:hover { border-color: #c9d7f4; background: #f8fbff; }
.pager span { color: #a0a8b5; }
.pager strong { font-size: 13px; font-weight: 650; }

.transcript-shell {
  max-width: 1080px;
  padding: 26px 32px 86px 176px;
}

.transcript-head {
  max-width: 820px;
  margin-bottom: 20px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.transcript-head h1 {
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.25;
  font-weight: 720;
  letter-spacing: -0.7px;
  margin: 12px 0 8px;
  color: #101828;
}

.query-note {
  color: var(--muted);
  font-size: 14px;
  margin: 12px 0 0;
}

.transcript-body {
  max-width: 820px;
  display: grid;
  gap: 0;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.transcript-line {
  padding: 11px 16px;
  border-bottom: 1px solid #eef1f5;
}

.transcript-line:last-child { border-bottom: 0; }
.transcript-line:hover { background: var(--surface-soft); }

.plain-transcript {
  max-width: 820px;
  white-space: pre-wrap;
  font-family: inherit;
  line-height: 1.75;
  color: #344054;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

@media (max-width: 900px) {
  .results-shell,
  .transcript-shell {
    padding-left: 32px;
  }
}

@media (max-width: 760px) {
  body {
    background: linear-gradient(180deg, #ffffff 0%, var(--bg) 36%, var(--bg) 100%);
  }

  .home-page {
    align-items: flex-start;
    padding: 88px 14px 54px;
  }

  .brand-block h1 {
    font-size: 46px;
    letter-spacing: -1.6px;
  }

  .brand-block p {
    font-size: 15px;
    margin: 16px auto 22px;
  }

  .home-search {
    border-radius: 24px;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .home-search input {
    width: 100%;
    padding: 20px 10px;
    text-align: center;
  }

  .home-search button { width: 100%; }

  .quick-links { gap: 8px; }
  .quick-links a { padding: 8px 13px; }

  .search-header {
    position: static;
    flex-direction: column;
    align-items: stretch;
    gap: 11px;
    padding: 14px;
  }

  .site-name { font-size: 21px; }

  .header-search {
    width: 100%;
    border-radius: 20px;
    padding: 8px;
  }

  .header-search input { padding-left: 7px; }
  .header-search button { padding: 10px 14px; }

  .results-shell,
  .transcript-shell {
    padding: 18px 14px 56px;
  }

  .result-meta { margin-bottom: 14px; }
  .result-list { gap: 14px; }

  .result-item {
    padding: 17px 15px 15px;
    border-radius: 16px;
  }

  .result-item + .result-item::before { display: none; }
  .result-title { font-size: 18px; }

  .match-row,
  .transcript-line {
    grid-template-columns: 54px 1fr;
    gap: 9px;
  }

  .match-row { padding: 6px 4px; }

  .match-text,
  .line-text {
    font-size: 15px;
    line-height: 1.68;
  }

  .result-actions a {
    min-height: 32px;
    padding: 6px 10px;
  }

  .pager {
    justify-content: center;
    flex-wrap: wrap;
  }

  .transcript-head {
    padding: 17px 15px;
    border-radius: 16px;
  }

  .transcript-body { border-radius: 16px; }
  .transcript-line { padding: 10px 12px; }
}
