:root{--bg:#f6f8fb;--card:#fff;--ink:#283447;--muted:#6c7b8d;--line:#dce3ed;--blue:#5b6f95;--bluebg:#edf2f9;--purple:#8d63df;--red:#d46046;--gold:#d1a52f;--green:#4d9d63;--grey:#8190a4;--error:#b34949}*{box-sizing:border-box}html{scrollbar-gutter:stable}body{margin:0;font:14px/1.6 -apple-system,BlinkMacSystemFont,"Yu Gothic","Hiragino Kaku Gothic ProN",Meiryo,system-ui,sans-serif;color:var(--ink);background:var(--bg)}button,input,select{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #92b2e0;outline-offset:2px}.wrap{max-width:990px;margin:auto;padding:28px 17px 52px}.top{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:20px}h1{font-size:24px;letter-spacing:.015em;margin:0 0 5px;line-height:1.4}.subtitle{color:var(--muted);margin:0;font-size:12px}.lang{border-radius:999px;background:#e9eef6;display:flex;align-items:center;gap:2px;padding:3px;flex:none}.lang button{border:0;background:transparent;border-radius:999px;color:#74819a;padding:6px 12px;font-size:12px;font-weight:700}.lang button.active{background:#fff;color:#43587c;box-shadow:0 1px 3px #9faaba45}.search-panel{background:#fff;border:1px solid var(--line);border-radius:14px;padding:17px 18px 18px;box-shadow:0 1px 3px #00000006}.control-label{font-size:12px;font-weight:700;color:#47566e;display:block;margin:0 0 6px}.searchbox{display:flex;align-items:center;gap:9px;background:#fff;border:1px solid #bfcbdc;border-radius:9px;padding:0 10px;min-height:43px}.searchbox:focus-within{border-color:#809dbb;box-shadow:0 0 0 2px #dce8f5}.searchbox span{font-size:23px;color:#97a6b8;line-height:1}.searchbox input{width:100%;min-width:0;border:0;outline:none;background:transparent;font-size:14px;padding:10px 0;color:var(--ink)}.searchbox input:focus-visible{outline:none}.tiny{border:0;background:none;color:#8794a6;font-size:21px;line-height:1;padding:3px}.filter-label{display:flex;justify-content:space-between;align-items:center;margin:15px 0 8px}.filter-label strong{font-size:12px}.filter-label span{font-size:10px;color:var(--muted)}.rarity-options{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px}.rarity-btn{border:1.5px solid var(--rar);border-radius:999px;background:#fff;color:var(--rar);font-weight:700;padding:6px 0;min-width:0;white-space:nowrap;line-height:1.35;font-size:12px}.rarity-btn.active{color:#fff;background:var(--rar)}.attr-options{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px}.attr-btn{background:#fff;border:1.5px solid var(--element-border);border-radius:8px;color:var(--element-border);font-weight:700;padding:6px 0;white-space:nowrap;font-size:12px;min-width:0;transition:background-color .1s,border-color .1s,color .1s}.attr-btn.active{border-color:var(--element-border);background:var(--element);color:var(--element-text)}.attr-btn:hover:not(.active){background:color-mix(in srgb,var(--element) 10%,white)}.tools{display:flex;align-items:flex-end;gap:12px;margin-top:16px;flex-wrap:wrap}.sort-wrap{flex:1;min-width:200px}.sort-wrap select{width:100%;min-height:40px;padding:7px 12px;border:1px solid #c3cfde;border-radius:8px;background:#fff;color:#3b4f68;font-size:13px}.level-wrap{flex:none}.level-button{min-height:40px;border:1px solid #a9bdd3;background:#f0f5fb;border-radius:8px;color:#405d82;display:flex;align-items:center;gap:7px;padding:0 11px;font-weight:700;font-size:12px}.level-button svg{color:#6786aa}.level-button #otherLevel{opacity:.57}.reset{border:0;background:none;padding:10px 4px;color:#5f779b;font-size:12px;text-decoration:underline}.result-bar{display:flex;justify-content:space-between;gap:10px;align-items:center;margin:20px 0 11px}.result-bar strong{font-size:14px}.result-bar span{color:var(--muted);font-size:11px}.cards{display:grid;grid-template-columns:minmax(0,1fr);gap:11px}.unit-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:14px 16px;box-shadow:0 1px 2px #00000005;min-width:0}.identity{display:flex;align-items:center;gap:12px;min-width:0}.unit-art{height:60px;width:60px;flex:none;border-radius:9px;object-fit:contain;background:#edf1f6}.unit-art.missing{padding:16px}.names{min-width:0;flex:1}.name-line{display:flex;flex-wrap:wrap;gap:7px;align-items:center}.unit-name{font-weight:800;font-size:15px;overflow-wrap:anywhere}.rarity-badge{display:inline-block;background:var(--rar);padding:2px 7px;line-height:1.35;color:white;border-radius:5px;font-weight:800;font-size:11px}.attribute-badge{color:#53657c;background:#eef2f7;border-radius:5px;font-weight:700;font-size:11px;padding:2px 7px}.meta-line{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:2px;color:#8190a1;font-size:11px}.meta-line .unit-id{margin-left:auto;white-space:nowrap}.statline{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px;margin-top:13px}.statcell{min-width:0;background:#f2f5f9;border-radius:5px;text-align:center;padding:6px 1px 7px}.statcell span{display:block;font-size:10px;color:#66798c}.statcell strong{display:block;font-weight:750;font-size:13px;font-variant-numeric:tabular-nums;letter-spacing:-.025em;overflow:hidden;text-overflow:clip}.bbview{border-top:1px solid #edf0f5;margin-top:13px;padding-top:10px}.bb-title{display:flex;gap:7px;align-items:center;margin-bottom:4px}.bb-title .capsule{font-size:10px;color:#72819a;font-weight:750}.bb-title strong{font-size:13px}.bb-cond{color:#607188;font-size:12px;white-space:pre-line;margin:2px 0 5px}.bb-effects{font-size:12px;line-height:1.55}.bb-effects div{margin:0 0 2px;white-space:pre-wrap;overflow-wrap:anywhere}.rerise-launch{margin-top:11px;width:100%;padding:9px 11px;display:flex;justify-content:space-between;align-items:center;border-radius:8px;border:1px solid #c6d8ec;background:#f0f6fd;color:#35618e;font-weight:700;font-size:12px}.rerise-launch:hover{background:#e3f0fe}.load-notice{background:#fff;border:1px solid #e3cfb8;border-radius:11px;padding:17px;margin:18px 0;color:#465569}.load-notice p{font-size:12px;margin:6px 0 12px}.load-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.file-btn,#retry{background:#58769d;color:#fff;border:none;border-radius:8px;padding:8px 13px;cursor:pointer}.load-actions input{display:none}.official-link{font-size:12px;color:#466b99}.muted{font-size:12px;color:#66778b;overflow-wrap:anywhere}.empty{border:1px dashed #cbd6e3;border-radius:12px;text-align:center;padding:35px;color:#708096;background:white}footer{text-align:center;padding-top:30px;font-size:11px;color:#8490a3}footer p{margin:0 0 3px}footer a{color:#6684a8}.overlay[hidden],.load-notice[hidden]{display:none!important}.overlay{position:fixed;z-index:1000;inset:0;display:flex;align-items:center;justify-content:center;padding:20px}.shade{position:absolute;inset:0;background:#17233691}.modal{position:relative;width:min(760px,100%);max-height:min(92dvh,940px);display:flex;flex-direction:column;background:#fff;border-radius:16px;box-shadow:0 16px 70px #17233660;overflow:hidden}.modal-head{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:13px 19px;border-bottom:1px solid #e5eaf1}.modal-head h2{font-size:17px;margin:0}.modal-head p{font-size:11px;color:#8190a1;margin:2px 0 0}.close{border:0;background:#f0f3f8;color:#506179;border-radius:999px;width:34px;height:34px;min-width:34px;min-height:34px;flex:0 0 34px;display:grid;place-items:center;padding:0;line-height:0;align-self:center;appearance:none;-webkit-appearance:none}.close svg{display:block;width:19px;height:19px;stroke:currentColor;stroke-width:1.7;fill:none;stroke-linecap:round}.close:hover{background:#e3eaf3}.modal-body{overflow:auto;padding:14px 19px 22px;overscroll-behavior:contain}.sim-top{display:flex;align-items:center;gap:10px;justify-content:space-between;margin-bottom:11px}.points{display:flex;align-items:baseline;gap:7px;font-weight:750}.points strong{font-size:21px;font-variant-numeric:tabular-nums}.points.warning{color:var(--error)}.pointbar{height:6px;border-radius:99px;background:#e8eef6;overflow:hidden;margin-bottom:13px}.pointfill{height:100%;background:#5b7ea8;max-width:100%;transition:width .15s}.pointfill.warning{background:#c76154}.sim-heading{font-size:12px;color:#6d7f94;font-weight:700;margin:13px 0 7px}.bb-picks{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:7px}.pick-bb{background:#fff;border:1px solid #cbd5e2;border-radius:9px;padding:9px 10px;display:flex;flex-direction:column;gap:3px;text-align:left;min-width:0}.pick-bb.selected{background:#e9f1fb;border-color:#5a82b4;box-shadow:inset 0 0 0 1px #5a82b4}.pick-bb strong{font-size:12px;overflow-wrap:anywhere}.pick-bb span{font-size:11px;color:#647990}.pick-bb.selected span{color:#386592}.picked-desc{background:#f7f9fc;border:1px solid #ebeff4;border-radius:9px;padding:9px 11px;margin-top:7px}.picked-desc .bb-cond,.picked-desc .bb-effects{font-size:11px}.picked-desc .bb-cond{margin:0 0 4px}.stat-rows{display:grid;gap:7px}.stat-row{display:grid;grid-template-columns:56px minmax(0,1fr);gap:7px;align-items:center}.stat-row-label{font-weight:700;font-size:12px}.stat-picks{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.stat-pick{border:1px solid #cfdae6;border-radius:7px;padding:6px 2px;background:#fff;color:#465d76;min-width:0;line-height:1.3}.stat-pick.selected{border-color:#678ab6;background:#e7f1fd;color:#325c8a;box-shadow:inset 0 0 0 1px #678ab6}.stat-pick b{font-size:11px;display:block}.stat-pick small{font-size:10px;display:block;white-space:nowrap}.gain-summary{border-top:1px solid #edf0f5;margin-top:14px;padding-top:12px;font-size:12px}.gain-summary strong{font-size:13px}.warn-text{color:var(--error);font-weight:700;font-size:12px;margin:6px 0 0}.modal-reset{background:transparent;border:0;text-decoration:underline;color:#6581a6;font-size:11px;padding:4px}.body-locked{overflow:hidden}@media(max-width:680px){.wrap{padding:18px 12px 40px}h1{font-size:19px;word-break:keep-all}.subtitle{font-size:11px}.search-panel{padding:12px}.rarity-options,.attr-options{gap:4px}.rarity-btn,.attr-btn{font-size:11px;padding:6px 0}.tools{gap:8px}.sort-wrap{min-width:150px}.unit-card{padding:11px 11px}.unit-art{width:52px;height:52px}.identity{gap:9px}.unit-name{font-size:13px}.statcell strong{font-size:12px}.bb-effects,.bb-cond{font-size:11px}.overlay{padding:0;align-items:flex-end}.modal{width:100%;height:auto;max-height:95dvh;border-radius:16px 16px 0 0}.modal-head{padding:10px 13px}.modal-body{padding:10px 12px 17px}.bb-picks{grid-template-columns:repeat(2,minmax(0,1fr))}.stat-row{grid-template-columns:39px minmax(0,1fr);gap:4px}.stat-pick b{font-size:10px}.stat-pick small{font-size:9px}.stat-picks{gap:3px}.stat-row-label{font-size:11px}}@media(max-width:350px){.wrap{padding:14px 8px 35px}h1{font-size:17px}.search-panel{padding:10px}.lang button{padding:5px 8px;font-size:11px}.statcell strong{font-size:11px}.statcell span{font-size:9px}.meta-line{gap:7px}.stat-pick{padding:5px 0}.stat-pick b{font-size:9px}.stat-pick small{font-size:8px}}

/* v4: compact Re-Rise-only filter beneath attribute choices */
.rerise-filter{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #e9eef5;border-bottom:1px solid #e9eef5;padding:11px 2px;margin-top:13px;cursor:pointer;user-select:none}
.rerise-filter-copy{display:flex;align-items:center;gap:9px;min-width:0}
.rerise-filter-copy strong{font-size:12px;color:var(--ink);font-weight:700}
.rerise-filter-count{font-size:11px;color:#7a879b;font-variant-numeric:tabular-nums}
.rerise-filter input{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;clip-path:inset(50%)}
.rerise-filter-track{position:relative;display:block;flex:0 0 43px;width:43px;height:25px;border-radius:99px;background:#d5deeb;transition:background .15s}
.rerise-filter-knob{position:absolute;left:3px;top:3px;width:19px;height:19px;border-radius:50%;background:white;box-shadow:0 1px 2px #23304735;transition:transform .15s}
.rerise-filter input:checked+.rerise-filter-track{background:#5b80b2}
.rerise-filter input:checked+.rerise-filter-track .rerise-filter-knob{transform:translateX(18px)}
.rerise-filter input:focus-visible+.rerise-filter-track{outline:3px solid #92b2e0;outline-offset:3px}
.rerise-filter+.tools{margin-top:13px}

/* v7: compact responsive re-rise panel; selector/search and data logic are unchanged */
.modal{width:min(1010px,100%);max-height:min(96dvh,960px)}
.modal-head{display:block;flex:0 0 auto;background:#fff;padding:10px 16px 8px;border-bottom:1px solid #e5eaf1}
.modal-head-row{display:flex;align-items:center;gap:9px;min-width:0;height:37px}
.modal-rarity{flex:none;background:var(--rar);color:#fff;font-size:11px;font-weight:800;border-radius:5px;padding:2px 7px;line-height:1.35}
.modal-head h2{font-size:15px;min-width:0;flex:1;line-height:1.4;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.modal-id{font-size:11px;color:#8090a4;font-variant-numeric:tabular-nums;white-space:nowrap;flex:none}
.modal-head .close{margin-left:2px;flex:none}
.sim-pointline{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:5px 0 5px;font-size:12px;color:#61758f;line-height:1.4}
.sim-pointline strong{font-size:17px;color:#2b4668;font-weight:800;font-variant-numeric:tabular-nums}
.sim-pointline .sim-point-remaining strong{color:#326ca5}
.sim-pointline strong.warning{color:var(--error)}
.modal-head .pointbar{height:5px;margin:0;border-radius:99px}
.modal-head .pointfill{height:100%;border-radius:99px}
.sim-warning{font-size:11px;color:var(--error);font-weight:700;margin:4px 0 0}
.sim-warning[hidden]{display:none}
.modal-body{padding:12px 15px 15px;min-height:0;overflow:auto}
.sim-workspace{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(0,.88fr);align-items:start;gap:14px;min-width:0}
.sim-bb-panel,.sim-stats-panel{min-width:0}
.sim-heading{margin:0 0 7px;font-size:12px;color:#667c96;font-weight:750;line-height:1.4}
.bb-picks{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:5px}
.pick-bb{padding:7px 8px;border-radius:8px;gap:2px;line-height:1.35;min-height:47px}
.pick-bb strong{font-size:11px}
.pick-bb span{font-size:10px}
.picked-desc{padding:9px 10px;margin-top:6px;border-radius:8px}
.picked-desc .bb-cond,.picked-desc .bb-effects{font-size:11px;line-height:1.58}
.sim-stat-title{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;min-height:20px}
.sim-stat-title .sim-heading{margin:0}
.sim-stat-title .modal-reset{padding:0 1px;white-space:nowrap;text-decoration:underline;font-size:11px}
.sim-stat-rows{display:grid;gap:4px}
.sim-stat-head,.sim-stat-row{display:grid;grid-template-columns:44px repeat(3,minmax(0,1fr));gap:4px;align-items:stretch;min-width:0}
.sim-stat-head{font-size:11px;color:#5c7190;font-weight:700;line-height:1.2}
.sim-stat-head span{background:#eaf0f8;border-radius:5px;padding:7px 2px;text-align:center}
.sim-stat-head span:first-child{font-size:10px}
.sim-stat-row{min-height:42px}
.sim-stat-name{font-size:11px;font-weight:750;color:#37516e;display:flex;align-items:center;justify-content:center;word-break:keep-all}
.sim-stat-choice{border:1px solid #d1dbe8;border-radius:7px;min-width:0;padding:4px 1px;background:#fff;color:#425a75;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:0;line-height:1.45;font-variant-numeric:tabular-nums;transition:background .08s}
.sim-stat-choice strong{font-size:11px;font-weight:750;white-space:nowrap}
.sim-stat-choice span{font-size:10px;white-space:nowrap;color:#78899e}
.sim-stat-choice.selected{border:2px solid #6489b9;background:#e7f0fc;color:#315b8b;padding:3px 0}
.sim-stat-choice.selected span{color:#376897}
.sim-stat-unavailable{color:#bcc7d4;background:#f5f7fa;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:11px}
.gain-summary{margin-top:8px;padding-top:8px;font-size:11px;color:#4a607c;line-height:1.55;overflow-wrap:anywhere}
.gain-summary strong{font-size:11px;color:#334b68}
@media(max-width:740px){
 .overlay{padding:0;align-items:flex-end}
 .modal{width:100%;height:auto;max-height:98dvh;border-radius:14px 14px 0 0}
 .modal-head{padding:8px 12px 8px}
 .modal-head-row{height:36px;gap:7px}
 .modal-head h2{font-size:14px}
 .modal-id{font-size:10px}
 .modal-body{padding:10px 11px 15px}
 .sim-workspace{grid-template-columns:minmax(0,1fr);gap:12px}
 .bb-picks{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
 .sim-stat-head,.sim-stat-row{grid-template-columns:45px repeat(3,minmax(0,1fr));gap:4px}
 .sim-stat-row{min-height:42px}
 .sim-pointline{font-size:11px}
 .sim-pointline strong{font-size:16px}
 .picked-desc .bb-cond,.picked-desc .bb-effects{font-size:11px;line-height:1.48}
}
@media(max-width:350px){
 .modal-head{padding:7px 9px}
 .modal-head h2{font-size:12px}
 .modal-rarity{font-size:10px;padding:2px 5px}
 .modal-id{font-size:9px}
 .modal-body{padding:9px 8px 12px}
 .sim-stat-head,.sim-stat-row{grid-template-columns:39px repeat(3,minmax(0,1fr));gap:3px}
 .sim-stat-choice strong{font-size:10px}
 .sim-stat-choice span{font-size:9px}
 .pick-bb strong{font-size:10px}
 .pick-bb span{font-size:9px}
}


/* v8: official element frames layered above the original unit thumbnails.
   Keep a stable icon footprint; only the visual layers change. */
.unit-portrait{
  position:relative;display:block;flex:0 0 60px;
  width:60px;height:60px;min-width:0;
  border-radius:11px;overflow:hidden;
  isolation:isolate;background:#edf1f6;
}
.unit-portrait .unit-art{
  position:absolute;inset:6%;width:88%;height:88%;
  border-radius:12%;object-fit:cover;background:#1c2735;
}
.unit-portrait .unit-art.missing{
  background:#edf1f6;object-fit:contain;padding:12%;
}
.unit-portrait .unit-frame{
  position:absolute;inset:0;z-index:1;
  display:block;width:100%;height:100%;
  object-fit:fill;pointer-events:none;user-select:none;
}
@media(max-width:680px){
  .unit-portrait{flex-basis:52px;width:52px;height:52px;border-radius:10px}
}


/* 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}}
