:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5f7186;
  --line: #d8e0e8;
  --panel: #fff;
  --soft: #f4f7fa;
  --accent: #087463;
  --accent-soft: #dff5ef;
  --shadow: 0 10px 26px rgba(26, 41, 55, .06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Pretendard, "Noto Sans KR", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #eef3f7;
}
button, input, select { font: inherit; }
.app-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  grid-template-areas:
    "title languages"
    "lead visitors"
    "lead usage";
  column-gap: clamp(28px, 4vw, 72px);
  row-gap: 12px;
  align-items: start;
  padding: 48px clamp(24px, 5vw, 72px) 38px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.language-switcher {
  grid-area: languages;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  justify-self: end;
  gap: 6px;
  max-width: 100%;
}
.lang-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 30px;
  padding: 2px;
  border: 1px solid #c7d3df;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  line-height: 1;
}
.lang-button img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  object-fit: contain;
}
.lang-button.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(8,116,99,.16);
}
.visitor-counter {
  grid-area: visitors;
  justify-self: end;
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 7px;
  width: 220px;
  min-height: 64px;
  margin-top: -10px;
  padding: 12px 14px;
  border: 1px solid #dce6ef;
  border-radius: 6px;
  background: #fbfdff;
}
.visitor-counter__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.visitor-counter__row[hidden] {
  display: none;
}
.visitor-counter__row--private {
  padding-top: 7px;
  border-top: 1px solid #e5edf4;
}
.visitor-counter__label {
  display: block;
  color: #52677b;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
}
.visitor-counter strong {
  color: #102238;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: 0;
}
.visitor-counter__status {
  position: relative;
  display: block;
  margin-top: 0;
  padding-left: 12px;
  color: var(--accent);
  font-size: .66rem;
  font-weight: 800;
  line-height: 1;
}
.visitor-counter__status::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-50%);
}
.usage-meter {
  grid-area: usage;
  justify-self: end;
  width: 220px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid #dce6ef;
  border-radius: 6px;
  background: #fbfdff;
}
.usage-meter[hidden] {
  display: none;
}
.usage-meter__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #52677b;
  font-size: .66rem;
  font-weight: 800;
}
.usage-meter__head strong {
  color: var(--accent);
  font-size: .72rem;
}
.usage-meter__bar {
  height: 6px;
  margin: 9px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eff5;
}
.usage-meter__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.usage-meter.is-medium .usage-meter__head strong { color: #a16207; }
.usage-meter.is-medium .usage-meter__bar span { background: #d97706; }
.usage-meter.is-high .usage-meter__head strong { color: #b91c1c; }
.usage-meter.is-high .usage-meter__bar span { background: #dc2626; }
.usage-meter__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  color: #52677b;
  font-size: .64rem;
  font-weight: 800;
}
.usage-meter__grid strong {
  color: #102238;
  font-size: .68rem;
}
.eyebrow {
  margin: 0 0 14px;
  color: #006b5e;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
h1, h2, p { margin-top: 0; }
h1 {
  grid-area: title;
  margin-bottom: 12px;
  font-size: clamp(2.15rem, 3.35vw, 3.45rem);
  line-height: 1.08;
  letter-spacing: 0;
}
.lead {
  grid-area: lead;
  display: flex;
  flex-wrap: wrap;
  gap: 0 .42em;
  max-width: 100%;
  margin: 0;
  color: #486073;
  font-size: .98rem;
  line-height: 1.65;
  white-space: normal;
  overflow-wrap: break-word;
}
.lead-sentence {
  white-space: nowrap;
}
.layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
  padding: 24px clamp(18px, 3vw, 36px) 56px;
}
.filters, .results {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.filters {
  align-self: start;
  position: sticky;
  top: 16px;
  padding: 20px;
}
.filters section + section {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.section-title, .toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}
.program-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 34%) 92px;
  gap: 18px;
  align-items: start;
  min-width: 0;
}
.program-head > * {
  min-width: 0;
}
.section-title h2, .toolbar h2 {
  margin-bottom: 4px;
  font-size: 1rem;
}
.filters .section-title h2 {
  font-size: 1.25rem;
  font-weight: 900;
}
.coverage, #summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.search-label {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: #17202a;
  font-size: 1rem;
  font-weight: 800;
}
.search-control {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.search-submit {
  display: none;
  min-height: 40px;
  border: 1px solid #c7d3df;
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.search-submit:focus {
  outline: 2px solid rgba(8,116,99,.18);
  outline-offset: 2px;
}
input, select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #c7d3df;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus {
  outline: 2px solid rgba(8,116,99,.18);
  border-color: var(--accent);
}
.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid #c7d3df;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.checks {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.filter-group {
  margin-top: 18px;
}
.filter-group > strong {
  display: block;
  margin-bottom: 10px;
  color: #17202a;
  font-size: 1rem;
  font-weight: 800;
}
.checks label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #17324d;
  font-size: .98rem;
  font-weight: 500;
}
.checks input {
  width: 16px;
  min-height: 16px;
}
.results {
  min-width: 0;
  padding: 22px;
}
.toolbar { margin-bottom: 18px; }
.result-list {
  display: grid;
  gap: 14px;
}
.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px dashed #c6d1dc;
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
}
.program-card {
  position: relative;
  border: 1px solid #cfdae5;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  min-width: 0;
  overflow: hidden;
}
.program-logo-bg {
  position: relative;
  width: 100%;
  height: 126px;
  display: grid;
  place-items: center;
  align-self: center;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}
