:root {
  color-scheme: light;
  --ink: #252a46;
  --muted: #535970;
  --paper: #fdfbf3;
  --white: #fffefa;
  --blue: #3548c7;
  --dark-blue: #2a3899;
  --lavender: #eaecff;
  --peach: #ffece0;
  --lime: #e7f389;
  --line: #dad9d2;
  --violet-line: #c5c7e3;
  --green: #1e5640;
  --red: #873c2c;
  --mincho: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", serif;
  font-family: "Hiragino Sans", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 1rem; line-height: 1.65; }
h1,h2,h3,h4,p,ul,ol,figure { margin: 0; }
a { color: inherit; text-underline-offset: .22em; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:where(input,button,a,summary,[tabindex]):focus-visible { outline: 3px solid #5064e3; outline-offset: 3px; }
:where(button,a) { -webkit-tap-highlight-color: #d9dcfc; }
[lang="ja"] { font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans CJK JP", system-ui, sans-serif; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(1180px,calc(100% - 76px)); margin-inline: auto; }
.top { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 1.08rem; letter-spacing: .04em; font-weight: 850; text-decoration: none; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; background: var(--blue); color: white; border: 1px solid #303153; border-radius: 9px; box-shadow: 2px 2px 0 #303153; transform: rotate(-7deg); }
.top-link, .plain { font-weight: 700; font-size: .9rem; color: var(--dark-blue); text-decoration: none; }
.plain { border: 0; background: transparent; padding: 6px 0; min-height: 36px; }
.top-link:hover,.plain:hover:not(:disabled) { text-decoration: underline; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hero { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0,1fr); align-items: center; gap: 24px; min-height: 300px; border: 1px solid #dfb3a1; border-radius: 26px 22px 29px 23px; background: var(--peach); padding: 34px 43px 40px; overflow: hidden; }
.hero:has(.recent:not([hidden])) { grid-template-columns: minmax(0,1.48fr) minmax(190px,1fr); }
.hero-text { position: relative; min-width: 0; }
.scope { display: flex; align-items: center; gap: 9px; color: var(--dark-blue); font-size: .86rem; font-weight: 800; letter-spacing: .04em; }
.scope span { padding-left: 9px; border-left: 1px solid #c2a7c1; }
#title { font-family: var(--mincho); font-size: clamp(3.65rem,7.2vw,6rem); font-weight: 900; letter-spacing: .04em; line-height: 1.2; margin: 8px 0 5px; }
#title span { position: relative; isolation: isolate; }
#title span::before { content: ""; position: absolute; z-index: -1; inset: 10% -4% 6%; border-radius: 49% 42% 49% 45%; border: 1px solid #a7b55f; background: var(--lime); rotate: -12deg; }
.subtitle { font-weight: 750; font-size: clamp(1.08rem,2.4vw,1.5rem); margin: 8px 0 18px; letter-spacing: .035em; }
.search { display: flex; align-items: center; gap: 10px; max-width: 660px; padding: 5px; border: 1px solid #8b89ad; background: var(--white); border-radius: 12px; box-shadow: 3px 4px 0 #383756; }
.search:focus-within { border-color: var(--blue); }
.search input { width: 100%; min-width: 0; outline: none; border: 0; background: transparent; min-height: 44px; padding: 4px 1px; }
.search input::placeholder { color: #60647a; opacity: 1; }
.lens { flex: none; width: 15px; height: 15px; margin: 0 4px 0 9px; border: 2px solid #555f9c; border-radius: 50%; position: relative; }
.lens::after { content: ""; position: absolute; background: #555f9c; width: 7px; height: 2px; left: 10px; top: 11px; rotate: 45deg; border-radius: 1px; }
.primary, .pill { min-height: 42px; border: 1px solid #b9bcd2; border-radius: 9px; background: var(--white); font-weight: 750; padding: 6px 14px; white-space: nowrap; font-size: .92rem; }
.primary { background: var(--blue); border-color: var(--blue); color: white; padding-inline: 19px; flex: none; }
.primary:hover { background: var(--dark-blue); }
.pill:hover { background: var(--lavender); }
.grid-accent { position: absolute; z-index: -1; inset: 9% 1.5% 4% auto; width: min(43%,365px); background-image: linear-gradient(#9386b11e 1px,transparent 1px), linear-gradient(90deg,#9386b11e 1px,transparent 1px); background-size: 20px 20px; mask-image: radial-gradient(ellipse at center,#000 36%,transparent 77%); pointer-events: none; }
.grid-accent i { display: block; position: absolute; border: 1px solid #33365d; box-shadow: 3px 4px 0 #35375b; }
.grid-accent i:nth-child(1) { top: 28%; right: 31%; width: 110px; height: 68px; rotate: -17deg; border-radius: 24% 46% 42% 18%; background: var(--lime); }
.grid-accent i:nth-child(2) { top: 43%; right: 16%; width: 85px; height: 62px; rotate: 14deg; border-radius: 26% 22% 21% 28%; background: var(--lavender); }
.grid-accent i:nth-child(3) { top: 62%; right: 39%; width: 25px; height: 25px; rotate: 35deg; border-radius: 4px; background: #faaf91; }
.hero:has(.recent:not([hidden])) .grid-accent { opacity: .38; }
.recent { align-self: center; min-width: 0; padding: 13px 14px 15px; border: 1px solid #c9b2c0; border-radius: 15px; background: #fff8f1; }
.recent h2 { font-size: 1rem; }
.recent ul { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0; gap: 9px; list-style: none; }
.recent .plain { font-size: .82rem; }
.recent-button { min-height: 42px; width: 100%; background: var(--lavender); border: 1px solid #8888b1; border-radius: 8px; padding: 5px 9px; text-align: left; font-size: .91rem; font-weight: 730; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent li:nth-child(3n+2) .recent-button { background: #eef6ae; }
.recent li:nth-child(3n) .recent-button { background: #ffdfd2; }
.recent-button:hover { box-shadow: 2px 2px 0 #747092; }
.indexes { margin-top: 32px; scroll-margin-top: 14px; }
.index-heading { margin-bottom: 12px; }
.index-heading h2 { font-size: 1.45rem; line-height: 1.2; }
.index-heading p { color: var(--muted); font-size: .87rem; margin-top: 5px; }
.index-heading .plain { flex: none; white-space: nowrap; text-align: right; }
.index-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.index-card { width: 100%; min-width: 0; min-height: 114px; display: flex; align-items: center; gap: 19px; text-align: left; padding: 16px 24px; border: 1px solid #7e82aa; border-radius: 15px 16px 13px 14px; box-shadow: 3px 4px 0 #383756; transition: transform .16s, box-shadow .16s; }
.index-card:hover { transform: translateY(-3px); box-shadow: 4px 7px 0 #383756; }
.index-card.exams { background: var(--lime); }
.index-card.terms { background: var(--lavender); }
.index-symbol { display: grid; place-items: center; flex: none; width: 52px; height: 51px; border: 1px solid #72749b; border-radius: 10px 9px 11px 8px; background: var(--white); font-size: 1.56rem; font-weight: 900; rotate: -7deg; }
.terms .index-symbol { rotate: 7deg; }
.index-card strong { display: block; font-size: 1.32rem; line-height: 1.3; }
.index-card small { display: block; margin-top: 4px; font-size: .91rem; color: #414764; }
.study { margin-top: 34px; display: grid; grid-template-columns: minmax(0,1.52fr) minmax(0,1fr); align-items: start; gap: 21px; scroll-margin-top: 16px; }
.study:has(#network[hidden]) { grid-template-columns: minmax(0,1fr); }
#result, #network { min-width: 0; scroll-margin-top: 14px; }
.mobile-nav { display: none; }
.network { position: sticky; top: 14px; max-height: calc(100dvh - 28px); scrollbar-width: thin; overflow-y: auto; padding: 17px; background: #f0f1fe; border-radius: 17px; border: 1px solid var(--violet-line); }
.network > h2 { font-size: 1.2rem; margin-bottom: 10px; }
.word-card { border-radius: 13px; border: 1px solid var(--violet-line); background: var(--white); padding: 15px; overflow-wrap: anywhere; }
.word-top { align-items: flex-start; }
.word-top h3 { font-family: var(--mincho); font-size: clamp(1.6rem,4vw,2.1rem); line-height: 1.2; font-weight: 900; margin: 3px 0; }
.word-label,.meta { color: var(--muted); font-size: .86rem; }
.word-meta { color: var(--dark-blue); font-size: .9rem; font-weight: 750; }
.word-meaning { margin-top: 10px; }
.word-section { margin-top: 13px; padding-top: 12px; border-top: 1px solid #e0e0ed; }
.word-section > h4 { font-size: .94rem; margin-bottom: 6px; color: #424a75; }
.tip { margin-top: 13px; border-left: 4px solid #a7bd58; background: #f4f7e4; padding: 9px 11px; border-radius: 0 7px 7px 0; font-size: .95rem; }
.tip strong { display: block; font-size: .86rem; margin-bottom: 3px; }
.chips,.badges { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.chip { border: 1px solid #c1c4e5; border-radius: 8px; padding: 4px 8px; min-height: 38px; color: var(--dark-blue); background: #f4f5ff; font-weight: 750; font-size: .9rem; overflow-wrap: anywhere; text-align: left; }
.chip:hover { background: var(--lavender); border-color: #949acb; }
.chip.green { border-color: #c0cb80; background: #f1f5d9; color: #34453b; }
.chip.green:hover { background: #eaf2be; }
.compare-list,.linked-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.compare-list li { display: grid; gap: 5px; justify-items: start; }
.compare-list p { font-size: .9rem; line-height: 1.55; }
.linked-list button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; min-height: 40px; border: 1px solid #dddff0; border-radius: 8px; text-align: left; color: var(--dark-blue); background: #f9f9ff; font-size: .9rem; font-weight: 750; }
.linked-list button:hover { border-color: #a1a6d2; background: var(--lavender); }
.linked-list button small { color: #4c5374; font-size: .78rem; font-weight: 650; text-align: right; }
.word-sources { font-size: .83rem; display: flex; flex-wrap: wrap; gap: 7px 12px; }
.word-sources a { color: var(--dark-blue); }
.review { color: var(--muted); font-size: .79rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.word-top .review { padding-top: 2px; }
.section-top { margin-bottom: 11px; }
.section-top h2 { font-size: 1.5rem; line-height: 1.3; overflow-wrap: anywhere; }
.section-top p { margin-top: 3px; }
.filters { display: grid; width: min(100%,420px); grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; margin-bottom: 13px; }
.filters button { min-height: 41px; min-width: 0; border: 1px solid #c5c7db; border-radius: 999px; padding: 4px 1px; background: var(--white); font-size: .87rem; font-weight: 720; white-space: nowrap; }
.filters button:hover { background: var(--lavender); }
.filters button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: white; }
.results { list-style: none; padding: 0; display: grid; gap: 9px; }
.hit-button { display: block; width: 100%; padding: 12px 14px; text-align: left; border-radius: 12px; border: 1px solid var(--line); background: var(--white); }
.hit-button:hover { border-color: #a1a6d8; background: #f9f8ff; }
.hit-heading { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.hit-title { font-weight: 830; font-size: 1.12rem; overflow-wrap: anywhere; }
.hit-id { font-size: .82rem; font-weight: 800; color: var(--dark-blue); }
.hit-description { display: block; margin-top: 4px; color: #464c67; font-size: .92rem; overflow-wrap: anywhere; }
.badges { margin-top: 6px; }
.badge { display: inline-block; padding: 1px 6px; border-radius: 5px; color: var(--dark-blue); background: #e9ebfe; font-size: .78rem; font-weight: 730; white-space: nowrap; }
.badge.correct { background: #e2f0db; color: var(--green); }
.badge.incorrect { background: #ffe9de; color: var(--red); }
.badge.reference { background: #f5efda; color: #674d20; }
.empty { padding: 17px; border: 1px dashed #aeb2cf; border-radius: 12px; background: var(--white); }
.empty p { margin-top: 5px; }
.more { margin-top: 12px; }
.question { background: var(--white); border: 1px solid var(--line); border-radius: 17px; padding: 17px 18px; }
.question-nav { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-bottom: 13px; }
.question-nav button { color: var(--dark-blue); }
.question-head { align-items: flex-start; margin-bottom: 12px; }
.question-head h2 { font-family: var(--mincho); font-size: clamp(1.8rem,5vw,2.5rem); line-height: 1.25; overflow-wrap: anywhere; }
.question .prompt { font-size: .91rem; margin-bottom: 10px; }
.answers { display: grid; gap: 9px; padding: 0; list-style: none; }
.answer { min-width: 0; border: 1px solid #dcdce8; border-radius: 11px; background: var(--white); overflow: clip; }
.answer.correct { border-color: #a4c7a4; background: #f4faef; }
.answer.incorrect.selected { border-color: #d1a293; background: #fff5ed; }
.answer > button { width: 100%; display: grid; text-align: left; align-items: baseline; gap: 8px; grid-template-columns: 1.45rem minmax(0,1fr); min-height: 50px; padding: 10px 11px; border: 0; background: transparent; }
.answer > button:focus-visible { outline-offset: -4px; }
.answer > button:not(:disabled):hover { background: #ecefff; }
.answer > button:disabled { color: var(--ink); opacity: 1; }
.answer-no { font-weight: 850; color: var(--dark-blue); }
.answer-copy { overflow-wrap: anywhere; }
.answer-note { padding: 7px 11px 11px 18px; border-top: 1px solid #dddfe6; color: #373f59; font-size: .93rem; }
.answer-note p { margin-top: 4px; }
.answer-source,.question-source { display: block; color: var(--muted); font-size: .82rem; margin-top: 9px; overflow-wrap: anywhere; }
.question-source summary { cursor: pointer; font-weight: 730; }
.question-source p { margin-top: 5px; }
.action-row { margin-top: 13px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.status { margin-top: 10px; font-weight: 750; font-size: .93rem; color: var(--dark-blue); }
.word-focus { background: var(--white); border: 1px solid var(--line); padding: 14px; border-radius: 12px; margin-bottom: 11px; }
.foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 31px; border-top: 1px solid var(--line); padding-block: 12px 25px; color: var(--muted); font-size: .9rem; align-items: center; }
.foot span { font-weight: 800; }
dialog { width: min(760px,calc(100% - 22px)); max-height: 82dvh; max-height: 82vh; padding: 0; overflow: auto; color: var(--ink); border: 1px solid #a4a9d2; border-radius: 18px; background: var(--white); box-shadow: 7px 8px 0 #222a5b38; }
dialog::backdrop { background: #21254b78; }
.dialog-head { position: sticky; top: 0; z-index: 1; background: var(--white); padding: 13px 17px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 1.35rem; }
#directory-body { padding: 14px 17px 19px; }
.directory-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.year-group { padding: 9px; border: 1px solid #daddf1; border-radius: 10px; background: #f6f6ff; }
.year-group h3 { font-size: .92rem; margin-bottom: 5px; }
.year-group .chips { align-items: stretch; }
.year-group .chip { flex: 1; text-align: center; }
.dir-input { display: block; width: 100%; margin-bottom: 11px; border: 1px solid #b2b7da; border-radius: 8px; padding: 7px 9px; min-height: 42px; }
.dir-terms { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.dir-terms b, .dir-terms small { display: block; }
.dir-terms small { font-size: .79rem; color: var(--muted); font-weight: 600; }
.sources-copy { display: grid; gap: 9px; }
.sources-copy ul { padding-inline-start: 1.3rem; }
.sources-copy a { color: var(--dark-blue); }

@media (max-width: 840px) {
  .wrap { width: min(100% - 38px,1180px); }
  .hero { padding-inline: 27px; }
  .study { gap: 13px; }
  .network { padding: 12px; }
}
@media (max-width: 670px) {
  .wrap { width: calc(100% - 26px); }
  .top { min-height: 61px; }
  .top-link { font-size: .83rem; }
  .hero,.hero:has(.recent:not([hidden])) { grid-template-columns: minmax(0,1fr); min-height: 0; padding: 19px 16px 23px; gap: 18px; border-radius: 16px; }
  #title { font-size: clamp(2.95rem,12vw,4.3rem); }
  .subtitle { margin-bottom: 14px; }
  .grid-accent { opacity: .45; inset: 4% -10% 21% auto; width: 56%; }
  .grid-accent i:nth-child(1) { width: 68px; height: 40px; }
  .grid-accent i:nth-child(2) { width: 41px; height: 34px; }
  .search .primary { padding-inline: 12px; min-height: 41px; }
  .indexes { margin-top: 24px; }
  .index-heading h2 { font-size: 1.27rem; }
  .index-heading p,.index-heading .plain { font-size: .79rem; }
  .index-cards { gap: 11px; }
  .index-card { gap: 6px; min-height: 90px; padding: 10px 7px; border-radius: 11px; box-shadow: 2px 3px 0 #383756; }
  .index-symbol { width: 28px; height: 31px; border-radius: 5px; font-size: 1rem; }
  .index-card strong { font-size: 1.05rem; }
  .index-card small { line-height: 1.31; font-size: .79rem; margin-top: 3px; }
  .study { display: grid; grid-template-columns: minmax(0,1fr); margin-top: 27px; gap: 9px; }
  .mobile-nav { display: flex; justify-content: flex-end; gap: 6px; }
  .mobile-nav .pill { font-size: .85rem; }
  .network { position: static; max-height: none; overflow: visible; margin-top: 7px; }
  .question { padding: 12px; }
  .directory-grid,.dir-terms { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.answer-copy mark { color: inherit; background: transparent; text-decoration: underline; text-decoration-color: #777fd2; text-decoration-thickness: 2px; text-underline-offset: .22em; font-weight: 760; }
.option-chips { margin-top: 7px; }
@media (max-width: 670px) {
  .mobile-nav { position: sticky; top: 0; z-index: 3; background: var(--paper); padding-block: 4px; }
  .study:has(.mobile-nav:not([hidden])) :is(#result,#network) { scroll-margin-top: 62px; }
}
.member-nav > span { align-items: center; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; }
.member-nav #member-expiration { color: var(--muted); font-size: .82rem; }
