.sb{--paper:#fbf8f2;--card:#fff;--ink:#1f1b17;--beni:#a8261c;--muted:#7a7168;--rule:#d9d2c4;--rule-strong:#b8b0a4;--ph:#ece5d8;color:var(--ink);line-height:1.9}
.sb *{box-sizing:border-box}
.sb a{color:var(--beni)}
.sb h2{display:flex;align-items:baseline;gap:12px;margin:44px 0 16px;font-size:20px;font-weight:700;letter-spacing:.06em;line-height:1.5}
.sb h2::before{content:"";flex:none;width:6px;height:18px;background:var(--beni);transform:translateY(2px)}
.sb h3{margin:30px 0 10px;font-size:17px;font-weight:700;border-bottom:.5px solid var(--rule-strong);padding-bottom:4px}
.sb h4{margin:0 0 6px;font-size:14px;font-weight:700}
.sb h4 small,.sb th small{margin-left:8px;font-size:11px;font-weight:400;color:var(--muted)}
.sb p{margin:0 0 1.1em}
.sb .hi{color:var(--beni);font-weight:700}
.sb .mid{color:#23407a;font-weight:700}
.sb-rank i{font-style:normal}
.sb-more-link{margin:12px 0 0;font-size:14px}
.sb-list th a{color:var(--ink);text-decoration:none}
.sb-list th a:hover{color:var(--beni)}
.sb-list .t{text-align:left;color:var(--muted);font-size:12.5px}
.sb-list .t small,.sb-list th small{margin-left:6px;font-size:11px}
.sb-kin small{color:var(--muted);font-size:11.5px}
.sb-db-form input[type=text]{width:110px;height:42px;padding:0 8px;border:.5px solid var(--rule-strong);border-radius:2px;background:var(--card);font:inherit;font-size:14px}
/* 並べ替えの印: ▽=並べ替えできる、▼=高い順、▲=低い順 */
.sb-db th .so{font-style:normal;margin-right:4px;font-size:10px;opacity:.75}
.sb-db th .so::before{content:"▽"}
.sb-db th.on .so{opacity:1}
.sb-db th.on .so::before{content:"▼"}
.sb-db th.on[data-dir="1"] .so::before{content:"▲"}
.sb-art{display:inline-block;margin-left:6px;padding:0 5px;font-size:10px;line-height:1.6;color:var(--beni);border:.5px solid var(--beni);border-radius:2px;vertical-align:middle}
.sb-note{font-size:12.5px;color:var(--muted);line-height:1.7}
.sb-lead{font-size:16.5px}
.sb-jump{margin:0 0 14px;font-size:14px}
.sb-jump a{display:inline-block;padding:5px 12px;border:.5px solid var(--beni);border-radius:2px;text-decoration:none;background:var(--card)}
.sb-jump a::after{content:" ↓"}
.sb [id]{scroll-margin-top:16px}
.sb-stats th small.sb-max{color:var(--beni)}
.sb-ref{margin-left:2px;font-size:10.5px;line-height:1}
.sb-ref a{margin-left:3px;text-decoration:none}
.sb-ref a::before{content:"["}.sb-ref a::after{content:"]"}

.sb-head{display:flex;flex-wrap:wrap;gap:6px 22px;margin:0 0 20px;padding:12px 14px;background:var(--card);border:.5px solid var(--rule);border-radius:2px;font-size:14px}
.sb-head div{display:flex;gap:8px}
.sb-head dt{color:var(--muted)}
.sb-head dd{margin:0}

.sb-toc{margin:22px 0;padding:14px 16px;background:var(--card);border:.5px solid var(--rule);border-radius:2px;font-size:14px}
.sb-toc ol{margin:6px 0 0;padding-left:1.4em}
.sb-toc a{color:var(--ink);text-decoration:none}
.sb-toc a:hover{color:var(--beni)}

.sb-tl{width:100%;border-collapse:collapse;font-size:14.5px}
.sb-tl th{width:5.2em;padding:7px 8px 7px 0;text-align:left;vertical-align:top;font-weight:500;color:var(--beni);white-space:nowrap;border-bottom:.5px solid var(--rule)}
.sb-tl td{padding:7px 0;border-bottom:.5px solid var(--rule)}
.sb-unv{font-size:11px;padding:1px 5px;border:.5px solid var(--rule-strong);color:var(--muted);border-radius:2px}

.sb-tw{overflow-x:auto}
.sb-stats{width:100%;min-width:420px;border-collapse:collapse;background:var(--card);font-size:14.5px;font-variant-numeric:tabular-nums}
.sb-stats th,.sb-stats td{padding:7px 10px;border:.5px solid var(--rule);text-align:right}
.sb-stats thead th{background:var(--ink);color:var(--paper);font-weight:500;text-align:right}
.sb-stats th:first-child{text-align:left;font-weight:500;white-space:nowrap}
.sb-stats td.na{color:var(--rule-strong)}
.sb-graph{overflow-x:auto;margin-top:18px;background:var(--card);border:.5px solid var(--rule);border-radius:2px;padding:8px}
.sb-graph svg{display:block;width:100%;min-width:600px;height:auto;font-family:inherit}
.sb-legend{display:flex;gap:16px;flex-wrap:wrap;margin:8px 0 4px;font-size:13px}
.sb-legend i{display:inline-block;width:14px;height:3px;margin-right:6px;vertical-align:middle}

.sb-rows{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px}
.sb-rows section{background:var(--card);border:.5px solid var(--rule);border-radius:2px;padding:10px 12px}
.sb-rows dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 14px;margin:0;font-size:13px}
.sb-rows dl div{display:flex;justify-content:space-between;gap:6px;border-bottom:.5px dotted var(--rule)}
.sb-rows dt{color:var(--muted)}
.sb-rows dd{margin:0;font-variant-numeric:tabular-nums}

.sb-faq dt{margin-top:16px;font-weight:700}
.sb-faq dt::before{content:"問 ";color:var(--beni)}
.sb-faq dd{margin:4px 0 0}

.sb-affs{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;margin:44px 0 0}
.sb-aff{background:var(--card);border:.5px solid var(--rule-strong);border-radius:2px;padding:14px}
.sb-aff h3{display:flex;justify-content:space-between;align-items:center;margin:0 0 6px;border:0;padding:0;font-size:15px}
.sb-pr{font-size:10px;font-weight:400;color:var(--muted);border:.5px solid var(--rule-strong);padding:0 5px;border-radius:2px}
.sb-aff p{font-size:13px;line-height:1.7;margin:0 0 10px}
.sb-btn{display:inline-block;padding:6px 14px;background:var(--ink);color:var(--paper)!important;text-decoration:none;font-size:13px;border-radius:2px;letter-spacing:.08em}

.sb-kin{display:flex;flex-wrap:wrap;gap:8px;margin:0;padding:0;list-style:none;font-size:14px}
.sb-kin a{display:block;padding:4px 10px;border:.5px solid var(--rule-strong);border-radius:2px;color:var(--ink);text-decoration:none;background:var(--card)}
.sb-kin a:hover{border-color:var(--beni);color:var(--beni)}
.sb-sources{font-size:12.5px;line-height:1.7;padding-left:1.8em;word-break:break-all}
.sb-sources a{color:var(--muted)}

/* 検索DB */
.sb-db-form{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:10px}
.sb-db-form input[type=search]{flex:1 1 220px;height:42px;padding:0 12px;border:.5px solid var(--rule-strong);border-radius:2px;background:var(--card);font:inherit;font-size:15px}
.sb-db-form select,.sb-db-form input[type=number]{height:42px;padding:0 8px;border:.5px solid var(--rule-strong);border-radius:2px;background:var(--card);font:inherit;font-size:14px}
.sb-db-form input[type=number]{width:74px}
.sb-db-form label{font-size:13px;display:flex;align-items:center;gap:4px}
.sb-db-count{font-size:13px;color:var(--muted);margin:0 0 6px}
.sb-db table{width:100%;min-width:640px;border-collapse:collapse;background:var(--card);font-size:14px;font-variant-numeric:tabular-nums}
.sb-db th,.sb-db td{padding:6px 8px;border:.5px solid var(--rule);text-align:right;white-space:nowrap}
.sb-db thead th{position:sticky;top:0;background:var(--ink);color:var(--paper);font-weight:500;cursor:pointer;user-select:none}
.sb-db thead th.on{background:var(--beni)}
.sb-db td:first-child,.sb-db th:first-child{text-align:left}
.sb-db td small{display:block;font-size:11px;color:var(--muted);line-height:1.2}
.sb-db td a{color:var(--ink);text-decoration:none;font-weight:500}
.sb-db td a:hover{color:var(--beni)}
.sb-db .t{text-align:left;color:var(--muted);font-size:12.5px}
.sb-more{display:block;margin:12px auto;padding:8px 20px;border:.5px solid var(--rule-strong);background:var(--card);border-radius:2px;font:inherit;font-size:13px;cursor:pointer}
.sb-rank ol{display:grid;grid-template-columns:26px minmax(0,1fr) auto auto;gap:6px 10px;margin:0;padding:0;list-style:none;font-size:14.5px;align-items:baseline}
.sb-rank li{display:contents}
.sb-rank .n{color:var(--beni);font-weight:500}
.sb-rank a{color:var(--ink);text-decoration:none}
.sb-rank .v{text-align:right;font-variant-numeric:tabular-nums}
.sb-rank .c{text-align:right;font-size:12px;color:var(--muted)}
.sb-rank .v small{color:var(--muted);margin-left:8px;font-size:11.5px}

/* 狭い画面: 検索表は武将名と能力値を優先し、生没年・家・登場作は隠す */
.sb-db td small{white-space:normal;max-width:14em}
@media (max-width:640px){
.sb-db table{min-width:0;font-size:13px}
.sb-db th,.sb-db td{padding:6px 5px}
.sb-db th:nth-child(2),.sb-db td:nth-child(2),.sb-db th:nth-child(3),.sb-db td:nth-child(3),.sb-db th:last-child,.sb-db td:last-child{display:none}
.sb-db td:first-child{white-space:normal;min-width:5.5em}
.sb-db td small{max-width:9em}
.sb-db .t{white-space:normal;font-size:11px}
.sb-db-form label{font-size:12px}
.sb-db-form input[type=number]{width:58px}
.sb-list{min-width:0;font-size:13px}
.sb-list th:nth-child(2),.sb-list td:nth-child(2),.sb-list th:last-child,.sb-list td:last-child{display:none}
.sb-stats th,.sb-stats td{padding:6px 6px}
.sb-rank ol{grid-template-columns:22px minmax(0,1fr) auto;font-size:14px}
.sb-rank .c{display:none}
.sb-head{gap:4px 16px;font-size:13px}
.sb-rows{grid-template-columns:1fr}
}

/* 作品ごとの検索 */
.sb-tnav{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 16px;font-size:13px}
.sb-tnav a,.sb-tnav b{padding:3px 10px;border:.5px solid var(--rule-strong);border-radius:2px;background:var(--card);color:var(--ink);text-decoration:none;font-weight:400}
.sb-tnav b{background:var(--ink);color:var(--paper);border-color:var(--ink)}
.sb-tnav a:hover{border-color:var(--beni);color:var(--beni)}
.sb-tdb table{min-width:0}
.sb-tdb .sb-db-form select{max-width:9.5em}
@media (max-width:640px){.sb-tdb th:nth-child(2),.sb-tdb td:nth-child(2),.sb-tdb th:nth-child(3),.sb-tdb td:nth-child(3),.sb-tdb th:last-child,.sb-tdb td:last-child{display:table-cell}.sb-tdb th:nth-child(2),.sb-tdb td:nth-child(2){display:none}}

/* 肖像画 */
.sb-portrait{float:right;width:176px;margin:0 0 14px 20px;padding:6px;background:var(--card);border:.5px solid var(--rule)}
.sb-portrait img{display:block;width:100%;height:auto}
.sb-portrait figcaption{margin-top:4px;font-size:10.5px;line-height:1.4;color:var(--muted);text-align:center}
.sb-portrait figcaption a{color:var(--muted)}
.sb-head{overflow:hidden}
.sb-th{width:32px;height:40px;object-fit:cover;vertical-align:middle;margin-right:8px;border:.5px solid var(--rule)}
.sb-toc,.sb h2{clear:both}
@media (max-width:640px){.sb-portrait{width:120px;margin-left:12px}.sb-th{width:24px;height:30px;margin-right:6px}}

/* 記事の無い武将は名前だけ(リンクにしない) */
.sb-kin .sb-nolink{display:block;padding:4px 10px;border:.5px solid var(--rule);border-radius:2px;color:var(--muted)}
.sb-db td a{color:var(--beni);text-decoration:underline;text-underline-offset:3px}
.sb-list th a{color:var(--beni);text-decoration:underline;text-underline-offset:3px}