.program-logo-bg img {
  position: relative;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 126px !important;
  object-fit: contain;
  object-position: center;
  opacity: .74;
  filter: saturate(.9) contrast(1.05);
}
.program-logo-bg img[src*="waseda-user-wordmark"] {
  width: 118% !important;
  height: 118% !important;
  max-width: 118% !important;
  max-height: 148px !important;
  opacity: 1;
  filter: none;
}
.program-logo-bg.is-broken img,
.program-logo-bg.is-fallback img {
  display: none;
}
.program-logo-bg.is-broken {
  display: none;
}
.program-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  margin: 0 0 7px;
  font-size: 1.1rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.program-title strong {
  font-weight: 800;
}
.program-title span {
  color: var(--muted);
  font-weight: 700;
}
.official-link {
  display: block;
  max-width: 100%;
  margin-top: 8px;
  overflow: hidden;
  color: var(--accent);
  font-size: .84rem;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.program-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #30465b;
  font-weight: 700;
}
.program-academic {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 10px;
  max-width: 900px;
  min-height: 116px;
  min-width: 0;
}
.academic-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  border-left: 3px solid #d7e3ec;
  padding-left: 10px;
  align-items: start;
}
.academic-row span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.45;
}
.academic-row strong,
.academic-row em {
  display: block;
  line-height: 1.45;
  font-style: normal;
  min-width: 0;
  overflow-wrap: anywhere;
}
.academic-row strong {
  font-weight: 800;
}
.academic-row em {
  color: #17324d;
  font-weight: 700;
  grid-column: 2;
}
.year {
  color: var(--muted);
  font-weight: 500;
}
.badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 14px;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--accent-soft);
  color: #006b5e;
  font-size: .8rem;
  font-weight: 700;
}
.fit-meter {
  width: 92px;
  min-width: 92px;
  justify-self: end;
  text-align: right;
}
.fit-meter strong {
  display: block;
  margin: 2px 0;
  font-size: 2rem;
}
.fit-meter span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: .82rem;
}
.fit-meter em,
.fit-meter a {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-style: normal;
  line-height: 1.4;
}
.fit-meter a {
  margin-top: 5px;
  color: var(--accent);
  font-weight: 700;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) minmax(150px, .8fr);
  gap: 10px;
  margin-top: 16px;
  min-width: 0;
}
.detail {
  min-height: 92px;
  border-radius: 6px;
  padding: 13px;
  background: var(--soft);
  min-width: 0;
  overflow: hidden;
}
.detail.detail-eju {
  overflow: visible;
}
.detail.detail-eju.has-eju-options {
  grid-column: auto;
}
.detail > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .82rem;
}
.detail strong {
  display: block;
  line-height: 1.55;
  white-space: pre-line;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.tag-list.eju-options {
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible;
}
.eju-option {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  white-space: normal;
  min-width: 0;
}
.eju-option-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  border: 1px solid #c8d7e3;
  border-radius: 6px;
  background: transparent;
  padding: 5px 7px;
}
.eju-options .tag-join {
  flex: 0 0 auto;
  margin: 0 2px;
}
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: .92rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}
.tag-join {
  align-self: center;
  color: #6b7280;
  font-size: .82rem;
  font-weight: 800;
}
.condition-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
}
.condition-note {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbe3ec;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  padding: 4px 9px;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.15;
}
.tag-jp { background: #dff5ef; color: #006b5e; }
.tag-jlpt { background: #e0f2fe; color: #075985; }
.tag-world { background: #fff0c2; color: #805700; }
.tag-math1 { background: #e7efff; color: #2052a3; }
.tag-math2 { background: #dfe7ff; color: #293f91; }
.tag-science { background: #e9f7d8; color: #406b00; }
.tag-physics { background: #e4f7ff; color: #00617b; }
.tag-chemistry { background: #f2e7ff; color: #673399; }
.tag-biology { background: #e6f8e8; color: #19692c; }
.tag-toefl { background: #e8f0ff; color: #1f55a8; }
.tag-toeic { background: #ecfdf5; color: #047857; }
.tag-ielts { background: #fff1f2; color: #be123c; }
.tag-interview { background: #fef3c7; color: #92400e; }
.tag-essay { background: #ffe4e6; color: #9f1239; }
.tag-oral { background: #fae8ff; color: #86198f; }
.tag-exam { background: #e0f2fe; color: #075985; }
.tag-practical { background: #f5f5dc; color: #725a00; }
.tag-written { background: #ede9fe; color: #5b21b6; }
.tag-lecture { background: #ccfbf1; color: #0f766e; }
.tag-same { background: #f3f4f6; color: #374151; }
.tag-muted, .tag-default { background: #eef2f6; color: #5b6775; }
.detail a {
  color: var(--accent);
  font-size: .84rem;
  font-weight: 700;
}
.map-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  background: currentColor;
  clip-path: path("M7 0C4.2 0 2 2.2 2 5c0 3.8 5 9 5 9s5-5.2 5-9c0-2.8-2.2-5-5-5Zm0 7.1A2.1 2.1 0 1 1 7 2.9a2.1 2.1 0 0 1 0 4.2Z");
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
@media (max-width: 980px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    column-gap: 24px;
  }
  .language-switcher {
    flex-wrap: wrap;
    max-width: 320px;
  }
  .layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .toolbar { display: grid; }
  .toolbar > select { width: 100%; }
}
@media (max-width: 720px) {
  .app-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "languages"
      "title";
    gap: 12px;
    padding: 16px 14px 18px;
  }
  .language-switcher {
    flex-wrap: nowrap;
    justify-content: flex-start;
    justify-self: stretch;
    max-width: none;
    gap: 4px;
  }
  .lang-button {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: 42px;
    height: auto;
    aspect-ratio: 7 / 5;
  }
  h1 {
    font-size: 2rem;
    margin-bottom: 0;
    overflow-wrap: anywhere;
  }
  .layout { padding: 14px; }
  .lead { display: none; }
  .visitor-counter { display: none; }
  .usage-meter { display: none; }
  .search-control {
    grid-template-columns: minmax(0, 1fr) 74px;
  }
  .search-submit {
    display: inline-grid;
    place-items: center;
  }
  .program-logo-bg {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    height: 92px;
  }
  .program-head {
    grid-template-columns: minmax(0, 1fr) minmax(74px, auto);
    gap: 14px 10px;
  }
  .program-title {
    display: block;
    margin-bottom: 10px;
  }
  .program-name {
    display: block;
  }
  .program-name strong,
  .program-name span {
    display: block;
  }
  .program-name .program-title-separator {
    display: none;
  }
  .detail-grid, .program-academic, .academic-row { grid-template-columns: 1fr; display: grid; }
  .detail.detail-eju.has-eju-options { grid-column: auto; }
  .academic-row em { grid-column: auto; }
  .fit-meter {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    width: auto;
    min-width: 74px;
    text-align: right;
  }
  .fit-meter strong {
    font-size: 1.65rem;
  }
  .fit-meter span {
    font-size: .76rem;
  }
}
