:root{
  color-scheme:light;
  font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Hiragino Sans","Yu Gothic",Meiryo,sans-serif;
  --bg:#f6f8fb;
  --card:#ffffff;
  --panel:#f7f8fa;
  --line:#d8dee8;
  --line-strong:#cdd5df;
  --text:#2b2f36;
  --muted:#6b7280;
  --accent:#5b6f95;
  --accent-strong:#3f557d;
  --accent-soft:#dfe7f5;
  --tag-bg:#f1f4f8;
  --tag-text:#5b6777;
  --danger:#923c35;
  --danger-bg:#fff8f7;
  --rarity-l:#8d63df;
  --rarity-e:#d46046;
  --rarity-r:#d1a52f;
  --rarity-u:#4d9d63;
  color:var(--text);
  background:var(--bg);
  line-height:1.6
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);font-size:14px}
button,input{font:inherit}
button{cursor:pointer}
button:focus-visible,input:focus-visible{outline:3px solid #78a5ed;outline-offset:2px}
a{color:var(--accent)}
.app{max-width:840px;margin:0 auto;padding:22px 18px 34px}
.header{margin-bottom:20px;display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.heading{min-width:0}
.language-toggle{display:inline-flex;align-items:center;gap:2px;flex-shrink:0;border:1px solid var(--line);background:#edf1f6;border-radius:999px;padding:3px;box-shadow:0 1px 2px rgba(20,35,60,.04)}
.lang-option{border:0;background:transparent;color:#687386;min-width:43px;padding:6px 11px;border-radius:999px;font-size:12px;font-weight:700;line-height:1.4;white-space:nowrap;transition:background-color .15s,color .15s,box-shadow .15s}
.lang-option:hover:not(.active){color:var(--accent-strong);background:#e3eaf4}
.lang-option.active{background:var(--card);color:var(--accent-strong);box-shadow:0 1px 4px rgba(30,45,75,.12)}
h1{font-size:clamp(20px,4vw,26px);line-height:1.4;margin:0;font-weight:750;letter-spacing:.01em}
.subtitle{font-size:12px;color:var(--muted);margin:5px 0 0}
.filters{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:6px;box-shadow:0 1px 2px rgba(20,35,60,.03)}
.field-label{font-size:13px;font-weight:750;color:#263244}
#search{border:1px solid var(--line-strong);border-radius:9px;width:100%;background:var(--card);min-height:43px;padding:8px 12px;color:#182232;outline:none}
#search:focus{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.help{font-size:11px;color:var(--muted);margin:0 0 8px}
.group{margin-top:8px}
.group-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.choice-row,.tag-checks{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px}
.choice{border:1.5px solid var(--line-strong);background:var(--card);padding:5px 15px;border-radius:999px;min-width:46px;font-weight:700;color:#465164;transition:background-color .15s,border-color .15s,color .15s,transform .05s}
.choice:hover{background:#f8fafc}
.choice:active{transform:translateY(1px)}
.choice.active{background:var(--accent-strong);border-color:var(--accent-strong);color:#fff}
.choice[data-rarity="L"]{border-color:var(--rarity-l);color:var(--rarity-l)}
.choice[data-rarity="E"]{border-color:var(--rarity-e);color:var(--rarity-e)}
.choice[data-rarity="R"]{border-color:var(--rarity-r);color:var(--rarity-r)}
.choice[data-rarity="U"]{border-color:var(--rarity-u);color:var(--rarity-u)}
.choice[data-rarity="L"]:hover{background:color-mix(in srgb, var(--rarity-l) 10%, white)}
.choice[data-rarity="E"]:hover{background:color-mix(in srgb, var(--rarity-e) 10%, white)}
.choice[data-rarity="R"]:hover{background:color-mix(in srgb, var(--rarity-r) 12%, white)}
.choice[data-rarity="U"]:hover{background:color-mix(in srgb, var(--rarity-u) 10%, white)}
.choice[data-rarity="L"].active{background:var(--rarity-l);border-color:var(--rarity-l);color:#fff}
.choice[data-rarity="E"].active{background:var(--rarity-e);border-color:var(--rarity-e);color:#fff}
.choice[data-rarity="R"].active{background:var(--rarity-r);border-color:var(--rarity-r);color:#fff}
.choice[data-rarity="U"].active{background:var(--rarity-u);border-color:var(--rarity-u);color:#fff}
.mode{border:1px solid var(--line-strong);border-radius:999px;padding:2px;display:flex;background:var(--card)}
.mode-choice{border:0;background:transparent;padding:4px 13px;border-radius:999px;font-size:12px;color:#536074}
.mode-choice.active{background:var(--accent-strong);color:white;font-weight:750}
.tag-checks{gap:12px 16px}
.tag-checks label{display:inline-flex;align-items:center;gap:4px;cursor:pointer;white-space:nowrap;color:#334155}
.tag-checks input{accent-color:var(--accent-strong);width:16px;height:16px;margin:0}
.result-bar{display:flex;align-items:center;justify-content:space-between;padding:16px 2px 11px;gap:10px}
.result-bar p{font-weight:750;margin:0;font-size:14px}
.reset{border:0;background:transparent;color:var(--accent);text-decoration:underline;text-underline-offset:2px;padding:5px}
.results{display:grid;gap:11px}
.bb{border:1px solid #e1e6ee;border-radius:12px;padding:16px 17px;background:var(--card);overflow-wrap:anywhere;box-shadow:0 1px 2px rgba(20,35,60,.03)}
.bb-head{display:flex;align-items:center;gap:9px;margin-bottom:8px}
.rarity{font-size:12px;font-weight:800;border-radius:999px;padding:3px 9px;min-width:31px;text-align:center;flex-shrink:0;color:#fff;border:1px solid transparent}
.rarity-l{background:var(--rarity-l);border-color:var(--rarity-l)}
.rarity-e{background:var(--rarity-e);border-color:var(--rarity-e)}
.rarity-r{background:var(--rarity-r);border-color:var(--rarity-r)}
.rarity-u{background:var(--rarity-u);border-color:var(--rarity-u)}
.bb-name{font-size:16px;font-weight:760;line-height:1.55;margin:0}
.tags{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:13px}
.tag{background:var(--tag-bg);border-radius:999px;color:var(--tag-text);padding:2px 8px;font-size:11px}
.section-label{font-size:12px;font-weight:750;margin:10px 0 4px;color:#3e5169}
.detail-line{margin:0 0 5px;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px}
.detail-line:last-child{margin-bottom:0}
.empty,.notice{border:1px solid #e2e7ee;border-radius:12px;text-align:center;padding:24px 12px;color:var(--muted);background:var(--card)}
.notice{color:var(--danger);background:var(--danger-bg)}
.footer{color:#748093;font-size:11px;line-height:1.8;margin:24px 3px 0}
.footer p{margin:0}
.footer p+p{margin-top:8px}
.footer a{color:var(--accent);text-decoration:underline}
[hidden]{display:none!important}
@media(max-width:480px){.header{gap:8px}.language-toggle{margin-top:1px}.lang-option{min-width:36px;padding:5px 9px;font-size:11px}.app{padding:14px 10px 22px}.filters{padding:14px 12px}.bb{padding:13px 12px}.bb-name{font-size:15px}.tag-checks{gap:10px 14px}.choice{padding:6px 12px}.detail-line{font-size:13px}}


/* Shared lightweight navigation across the three BFH encyclopedias (v1). */
.bfh-dex-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;width:min(100%,520px);margin:-4px 0 18px}
.bfh-dex-item{min-width:0;min-height:41px;display:flex;align-items:center;justify-content:center;gap:7px;padding:7px 8px;border:1px solid #d8e1ed;border-radius:9px;background:#fff;color:#526987;text-decoration:none;font-size:13px;font-weight:700;line-height:1.2;white-space:nowrap;transition:background-color .13s,border-color .13s}
.bfh-dex-item svg{width:16px;height:16px;flex:0 0 16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
a.bfh-dex-item:hover{background:#eef3fa;border-color:#b7cbe2;color:#38597f}
a.bfh-dex-item:focus-visible{outline:3px solid #92b2e0;outline-offset:2px}
.bfh-dex-item.is-current{background:#526f9a;color:#fff;border-color:#526f9a;cursor:default}
.bfh-dex-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;column-gap:11px;row-gap:3px;font-size:11px;line-height:1.65;margin:0 0 10px;color:#7c8ba2}
.bfh-dex-footer a{color:#5c789d;text-decoration:underline;text-underline-offset:2px}
@media(max-width:420px){.bfh-dex-nav{gap:5px;margin-top:-3px;margin-bottom:14px}.bfh-dex-item{min-height:39px;padding:7px 3px;gap:5px;font-size:12px}.bfh-dex-item svg{width:14px;height:14px;flex-basis:14px}}
@media(max-width:320px){.bfh-dex-item{font-size:11px;gap:4px}.bfh-dex-item svg{width:13px;height:13px;flex-basis:13px}}
