:root {
  --ink: #1b201c;
  --muted: #6c746d;
  --paper: #f3f0e8;
  --card: #fffdf8;
  --line: #d7d3c7;
  --green: #184f3a;
  --green-2: #2c7958;
  --orange: #ef6d35;
  --shadow: 0 18px 55px rgba(32, 45, 36, .12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 8%, rgba(239,109,53,.13), transparent 24rem),
    linear-gradient(rgba(24,79,58,.035) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 100% 42px, auto;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  line-height: 1.75;
  min-height: 100vh;
}

button, input { font: inherit; }
button { color: inherit; }
.site-header {
  height: 74px;
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(24,79,58,.15);
  background: rgba(243,240,232,.82);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { border: 0; background: none; display: flex; gap: 12px; align-items: center; font-weight: 800; font-size: 18px; cursor: pointer; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: white; display: grid; place-items: center; font-family: Georgia, serif; }
.header-meta { color: var(--muted); font-size: 13px; letter-spacing: .08em; display: flex; align-items: center; gap: 12px; }
.friend-badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 4px 9px; color: #923d18; background: #fff0e8; border: 1px solid #efb699; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.header-button { border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--green); padding: 6px 10px; font-size: 12px; font-weight: 800; cursor: pointer; }
main { width: min(1120px, calc(100% - 36px)); margin: 0 auto; }
.hero { padding: clamp(48px, 7vw, 86px) 0 72px; max-width: 980px; }
.eyebrow { margin: 0 0 16px; color: var(--green-2); font-weight: 800; letter-spacing: .16em; font-size: 12px; }
h1 { margin: 0; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(42px, 7vw, 82px); line-height: 1.18; letter-spacing: -.035em; }
h1 em { color: var(--orange); font-style: normal; position: relative; }
.lead { max-width: 680px; color: var(--muted); font-size: clamp(16px, 2vw, 19px); margin: 28px 0 34px; }
.program-title { font-size: clamp(43px, 6.8vw, 76px); }
.program-title span { font-size: .58em; color: var(--green); letter-spacing: .02em; }
.hero-tagline { margin: 18px 0 0; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(25px, 3.5vw, 40px); font-weight: 800; line-height: 1.35; }
.hero-tagline em { color: var(--orange); font-style: normal; }
.hero-lead { display: grid; gap: 6px; margin: 19px 0 26px; }
.hero-lead strong { color: var(--ink); font-size: 1.05em; }
.hero-lead span { display: block; }
.search-box { display: grid; grid-template-columns: 1fr auto; padding: 8px; border: 1px solid rgba(24,79,58,.22); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.search-box input { border: 0; outline: 0; background: transparent; padding: 16px 18px; min-width: 0; font-size: 17px; color: var(--ink); }
.search-box button { border: 0; border-radius: 12px; background: var(--green); color: white; font-weight: 800; padding: 13px 22px; cursor: pointer; display: flex; gap: 24px; align-items: center; transition: transform .18s, background .18s; }
.search-box button:hover { background: var(--green-2); transform: translateY(-1px); }
.query-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 14px; }
.query-examples > span { color: var(--muted); font-size: 12px; font-weight: 800; margin-right: 2px; }
.query-example { border: 1px solid #c9d3cb; border-radius: 99px; background: rgba(255,253,248,.72); color: var(--green); padding: 6px 10px; font-size: 12px; line-height: 1.3; cursor: pointer; transition: background .18s, border-color .18s; }
.query-example:hover { background: #e1eee5; border-color: #9ac0aa; }
.search-actions { display: flex; justify-content: space-between; margin-top: 16px; color: var(--muted); font-size: 13px; }
.archive-hook { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 34px; margin-top: 30px; padding: 22px 24px; border: 1px solid rgba(24,79,58,.16); border-radius: 18px; background: rgba(255,253,248,.64); }
.archive-copy { display: grid; gap: 3px; align-content: center; }
.archive-copy strong { color: var(--green); font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 20px; }
.archive-copy span { color: var(--muted); font-size: 13px; }
.archive-stats { display: flex; align-items: center; gap: 26px; }
.archive-stats div { display: grid; gap: 1px; min-width: 116px; }
.archive-stats strong { color: var(--orange); font-family: Georgia, "Yu Mincho", serif; font-size: 27px; line-height: 1.1; }
.archive-stats span { color: var(--muted); font-size: 11px; font-weight: 800; }
.coverage-note { grid-column: 1 / -1; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.65; }
.text-button, .back-button { border: 0; background: none; color: var(--green); font-weight: 800; cursor: pointer; padding: 0; }
.results-section { padding: 20px 0 100px; }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; border-bottom: 1px solid var(--line); padding-bottom: 24px; margin-bottom: 24px; }
h2 { margin: 0; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(28px, 4vw, 42px); line-height: 1.25; }
.section-heading > p { color: var(--muted); margin: 0; white-space: nowrap; }
.result-list { display: grid; gap: 18px; }
.result-card { display: grid; grid-template-columns: 92px 1fr; gap: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: 0 8px 28px rgba(32,45,36,.06); transition: transform .2s, box-shadow .2s; }
.result-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rank { border-right: 1px solid var(--line); color: var(--orange); font-weight: 900; font-size: 32px; line-height: 1; padding-top: 4px; }
.rank small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .12em; margin-top: 8px; }
.candidate-label { display: inline-flex; border-radius: 99px; background: #e1eee5; color: var(--green); font-size: 12px; font-weight: 800; padding: 4px 10px; }
.episode-line { color: var(--muted); font-size: 13px; margin: 12px 0 2px; }
.result-title { font-size: clamp(20px, 3vw, 27px); line-height: 1.4; margin: 4px 0 10px; }
.result-summary { margin: 0; color: #4b524c; }
.timecode { font-family: Consolas, monospace; color: var(--green-2); font-weight: 800; }
.reasons { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 16px 0; list-style: none; }
.reasons li { font-size: 12px; background: #f0ede5; border-radius: 7px; padding: 4px 8px; color: #5c625d; }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.primary-link, .secondary-button, .found-button { display: inline-flex; text-decoration: none; border-radius: 10px; padding: 10px 14px; font-weight: 800; font-size: 13px; align-items: center; cursor: pointer; }
.primary-link { color: white; background: var(--green); }
.secondary-button { color: var(--green); background: transparent; border: 1px solid var(--green); }
.found-button { color: #9a3f19; background: #fff0e8; border: 1px solid #f0b497; }
.found-button.saved { color: var(--green); background: #e1eee5; border-color: #9ac0aa; }
.not-found-button { display: block; margin: 28px auto 0; border: 1px solid #aaa69c; border-radius: 10px; background: transparent; color: var(--muted); padding: 11px 18px; font-weight: 800; cursor: pointer; }
.not-found-button:disabled { cursor: default; opacity: .75; }
.detail-view { padding: 48px 0 100px; }
.back-button { margin-bottom: 34px; }
.detail-hero { background: var(--green); color: white; border-radius: 24px; padding: clamp(28px, 6vw, 64px); position: relative; overflow: hidden; }
.detail-hero::after { content: ""; position: absolute; width: 260px; height: 260px; border: 50px solid rgba(255,255,255,.06); border-radius: 50%; right: -80px; top: -90px; }
.detail-hero .eyebrow { color: #9bd0b4; }
.detail-hero h1 { font-size: clamp(32px, 5vw, 58px); }
.detail-meta { color: #c4d9cc; margin: 16px 0 0; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; margin-top: 28px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px; margin-bottom: 20px; }
.panel h2 { font-size: 26px; margin-bottom: 14px; }
.panel h3 { font-size: 18px; margin: 0 0 8px; }
.timeline { display: grid; gap: 12px; }
.timeline-item { border-left: 3px solid #b8c8bd; padding: 15px 18px; background: #f7f5ef; border-radius: 0 12px 12px 0; }
.timeline-item.highlight { border-left-color: var(--orange); background: #fff0e8; box-shadow: 0 0 0 1px #f2b79b; }
.timeline-item p { margin: 7px 0 0; color: #555c56; }
.entity-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.entity-list span { color: var(--green); background: #e1eee5; border-radius: 99px; padding: 3px 8px; font-size: 11px; }
.side-list { margin: 0; padding-left: 20px; }
.related-item { border-bottom: 1px solid var(--line); padding: 12px 0; }
.related-item:last-child { border: 0; }
.related-item a { color: var(--green); font-weight: 800; text-decoration: none; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 11px 18px; border-radius: 99px; background: var(--ink); color: white; transition: .2s; z-index: 30; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.privacy-notice { width: min(1120px, calc(100% - 36px)); margin: 0 auto 36px; padding: 18px 20px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; line-height: 1.7; }
.privacy-notice strong { color: var(--green); margin-right: 10px; }
.loading { padding: 40px; color: var(--muted); text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.login-page { display: grid; place-items: center; padding: 24px 0; }
.login-shell { width: min(480px, calc(100% - 32px)); }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: clamp(28px, 8vw, 52px); box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 900; margin: 20px 0 42px; }
.login-card h1 { font-size: clamp(38px, 10vw, 58px); }
.login-card .lead { margin: 18px 0 28px; }
.login-form { display: grid; gap: 10px; }
.login-form label { color: var(--muted); font-size: 13px; font-weight: 800; }
.login-form input { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); font-size: 18px; padding: 14px 16px; outline: none; }
.login-form input:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(44,121,88,.13); }
.login-form button { border: 0; border-radius: 12px; background: var(--green); color: white; font-weight: 900; min-height: 50px; margin-top: 8px; cursor: pointer; }
.login-error { color: #a23425; background: #fff0ed; border-radius: 9px; padding: 9px 11px; font-size: 13px; }
.login-note { color: var(--muted); font-size: 12px; margin: 26px 0 0; }
@media (max-width: 760px) {
  .site-header { height: auto; min-height: 68px; padding: 10px 18px; }
  .header-meta { gap: 7px; letter-spacing: 0; }
  main { width: min(100% - 24px, 1120px); }
  .hero { padding: 30px 0 48px; }
  .hero .eyebrow { margin-bottom: 10px; letter-spacing: .06em; font-size: 11px; }
  .hero .program-title { font-size: clamp(38px, 11.5vw, 52px); line-height: 1.16; }
  .hero-tagline { margin-top: 12px; font-size: clamp(23px, 7vw, 31px); }
  .hero-lead { gap: 4px; margin: 14px 0 20px; font-size: 14px; line-height: 1.65; }
  .search-box { grid-template-columns: 1fr; }
  .search-box input { font-size: 16px; padding: 14px 12px; }
  .search-box button { justify-content: center; min-height: 48px; }
  .query-examples { gap: 6px; margin-top: 12px; }
  .query-examples > span { width: 100%; }
  .query-example { max-width: 100%; text-align: left; }
  .search-actions { gap: 8px; margin-top: 13px; }
  .archive-hook { grid-template-columns: 1fr; gap: 15px; margin-top: 22px; padding: 18px; }
  .archive-copy strong { font-size: 18px; }
  .archive-stats { justify-content: space-between; gap: 12px; }
  .archive-stats div { min-width: 0; }
  .archive-stats strong { font-size: 24px; }
  .coverage-note { grid-column: 1; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .result-card { grid-template-columns: 1fr; padding: 20px; gap: 17px; }
  .rank { border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-view { padding-top: 26px; }
  .panel { padding: 20px; }
  .card-actions { display: grid; grid-template-columns: 1fr; }
  .primary-link, .secondary-button, .found-button { width: 100%; justify-content: center; min-height: 46px; text-align: center; }
}
