/*
 * UNDER LAYERS — UI stylesheet
 * base: myhomepage (lainchan "dark") / add: 潜行戦の HUD・ダイブ・16進・警告赤
 * 外部フォント・画像なし。すべて相対パス。
 */

/* ============================================================ tokens */

:root {
	color-scheme: dark;

	/* myhomepage と同じ基本色 */
	--bg: #0b000f;
	--fg: #7fdd57;
	--muted: #677965;
	--line: #2b4426;
	--alert: #ff4040;

	/* UNDER LAYERSで足した色 */
	--bg-1: #120818;          /* パネルの地(わずかに持ち上げる) */
	--bg-2: #1b0e24;          /* hover */
	--bg-deep: #070009;       /* 最深部 */
	--fg-hi: #a6f08a;         /* myhomepage の outset ボタン縁と同じ */
	--sub: #8ea08a;           /* 小さい補助文字(--muted だと小サイズで読みにくい) */
	--line-hi: #3f6636;
	--alert-hi: #ff6a5e;
	--alert-bg: rgba(255, 64, 64, .1);
	--warn: #e8c15a;          /* 容量の残りわずか・レアリティ SR */
	--cyan: #6fd6e8;          /* レアリティ R */
	/* 抽出品のティア(標準 灰 / 調整品 緑 / 特化品 シアン / 異常品 紫)と湿り(悪い付加効果。赤は使わない) */
	--tier-t1: #8ea08a;
	--tier-t2: #a6f08a;
	--tier-t3: #6fd6e8;
	--tier-t4: #c79bff;
	--wet: #e8c15a;
	/* 色の印(保管庫 第2弾 2026-11-23。形 ● ▲ ◆ と名前を必ず添える。赤・ティアの色・琥珀と重ならない色) */
	--mk-1: #ff8ac6;
	--mk-2: #7aa2ff;
	--mk-3: #e6ece2;

	--sans: "MS PGothic", "ＭＳ Ｐゴシック", Osaka, "Noto Sans CJK JP", Arial, Helvetica, sans-serif;
	--mono: "MS Gothic", "ＭＳ ゴシック", "Osaka-Mono", "Noto Sans Mono CJK JP", "Courier New", Courier, monospace;
	--display: "Arial Black", "Arial Bold", Gadget, "Hiragino Kaku Gothic StdN", "Hiragino Sans", "Yu Gothic", "Noto Sans CJK JP", Impact, sans-serif;

	--fs-xs: 11px;
	--fs-s: 12px;
	--fs-m: 14px;
	--fs-l: 16px;
	--fs-xl: 22px;

	--gap: 12px;
	--bracket: 9px;           /* HUD の角ブラケットの長さ */
	--deckbar-h: 50px;
	--btn-h: 40px;            /* 主な操作ボタン(.btn)の最小の高さ。スマホで横いっぱいにするものは各画面で 44px */
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

[hidden] {
	display: none !important;
}

html {
	/* 横にはみ出した要素があっても、画面ごと横へ動かない(2026-11-09 制作者の指摘: スマホで右へ少しスクロールできる)。
	   clip はスクロールの箱を作らないので position: sticky は効いたまま */
	overflow-x: clip;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scrollbar-color: var(--muted) var(--bg);
}

body {
	margin: 0;
	min-height: 100vh;
	background: var(--bg);
	color: var(--fg);
	font: var(--fs-m)/1.6 var(--mono);
	overflow-x: hidden;
}

@supports (overflow: clip) {
	body { overflow-x: clip; }
}

/* CRT の周辺減光(myhomepage と同じ。走査線は目が疲れるので全面には敷かない) */
body::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 9999;
	pointer-events: none;
	background: radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, .55) 100%);
}

/* ゲーム画面(構築・侵入構築・侵入)は四隅まで情報が並ぶので、周辺減光を掛けない。
   雰囲気づくりはタイトル画面だけに残す */
body.page-builder::after,
body.page-hack::after {
	content: none;
}

/* ------------------------------------------------------------ 背景のドット絵(docs/ui-design.md §3.8)
   2026-11-09 制作者の指摘: 背景が真っ暗でさみしい。雨の夜の港町「あかり浜」を、ごく暗く・低いコントラストで敷く。
   - 画面の下: 港の街並みのシルエット(電柱と電線で結ばれた灯網・クレーン・電波塔・詰所の灯・水面に映る灯)。
     town.gif(800×56)を 2倍で横に並べる。動きは航空灯と窓の灯がいくつか、ゆっくり点いたり消えたりするだけ。
   - 画面の端と下の方: 回路の格子の点・短い配線・雨粒(grid.png、96×96 を 2倍)。本文の後ろ(画面の中央)は
     マスクで地の色のままにする。スマホは中身が全幅なので、下の方にだけ出す。
   - 絵は tools/art/backdrop.py で生成。整数倍・image-rendering: pixelated。
   - 地の色は html に塗り、body は透明にする(html::before を body の後ろ・地の色の上に置くため)。
     .box・パネルは地の色で塗りつぶしているので、絵が文字の後ろに透けることはない。
   - 「文字だけ」の設定(html.kb-arts-off)・印刷・強制カラー・管理画面では出さない。動きを減らす設定では静止画。
   - 周辺減光(body::after)はこの上に重なる(四隅の街並みが少し暗くなるだけで、喧嘩しない)。 */
html {
	background: var(--bg);
}

body,
html.kb-boot body {
	background: transparent;
}

html::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		url("../art/bg/town.gif") 50% 100% / 2400px 168px repeat-x,
		linear-gradient(to top, rgba(54, 50, 98, .2), rgba(54, 50, 98, 0) 320px),
		url("../art/bg/grid.png") 50% 0 / 192px 192px repeat;
	image-rendering: pixelated;
	/* 下(街並み)はそのまま、その上は上へ行くほど薄く。左右の端は楕円の外側だけ */
	-webkit-mask-image:
		linear-gradient(to top, #000 0 168px, rgba(0, 0, 0, .65) 168px, transparent 60%),
		radial-gradient(ellipse 75% 85% at 50% 42%, transparent 52%, rgba(0, 0, 0, .85) 100%);
	mask-image:
		linear-gradient(to top, #000 0 168px, rgba(0, 0, 0, .65) 168px, transparent 60%),
		radial-gradient(ellipse 75% 85% at 50% 42%, transparent 52%, rgba(0, 0, 0, .85) 100%);
}

@media (max-width: 759px) {
	html::before {
		background-size: 1600px 112px, auto, 192px 192px;
		-webkit-mask-image: linear-gradient(to top, #000 0 112px, rgba(0, 0, 0, .55) 112px, transparent 40%);
		mask-image: linear-gradient(to top, #000 0 112px, rgba(0, 0, 0, .55) 112px, transparent 40%);
	}
}

@media (prefers-reduced-motion: reduce) {
	html::before {
		background-image:
			url("../art/bg/town.png"),
			linear-gradient(to top, rgba(54, 50, 98, .14), rgba(54, 50, 98, 0) 240px),
			url("../art/bg/grid.png");
	}
}

html.kb-arts-off::before,
html:has(> body.page-admin)::before {
	content: none;
}

@media print, (forced-colors: active) {
	html::before {
		content: none;
	}
}

a:link,
a:visited {
	color: var(--sub);
	text-decoration: none;
}

a:hover,
a:focus-visible {
	color: var(--fg);
	text-decoration: underline;
}

:focus-visible {
	outline: 1px dotted var(--fg);
	outline-offset: 2px;
}

::selection {
	color: var(--bg);
	background: var(--fg);
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

.sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.phrase {
	display: inline-block;
}

.dim {
	color: var(--sub);
}

.alert {
	color: var(--alert);
}

.num {
	font-variant-numeric: tabular-nums;
}

/* ============================================================ boardlist / marquee (myhomepage) */

.boardlist {
	color: var(--muted);
	font-size: var(--fs-s);
	text-align: center;
}

.boardlist .group {
	display: inline-block;
	margin: 0 4px;
	/* リンクの並びは折り返してよい(リンク1つの途中では折り返さない: 下の .boardlist .group a)。
	   nowrap のままだと、PC の幅でも項目が増えた分だけ右端からはみ出して切れていた(2026-11-09 夜) */
	white-space: normal;
}

.boardlist [aria-current="page"] {
	color: var(--fg);
}

/* ------------------------------------------------------------ ヘッダーの並び(全ページ共通。2026-11-11 制作者の指摘①)
   HTML はどのページも同じ形: <nav class="boardlist"> の中に .auth-slot(ID チップ・帯域)・.group(サイト内リンク)・.snd-slot(曲の指定だけ)。
   .group の区切り「[ / ]」は <span class="gb|gs" aria-hidden> に包んである(スマホの格子では消す。読み上げない)。
   ページごとの上書きは置かない(以前は auth.css・fx.css・ops.css・battle.css・legal.css などに散っていた)。
   docs/ui-design.md §3.13 */

/* .snd-slot はページの名前(data-page。曲は sound/music.js の表)を持ち、中に ui-sound.js が BGM のワンタッチ ON/OFF
   (.snd-sw。2026-11-15 復活)を入れる。音量・効果音などの細かい設定は設定ページ(settings.html)。
   ボタンが入る前から 44px の場所を取っておく(読み込み中に並びが跳ねないように。.auth-slot と同じ考え方) */
.boardlist > .snd-slot {
	display: inline-flex;
	flex: none;
	align-items: center;
	min-width: 44px;
	min-height: 44px;
}

/* 見た目はヘッダーの帯域のチップ(auth.css の .st-chip)に合わせる。[♪] の札が明るく塗られていれば ON */
.snd-sw {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0 4px;
	color: var(--sub);
	background: none;
	border: 0;
	font: inherit;
	font-size: var(--fs-s);
	line-height: 1.3;
	white-space: nowrap;
	cursor: pointer;
}

.snd-sw-k {
	padding: 0 3px;
	color: var(--muted);
	border: 1px solid var(--line-hi);
	font-size: var(--fs-xs);
}

/* ON / OFF で幅が変わらないように(OFF の3文字ぶん) */
.snd-sw-v {
	min-width: 3ch;
	color: var(--muted);
	text-align: left;
}

.snd-sw[aria-pressed="true"] .snd-sw-k {
	color: var(--bg);
	background: var(--fg);
	border-color: var(--fg);
}

.snd-sw[aria-pressed="true"] .snd-sw-v { color: var(--fg); }

.snd-sw:hover .snd-sw-k {
	color: var(--fg);
	border-color: var(--fg);
}

.snd-sw[aria-pressed="true"]:hover .snd-sw-k { color: var(--bg); }

.snd-sw:focus-visible {
	outline: 1px dotted var(--fg);
	outline-offset: -2px;
}

/* 中央寄せのページ(.mainblock): 1段目 = サイト内リンク(中央)、2段目 = BGM のボタン・ID チップ・帯域(右寄せ) */
.mainblock > .boardlist {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
}

.mainblock > .boardlist > .group {
	grid-row: 1;
	grid-column: 1 / -1;
	justify-self: center;
}

.mainblock > .boardlist > .snd-slot {
	grid-row: 2;
	grid-column: 2;
	margin-top: -4px; /* .auth-slot と同じ(段の高さを 44px のままに) */
}

/* header.js がチップを入れる前から段と高さ(44px)を取っておく(読み込み中に下の内容が跳ねないように) */
.mainblock > .boardlist > .auth-slot {
	grid-row: 2;
	grid-column: 3;
	justify-self: end;
	min-height: 44px;
	margin: -4px -4px 0 0;
}

/* ヘッダーの幅はページの本文の幅(.mainblock の max-width。670〜1080px とページごとに違う)と関係なく、全ページ同じにする
   (2026-11-22 制作者の指摘: トップだけ6カテゴリ + 帯域が2段に折り返す)。基準はジョブページ(本文 1020px - 余白 32px = 988px)。
   本文より広いページでは本文の左右へはみ出して(中央は同じ)、狭いページ(トップ・ログイン等)でも同じ幅で1段に収まる。
   100vw から引くのは、ページの余白(左右16pxずつ)と縦スクロールバーの分。スマホ(759px 以下)は従来どおり本文の幅いっぱい。
   折り返す幅(1段目が入りきらない)になったら --hdr-w を広げる(tests/ui/header-rows.py が見張る)。 */
:root { --hdr-w: 988px; }

@media (min-width: 760px) {
	.mainblock > .boardlist {
		width: min(var(--hdr-w), 100vw - 48px);
		margin-inline: calc(50% - min(var(--hdr-w) / 2, 50vw - 24px));
	}
}


.marquee {
	margin-top: 10px;
	padding: 2px 0;
	overflow: hidden;
	white-space: nowrap;
	border-top: 1px dashed var(--muted);
	border-bottom: 1px dashed var(--muted);
	font-size: 13px;
}

.marquee span {
	display: inline-block;
	padding-left: 100%;
	animation: marquee 28s linear infinite;
}

@keyframes marquee {
	from { transform: translateX(0); }
	to { transform: translateX(-100%); }
}

.cursor {
	animation: blink 1s steps(1, end) infinite;
}

.blink {
	color: var(--alert);
	font-weight: bold;
	animation: blink 1s steps(1, end) infinite;
}

@keyframes blink {
	50% { visibility: hidden; }
}

/* ============================================================ buttons */

.btn {
	/* 括弧 [ ] と文字・アイコンを1列に並べ、上下の中心をそろえる(2026-11-09 制作者の指摘: スマホで [ ] が上下にずれる。
	   iOS などでは英数字と日本語で別の書体に代わり、行の基準線が食い違うため。並べ方を flex にして箱ごとに中央へ) */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .35em;
	box-sizing: border-box;
	max-width: 100%;
	min-width: 120px;
	padding: 6px 18px;
	color: var(--fg);
	background: var(--bg);
	border: 2px outset var(--fg-hi);
	border-radius: 0;
	font-family: var(--mono);
	font-size: 15px;
	line-height: 1.4;
	text-align: center;
	white-space: nowrap;
	cursor: pointer;
}

/* 最小の高さは全ボタン共通(2026-11-23「見出しとボタンの統一」。DESIGN.md §4.1)。.sm(表・行の中の小さい操作)は対象外。
   :where() で詳しさを 0 にし、画面ごとの `.xx-acts .btn { min-height: 44px }`(スマホの全幅)がそのまま勝つようにする */
.btn:where(:not(.sm)) { min-height: var(--btn-h); }

/* 括弧 [ ] は文字ではなく線で描く(書体が代わっても高さ・位置が変わらない。文字の高さに合わせて上下の中央) */
.btn::before,
.btn::after {
	content: "";
	flex: none;
	align-self: center;
	width: .3em;
	height: 1.25em;
	border: 2px solid currentColor;
	opacity: .75;
}
.btn::before { border-right: 0; }
.btn::after { border-left: 0; }
.btn.sm::before,
.btn.sm::after { border-width: 1px; }
.btn.sm::before { border-right: 0; }
.btn.sm::after { border-left: 0; }

a.btn:link,
a.btn:visited {
	color: var(--fg);
	text-decoration: none;
}
/* 上の a.btn:link の色は .btn:hover より強いので、hover・フォーカスの反転(地 --fg)で文字が地と同じ緑になり読めなかった
   (スマホでは押した後も hover が残る。引揚場の結果の [保管庫で見る] など。2026-11-23)。反転の文字色をここでも当てる */
a.btn:link:hover,
a.btn:visited:hover,
a.btn:link:focus-visible,
a.btn:visited:focus-visible {
	color: var(--bg);
}

.btn:hover,
.btn:focus-visible,
.btn[aria-expanded="true"],
.btn[aria-pressed="true"] {
	color: var(--bg);
	background: var(--fg);
	text-decoration: none;
}

.btn:active,
.btn[aria-pressed="true"] {
	border-style: inset;
}

.btn:disabled,
.btn[aria-disabled="true"] {
	color: var(--muted);
	background: var(--bg);
	border: 2px solid var(--line);
	cursor: not-allowed;
}

/* 小さい操作ボタン(枠は細線、括弧はそのまま) */
.btn.sm {
	min-width: 0;
	padding: 1px 6px;
	border-width: 1px;
	border-style: solid;
	border-color: var(--line-hi);
	font-size: var(--fs-s);
}

.btn.sm:hover,
.btn.sm:focus-visible {
	border-color: var(--fg);
}

.btn.sm:disabled {
	border-width: 1px;
	border-color: var(--line);
}

/* 記号だけのボタン(↑ ↓ ×): 括弧なし、正方形 */
.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 26px;
	height: 26px;
	padding: 0;
	color: var(--sub);
	background: transparent;
	border: 1px solid var(--line);
	cursor: pointer;
}

.icon-btn svg {
	width: 14px;
	height: 14px;
}

.icon-btn:hover,
.icon-btn:focus-visible {
	color: var(--bg);
	background: var(--fg);
	border-color: var(--fg);
}

.icon-btn.danger:hover,
.icon-btn.danger:focus-visible {
	background: var(--alert);
	border-color: var(--alert);
}

.icon-btn:disabled {
	color: var(--line-hi);
	background: transparent;
	border-color: var(--line);
	cursor: not-allowed;
}

.btn.alert-btn {
	color: var(--alert);
	border-color: var(--alert);
}

.btn.alert-btn:hover,
.btn.alert-btn:focus-visible {
	color: var(--bg);
	background: var(--alert);
}

/* テキストリンク風ボタン */
.linklike {
	padding: 0;
	color: var(--sub);
	background: none;
	border: 0;
	text-align: left;
	cursor: pointer;
}

.linklike:hover,
.linklike:focus-visible {
	color: var(--fg);
	text-decoration: underline;
}

/* ============================================================ form controls */

.field {
	display: block;
	width: 100%;
	min-width: 0;
	padding: 5px 8px;
	color: var(--fg);
	background: var(--bg);
	border: 1px solid var(--line-hi);
	border-radius: 0;
	font-family: var(--mono);
	font-size: var(--fs-m);
}

.field::placeholder {
	color: var(--muted);
}

.field:focus {
	border-color: var(--fg);
	outline: none;
	box-shadow: 0 0 0 1px var(--fg) inset;
}

.field[aria-invalid="true"] {
	border-color: var(--alert);
}

select.field {
	padding-right: 4px;
}

textarea.field {
	resize: vertical;
	min-height: 64px;
}

/* [x] トグル */
.toggle {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	cursor: pointer;
	user-select: none;
	white-space: nowrap;
}

.toggle input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

/* 印「[x]」は縮めない・途中で折り返さない(文が長い行で「[x」と「]」が上下に分かれるのを防ぐ) */
.toggle .box-mark {
	flex: none;
	white-space: nowrap;
	overflow-wrap: normal;
}

.toggle .box-mark::before {
	content: "[ ]";
	color: var(--sub);
}

.toggle input:checked + .box-mark::before {
	content: "[x]";
	color: var(--fg);
}

.toggle input:focus-visible + .box-mark {
	outline: 1px dotted var(--fg);
	outline-offset: 2px;
}

/* ============================================================ boxes (緑帯の見出し) */

.box {
	position: relative;
	background: var(--bg);
	border: 1px solid var(--line);
	text-align: left;
}

.band {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin: 0;
	padding: 3px 7px;
	color: var(--bg);
	background-color: var(--fg);
	/* 帯にだけ薄い走査線(スキャン感) */
	background-image: repeating-linear-gradient(0deg, rgba(11, 0, 15, .1) 0 1px, transparent 1px 3px);
	font-family: var(--sans);
	font-size: 12pt;
	font-weight: bold;
	line-height: 1.5;
}

.band .meta {
	margin-left: auto;
	font-family: var(--mono);
	font-size: var(--fs-xs);
	font-weight: normal;
	letter-spacing: .04em;
	white-space: nowrap;
}

.band.is-alert {
	background-color: var(--alert);
}

.box-body {
	padding: 8px 10px;
}

/* key / value 表(myhomepage の .services) */
.kv {
	width: 100%;
	border-collapse: collapse;
}

.kv th,
.kv td {
	padding: 5px 10px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px dotted var(--line);
}

.kv tr:last-child th,
.kv tr:last-child td {
	border-bottom: 0;
}

.kv th {
	width: 1%;
	color: var(--fg);
	font-weight: normal;
	white-space: nowrap;
}

.kv th::before {
	content: "> ";
	color: var(--muted);
}

.kv td {
	overflow-wrap: anywhere;
}

/* ============================================================ HUD brackets */

.hud {
	position: relative;
}

.hud::before {
	content: "";
	position: absolute;
	inset: -4px;
	pointer-events: none;
	--c: var(--fg-hi);
	background:
		linear-gradient(var(--c), var(--c)) left top / var(--bracket) 1px,
		linear-gradient(var(--c), var(--c)) left top / 1px var(--bracket),
		linear-gradient(var(--c), var(--c)) right top / var(--bracket) 1px,
		linear-gradient(var(--c), var(--c)) right top / 1px var(--bracket),
		linear-gradient(var(--c), var(--c)) left bottom / var(--bracket) 1px,
		linear-gradient(var(--c), var(--c)) left bottom / 1px var(--bracket),
		linear-gradient(var(--c), var(--c)) right bottom / var(--bracket) 1px,
		linear-gradient(var(--c), var(--c)) right bottom / 1px var(--bracket);
	background-repeat: no-repeat;
}

.hud.is-alert::before {
	--c: var(--alert);
}

/* ============================================================ tags / rarity */

.tags {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0 6px;
}

.tag {
	color: var(--sub);
	white-space: nowrap;
}

.tag::before {
	content: "#";
	color: var(--muted);
}

/* 攻性 = 赤 */
.tag[data-tag="攻性"] {
	color: var(--alert);
}

.rar {
	display: inline-block;
	min-width: 2.2em;
	padding: 0 3px;
	border: 1px solid currentColor;
	font-size: var(--fs-xs);
	line-height: 1.35;
	text-align: center;
}

.rar[data-r="C"] { color: var(--sub); border-color: var(--line-hi); }
.rar[data-r="U"] { color: var(--fg); }
.rar[data-r="R"] { color: var(--cyan); }
.rar[data-r="SR"] { color: var(--bg); background: var(--warn); border-color: var(--warn); }

.cost {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.cost::before {
	content: "◇";
	margin-right: 1px;
	color: var(--muted);
}

/* ============================================================ hexdump */

.hexdump {
	margin: 0;
	color: var(--muted);
	font-family: var(--mono);
	font-size: var(--fs-xs);
	line-height: 1.5;
	white-space: pre;
	overflow: hidden;
}

/* ============================================================ title page / hack page (myhomepage のトップ構成) */

.mainblock {
	position: relative;
	z-index: 10;
	max-width: 670px;
	margin: 0 auto;
	padding: 12px 16px 24px;
}

.site-header {
	padding: 18px 0 4px;
	text-align: center;
}

.tunnel {
	display: block;
	width: 120px;
	height: 120px;
	margin: 0 auto;
	filter: drop-shadow(0 0 4px rgba(127, 221, 87, .45));
}

.title {
	position: relative;
	margin: 12px 0 4px;
	color: var(--fg);
	font-family: var(--display);
	font-weight: 900;
	font-size: clamp(1.7rem, 9.5vw, 4.4rem); /* 英字12字(空白込み)の題名(UNDER LAYERS)。狭い画面で収まらなければ UNDER と LAYERS の間でだけ折り返す(単語の途中では切らない) */
	word-break: keep-all; /* 折り返すなら空白(UNDER と LAYERS の間)だけ */
	overflow-wrap: normal;
	line-height: 1;
	letter-spacing: .02em;
	text-shadow: 0 0 6px rgba(127, 221, 87, .45);
}

/* 起動時に一度だけ走るグリッチ(赤とハイライトがずれて切れる) */
.title::before,
.title::after {
	content: attr(data-text);
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
}

.title::before {
	color: var(--alert);
	text-shadow: none;
	animation: glitch-a .9s steps(1, end) .25s 1 both;
}

.title::after {
	color: var(--fg-hi);
	text-shadow: none;
	animation: glitch-b .9s steps(1, end) .25s 1 both;
}

@keyframes glitch-a {
	0% { opacity: 1; transform: translate(-4px, 0); clip-path: inset(10% 0 62% 0); }
	15% { transform: translate(5px, 0); clip-path: inset(55% 0 20% 0); }
	30% { transform: translate(-2px, 0); clip-path: inset(30% 0 45% 0); }
	45% { transform: translate(3px, 0); clip-path: inset(78% 0 4% 0); }
	60% { transform: translate(-5px, 0); clip-path: inset(4% 0 80% 0); }
	75%, 100% { opacity: 0; }
}

@keyframes glitch-b {
	0% { opacity: 1; transform: translate(3px, 0); clip-path: inset(62% 0 12% 0); }
	15% { transform: translate(-4px, 0); clip-path: inset(18% 0 60% 0); }
	30% { transform: translate(2px, 0); clip-path: inset(70% 0 10% 0); }
	45% { transform: translate(-3px, 0); clip-path: inset(40% 0 38% 0); }
	60% { opacity: 0; }
	100% { opacity: 0; }
}

.title-hex {
	display: inline-block;
	margin: 0 0 12px;
	text-align: left;
}

.undertitle {
	margin: 0;
	font-size: clamp(13px, 3.6vw, 16px);
	line-height: 1.7;
}

.buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 20px;
}

.mode-btn {
	position: relative;
}

.mode-btn .soon {
	position: absolute;
	top: -9px;
	right: -6px;
	padding: 0 4px;
	color: var(--bg);
	background: var(--alert);
	font-size: 10px;
	line-height: 1.5;
}

.mode-btn .soon::before,
.mode-btn .soon::after {
	content: none;
}

.mainblock > .box {
	margin-top: 22px;
}

.op-form {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.op-form .field {
	flex: 1 1 auto;
}

.op-form .btn {
	min-width: 0;
	padding: 4px 12px;
	font-size: var(--fs-m);
}

.op-note {
	margin: 6px 0 0;
	color: var(--sub);
	font-size: var(--fs-s);
}

.op-error {
	margin: 6px 0 0;
	color: var(--alert);
	font-size: var(--fs-s);
}

.op-handle {
	color: var(--fg-hi);
	overflow-wrap: anywhere;
}

/* ============================================================ footer (88x31 バナー風) */

.site-footer {
	position: relative;
	z-index: 10;
	width: calc(100% - 32px);
	max-width: 638px;
	margin: 0 auto;
	padding: 16px 0 28px;
	color: var(--muted);
	border-top: 1px dashed var(--muted);
	font-size: var(--fs-s);
	text-align: center;
}

.site-footer p {
	margin: 6px 0 0;
}

/* 全ページのフッターの「利用規約 · プライバシーポリシー」(docs/legal.md) */
.site-footer .legal-links {
	margin: 8px 0 0;
	font-size: var(--fs-xs);
}

.site-footer .legal-links a {
	color: var(--sub);
	text-decoration: underline dotted var(--line-hi);
	text-underline-offset: 3px;
}

.site-footer .legal-links a:hover,
.site-footer .legal-links a:focus-visible,
.site-footer .legal-links a[aria-current="page"] {
	color: var(--fg-hi);
}

/* フッターが無かったページ(防壁構築・侵入構築)の控えめなフッター */
.site-footer.is-quiet {
	padding: 10px 0 18px;
}

.banners {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 14px 0;
}

/* 88x31 を CSS だけで(画像なし) */
.b88 {
	display: grid;
	grid-template-columns: 26px 1fr;
	width: 88px;
	height: 31px;
	overflow: hidden;
	border: 1px solid;
	border-color: #9fe07f #24391f #24391f #9fe07f;
	font: bold 9px/1.05 var(--mono);
	text-align: left;
	image-rendering: pixelated;
}

.b88 .l {
	display: grid;
	place-items: center;
	color: var(--bg);
	background: var(--fg);
	font-size: 12px;
}

.b88 .r {
	display: grid;
	align-content: center;
	padding: 0 3px;
	color: var(--fg);
	background: repeating-linear-gradient(90deg, #120818 0 2px, #0b000f 2px 4px);
}

.b88.red .l { background: var(--alert); }
.b88.red .r { color: var(--alert-hi); }
.b88.amber .l { background: var(--warn); }
.b88.amber .r { color: var(--warn); }
.b88.mono .l { color: var(--fg); background: var(--bg); border-right: 1px solid var(--line-hi); }

/* ============================================================ builder: layout */

.kb-top {
	position: relative;
	z-index: 10;
	padding: 6px 12px 0;
}

.kb-top .boardlist {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 2px 12px;
	text-align: left;
}

.kb-top .who {
	margin-left: auto;
	color: var(--sub);
	white-space: nowrap;
}

/* 防壁構築・侵入構築: 狭い幅ではサイト内リンクの格子を1段まるごと使い、その下に ガイド・operator・ID チップ */
@media (max-width: 640px) {
	.kb-top .boardlist { align-items: center; row-gap: 6px; }
	.kb-top .boardlist > .group { flex: 1 0 100%; }

	/* BGM のボタン(2026-11-15 復活)を足しても今の行数に収める: 「operator:」の札を省き(名前と ONLINE の札は残す)、
	   ボタンは [♪] の札だけにする(塗り = ON、取り消し線 = OFF。文字の ON/OFF は読み上げ用に aria-pressed)。
	   見た目の幅は 28px、押せる範囲は ::after で左右の隙間まで広げて 44px。
	   置き場所は格子の下の行の左端(? ガイドの前)。末尾に置くと ID チップの後ろで1つだけ折り返して行が増えることがある */
	.kb-top .who-k { display: none; }
	.kb-top .boardlist > .group { order: -2; }
	/* ? ガイドの行は ID チップより低い(ID チップが次の行へ折り返すとき)ので、見た目は札の高さだけにして行を高くしない。
	   押せる範囲(44×44)は上の格子に掛からないよう、上へ 6px(行の隙間)から下へ 44px 取る */
	.kb-top .boardlist > .snd-slot { order: -1; min-width: 28px; min-height: 0; }
	.kb-top .snd-sw { position: relative; min-width: 28px; min-height: 0; padding: 0 5px; }
	.kb-top .snd-sw::after { content: ""; position: absolute; top: -6px; right: -8px; left: -8px; height: 44px; }
	.kb-top .snd-sw-v { display: none; }
	.kb-top .snd-sw[aria-pressed="false"] .snd-sw-k { text-decoration: line-through; }
}

.kb-top .who b {
	color: var(--fg);
	font-weight: normal;
}

.mode-pill {
	padding: 0 4px;
	border: 1px solid var(--line-hi);
	font-size: var(--fs-xs);
}

.mode-pill[data-mode="offline"] {
	color: var(--warn);
	border-color: rgba(232, 193, 90, .5);
}

.mode-pill[data-mode="api"] {
	color: var(--fg);
}

/* デッキバー(上部に固定) */
.deckbar {
	position: sticky;
	top: 0;
	z-index: 50;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	min-height: var(--deckbar-h);
	padding: 8px 12px;
	background: rgba(11, 0, 15, .96);
	border-bottom: 1px solid var(--line);
}

.deckbar .namebox {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 1 1 260px;
	min-width: 0;
}

.deckbar .namebox label {
	color: var(--sub);
	font-size: var(--fs-s);
	white-space: nowrap;
}

.deckbar .namebox .field {
	max-width: 340px;
	font-size: var(--fs-l);
}

.dirty {
	color: var(--warn);
	font-size: var(--fs-s);
	white-space: nowrap;
}

.dirty::before {
	content: "● ";
}

.sig {
	color: var(--muted);
	font-size: var(--fs-xs);
	letter-spacing: .06em;
	white-space: nowrap;
}

.deckbar .tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.deckbar .btn.sm {
	min-height: var(--btn-h);   /* 上部バーの [新規][一覧][コード][保存] は同じ高さ(2026-11-23。.sm の細い枠・小さい文字はそのまま) */
	padding: 3px 8px;
	font-size: 13px;
}

.deckbar .btn.primary {
	min-width: 0;
	padding: 3px 12px;
	font-size: 14px;
}

/* 容量ミニメーター(デッキバー) */
.capmini {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: var(--fs-s);
	white-space: nowrap;
}

.capmini .bar {
	position: relative;
	width: 72px;
	height: 8px;
	background: var(--bg-2);
	border: 1px solid var(--line);
}

.capmini .bar i {
	position: absolute;
	inset: 0 auto 0 0;
	background: var(--fg);
}

.capmini.over {
	color: var(--alert);
}

.capmini.over .bar i {
	background: var(--alert);
}

/* モバイル用の表示切替タブ */
.viewtabs {
	display: none;
}

.kb-app {
	position: relative;
	z-index: 10;
	display: grid;
	grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) minmax(260px, 320px);
	grid-template-areas:
		"cat stack status"
		"cat sim sim";
	align-items: start;
	gap: var(--gap);
	max-width: 1480px;
	margin: 0 auto;
	padding: var(--gap) 12px 24px;
}

.col-cat { grid-area: cat; }
.col-stack { grid-area: stack; min-width: 0; }
.col-status { grid-area: status; min-width: 0; display: grid; gap: var(--gap); }
.col-sim { grid-area: sim; min-width: 0; }

.col-cat {
	position: sticky;
	top: calc(var(--deckbar-h) + 8px);
	display: flex;
	flex-direction: column;
	height: calc(100vh - var(--deckbar-h) - 20px);
	min-height: 420px;
	min-width: 0;
}

@media (max-width: 1179px) {
	.kb-app {
		grid-template-columns: minmax(290px, 340px) minmax(0, 1fr);
		grid-template-areas:
			"cat stack"
			"cat status"
			"cat sim";
	}
}

/* ============================================================ builder: catalog */

.catalog {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
}

.tabs {
	display: flex;
	border-bottom: 1px solid var(--line);
}

.tabs [role="tab"] {
	flex: 1 1 0;
	padding: 6px 4px;
	color: var(--sub);
	background: transparent;
	border: 0;
	border-right: 1px solid var(--line);
	cursor: pointer;
	white-space: nowrap;
}

.tabs [role="tab"]:last-child {
	border-right: 0;
}

.tabs [role="tab"] .n {
	margin-left: 4px;
	color: var(--muted);
	font-size: var(--fs-xs);
}

.tabs [role="tab"][aria-selected="true"] {
	color: var(--fg);
	background: var(--bg-1);
	box-shadow: inset 0 -2px 0 var(--fg);
}

.tabs [role="tab"]:hover {
	color: var(--fg);
}

.searchrow {
	display: flex;
	gap: 6px;
	padding: 8px 8px 6px;
}

.searchrow .field {
	flex: 1 1 auto;
}

.searchrow .sort {
	flex: 0 0 auto;
	width: auto;
	font-size: var(--fs-s);
}

.filters {
	border-bottom: 1px dotted var(--line);
}

.filters > summary {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 2px 8px 6px;
	color: var(--sub);
	font-size: var(--fs-s);
	cursor: pointer;
	list-style: none;
}

.filters > summary::-webkit-details-marker {
	display: none;
}

.filters > summary::before {
	content: "+";
	width: 1ch;
	color: var(--muted);
}

.filters[open] > summary::before {
	content: "-";
}

.filters .active-n {
	color: var(--fg);
}

.filters .grid {
	display: grid;
	gap: 6px;
	padding: 0 8px 8px;
}

.filters .row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 6px;
	font-size: var(--fs-s);
}

.filters .row > .lbl {
	width: 4.5em;
	color: var(--muted);
}

.chip {
	padding: 0 6px;
	color: var(--sub);
	background: transparent;
	border: 1px solid var(--line);
	font-size: var(--fs-s);
	line-height: 1.6;
	cursor: pointer;
}

.chip:hover {
	color: var(--fg);
	border-color: var(--line-hi);
}

.chip[aria-pressed="true"] {
	color: var(--bg);
	background: var(--fg);
	border-color: var(--fg);
}

.chip[data-tag="攻性"][aria-pressed="true"] {
	background: var(--alert);
	border-color: var(--alert);
}

.chip .n {
	margin-left: 3px;
	opacity: .7;
	font-size: var(--fs-xs);
}

.range {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.range .field {
	width: 4.6em;
	padding: 1px 4px;
	font-size: var(--fs-s);
}

.listmeta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 4px 8px;
	color: var(--sub);
	font-size: var(--fs-xs);
	border-bottom: 1px solid var(--line);
}

.target-line {
	color: var(--sub);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.target-line b {
	color: var(--fg);
	font-weight: normal;
}

.entries {
	flex: 1 1 auto;
	min-height: 120px;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
}

.entry {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	border-bottom: 1px dotted var(--line);
}

.entry .pick {
	display: grid;
	grid-template-columns: 1.2ch minmax(0, 1fr) auto auto;
	grid-template-areas:
		"mk name rar cost"
		". sub sub sub";
	align-items: baseline;
	column-gap: 6px;
	width: 100%;
	min-width: 0;
	padding: 4px 4px 4px 6px;
	color: var(--fg);
	background: transparent;
	border: 0;
	text-align: left;
	cursor: pointer;
}

.entry .pick::before {
	content: "";
	grid-area: mk;
	color: var(--muted);
}

.entry .pick:hover {
	background: var(--bg-2);
}

.entry .pick:hover::before,
.entry .pick:focus-visible::before {
	content: ">";
}

.entry .name {
	grid-area: name;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.entry .rar { grid-area: rar; }

.entry .cost {
	grid-area: cost;
	min-width: 3ch;
	text-align: right;
}

.entry .sub {
	grid-area: sub;
	display: flex;
	flex-wrap: wrap;
	gap: 0 8px;
	min-width: 0;
	color: var(--sub);
	font-size: var(--fs-xs);
	line-height: 1.5;
}

.entry .state {
	color: var(--muted);
}

/* 選択中の層に差せない・枚数上限 = 注意(エラーではない) */
.entry .state.bad {
	color: var(--warn);
}

.entry .state.used {
	color: var(--fg-hi);
}

.entry .add {
	align-self: stretch;
	width: 36px;
	padding: 0;
	color: var(--sub);
	background: transparent;
	border: 0;
	border-left: 1px dotted var(--line);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.entry .add:hover,
.entry .add:focus-visible {
	color: var(--bg);
	background: var(--fg);
}

.entry .add:disabled {
	color: var(--line-hi);
	background: transparent;
	cursor: not-allowed;
}

/* 選択中のエントリ = 反転(myhomepage の hover と同じ見せ方) */
.entry[aria-current="true"] .pick {
	color: var(--bg);
	background: var(--fg);
}

.entry[aria-current="true"] .pick::before {
	content: ">";
	color: var(--bg);
}

.entry[aria-current="true"] .sub,
.entry[aria-current="true"] .state,
.entry[aria-current="true"] .state.used,
.entry[aria-current="true"] .tag,
.entry[aria-current="true"] .tag::before,
.entry[aria-current="true"] .cost::before {
	color: var(--bg);
}

.entry[aria-current="true"] .rar {
	color: var(--bg);
	border-color: var(--bg);
	background: transparent;
}

.entry.unfit .name {
	color: var(--sub);
}

.empty {
	padding: 16px 10px;
	color: var(--sub);
	font-size: var(--fs-s);
	text-align: center;
}

.empty .btn {
	margin-top: 8px;
}

.keyhelp {
	padding: 3px 8px;
	color: var(--muted);
	font-size: var(--fs-xs);
	border-top: 1px dotted var(--line);
}

/* 詳細(ドシエ) */
.dossier {
	flex: 0 0 auto;
	max-height: 48%;
	overflow-y: auto;
	background: var(--bg-1);
	border-top: 1px solid var(--line-hi);
}

.dossier-inner {
	padding: 8px 10px 10px;
}

.dossier .dhead {
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.dossier .dname {
	margin: 0;
	color: var(--fg-hi);
	font-size: var(--fs-l);
	font-weight: bold;
	line-height: 1.35;
}

.dossier .dclose {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
}

.dossier .dtype {
	margin-left: auto;
	color: var(--sub);
	font-size: var(--fs-xs);
	white-space: nowrap;
}

.dossier .did {
	color: var(--muted);
	font-size: var(--fs-xs);
}

.dossier .stats {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 14px;
	margin: 6px 0;
	font-size: var(--fs-s);
}

.dossier .stats b {
	color: var(--fg-hi);
	font-weight: normal;
}

.dossier .stats span {
	color: var(--sub);
}

.dossier .rule {
	margin: 6px 0;
	padding: 4px 8px;
	border-left: 2px solid var(--fg);
	line-height: 1.55;
}

.dossier .req {
	margin: 4px 0;
	color: var(--warn);
	font-size: var(--fs-s);
}

.dossier .req.bad {
	color: var(--alert-hi);
}

.dossier .flavor {
	margin: 6px 0;
	color: var(--sub);
	font-size: var(--fs-s);
	font-family: var(--sans);
	line-height: 1.6;
}

.dossier .flavor::before { content: "「"; }
.dossier .flavor::after { content: "」"; }

.dossier .actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.dossier .actions .btn {
	min-width: 0;
	padding: 3px 10px;
	font-size: 13px;
}

.dossier .why {
	margin: 6px 0 0;
	color: var(--warn);
	font-size: var(--fs-s);
}

.dossier details {
	margin-top: 8px;
	font-size: var(--fs-xs);
}

.dossier summary {
	color: var(--muted);
	cursor: pointer;
}

.dossier pre {
	max-height: 180px;
	margin: 4px 0 0;
	padding: 6px 8px;
	overflow: auto;
	color: var(--sub);
	background: var(--bg);
	border: 1px solid var(--line);
	font-size: var(--fs-xs);
	line-height: 1.45;
	white-space: pre;
}

/* ============================================================ builder: dive stack */

.stack-body {
	position: relative;
	padding: 12px 12px 16px;
	/* 下へ行くほど暗く(最深部へ潜る) */
	background: linear-gradient(to bottom, var(--bg) 0%, var(--bg) 40%, var(--bg-deep) 100%);
}

.deckinfo {
	margin: 0 0 10px;
	font-size: var(--fs-s);
}

.deckinfo > summary {
	color: var(--sub);
	cursor: pointer;
}

.deckinfo .field {
	margin-top: 4px;
	font-size: var(--fs-s);
}

.deckinfo .count {
	margin-top: 2px;
	color: var(--muted);
	font-size: var(--fs-xs);
	text-align: right;
}

.surface-label {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 6px;
	color: var(--muted);
	font-size: var(--fs-xs);
}

.dive {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* 層ごとに少しずつ狭まる = 潜っていく漏斗 */
.layer-wrap {
	--inset: calc(var(--d, 0) * 10px);
	margin: 0 var(--inset);
}

.connector {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 22px;
	color: var(--muted);
	font-size: var(--fs-xs);
}

.connector::before,
.connector::after {
	content: "";
	flex: 0 0 1px;
	align-self: stretch;
	background: repeating-linear-gradient(to bottom, var(--line-hi) 0 3px, transparent 3px 6px);
}

.layer {
	position: relative;
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr);
	background: var(--bg-1);
	border: 1px solid var(--line);
	transition: border-color .12s;
}

.layer.is-selected {
	border-color: var(--fg);
}

.layer.has-error {
	border-color: rgba(255, 64, 64, .7);
}

.layer.is-drop {
	border-color: var(--fg-hi);
	border-style: dashed;
	background: var(--bg-2);
}

.layer .depth {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 6px 0;
	color: var(--muted);
	border-right: 1px solid var(--line);
	cursor: pointer;
}

.layer .depth .dn {
	color: var(--sub);
	font-size: var(--fs-xl);
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.layer.is-selected .depth {
	color: var(--bg);
	background: var(--fg);
	border-right-color: var(--fg);
}

.layer.is-selected .depth .dn {
	color: var(--bg);
}

.layer .depth .grip {
	color: inherit;
	cursor: grab;
	font-size: var(--fs-s);
	line-height: 1;
}

.layer .lbody {
	min-width: 0;
	padding: 6px 8px 8px 10px;
}

.layer .lhead {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
}

.layer .lname {
	padding: 0;
	color: var(--fg);
	background: none;
	border: 0;
	font-size: var(--fs-m);
	cursor: pointer;
}

.layer .lname .pos {
	margin-left: 6px;
	color: var(--muted);
	font-size: var(--fs-xs);
}

.layer .target-mark {
	color: var(--fg-hi);
	font-size: var(--fs-xs);
}

.layer .ctrl {
	display: flex;
	gap: 4px;
	margin-left: auto;
}

.frame-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 10px;
	margin-top: 4px;
	padding: 4px 0 6px;
	border-bottom: 1px dotted var(--line);
}

.frame-row .fname {
	padding: 0;
	color: var(--fg-hi);
	background: none;
	border: 0;
	font-size: var(--fs-l);
	font-weight: bold;
	text-align: left;
	cursor: pointer;
}

.frame-row .fname:hover,
.frame-row .fname:focus-visible {
	text-decoration: underline;
}

.frame-row .fstats {
	display: flex;
	flex-wrap: wrap;
	gap: 0 10px;
	color: var(--sub);
	font-size: var(--fs-s);
}

.frame-row .fstats b {
	color: var(--fg);
	font-weight: normal;
}

.frame-row .fctl {
	margin-left: auto;
}

.frame-empty {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 10px;
	color: var(--sub);
	background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(43, 68, 38, .35) 6px 7px);
	border: 1px dashed var(--line-hi);
	text-align: center;
	cursor: pointer;
}

.frame-empty:hover,
.frame-empty:focus-visible {
	color: var(--fg);
	border-color: var(--fg);
}

.slots {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 6px;
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

.slot {
	display: flex;
	align-items: stretch;
	min-width: 0;
	min-height: 34px;
	background: var(--bg);
	border: 1px solid var(--line-hi);
}

.slot .sname {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 6px;
	min-width: 0;
	padding: 3px 6px;
	color: var(--fg);
	background: none;
	border: 0;
	text-align: left;
	cursor: pointer;
}

.slot .sname .t {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.slot .sname:hover .t,
.slot .sname:focus-visible .t {
	text-decoration: underline;
}

.slot .sname .cost {
	color: var(--sub);
	font-size: var(--fs-s);
}

.slot .sidx {
	color: var(--muted);
	font-size: var(--fs-xs);
}

.slot .icon-btn {
	width: 30px;
	height: auto;
	border-width: 0 0 0 1px;
	border-color: var(--line);
}

.slot.is-empty {
	border-style: dashed;
	border-color: var(--line);
}

.slot.is-empty .sname {
	justify-content: center;
	color: var(--muted);
}

.slot.is-empty .sname:hover,
.slot.is-empty .sname:focus-visible {
	color: var(--fg);
}

.slot.is-bad {
	border-color: var(--alert);
	background: var(--alert-bg);
}

.slot.is-bad .sname {
	color: var(--alert-hi);
}

.slot.is-over {
	border-style: dashed;
	border-color: var(--alert);
	background: var(--alert-bg);
}

.inline-errors {
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
	color: var(--alert);
	font-size: var(--fs-s);
	/* 未知の長いIDをそのまま表示するので、狭い画面でも折り返す */
	overflow-wrap: anywhere;
}

.inline-errors li::before {
	content: "! ";
}

.inline-errors .fix {
	margin-left: 6px;
}

.stack-foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 6px 12px;
	margin: 14px 0 0;
	font-size: var(--fs-s);
}

.stack-foot .btn {
	min-width: 0;
	padding: 3px 12px;
	font-size: 13px;
}

/* 最深部(中枢) */
.core-wrap {
	margin: 0 var(--inset, 0);
}

.core-block {
	position: relative;
	padding: 8px 12px 10px;
	background:
		radial-gradient(ellipse at 50% 120%, rgba(255, 64, 64, .14), transparent 70%),
		var(--bg-deep);
	border: 1px solid rgba(255, 64, 64, .55);
	text-align: center;
}

.core-block.is-drop {
	border-style: dashed;
	border-color: var(--alert-hi);
}

.core-block .chead {
	display: flex;
	justify-content: center;
	align-items: baseline;
	gap: 8px;
	color: var(--alert);
	font-size: var(--fs-s);
}

.core-block .glyph {
	display: inline-block;
	color: var(--alert);
	font-size: 16px;
	line-height: 1;
}

.core-block .cname {
	display: inline-block;
	margin-top: 2px;
	padding: 0;
	color: var(--alert-hi);
	background: none;
	border: 0;
	font-size: var(--fs-l);
	font-weight: bold;
	cursor: pointer;
}

.core-block .cname:hover,
.core-block .cname:focus-visible {
	text-decoration: underline;
}

.core-block .cmeta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2px 10px;
	color: var(--sub);
	font-size: var(--fs-s);
}

.core-block .ctext {
	max-width: 52ch;
	margin: 4px auto 0;
	color: var(--sub);
	font-size: var(--fs-s);
}

.core-block .cempty {
	margin-top: 6px;
	padding: 6px 12px;
	color: var(--alert-hi);
	background: transparent;
	border: 1px dashed rgba(255, 64, 64, .55);
	cursor: pointer;
}

.core-block .cempty:hover,
.core-block .cempty:focus-visible {
	color: var(--bg);
	background: var(--alert);
}

.core-block .cctl {
	position: absolute;
	top: 6px;
	right: 6px;
}

/* ============================================================ builder: status */

.meter-wrap {
	padding: 10px 10px 8px;
}

.cap-read {
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.cap-read .big {
	color: var(--fg-hi);
	font-size: 30px;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.cap-read .of {
	color: var(--sub);
	font-size: var(--fs-m);
}

.cap-read .rest {
	margin-left: auto;
	color: var(--sub);
	font-size: var(--fs-s);
}

.meter {
	position: relative;
	height: 14px;
	margin: 8px 0 4px;
	background: var(--bg-2);
	border: 1px solid var(--line-hi);
}

.meter .fill {
	position: absolute;
	inset: 0 auto 0 0;
	background: var(--fg);
	/* 20分割の目盛り(HUDのゲージ) */
	-webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(5% - 2px), transparent calc(5% - 2px) 5%);
	mask: repeating-linear-gradient(90deg, #000 0 calc(5% - 2px), transparent calc(5% - 2px) 5%);
	transition: width .18s ease-out;
}

.meter .over {
	position: absolute;
	inset: 0 auto 0 auto;
	background: var(--alert);
}

.meter .cap-mark {
	position: absolute;
	top: -4px;
	bottom: -4px;
	width: 2px;
	background: var(--fg-hi);
}

.meter.is-warn .fill {
	background: var(--warn);
}

.meter.is-over {
	border-color: var(--alert);
}

.meter.is-over .fill {
	background: var(--alert);
}

.meter.is-over .cap-mark {
	background: var(--bg);
	box-shadow: 0 0 0 1px var(--alert-hi);
}

.cap-break {
	display: flex;
	flex-wrap: wrap;
	gap: 0 12px;
	color: var(--sub);
	font-size: var(--fs-s);
}

.cap-break b {
	color: var(--fg);
	font-weight: normal;
}

.status-kv {
	margin-top: 6px;
	font-size: var(--fs-s);
	border-top: 1px dotted var(--line);
}

.status-kv th,
.status-kv td {
	padding: 3px 4px;
}

.cap-over-msg {
	margin: 4px 0 0;
	color: var(--alert);
	font-size: var(--fs-s);
	font-weight: bold;
}

/* 一度だけ走る赤いノイズ(超過した瞬間) */
.flicker {
	animation: flicker .5s steps(2, end) 1;
}

@keyframes flicker {
	0% { filter: none; transform: translateX(0); }
	20% { filter: drop-shadow(2px 0 0 var(--alert)); transform: translateX(-2px); }
	40% { filter: none; transform: translateX(2px); }
	60% { filter: drop-shadow(-2px 0 0 var(--alert)); transform: translateX(-1px); }
	100% { filter: none; transform: translateX(0); }
}

.profile {
	padding: 8px 10px 10px;
}

.arch {
	margin: 0;
	color: var(--fg-hi);
	font-size: var(--fs-l);
}

.arch-desc {
	margin: 0 0 8px;
	color: var(--sub);
	font-size: var(--fs-s);
}

.axes {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.axis {
	display: grid;
	grid-template-columns: 3.2em minmax(0, 1fr) auto;
	align-items: center;
	gap: 0 8px;
	font-size: var(--fs-s);
}

.axis .track {
	position: relative;
	height: 8px;
	background: var(--bg-2);
}

.axis .track i {
	position: absolute;
	inset: 0 auto 0 0;
	background: var(--fg);
	border-radius: 0 2px 2px 0;
}

.axis .track .goal {
	position: absolute;
	top: -3px;
	bottom: -3px;
	width: 1px;
	background: var(--sub);
}

.axis .v {
	color: var(--sub);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.axis .v b {
	color: var(--fg);
	font-weight: normal;
}

.axis.reached .v b {
	color: var(--fg-hi);
}

.prof-note {
	margin: 6px 0 0;
	color: var(--muted);
	font-size: var(--fs-xs);
}

.tagdist {
	display: grid;
	gap: 2px;
	margin: 8px 0 0;
	padding: 6px 0 0;
	list-style: none;
	border-top: 1px dotted var(--line);
}

.tagdist li {
	display: grid;
	grid-template-columns: 5.5em minmax(0, 1fr) 2ch;
	align-items: center;
	gap: 8px;
	font-size: var(--fs-s);
}

.tagdist .bar {
	height: 6px;
	background: var(--line-hi);
	border-radius: 0 2px 2px 0;
}

.tagdist li[data-tag="攻性"] .bar {
	background: var(--alert);
}

.tagdist .n {
	color: var(--sub);
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.legal {
	padding: 8px 10px 10px;
	font-size: var(--fs-s);
}

.legal .ok {
	margin: 0;
	color: var(--fg);
}

.legal .ok::before {
	content: "OK ";
	padding: 0 4px;
	margin-right: 4px;
	color: var(--bg);
	background: var(--fg);
}

.legal .src {
	margin: 6px 0 0;
	color: var(--muted);
	font-size: var(--fs-xs);
}

.errlist {
	margin: 0;
	padding: 0;
	list-style: none;
}

.errlist li + li {
	border-top: 1px dotted var(--line);
}

.errlist button {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 0 6px;
	width: 100%;
	padding: 4px 0;
	color: var(--alert-hi);
	background: none;
	border: 0;
	text-align: left;
	cursor: pointer;
}

.errlist button:hover .m,
.errlist button:focus-visible .m {
	text-decoration: underline;
}

.errlist .c {
	color: var(--alert);
	font-size: var(--fs-xs);
	line-height: 1.9;
}

/* ============================================================ builder: test run (terminal) */

.sim-body {
	padding: 8px 10px 10px;
}

.sim-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: 8px 12px;
	font-size: var(--fs-s);
}

.sim-controls label {
	display: grid;
	gap: 2px;
	color: var(--sub);
}

.sim-controls .field {
	width: auto;
	min-width: 8em;
	font-size: var(--fs-s);
}

.sim-controls .seed {
	width: 7em;
	min-width: 0;
}

.sim-controls .btn {
	min-width: 0;
	padding: 4px 14px;
	font-size: 14px;
}

.sim-wait {
	margin: 8px 0 0;
	color: var(--warn);
	font-size: var(--fs-s);
}

.sim-results {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 8px;
	margin: 10px 0 0;
}

.stat {
	padding: 6px 8px;
	border: 1px solid var(--line);
}

.stat .k {
	color: var(--sub);
	font-size: var(--fs-xs);
}

.stat .v {
	color: var(--fg-hi);
	font-size: 20px;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

.stat .v small {
	color: var(--sub);
	font-size: var(--fs-s);
}

.stat.is-bad .v {
	color: var(--alert-hi);
}

.reasons {
	display: grid;
	gap: 2px;
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
	font-size: var(--fs-s);
}

.reasons li {
	display: grid;
	grid-template-columns: 7em minmax(0, 1fr) 4ch;
	align-items: center;
	gap: 8px;
}

.reasons .bar {
	height: 6px;
	background: var(--fg);
	border-radius: 0 2px 2px 0;
}

.reasons li[data-side="attacker"] .bar {
	background: var(--alert);
}

.reasons .n {
	color: var(--sub);
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.term {
	min-height: 84px;
	max-height: 320px;
	margin: 10px 0 0;
	padding: 8px 10px;
	overflow: auto;
	color: var(--fg);
	background: #050007;
	border: 1px solid var(--line);
	font-size: var(--fs-s);
	line-height: 1.5;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.term .ln {
	display: block;
}

.term .ln.dim { color: var(--muted); }
.term .ln.hit { color: var(--alert-hi); }
.term .ln.def { color: var(--fg-hi); }
.term .ln.sys { color: var(--warn); }

.term .ln .t {
	color: var(--muted);
}

/* ============================================================ dialogs */

.kb-dialog {
	width: min(680px, calc(100% - 24px));
	max-height: calc(100vh - 32px);
	padding: 0;
	color: var(--fg);
	background: var(--bg);
	border: 1px solid var(--fg);
	box-shadow: 0 0 0 1px var(--bg), 0 0 24px rgba(127, 221, 87, .12);
}

.kb-dialog::backdrop {
	background: rgba(5, 0, 8, .78);
}

.kb-dialog .band .x {
	margin-left: auto;
	padding: 0 4px;
	color: var(--bg);
	background: none;
	border: 0;
	font-family: var(--mono);
	font-size: var(--fs-s);
	cursor: pointer;
}

.kb-dialog .band .x:hover,
.kb-dialog .band .x:focus-visible {
	color: var(--fg);
	background: var(--bg);
}

.kb-dialog .dbody {
	padding: 10px 12px 12px;
	overflow-y: auto;
	max-height: calc(100vh - 90px);
}

.kb-dialog .dbody p {
	margin: 0 0 8px;
}

.kb-dialog .dactions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 12px;
}

.kb-dialog .dactions .btn {
	min-width: 0;
	padding: 4px 14px;
	font-size: 14px;
}

.mgr-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}

.mgr-tools .btn {
	min-width: 0;
	padding: 3px 10px;
	font-size: 13px;
}

.mgr-tabs {
	margin-bottom: 8px;
	border: 1px solid var(--line);
}

.decklist {
	margin: 0;
	padding: 0;
	list-style: none;
}

.decklist li {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 4px 10px;
	padding: 6px 2px;
	border-bottom: 1px dotted var(--line);
}

.decklist li.is-current .dn::after {
	content: " ◀ 編集中";
	color: var(--fg-hi);
	font-size: var(--fs-xs);
}

.decklist .dn {
	overflow-wrap: anywhere;
}

.decklist .dm {
	color: var(--sub);
	font-size: var(--fs-xs);
}

.decklist .dc {
	display: block;
	color: var(--sub);
	font-size: var(--fs-s);
	font-family: var(--sans);
}

.decklist .pub {
	color: var(--fg-hi);
}

.decklist .exp {
	color: var(--cyan);
	text-decoration: none;
}

.decklist .acts {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 4px;
}

.code-out {
	font-size: var(--fs-s);
	word-break: break-all;
}

.code-hex {
	margin: 6px 0 0;
	padding: 4px 6px;
	border: 1px dotted var(--line);
}

.code-sec + .code-sec {
	margin-top: 14px;
	padding-top: 10px;
	border-top: 1px dashed var(--line-hi);
}

.code-sec h3 {
	margin: 0 0 6px;
	color: var(--fg);
	font-size: var(--fs-m);
}

.code-sec h3::before {
	content: "> ";
	color: var(--muted);
}

.code-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 6px;
}

.code-row .btn {
	min-width: 0;
	padding: 3px 12px;
	font-size: 13px;
}

.form-err {
	margin: 6px 0 0;
	color: var(--alert);
	font-size: var(--fs-s);
}

/* ============================================================ toast */

/* 広い画面: 左下(カタログ欄の下端。キー操作の説明だけの行で、操作要素が無い)。
   右下はテスト侵入・状態欄の操作と重なるため使わない */
.toasts {
	position: fixed;
	left: 12px;
	bottom: 12px;
	z-index: 200;
	display: grid;
	gap: 6px;
	width: min(360px, calc(100% - 24px));
	pointer-events: none;
}

.toast {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 6px 10px;
	color: var(--fg);
	background: #050007;
	border: 1px solid var(--line-hi);
	border-left: 3px solid var(--fg);
	font-size: var(--fs-s);
	/* 通知の下にある保存・公開ボタンを塞がない。「元に戻す」など操作のある通知だけ受け付ける */
	pointer-events: none;
}

.toast.has-action {
	pointer-events: auto;
}

.toast::before {
	content: ">";
	color: var(--muted);
}

.toast.is-err {
	color: var(--alert-hi);
	border-left-color: var(--alert);
}

.toast .msg {
	flex: 1 1 auto;
	min-width: 0;
}

.toast .btn.sm {
	flex: 0 0 auto;
}

/* 押せる通知(融通所の呼び出し。ui.js の toast の warn・sticky・actions・place。DESIGN.md §4.14)
   琥珀の左の線と頭の印(赤は使わない・点滅しない)。ボタンは本文の下の行へ、閉じる × は右上 */
.toast.is-warn {
	border-left-color: var(--warn);
}
.toast.is-warn::before {
	content: "!";
	color: var(--warn);
	font-weight: bold;
}
.toast.is-sticky {
	position: relative;
	flex-wrap: wrap;
	padding-right: 34px;
}
.toast.is-sticky .msg {
	flex-basis: calc(100% - 20px);
}
.toast-acts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-left: 14px;
}
.toast-acts .btn.sm {
	min-height: 32px;
	padding: 1px 10px;
}
.toast-x {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 28px;
	height: 28px;
	padding: 0;
	color: var(--sub);
	background: none;
	border: 1px solid transparent;
	font: inherit;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}
.toast-x:hover,
.toast-x:focus-visible {
	color: var(--fg-hi);
	border-color: var(--line-hi);
}
/* PC の押せる通知は右上(左下の通知・共用線のボタンと重ねない)。759px 以下は通知と同じ上(ui.js が置き場所を分ける)。
   共用線のボタンがある間の html[data-gchat] .toasts(下を上げる規則)より強くする */
html body > .toasts.is-top {
	top: var(--toast-top-pc, 8px); /* ヘッダーが見えている間はその下(ui.js が出すときに測る。右端のアカウントボタンに重ねない) */
	right: 12px;
	bottom: auto;
	left: auto;
}

/* ============================================================ hack page */

.pub-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--fs-s);
}

.pub-table th,
.pub-table td {
	padding: 4px 8px;
	text-align: left;
	border-bottom: 1px dotted var(--line);
}

.pub-table th {
	color: var(--sub);
	font-weight: normal;
}

.pub-table td.n {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.pub-table .nm {
	color: var(--fg);
	overflow-wrap: anywhere;
}

.soon-panel {
	padding: 14px 12px;
	text-align: center;
}

.soon-panel .big {
	margin: 0 0 6px;
	color: var(--alert);
	font-size: var(--fs-xl);
	letter-spacing: .1em;
}

/* ============================================================ responsive */

@media (max-width: 759px) {
	:root {
		--gap: 10px;
	}

	body {
		font-size: 15px;
	}

	.deckbar {
		position: static;
		padding: 8px 10px;
	}

	.deckbar .namebox {
		flex-basis: 100%;
	}

	.deckbar .namebox .field {
		max-width: none;
	}

	.deckbar .capmini,
	.deckbar .sig {
		display: none;
	}

	.deckbar .tools {
		flex: 1 1 100%;
		flex-wrap: nowrap;
		gap: 5px;
	}

	.deckbar .tools .toggle {
		margin-right: auto;
	}

	.deckbar .btn.sm,
	.deckbar .btn.primary {
		padding: 4px 5px;
		font-size: 13px;
	}

	.layer .lname .pos.num {
		display: none;
	}

	/* 一覧 / 構成 / 状態 の切替(上部に固定) */
	.viewtabs {
		position: sticky;
		top: 0;
		z-index: 60;
		display: flex;
		gap: 0;
		background: var(--bg);
		border-bottom: 1px solid var(--line);
	}

	.viewtabs button {
		flex: 1 1 0;
		padding: 8px 2px;
		color: var(--sub);
		background: var(--bg);
		border: 0;
		border-right: 1px solid var(--line);
		font-size: 14px;
		cursor: pointer;
		white-space: nowrap;
	}

	.viewtabs button[aria-selected="true"] {
		color: var(--bg);
		background: var(--fg);
	}

	.viewtabs .vcap {
		flex: 0 0 auto;
		display: flex;
		align-items: center;
		padding: 0 8px;
		font-size: var(--fs-s);
		white-space: nowrap;
	}

	.viewtabs .vcap.over {
		color: var(--alert);
	}

	.viewtabs .badge {
		margin-left: 3px;
		color: var(--alert);
	}

	.viewtabs button[aria-selected="true"] .badge {
		color: var(--bg);
	}

	.kb-app {
		display: block;
		padding: var(--gap) 10px 80px;
	}

	.kb-app > section + section {
		margin-top: var(--gap);
	}

	.kb-app[data-view="catalog"] .col-stack,
	.kb-app[data-view="catalog"] .col-status,
	.kb-app[data-view="catalog"] .col-sim,
	.kb-app[data-view="stack"] .col-cat,
	.kb-app[data-view="stack"] .col-status,
	.kb-app[data-view="stack"] .col-sim,
	.kb-app[data-view="status"] .col-cat,
	.kb-app[data-view="status"] .col-stack {
		display: none;
	}

	.col-cat {
		position: static;
		height: auto;
		min-height: 0;
	}

	.col-status {
		display: grid;
	}

	.entries {
		max-height: none;
		overflow: visible;
	}

	/* 詳細は画面下に貼り付く */
	.dossier {
		position: sticky;
		bottom: 0;
		z-index: 20;
		max-height: 46vh;
		box-shadow: 0 -8px 16px rgba(5, 0, 8, .8);
	}

	.layer-wrap {
		--inset: calc(var(--d, 0) * 3px);
	}

	.layer {
		grid-template-columns: 34px minmax(0, 1fr);
	}

	.layer .depth .dn {
		font-size: var(--fs-l);
	}

	.slots {
		grid-template-columns: 1fr;
	}

	.slot {
		min-height: 40px;
	}

	.icon-btn {
		width: 32px;
		height: 32px;
	}

	.entry .add {
		width: 44px;
	}

	.term {
		max-height: 260px;
	}

	/* 下は詳細パネルが貼り付くので、通知は上の切替タブの直下に出す。
	   ページ先頭(防壁名欄・保存ボタンが見えている)では、タブの位置まで下げる(ui.js が --toast-top を入れる) */
	.toasts {
		top: var(--toast-top, 44px);
		right: 10px;
		bottom: auto;
		left: 10px;
		width: auto;
	}
}

@media screen and (max-width: 480px) {
	.buttons .btn {
		flex: 1 1 0;
		min-width: 0;
		max-width: 200px;
		padding: 8px 6px;
	}

	.kv:not(.status-kv),
	.kv:not(.status-kv) tbody,
	.kv:not(.status-kv) tr,
	.kv:not(.status-kv) th,
	.kv:not(.status-kv) td {
		display: block;
		width: auto;
	}

	.kv:not(.status-kv) tr {
		padding: 6px 10px;
		border-bottom: 1px dotted var(--line);
	}

	.kv:not(.status-kv) tr:last-child {
		border-bottom: 0;
	}

	.kv:not(.status-kv) th,
	.kv:not(.status-kv) td {
		padding: 0;
		border: 0;
		white-space: normal;
	}

	.kv:not(.status-kv) td {
		padding-left: 1.2em;
	}

	.op-form {
		flex-wrap: wrap;
	}

	.op-form .btn {
		flex: 1 1 auto;
	}

	.pub-table .hide-s {
		display: none;
	}
}

/* ============================================================ motion */

@media (prefers-reduced-motion: reduce) {
	.marquee {
		white-space: normal;
		text-align: center;
	}

	.marquee span {
		padding-left: 0;
		animation: none;
	}

	.blink,
	.cursor,
	.flicker {
		animation: none;
	}

	.title::before,
	.title::after {
		animation: none;
		opacity: 0;
	}

	.meter .fill,
	.layer {
		transition: none;
	}
}

@media (forced-colors: active) {
	.meter .fill,
	.axis .track i,
	.tagdist .bar,
	.reasons .bar,
	.capmini .bar i {
		background: CanvasText;
		forced-color-adjust: none;
	}
}

/* 組み途中(フレーム未設定だけ)= 警告ではなく案内 */
.errlist.pending button {
	color: var(--warn);
}

.errlist.pending .c {
	color: var(--warn);
}

/* ---------------------------------------------------------------- 解放(未解放のカード。docs/progression.md §1)
   一覧では暗くして置けない(+ の代わりに鍵)。構成に入っているもの(見本・共有コード)は「未解放」の札。 */
.entry.is-locked .pick {
	opacity: .55;
}

.entry.is-locked .name {
	color: var(--sub);
}

.entry.is-locked .kb-art {
	filter: grayscale(1) brightness(.6);
}

.entry.is-locked .add:disabled {
	color: var(--muted);
}

.entry .lock-tag,
.lock-why {
	color: var(--warn);
}

.lock-why {
	margin: 0 0 6px;
	font-size: var(--fs-s);
}

.lock-mark {
	display: inline-block;
	margin-left: 6px;
	padding: 0 4px;
	color: var(--warn);
	border: 1px solid currentColor;
	font-size: var(--fs-xs);
	line-height: 1.4;
	vertical-align: middle;
	white-space: nowrap;
}

.lock-note {
	margin: 0;
	padding: 6px 12px;
	color: var(--warn);
	background: rgba(232, 193, 90, .08);
	border-bottom: 1px solid var(--line);
	font-size: var(--fs-s);
	overflow-wrap: anywhere;
}

.lock-note.is-alert {
	color: var(--alert-hi);
	background: var(--alert-bg);
}

.lock-note .lk-k {
	margin-right: 2px;
}

/* サイト内のリンクは語の途中で折り返さない(狭い画面で「マイペ/ージ」にならないように) */
.boardlist .group a {
	white-space: nowrap;
}

/* 使い道のタグ(防壁用/侵入用。assets/js/use-tag.js。2026-11-09 制作者の指摘)。色だけに頼らず記号と文字で示す */
.use-tag {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 0 4px;
	border: 1px solid currentColor;
	font-family: var(--mono);
	font-size: var(--fs-xs);
	line-height: 1.5;
	white-space: nowrap;
	vertical-align: middle;
}
.use-tag .use-mk { font-size: 9px; }
.use-tag.use-barrier { color: var(--fg-hi); }
.use-tag.use-intrude { color: var(--cyan); }

/* ============================================================ ドット絵のアイコンと「押せるもの」の見分け(docs/ui-design.md §3.6)
   2026-11-09 制作者の指摘: 押せるボタンなのか分かりにくい。押せるもの(リンク・ボタン・タブ・開閉)の頭にドット絵の
   アイコン(assets/art/ui/*.png。tools/art/icons.py で生成。16×16 を 16px か 32px の整数倍で出す)を付ける。
   ただの見出し・ラベルには付けない。 */

.pi {
	display: inline-block;
	flex: none;
	width: 16px;
	height: 16px;
	background: no-repeat center / 16px 16px;
	image-rendering: pixelated;
	vertical-align: -3px;
}
.pi.x2 { width: 32px; height: 32px; background-size: 32px 32px; vertical-align: middle; }
/* 文字との間(ボタン・出撃口の見出しは flex の gap で空ける) */
.pi { margin-right: 5px; }
.btn > .pi, .pf-go-t > .pi, .src-switch .pi { margin-right: 0; }
html.kb-arts-off .pi { display: none; } /* 「文字だけ」の設定ではアイコンも出さない */

.pi-top { background-image: url("../art/ui/top.png"); }
.pi-mypage { background-image: url("../art/ui/mypage.png"); }
.pi-ops { background-image: url("../art/ui/ops.png"); }
.pi-roster { background-image: url("../art/ui/roster.png"); }
.pi-daily { background-image: url("../art/ui/daily.png"); } /* 出勤簿(tools/art/daily_icons.py) */
.pi-notice { background-image: url("../art/ui/notice.png"); } /* 解放のお知らせ */
.pi-shop { background-image: url("../art/shop/icon16.gif"); }
.pi-shop.x2 { background-image: url("../art/shop/icon.gif"); }
.pi-salvage { background-image: url("../art/salvage/icon16.gif"); }
.pi-salvage.x2 { background-image: url("../art/salvage/icon.gif"); }
.pi-builder { background-image: url("../art/ui/builder.png"); }
.pi-intruder { background-image: url("../art/ui/intruder.png"); }
.pi-hack { background-image: url("../art/ui/hack.png"); }
.pi-vault { background-image: url("../art/ui/vault.png"); }
.pi-tips { background-image: url("../art/ui/tips.png"); }
.pi-news { background-image: url("../art/ui/news.png"); }
.pi-catalog { background-image: url("../art/ui/catalog.png"); }
.pi-layers { background-image: url("../art/ui/layers.png"); }
.pi-status { background-image: url("../art/ui/status.png"); }
.pi-guide { background-image: url("../art/ui/guide.png"); }
/* 照会の難しさ(通常照会 = 灯のともった開いた扉・緑 / 封鎖照会 = 錠と警戒の縞・赤と琥珀)と、当直表などの操作 */
.pi-normal { background-image: url("../art/ui/normal.png"); }
.pi-lockdown { background-image: url("../art/ui/lockdown.png"); }
.pi-key { background-image: url("../art/ui/key.png"); }
.pi-reload { background-image: url("../art/ui/reload.png"); }
.pi-mail { background-image: url("../art/ui/mail.png"); }
.pi-settings { background-image: url("../art/ui/settings.png"); }
.pi-dock { background-image: url("../art/ui/dock.png"); }
/* 班(tools/art/guild.py): 班そのもの・班のページの箱の見出し・炊き出し3種 */
.pi-guild { background-image: url("../art/ui/guild.png"); }
.pi-stock { background-image: url("../art/ui/stock.png"); }
.pi-build { background-image: url("../art/ui/build.png"); }
.pi-pot { background-image: url("../art/ui/pot.png"); }
.pi-onigiri { background-image: url("../art/ui/onigiri.png"); }
.pi-tonjiru { background-image: url("../art/ui/tonjiru.png"); }
.pi-tea { background-image: url("../art/ui/tea.png"); }
.pi-chat { background-image: url("../art/ui/chat.png"); }
/* 大潮の四夜(tools/art/tide.py): 大潮・潮札・先触れ・主 */
.pi-tide { background-image: url("../art/ui/tide.png"); }
/* 底無階段(tools/art/corridor.py): 回廊・増幅器の欠片・棚板・番人 */
.pi-corridor { background-image: url("../art/ui/corridor.png"); }
.pi-corr-amp { background-image: url("../art/ui/corr_amp.png"); }
.pi-corr-shelf { background-image: url("../art/ui/corr_shelf.png"); }
.pi-corr-boss { background-image: url("../art/ui/corr_boss.png"); }
/* ジョブ(tools/art/jobs.py): ヘッダー・ボタンの印と、素材4つ */
.pi-jobs { background-image: url("../art/ui/jobs.png"); }
.pi-job-unlock { background-image: url("../art/ui/job_unlock.png"); }
.pi-job-m1 { background-image: url("../art/ui/job_m1.png"); }
.pi-job-kou { background-image: url("../art/ui/job_kou.png"); }
.pi-job-otsu { background-image: url("../art/ui/job_otsu.png"); }
/* 遠征(tools/art/expedition.py): 遠征・難度の印4つ */
.pi-expedition { background-image: url("../art/ui/expedition.png"); }
/* 追討(tools/art/pursuit.py): 照準の輪 */
.pi-pursuit { background-image: url("../art/ui/pursuit.png"); }
/* 番小屋(tools/art/base.py): 入口の小屋・沈み材・施設 5 つ */
.pi-base { background-image: url("../art/ui/base.png"); }
.pi-base-mat { background-image: url("../art/ui/base_mat.png"); }
.pi-base-omoya { background-image: url("../art/ui/base_omoya.png"); }
.pi-base-yobi { background-image: url("../art/ui/base_yobi.png"); }
.pi-base-senbetsu { background-image: url("../art/ui/base_senbetsu.png"); }
.pi-base-fudabako { background-image: url("../art/ui/base_fudabako.png"); }
.pi-base-naya { background-image: url("../art/ui/base_naya.png"); }
.pi-base-funatsuki { background-image: url("../art/ui/base_funatsuki.png"); }
.pi-base-tsukue { background-image: url("../art/ui/base_tsukue.png"); }
.pi-base-mihari { background-image: url("../art/ui/base_mihari.png"); }
.pi-base-drift { background-image: url("../art/ui/base_drift.png"); }
.pi-base-isogi { background-image: url("../art/ui/base_isogi.png"); }
.pi-base-ourai { background-image: url("../art/ui/base_ourai.png"); }
.pi-base-gift { background-image: url("../art/ui/base_gift.png"); }
.pi-base-foot { background-image: url("../art/ui/base_foot.png"); }
.pi-base-extra { background-image: url("../art/ui/base_extra.png"); }
/* 日課(tools/art/nikka.py) */
.pi-nikka { background-image: url("../art/ui/nikka.png"); }
.pi-nikka-kiriyomi { background-image: url("../art/ui/nikka_kiriyomi.png"); }
.pi-nikka-amitsukuroi { background-image: url("../art/ui/nikka_amitsukuroi.png"); }
.pi-nikka-kaijo { background-image: url("../art/ui/nikka_kaijo.png"); }
.pi-nikka-shinsen { background-image: url("../art/ui/nikka_shinsen.png"); }
.pi-exp-lv1 { background-image: url("../art/ui/exp_lv1.png"); }
.pi-exp-lv2 { background-image: url("../art/ui/exp_lv2.png"); }
.pi-exp-lv3 { background-image: url("../art/ui/exp_lv3.png"); }
.pi-exp-lv4 { background-image: url("../art/ui/exp_lv4.png"); }
.pi-ticket { background-image: url("../art/ui/ticket.png"); }
.pi-herald { background-image: url("../art/ui/herald.png"); }
.pi-lord { background-image: url("../art/ui/lord.png"); }
/* カテゴリの見出し(tools/art/cat_icons.py)。ヘッダーの .nc-b は --nci で同じ絵を出す。管理画面は admin.css */
.pi-cat-fixed { background-image: url("../art/ui/cat_fixed.png"); }
.pi-cat-duty { background-image: url("../art/ui/cat_duty.png"); }
.pi-cat-supply { background-image: url("../art/ui/cat_supply.png"); }
.pi-cat-build { background-image: url("../art/ui/cat_build.png"); }
.pi-cat-guide { background-image: url("../art/ui/cat_guide.png"); }
.pi-cat-deep { background-image: url("../art/ui/cat_deep.png"); }
.pi-stamp { background-image: url("../art/ui/stamp.png"); } /* 判(届け出・出勤簿) */
/* 枠の見出しの帯(tools/art/frame_icons.py。2026-11-15): 同じ意味の見出しはどのページでも同じ絵 */
.pi-ledger { background-image: url("../art/ui/ledger.png"); }
.pi-battle { background-image: url("../art/ui/battle.png"); }
.pi-replay { background-image: url("../art/ui/replay.png"); }
.pi-log { background-image: url("../art/ui/log.png"); }
.pi-edit { background-image: url("../art/ui/edit.png"); }
.pi-exit { background-image: url("../art/ui/exit.png"); }
.pi-search { background-image: url("../art/ui/search.png"); }
.pi-wanted { background-image: url("../art/ui/wanted.png"); }
.pi-cal-day { background-image: url("../art/ui/cal_day.png"); }
.pi-cal-week { background-image: url("../art/ui/cal_week.png"); }
.pi-cal-month { background-image: url("../art/ui/cal_month.png"); }
.pi-extract { background-image: url("../art/ui/extract.png"); }
.pi-tools { background-image: url("../art/ui/tools.png"); }
/* 保管庫の整理(tools/art/vault_icons.py。docs/ui-design.md §3.20) */
.pi-vt-group { background-image: url("../art/ui/vt_group.png"); }
.pi-vt-fold { background-image: url("../art/ui/vt_fold.png"); }
.pi-vt-all { background-image: url("../art/ui/vt_all.png"); }
.pi-vt-worse { background-image: url("../art/ui/vt_worse.png"); }
.pi-vt-new { background-image: url("../art/ui/vt_new.png"); }
.pi-vt-best { background-image: url("../art/ui/vt_best.png"); }
/* 保管庫 第2弾(2026-11-23): 色の印・保存した条件・数値で絞る(tools/art/vault_icons.py) */
.pi-vt-mark0 { background-image: url("../art/ui/vt_mark0.png"); }
.pi-vt-mark1 { background-image: url("../art/ui/vt_mark1.png"); }
.pi-vt-mark2 { background-image: url("../art/ui/vt_mark2.png"); }
.pi-vt-mark3 { background-image: url("../art/ui/vt_mark3.png"); }
.pi-vt-save { background-image: url("../art/ui/vt_save.png"); }
.pi-vt-num { background-image: url("../art/ui/vt_num.png"); }
/* 共用線(全体チャット。tools/art/gchat_icons.py。2026-11-24 マルチ要素 ①) */
.pi-gchat { background-image: url("../art/ui/gchat.png"); }
.pi-gchat-mute { background-image: url("../art/ui/gchat_mute.png"); }
.pi-gchat-new { background-image: url("../art/ui/gchat_new.png"); }
.pi-gchat-att { background-image: url("../art/ui/gchat_att.png"); }
.pi-gchat-sell { background-image: url("../art/ui/gchat_sell.png"); }
.pi-gchat-buy { background-image: url("../art/ui/gchat_buy.png"); }
/* 融通所(プレイヤー間の取引。tools/art/trade_icons.py。docs/trade-design.md §4.4) */
.pi-trade { background-image: url("../art/ui/trade.png"); }
.pi-trade-call { background-image: url("../art/ui/trade_call.png"); }
.pi-trade-seat { background-image: url("../art/ui/trade_seat.png"); }
.pi-trade-ok { background-image: url("../art/ui/trade_ok.png"); }
.pi-trade-fee { background-image: url("../art/ui/trade_fee.png"); }
/* 合同照会(ワールドボス。ページの絵は tools/art/page_icons.py、ほかは tools/art/wboss.py。docs/worldboss-design.md §2.6)。
   記章は型ごと(.pi-wb-badge-<型>)。とどめの印・上位の縁取りは同じ大きさの重ね(透明の上に描いた絵。親に position: relative、重ねに position: absolute; inset: 0) */
.pi-wboss { background-image: url("../art/ui/wboss.png"); }
.pi-wb-report { background-image: url("../art/ui/wb_report.png"); }
.pi-wb-slot { background-image: url("../art/ui/wb_slot.png"); }
.pi-wb-slot-off { background-image: url("../art/ui/wb_slot_off.png"); }
.pi-wb-hp { background-image: url("../art/ui/wb_hp.png"); }
.pi-wb-form { background-image: url("../art/ui/wb_form.png"); }
.pi-wb-down { background-image: url("../art/ui/wb_down.png"); }
.pi-wb-kill { background-image: url("../art/ui/wb_kill.png"); }
.pi-wb-rank { background-image: url("../art/ui/wb_rank.png"); }
.pi-wb-border { background-image: url("../art/ui/wb_border.png"); }
.pi-wb-recent { background-image: url("../art/ui/wb_recent.png"); }
.pi-wb-badge { background-image: url("../art/ui/wb_badge.png"); }
.pi-wb-badge-fire { background-image: url("../art/ui/wb_badge_fire.png"); }
.pi-wb-badge-net { background-image: url("../art/ui/wb_badge_net.png"); }
.pi-wb-badge-fog { background-image: url("../art/ui/wb_badge_fog.png"); }
.pi-wb-badge-mirror { background-image: url("../art/ui/wb_badge_mirror.png"); }
.pi-wb-badge-drone { background-image: url("../art/ui/wb_badge_drone.png"); }
.pi-wb-badge-heavy { background-image: url("../art/ui/wb_badge_heavy.png"); }
.pi-wb-badge-kill { background-image: url("../art/ui/wb_badge_kill.png"); }
.pi-wb-badge-rim { background-image: url("../art/ui/wb_badge_rim.png"); }
/* 水際(拠点の占領。ページの絵は tools/art/page_icons.py、ほかは tools/art/hold.py。docs/outpost-design.md §2.12)。
   効果は局の id で .pi-hold-fx-<局>(帯域・断片は既存の絵を指す)。順位・最近の動き・ボーダーは合同照会と同じ絵 */
.pi-hold { background-image: url("../art/ui/hold.png"); }
.pi-hold-lamp-on { background-image: url("../art/ui/hold_lamp_on.png"); }
.pi-hold-lamp-off { background-image: url("../art/ui/hold_lamp_off.png"); }
.pi-hold-lamp-keep { background-image: url("../art/ui/hold_lamp_keep.png"); }
.pi-hold-lamp-fight { background-image: url("../art/ui/hold_lamp_fight.png"); }
.pi-hold-offense-warn { background-image: url("../art/ui/hold_offense_warn.png"); }
.pi-hold-offense { background-image: url("../art/ui/hold_offense.png"); }
.pi-hold-push { background-image: url("../art/ui/hold_push.png"); }
.pi-hold-progress { background-image: url("../art/ui/hold_progress.png"); }
.pi-hold-hp { background-image: url("../art/ui/hold_hp.png"); }
.pi-hold-report { background-image: url("../art/ui/hold_report.png"); }
.pi-hold-slot { background-image: url("../art/ui/hold_slot.png"); }
.pi-hold-slot-off { background-image: url("../art/ui/hold_slot_off.png"); }
.pi-hold-key { background-image: url("../art/ui/hold_key.png"); }
.pi-hold-fx-pier { background-image: url("../art/ui/gift_band.png"); }
.pi-hold-fx-stack { background-image: url("../art/ui/aid_frag.png"); }
.pi-hold-fx-relay { background-image: url("../art/ui/hold_fx_relay.png"); }
.pi-hold-fx-tank { background-image: url("../art/ui/hold_fx_tank.png"); }
.pi-hold-fx-beacon { background-image: url("../art/ui/hold_fx_beacon.png"); }
.pi-hold-rank { background-image: url("../art/ui/wb_rank.png"); }
.pi-hold-recent { background-image: url("../art/ui/wb_recent.png"); }
.pi-hold-border { background-image: url("../art/ui/wb_border.png"); }
/* 水際の守り(第 2 段。局に就かせた防壁): 守り = 緑の縁の盾と三つ灯・退けた = 盾にしるし・破られた = 灰色の盾にひび(控えめ。赤は使わない) */
.pi-hold-guard { background-image: url("../art/ui/hold_guard.png"); }
.pi-hold-guard-win { background-image: url("../art/ui/hold_guard_win.png"); }
.pi-hold-guard-lose { background-image: url("../art/ui/hold_guard_lose.png"); }
.pi-sound { background-image: url("../art/ui/sound.png"); }
.pi-view { background-image: url("../art/ui/view.png"); }
.pi-mix { background-image: url("../art/ui/mix.png"); }
.pi-legal { background-image: url("../art/ui/legal.png"); }
.pi-glossary { background-image: url("../art/ui/glossary.png"); }
.pi-rules { background-image: url("../art/ui/rules.png"); }
.pi-person { background-image: url("../art/ui/person.png"); }
.pi-bonus { background-image: url("../art/ui/bonus.png"); }
.pi-contact { background-image: url("../art/ui/contact.png"); }
.pi-clock { background-image: url("../art/ui/clock.png"); }
.pi-terms { background-image: url("../art/ui/terms.png"); }
.pi-privacy { background-image: url("../art/ui/privacy.png"); }
/* 通貨と断片(配給所の通貨の絵と同じ物。assets/js/util.js の curIcon(id) で付ける) */
.pi-yakin { background-image: url("../art/shop/cur_yakin.gif"); }
.pi-fusa { background-image: url("../art/shop/cur_fusa.gif"); }
.pi-shizumi { background-image: url("../art/shop/cur_shizumi.gif"); }
.pi-frag { background-image: url("../art/ui/aid_frag.png"); }
/* 重ね打ち(凸)・芯鉄・常設の棚(tools/art/totsu_icons.py。docs/totsu-design.md) */
.pi-totsu { background-image: url("../art/ui/totsu.png"); }
.pi-totsu-iron, .pi-iron { background-image: url("../art/ui/totsu_iron.png"); }
/* ジョブ第3弾(称号・当直長。tools/art/jobs3.py) */
.pi-job-toushin { background-image: url("../art/ui/job_toushin.png"); }
.pi-job-chief { background-image: url("../art/ui/job_chief.png"); }
.pi-job-title { background-image: url("../art/ui/job_title.png"); }
.pi-job-osame { background-image: url("../art/ui/job_osame.png"); }
.pi-job-aura { background-image: url("../art/ui/job_aura.png"); }
.pi-job-night { background-image: url("../art/ui/job_night.png"); }
.pi-motion { background-image: url("../art/ui/motion.png"); }
.pi-lamp-3 { background-image: url("../art/ui/lamp_3.png"); }
.pi-lamp-7 { background-image: url("../art/ui/lamp_7.png"); }
.pi-lamp-10 { background-image: url("../art/ui/lamp_10.png"); }
.pi-totsu-star { background-image: url("../art/ui/totsu_star.png"); }
.pi-totsu-none { background-image: url("../art/ui/totsu_none.png"); }
.pi-shop-shelf { background-image: url("../art/ui/shop_shelf.png"); }
/* 帯域・照準符(結果画面の「得たもの」。curIcon('stamina' | 'aim')) */
.pi-band { background-image: url("../art/ui/gift_band.png"); }
/* 減免(帯域の使用量の割引。assets/js/band.js bandNum): 元の数を打ち消して薄く + 減らした数(シアン)+ アイコン。押せない・高さを変えない */
.pi-band-cut { background-image: url("../art/ui/band_cut.png"); }
.bd-cost { white-space: nowrap; }
.bd-cost .bd-was { position: relative; margin-right: 3px; color: var(--sub); font-weight: normal; text-decoration: none; }
/* 打ち消し線は書体によって細く消えるので、1px の線を自前で引く(text-decoration は使わない) */
.bd-cost .bd-was::after { content: ""; position: absolute; left: -1px; right: -1px; top: 52%; border-top: 1px solid var(--sub); pointer-events: none; }
.bd-cost .bd-now { color: var(--cyan); font-weight: bold; }
.bd-cost .pi-band-cut { margin-left: 2px; vertical-align: -3px; }
.pi-aim { background-image: url("../art/ui/aid_aim.png"); }
/* 文の中の通貨のアイコン: 文字の間を詰め、名前と離れて折り返さない */
.pi.cur { margin-right: 2px; }
.band .pi.cur { margin-right: 5px; }
.cur-w { white-space: nowrap; }

/* ヘッダーのサイト内リンク: どのページの HTML もそのまま、リンク先でアイコンを決める */
html:not(.kb-arts-off) .boardlist .group a::before {
	content: "";
	display: inline-block;
	width: 16px;
	height: 16px;
	margin-right: 3px;
	background: no-repeat center / 16px 16px;
	image-rendering: pixelated;
	vertical-align: -3px;
}
html:not(.kb-arts-off) .boardlist .group a[href$="index.html"]::before { background-image: url("../art/ui/top.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="profile/"]::before,
html:not(.kb-arts-off) .page-profile .boardlist .group a[href="./"]::before,
html:not(.kb-arts-off) .page-profile .boardlist .group a[href="../"]::before { background-image: url("../art/ui/mypage.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="operations.html"]::before { background-image: url("../art/ui/ops.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="roster.html"]::before { background-image: url("../art/ui/roster.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="daily.html"]::before { background-image: url("../art/ui/daily.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="shop.html"]::before { background-image: url("../art/shop/icon16.gif"); }
html:not(.kb-arts-off) .boardlist .group a[href$="shop.html#salvage"]::before { background-image: url("../art/salvage/icon16.gif"); }
html:not(.kb-arts-off) .boardlist .group a[href$="base.html"]::before { background-image: url("../art/ui/base.png"); } /* 番小屋(tools/art/base.py) */
html:not(.kb-arts-off) .boardlist .group a[href$="nikka.html"]::before { background-image: url("../art/ui/nikka.png"); } /* 日課(tools/art/nikka.py) */
html:not(.kb-arts-off) .boardlist .group a[href$="trade.html"]::before { background-image: url("../art/ui/trade.png"); } /* 融通所(tools/art/trade_icons.py) */
html:not(.kb-arts-off) .boardlist .group a[href$="wboss.html"]::before { background-image: url("../art/ui/wboss.png"); } /* 合同照会(絵の担当。pi-wboss と同じ絵) */
html:not(.kb-arts-off) .boardlist .group a[href$="hold.html"]::before { background-image: url("../art/ui/hold.png"); } /* 水際(絵の担当。pi-hold と同じ絵) */
html:not(.kb-arts-off) .boardlist .group a[href$="guild.html"]::before { background-image: url("../art/ui/guild.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="tide.html"]::before { background-image: url("../art/ui/tide.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="corridor.html"]::before { background-image: url("../art/ui/corridor.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="jobs.html"]::before { background-image: url("../art/ui/jobs.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="expedition.html"]::before { background-image: url("../art/ui/expedition.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="operations.html#pursuit"]::before { background-image: url("../art/ui/pursuit.png"); } /* 追討(tools/art/pursuit.py)。href が #pursuit で終わるので上の operations.html の規則には当たらない */
html:not(.kb-arts-off) .boardlist .group a[href$="#tutorial"]::before { background-image: url("../art/ui/guide.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="builder.html"]::before { background-image: url("../art/ui/builder.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="intruder.html"]::before { background-image: url("../art/ui/intruder.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="hack.html"]::before { background-image: url("../art/ui/hack.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="inventory.html"]::before { background-image: url("../art/ui/vault.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="tips.html"]::before { background-image: url("../art/ui/tips.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="news.html"]::before { background-image: url("../art/ui/news.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="mail.html"]::before { background-image: url("../art/ui/mail.png"); }
html:not(.kb-arts-off) .boardlist .group a[href$="settings.html"]::before { background-image: url("../art/ui/settings.png"); }

/* リンクは押せることが分かるよう、下線を点線で(いま開いているページは下線なし) */
.boardlist .group a:link,
.boardlist .group a:visited {
	text-decoration: underline dotted;
	text-underline-offset: 3px;
}
.boardlist .group a[aria-current="page"] { text-decoration: none; }

/* ------------------------------------------------------------ ヘッダーのカテゴリ(2026-11-17 制作者の要望。assets/js/nav-fold.js・docs/ui-design.md §3.13)
   1段目 = 常設の4つ(top・マイページ・お知らせ・電報)+ カテゴリ名(.nc-b)、2段目 = 開いているカテゴリのリンク(.nc-l)。
   .nc は display: contents にして、ボタンを1段目へ・リンクの束(order: 1)を2段目へ並べる。
   開閉は .nc.is-open(HTML が「いまのページのカテゴリ」に最初から付ける。JS が押された分を付け替える)。カテゴリに属さないページは
   boot.js が <html data-nav-cat> に最後に開いたカテゴリを付けるので、それを JS の前の描く前から開く(nav-fold.js が .is-open と data-nav-set に引き継ぐ)。
   JS が無いとき(html に kb-boot / kb-ready が無い)は閉じる規則を当てず、全部のリンクが見える(ボタンは押せないただの札)。 */
.boardlist .group:has(> .nc) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	column-gap: .45em;
}

.boardlist .group > .nc { display: contents; }

.boardlist .group .nc-l {
	display: flex;
	flex: 1 0 100%;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	order: 1;
	column-gap: .45em;
	margin-top: 3px;
	padding: 3px 0 1px;
	border-top: 1px dotted var(--line-hi);
}

/* トップページは本文の幅が狭い(670px)ので、1段目(常設4つ + カテゴリ5つ)が1行に収まるよう間を詰める(「深部」だけ次の行に落ちていた。2026-11-18 制作者の指摘) */
@media (min-width: 760px) {
	.page-title .boardlist .group:has(> .nc) { column-gap: .12em; }
	.page-title .boardlist .group .nc-b { padding-inline: 5px; }
}

html:is(.kb-boot, .kb-ready) .boardlist .group .nc-l { display: none; }

html:is(.kb-boot, .kb-ready) .boardlist .group .nc.is-open > .nc-l,
html[data-nav-cat="duty"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="duty"] > .nc-l,
html[data-nav-cat="supply"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="supply"] > .nc-l,
html[data-nav-cat="build"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="build"] > .nc-l,
html[data-nav-cat="guide"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="guide"] > .nc-l,
html[data-nav-cat="deep"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="deep"] > .nc-l { display: flex; }

.nc-b {
	position: relative;
	margin: 0;
	padding: 1px 8px;
	color: var(--sub);
	background: none;
	border: 1px solid var(--line);
	font: inherit;
	line-height: 1.5;
	white-space: nowrap;
	cursor: pointer;
}

html:is(.kb-boot, .kb-ready) .nc-b::after { content: " \25BE"; color: var(--muted); }

/* カテゴリ名のアイコン(tools/art/cat_icons.py。2026-11-22)。PC は文字の前(::before)、スマホの格子は文字の前(::after に order: -1。::before は角の三角に使う) */
.nc[data-cat="duty"] > .nc-b { --nci: url("../art/ui/cat_duty.png"); }
.nc[data-cat="supply"] > .nc-b { --nci: url("../art/ui/cat_supply.png"); }
.nc[data-cat="build"] > .nc-b { --nci: url("../art/ui/cat_build.png"); }
.nc[data-cat="guide"] > .nc-b { --nci: url("../art/ui/cat_guide.png"); }
.nc[data-cat="deep"] > .nc-b { --nci: url("../art/ui/cat_deep.png"); }
html:not(.kb-arts-off) .nc-b::before {
	content: "";
	display: inline-block;
	width: 16px;
	height: 16px;
	margin-right: 3px;
	background: var(--nci, none) no-repeat center / 16px 16px;
	image-rendering: pixelated;
	vertical-align: -3px;
}

.nc-b:hover,
.nc-b:focus-visible {
	color: var(--fg);
	border-color: var(--fg);
}

.nc-b:focus-visible {
	outline: 1px dotted var(--fg);
	outline-offset: 2px;
}

/* いまのページのカテゴリ: 文字を明るく、下に灯の線 */
.nc-b[aria-current="true"] {
	color: var(--fg-hi);
	border-color: var(--line-hi);
	box-shadow: inset 0 -2px 0 var(--fg);
}

/* 開いているカテゴリ */
html .boardlist .group .nc.is-open > .nc-b,
html[data-nav-cat="duty"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="duty"] > .nc-b,
html[data-nav-cat="supply"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="supply"] > .nc-b,
html[data-nav-cat="build"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="build"] > .nc-b,
html[data-nav-cat="guide"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="guide"] > .nc-b,
html[data-nav-cat="deep"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="deep"] > .nc-b {
	color: var(--fg-hi);
	background: var(--bg-2);
	border-color: var(--fg);
}

html:is(.kb-boot, .kb-ready) .boardlist .group .nc.is-open > .nc-b::after,
html[data-nav-cat="duty"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="duty"] > .nc-b::after,
html[data-nav-cat="supply"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="supply"] > .nc-b::after,
html[data-nav-cat="build"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="build"] > .nc-b::after,
html[data-nav-cat="guide"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="guide"] > .nc-b::after,
html[data-nav-cat="deep"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="deep"] > .nc-b::after { content: " \25B4"; color: var(--fg); }

/* JS の前(boot.js だけ)はボタンを押せない札として出す */
html:not(.kb-boot):not(.kb-ready) .nc-b { cursor: default; pointer-events: none; }

/* 中のリンクに印があるとき(出勤簿の「!」・大潮の開催中など): 閉じていても分かるようにカテゴリ名の右上に四角(nav-fold.js)。開いている間は出さない */
.nc-b .nc-dot {
	position: absolute;
	top: -3px;
	right: -3px;
	width: 7px;
	height: 7px;
	background: var(--warn);
	box-shadow: 0 0 0 1px var(--bg);
}

.nc-b .nc-dot.is-tide { background: var(--cyan); }
.nc-b .nc-dot[hidden],
html .boardlist .group .nc.is-open > .nc-b .nc-dot,
html[data-nav-cat="duty"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="duty"] > .nc-b .nc-dot,
html[data-nav-cat="supply"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="supply"] > .nc-b .nc-dot,
html[data-nav-cat="build"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="build"] > .nc-b .nc-dot,
html[data-nav-cat="guide"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="guide"] > .nc-b .nc-dot,
html[data-nav-cat="deep"] .boardlist .group:not([data-nav-set]):not(:has(.nc.is-open)) .nc[data-cat="deep"] > .nc-b .nc-dot { display: none; }

/* スマホ幅のヘッダーの格子(上の「ヘッダーの並び」の続き。下線・アイコンの規則より後に置く)。
   区切りを span(.gb)に包んだ nav だけ(管理画面の「[ ゲームのトップへ ]」は文字の区切りのまま) */
/* スマホ幅: サイト内リンクを横3列の格子に(アイコンとラベルを各セルの左にそろえる。区切りは出さない)。
   6列の格子に1項目2列ずつ置き、端数の行は残りの幅を分け合う(2項目なら半分ずつ、1項目なら全幅)。 */
@media (max-width: 640px) {
	.boardlist .group:has(> .gb) {
		display: grid;
		grid-template-columns: repeat(60, minmax(0, 1fr)); /* 常設4つ = 各15(4つで1行)、カテゴリ5つ = 各12(5つで1行)、下の段 .nc-l は全幅で3つずつ */
		gap: 4px;
		width: 100%;
		margin: 0;
		text-align: left;
	}

	.mainblock > .boardlist > .group:has(> .gb) { justify-self: stretch; }

	.boardlist .group:has(> .gb) .gb,
	.boardlist .group:has(> .gb) .gs { display: none; }


	.boardlist .group:has(> .gb) a {
		position: relative;
		display: block;
		min-width: 0;
		min-height: 38px;
		padding: 0 4px;
		overflow: hidden;
		color: var(--fg);
		background: var(--bg-1);
		border: 1px solid var(--line);
		line-height: 36px;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	/* 常設4つは1行に並べる(top 12・マイページ 18・お知らせ 16・電報 14 = 60。長い「マイページ」に多く)ので、文字を少し詰める(「マイページ」が390pxで切れないように) */
	.boardlist .group:has(> .gb) > a { grid-column: span 15; padding: 0 3px; font-size: 12px; letter-spacing: -.02em; }
	.boardlist .group:has(> .gb) > a:nth-of-type(1) { grid-column: span 12; }
	.boardlist .group:has(> .gb) > a:nth-of-type(2) { grid-column: span 18; }
	.boardlist .group:has(> .gb) > a:nth-of-type(3) { grid-column: span 16; }
	.boardlist .group:has(> .gb) > a:nth-of-type(4) { grid-column: span 14; }

	/* 下の段(開いたカテゴリのリンク): 3つずつ。端数の行は残りの幅を分け合う(flex-grow) */
	/* 下の段は3つずつ・同じ幅(余った1つを横いっぱいに伸ばさない。4つのカテゴリは2つずつ。2026-11-18 制作者の指摘) */
	.boardlist .group:has(> .gb) .nc-l a { flex: 0 0 calc((100% - 8px) / 3); }
	.boardlist .group:has(> .gb) .nc-l:has(> a:nth-of-type(4)):not(:has(> a:nth-of-type(5))) a { flex-basis: calc((100% - 4px) / 2); }

	.boardlist .group:has(> .gb) a:link,
	.boardlist .group:has(> .gb) a:visited { text-decoration: none; }

	.boardlist .group:has(> .gb) a:hover,
	.boardlist .group:has(> .gb) a:focus-visible {
		background: var(--bg-2);
		border-color: var(--line-hi);
	}

	/* いま開いているページ: 枠を明るく、左に灯の線 */
	.boardlist .group:has(> .gb) a[aria-current="page"] {
		color: var(--fg-hi);
		background: var(--bg-2);
		border-color: var(--fg);
		box-shadow: inset 3px 0 0 var(--fg);
	}

	html:not(.kb-arts-off) .boardlist .group:has(> .gb) a::before { margin-right: 4px; }
	html:not(.kb-arts-off) .boardlist .group:has(> .gb) > a::before { margin-right: 2px; }

	/* 未読の印(お知らせの NEW・電報の件数)はセルの右上に重ねる(ラベルを押し出さない) */
	.boardlist .group:has(> .gb) a > span {
		position: absolute;
		top: 1px;
		right: 2px;
		margin: 0;
		line-height: 1.2;
	}

	/* いちばん長いラベル(チュートリアル・7文字)が 360px でも切れないよう、狭い端末では少しだけ詰める */
	@media (max-width: 380px) {
		.boardlist .group:has(> .gb) a { padding: 0 3px; font-size: 11px; letter-spacing: -.02em; }
		html:not(.kb-arts-off) .boardlist .group:has(> .gb) a::before { margin-right: 3px; }
	}

	/* カテゴリ名(1段目): 5つで1行。下の段(.nc-l)は全幅で3つずつ */
	.boardlist .group:has(> .gb) .nc-b {
		grid-column: span 12;
		min-width: 0;
		min-height: 38px;
		padding: 0 2px;
		overflow: visible;
		font-size: var(--fs-s);
		text-align: center;
	}

	.boardlist .group:has(> .gb) .nc-b { display: inline-flex; align-items: center; justify-content: center; gap: 3px; }
	.boardlist .group:has(> .gb) .nc-b::after { content: none !important; }
	html:not(.kb-arts-off) .boardlist .group:has(> .gb) .nc-b::after {
		content: "" !important;
		order: -1;
		flex: none;
		width: 16px;
		height: 16px;
		margin: 0;
		background: var(--nci, none) no-repeat center / 16px 16px;
		image-rendering: pixelated;
	}

	.boardlist .group:has(> .gb) .nc-b::before {
		margin: 0;
		background: none;
		vertical-align: baseline;
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		width: 0;
		height: 0;
		border-style: solid;
		border-width: 5px 5px 0 0;
		border-color: var(--muted) transparent transparent transparent;
	}

	.boardlist .group:has(> .gb) .nc-l {
		grid-column: 1 / -1;
		gap: 4px;
		margin: 0;
		padding: 0;
		border: 0;
	}

	/* ID チップ・帯域: リンクの格子の下に1行(左端に BGM のボタン、チップは左、帯域は右。アカウントの名前は省略記号で縮める) */
	.mainblock > .boardlist { grid-template-columns: auto minmax(0, 1fr); }
	.mainblock > .boardlist > .snd-slot { grid-column: 1; margin: 2px 0 0 -4px; }
	.mainblock > .boardlist > .auth-slot { grid-column: 2; }

	.mainblock > .boardlist > .auth-slot {
		justify-self: stretch;
		justify-content: space-between;
		margin: 2px 0 0;
	}
}

/* ------------------------------------------------------------ ヘッダーの折り畳み(assets/js/nav-fold.js。2026-11-16 制作者の指摘)
   狭い画面(幅 859px 以下・高さ 500px 以下 = スマホ・タブレット縦・スマホの横持ち)では、サイト内リンク(.group)を既定で畳み、
   [≡ メニュー]・今いるページ・印の要約の1行(.nav-fold)だけを出す。開くと今までの格子。
   開いた状態は <html class="kb-nav-open">(boot.js が描く前に控え kb.ui.nav から付ける)。PC 幅は .nav-fold を出さない。
   .nav-fold は JS が .group の前に入れるので、JS が動かないときはリンクがそのまま出る。docs/ui-design.md §3.13 */
.nav-fold { display: none; }

/* 畳む幅は 859px 以下(2026-11-23 制作者の決定。以前は 759px 以下)。6カテゴリ + 常設が1段に収まる最小の幅は実測で 820px
   (深部が開いた状態・いまいるカテゴリに ▴ が付いた状態。ヘッダー幅は 100vw - 48px)。それ未満の 760〜819px で2段に折れていたので、
   余裕 40px を見て 860px 未満を畳む。本文の作り(PC / スマホの 759px)の切り替え幅とは別。nav-fold.js の FOLD_MQ と同じ値 */
@media (max-width: 859px), (max-height: 500px) {
	.boardlist > .nav-fold {
		display: flex;
		align-items: center;
		gap: 8px;
		min-width: 0;
		min-height: 44px;
		text-align: left;
	}

	html:not(.kb-nav-open) .boardlist > .nav-fold ~ .group { display: none; }

	.mainblock > .boardlist > .nav-fold { grid-row: 1; grid-column: 1 / -1; }
	.mainblock > .boardlist > .nav-fold ~ .group { grid-row: 2; margin-top: 2px; margin-bottom: 4px; }
	.mainblock > .boardlist > .nav-fold ~ .snd-slot,
	.mainblock > .boardlist > .nav-fold ~ .auth-slot { grid-row: 3; }

	/* 防壁構築・侵入構築(.kb-top の flex): 1段まるごと、格子より前 */
	.kb-top .boardlist > .nav-fold { flex: 1 0 100%; order: -3; }
	.kb-top .boardlist > .nav-fold ~ .group { flex: 1 0 100%; order: -2; }

	.nav-fold-btn {
		position: relative;
		display: inline-flex;
		flex: none;
		align-items: center;
		gap: 6px;
		min-height: 36px;
		margin: 0;
		padding: 0 10px 0 8px;
		color: var(--fg);
		background: var(--bg-1);
		border: 1px solid var(--line-hi);
		font: inherit;
		font-size: var(--fs-s);
		line-height: 1;
		white-space: nowrap;
		cursor: pointer;
	}

	/* 押せる範囲は上下に広げて 44px(見た目は格子のセルに近い 36px) */
	.nav-fold-btn::after { content: ""; position: absolute; top: -4px; right: 0; bottom: -4px; left: 0; }

	.nav-fold-btn .nf-ic {
		display: inline-block;
		width: 1em;
		color: var(--fg-hi);
		font-size: var(--fs-m);
		text-align: center;
	}

	.nav-fold-btn:hover,
	.nav-fold-btn[aria-expanded="true"] {
		background: var(--bg-2);
		border-color: var(--fg);
	}

	.nav-fold-btn:focus-visible {
		outline: 1px dotted var(--fg);
		outline-offset: 2px;
	}

	/* 畳んだリンクのどこかに印がある: ボタンの右上に琥珀の四角(開いている間は格子に印が見えるので出さない) */
	.nav-fold-btn .nf-dot {
		position: absolute;
		top: -3px;
		right: -3px;
		width: 7px;
		height: 7px;
		background: var(--warn);
		box-shadow: 0 0 0 1px var(--bg);
	}

	.nav-fold-btn .nf-dot[hidden],
	.nav-fold-btn[aria-expanded="true"] .nf-dot { display: none; }

	.nf-here {
		display: inline-flex;
		flex: 1 1 auto;
		gap: 5px;
		min-width: 0;
		overflow: hidden;
		color: var(--fg-hi);
		white-space: nowrap;
	}

	.nf-here-k { color: var(--muted); }
	.nf-here-v { overflow: hidden; text-overflow: ellipsis; }

	/* 印の要約(畳んでいる間だけ。押すとその項目へ) */
	.nf-marks {
		display: inline-flex;
		flex: 0 1 auto;
		gap: 4px;
		min-width: 0;
		overflow: hidden;
	}

	html.kb-nav-open .nf-marks { display: none; }

	.nf-mk {
		display: inline-flex;
		flex: none;
		align-items: center;
		gap: 3px;
		min-height: 30px;
		padding: 0 5px;
		color: var(--fg);
		background: var(--bg-1);
		border: 1px solid var(--line);
		font-size: var(--fs-xs);
		white-space: nowrap;
	}

	.nf-mk:link,
	.nf-mk:visited { color: var(--fg); text-decoration: none; }
	.nf-mk:hover { border-color: var(--line-hi); }
	.nf-mk.is-tide,
	.nf-mk.is-tide:link,
	.nf-mk.is-tide:visited { color: var(--cyan); border-color: var(--cyan); }

	.nf-mk-b {
		padding: 0 3px;
		color: var(--bg);
		background: var(--alert);
		font-weight: bold;
		line-height: 1.4;
	}

	.nf-mk.is-daily { border-color: var(--warn); }
	.nf-mk.is-daily .nf-mk-b { background: var(--warn); }

	/* とても狭い画面: 印の要約はラベルを省いて印だけ(読み上げは aria-label) */
	@media (max-width: 380px) {
		.nf-mk-l { display: none; }
		.nf-mk.is-tide .nf-mk-l { display: inline; }
	}
}

/* 開閉できる区画(details)は ▶/▼ を必ず見せる。件数は summary の中の .n に */
details > summary {
	cursor: pointer;
}

/* 狭い画面: ボタンの枠と文字の間の余白を詰める(min-width をやめる) */
@media (max-width: 559px) {
	.btn {
		min-width: 0;
		padding: 6px 12px;
	}

	.btn.sm {
		padding: 2px 6px;
	}

	.deckbar .btn.sm,
	.deckbar .btn.primary {
		gap: 2px;
	}
}

/* ページの見出しの頭のアイコン(ヘッダーのリンクと同じ絵。どの入口から来たページか分かるように) */
h1 > .pi.x2 { margin-right: 8px; vertical-align: -6px; }

/* ページの見出し(新式。全ページ共通。2026-11-23「見出しとボタンの統一」。手本はジョブ)
   頭に 32px(.pi.x2)のアイコン + 題名 + 点滅カーソル。色 --fg-hi・--display・--fs-xl。
   見出しの下の一言(p.dim)・状態の行は .pg-head の中に置く。.is-alert は「侵入」だけ(赤は攻性と危険だけ) */
.pg-head { margin: 6px 0 10px; }
.pg-h1 {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: var(--fg-hi);
	font-family: var(--display);
	font-size: var(--fs-xl);
	letter-spacing: .06em;
	overflow-wrap: anywhere;
}
.pg-h1.is-alert { color: var(--alert-hi); }

/* ============================================================ 抽出品(個体)の共通部品
   ティアの札・絵のティアの枠・付加効果・標準カードとの比較(assets/js/ops/items.js)。
   作戦記録・保管庫・構築画面に加えて、カードの詳細(card-info.js)で当直表・お知らせ・侵入でも使うので kb.css に置く */

.x-tier {
	display: inline-block;
	padding: 0 4px;
	border: 1px solid currentColor;
	font-size: var(--fs-xs);
	line-height: 1.4;
	white-space: nowrap;
}

.x-tier.x-t1 { color: var(--tier-t1); }
.x-tier.x-t2 { color: var(--tier-t2); }
.x-tier.x-t3 { color: var(--tier-t3); }
.x-tier.x-t4 { color: var(--bg); background: var(--tier-t4); border-color: var(--tier-t4); }

/* 絵のティアの枠(base の絵 + 枠) */
.kb-art[data-tier] { outline: 2px solid var(--tier-t1); outline-offset: -2px; }
.kb-art[data-tier="t2"] { outline-color: var(--tier-t2); }
.kb-art[data-tier="t3"] { outline-color: var(--tier-t3); box-shadow: 0 0 6px rgba(111, 214, 232, .45); }
.kb-art[data-tier="t4"] { outline-color: var(--tier-t4); box-shadow: 0 0 8px rgba(199, 155, 255, .55); }

.x-ax {
	margin: 4px 0 0;
	padding: 0;
	list-style: none;
	font-size: var(--fs-s);
}

.x-ax li {
	display: flex;
	flex-wrap: wrap;
	gap: 0 6px;
	padding: 1px 0;
}

.x-ax-k {
	flex: none;
	padding: 0 3px;
	font-size: var(--fs-xs);
	line-height: 1.5;
}

.x-ax-good .x-ax-k { color: var(--bg); background: var(--fg); }
.x-ax-bad .x-ax-k { color: var(--bg); background: var(--wet); }
.x-ax-bad .x-ax-t { color: var(--wet); }
.x-ax-n { color: var(--fg-hi); font-weight: normal; }
.x-ax.is-compact { font-size: var(--fs-xs); }
.x-ax-none { margin: 4px 0 0; font-size: var(--fs-xs); }

.x-wet {
	padding: 0 4px;
	color: var(--bg);
	background: var(--wet);
	font-size: var(--fs-xs);
}

.x-up { color: var(--fg-hi); }
.x-down { color: var(--wet); }

.x-cmp {
	border-collapse: collapse;
	font-size: var(--fs-s);
}

.x-cmp th,
.x-cmp td {
	padding: 2px 10px 2px 0;
	border-bottom: 1px dotted var(--line);
	text-align: left;
}

.x-cmp td.num,
.x-cmp th.num { text-align: right; }
.x-cmp thead th { color: var(--sub); font-weight: normal; font-size: var(--fs-xs); }

/* ============================================================ カードの詳細(assets/js/card-info.js。docs/ui-design.md §3.12)
   名前のボタン = 点線の下線 + 小さな「i」。押すと PC は近くに小さなパネル、559px 以下は画面下からのシート */

.ci-btn {
	display: inline;
	padding: 0;
	color: inherit;
	background: none;
	border: 0;
	font: inherit;
	text-align: inherit;
	text-decoration: underline dotted;
	text-decoration-color: var(--sub);
	text-underline-offset: 3px;
	cursor: pointer;
}

.ci-btn > .ci-l > b,
.ci-btn > .ci-l { text-decoration: inherit; }

.ci-btn:hover,
.ci-btn[aria-expanded="true"] {
	color: var(--fg-hi);
	text-decoration-style: solid;
	text-decoration-color: currentColor;
}

.ci-btn:focus-visible {
	outline: 1px dashed var(--fg-hi);
	outline-offset: 2px;
}

/* 「i」の印(押せることが分かるように。色だけに頼らない) */
.ci-i {
	display: inline-block;
	width: 13px;
	height: 13px;
	margin-left: 3px;
	color: var(--sub);
	border: 1px solid currentColor;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 10px;
	font-style: italic;
	font-weight: bold;
	line-height: 11px;
	text-align: center;
	text-decoration: none;
	vertical-align: 1px;
}

.ci-btn:hover .ci-i,
.ci-btn[aria-expanded="true"] .ci-i {
	color: var(--bg);
	background: var(--fg-hi);
	border-color: var(--fg-hi);
}

/* 指で押す端末は、行の高さを変えずに押せる幅を少し広げる */
@media (pointer: coarse) {
	.ci-btn { padding: 4px 0; margin: -4px 0; }
	.ci-i { width: 15px; height: 15px; line-height: 13px; font-size: 11px; }
}

.ci-pop {
	position: fixed;
	z-index: 900;
	display: flex;
	flex-direction: column;
	max-width: calc(100vw - 16px);
	color: var(--fg);
	background: var(--bg-1);
	border: 1px solid var(--fg);
	box-shadow: 0 8px 28px rgba(0, 0, 0, .75);
	font-family: var(--mono);
	font-size: var(--fs-s);
	line-height: 1.55;
	text-align: left;
	white-space: normal;
	overflow: hidden;
}

.ci-pop:focus { outline: none; }

.ci-head {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: none;
	padding: 3px 4px 3px 8px;
	color: var(--bg);
	background-color: var(--fg);
	background-image: repeating-linear-gradient(0deg, rgba(11, 0, 15, .1) 0 1px, transparent 1px 3px);
}

.ci-band {
	font-size: var(--fs-xs);
	letter-spacing: .06em;
	opacity: .8;
}

.ci-name {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	font-family: var(--sans);
	font-size: var(--fs-m);
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.ci-kana {
	margin-left: 4px;
	font-size: var(--fs-xs);
	font-weight: normal;
}

.ci-head .ci-x {
	flex: none;
	width: 28px;
	height: 28px;
	color: var(--bg);
	border-color: var(--bg);
}

.ci-head .ci-x:hover,
.ci-head .ci-x:focus-visible {
	color: var(--fg);
	background: var(--bg);
}

.ci-body {
	display: grid;
	gap: 8px;
	padding: 10px 12px 12px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.ci-body p { margin: 0; }

.ci-top {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	min-width: 0;
}

.ci-top > .kb-art { flex: none; }

.ci-top-b {
	display: grid;
	gap: 6px;
	flex: 1 1 auto;
	min-width: 0;
}

.ci-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
}

.ci-type { color: var(--sub); font-size: var(--fs-xs); }

.ci-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 12px;
}

.ci-st { white-space: nowrap; }
.ci-st b { color: var(--fg-hi); font-weight: normal; }

.ci-k {
	margin-right: 4px;
	color: var(--sub);
	font-size: var(--fs-xs);
}

.ci-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0 8px;
	font-size: var(--fs-xs);
}

.ci-text {
	padding: 6px 8px;
	color: var(--fg-hi);
	background: var(--bg);
	border-left: 2px solid var(--line-hi);
	font-size: var(--fs-m);
	line-height: 1.6;
}

.ci-req { color: var(--warn); }
.ci-req .ci-k { color: var(--warn); }

.ci-inst {
	display: grid;
	gap: 4px;
	padding-top: 6px;
	border-top: 1px dotted var(--line);
}

.ci-h {
	margin: 0;
	font-size: var(--fs-s);
	font-weight: normal;
	color: var(--fg-hi);
}

.ci-inst .x-cmp { width: 100%; }

.ci-tiers {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 6px;
}

.ci-note {
	color: var(--sub);
	font-size: var(--fs-xs);
}

.ci-note.is-lock { color: var(--warn); }

/* 共用線の品のリンクの写し(card-info の任意の asOf・owner。docs/chat-link-design.md §4.2): 詳細の頭に「持ち主 · 11/24 21:03 の時点」を --sub で1行 */
.ci-asof {
	display: flex;
	flex-wrap: wrap;
	gap: 0 8px;
	flex: none;
	margin: 0;
	padding: 4px 12px 0;
	color: var(--sub);
	font-size: var(--fs-xs);
	overflow-wrap: anywhere;
}
.ci-asof .ci-owner { color: var(--fg); }

/* 詳細の末尾の操作(card-info の任意の actions。② 取引の [この品で申し込む] の場所。空なら出さない) */
.ci-acts { display: flex; flex-wrap: wrap; gap: 6px; }

.ci-flavor {
	color: var(--sub);
	font-family: var(--sans);
	font-size: var(--fs-xs);
	font-style: italic;
}

.ci-wait { color: var(--sub); }

/* スマホ: 画面下からのシート(外側は暗くして、押すと閉じる) */
.ci-scrim {
	position: fixed;
	inset: 0;
	z-index: 899;
	background: rgba(3, 0, 5, .62);
}

.ci-pop.is-sheet {
	left: 0;
	right: 0;
	bottom: 0;
	top: auto;
	width: auto;
	max-width: none;
	max-height: 78vh;
	max-height: 78dvh;
	border-width: 1px 0 0;
	box-shadow: 0 -8px 28px rgba(0, 0, 0, .8);
	padding-bottom: max(env(safe-area-inset-bottom, 0px), var(--kb-sa-b, 0px));
}

.ci-pop.is-sheet .ci-head { padding: 6px 6px 6px 10px; }
.ci-pop.is-sheet .ci-head .ci-x { width: 40px; height: 40px; }
.ci-pop.is-sheet .ci-text { font-size: var(--fs-m); }

@media (max-width: 380px) {
	.ci-top > .kb-art.kb-art--lg { --art: 64px; }
}

@media (prefers-reduced-motion: no-preference) {
	.ci-pop.is-sheet { animation: ci-up .16s ease-out; }
	@keyframes ci-up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
}

html:not(.kb-arts) .ci-top > .kb-art { display: none; }

/* ============================================================ 右下の近道(assets/js/fab.js。全ページ。docs/ui-design.md §3.15)
   最初は畳んだ小さなボタン1つ。開くと左へ ホーム・保管庫・侵入構築・リロード が並ぶ(ユーザーが畳むまで開いたまま)。
   開いた項目は半透明(触れている間・キーボードで選んでいる間は濃く)。畳んだボタンは不透明で目立たせる(2026-11-16)。画面下の操作と重なるときは fab.js が --fab-lift でずらす。 */

.fab {
	position: fixed;
	right: calc(8px + max(env(safe-area-inset-right, 0px), var(--kb-sa-r, 0px)));
	bottom: calc(8px + max(env(safe-area-inset-bottom, 0px), var(--kb-sa-b, 0px)) + var(--fab-lift, 0px));
	z-index: 150; /* トースト(200)・ダイアログより下、ページの内容より上 */
	display: flex;
	align-items: flex-end;
	gap: 4px;
	opacity: .62;
	transition: opacity .15s ease;
	font-family: var(--mono);
}

.fab:hover,
.fab:focus-within,
.fab[data-open="1"] { opacity: .9; }

.fab[hidden],
.fab.is-away,
html.ci-sheet-on .fab { display: none; }

.fab-t,
.fab-i {
	display: grid;
	place-items: center;
	align-content: center;
	gap: 1px;
	min-width: 40px;
	height: 40px;
	margin: 0;
	padding: 0 4px;
	color: var(--fg);
	background: rgba(18, 8, 24, .88);
	border: 1px solid var(--line-hi);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .55);
	font: inherit;
	font-size: 10px;
	line-height: 1.1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

.fab-t {
	grid-auto-flow: column;
	width: 40px;
	padding: 0;
}

.fab-t .pi,
.fab-i .pi { margin: 0; }

/* 畳んでいるとき(2026-11-16 制作者の指摘「目立たなすぎる」で強めた。以前は 32px・半透明 .45):
   不透明の地・明るい緑の枠の二重線(ドット風)・アイコンの下に「近道」の札で、押せるボタンだと一目で分かるように。
   ヘッダーの [≡ メニュー](横長の [ ] ボタン)と紛れないよう、四角い札の形とドット絵の4区画のアイコンのまま。
   大きさは 40×44px(本文に掛かる面積を増やしすぎない)。このタブで最初に出たときだけ、数秒ゆっくり光る(.is-hint) */
.fab[data-open="0"] { opacity: 1; }
.fab[data-open="0"] .fab-t {
	grid-auto-flow: row;
	gap: 2px;
	width: 40px;
	min-width: 40px;
	height: 44px;
	color: var(--fg-hi);
	background: var(--bg-1);
	border-color: var(--fg);
	box-shadow: inset 0 0 0 1px var(--bg-1), inset 0 0 0 2px var(--line-hi), 0 2px 8px rgba(0, 0, 0, .7);
}
.fab[data-open="0"] .fab-t:hover {
	background: var(--bg-2);
	border-color: var(--fg-hi);
}
.fab-tl { display: none; font-size: 9px; letter-spacing: .04em; line-height: 1; }
.fab[data-open="0"] .fab-tl { display: block; }
html.kb-arts-off .fab[data-open="0"] .fab-t::before { line-height: 1; }

@media (prefers-reduced-motion: no-preference) {
	.fab.is-hint[data-open="0"] .fab-t { animation: fab-hint 1.6s ease-in-out 3; }
}

@keyframes fab-hint {
	0%, 100% { box-shadow: inset 0 0 0 1px var(--bg-1), inset 0 0 0 2px var(--line-hi), 0 2px 8px rgba(0, 0, 0, .7); }
	50% { box-shadow: inset 0 0 0 1px var(--bg-1), inset 0 0 0 2px var(--fg), 0 0 0 2px rgba(127, 221, 87, .35), 0 0 14px rgba(127, 221, 87, .55); }
}

/* 近道が出ている間は、ページの末尾(フッター)に近道の高さぶんの余白を足す(末尾までスクロールすれば、近道の下に隠れる操作が無い) */
html.fab-on .site-footer { padding-bottom: calc(28px + 48px + max(env(safe-area-inset-bottom, 0px), var(--kb-sa-b, 0px))); }

/* 開いているときは「›」(畳む向き)を添える。畳んでいるときはアイコンだけ */
.fab-x { display: none; color: var(--sub); font-size: 14px; }
.fab[data-open="1"] .fab-t { width: 44px; }
.fab[data-open="1"] .fab-x { display: inline; }

.fab-menu {
	display: flex;
	gap: 4px;
}

.fab-menu[hidden] { display: none; }

.fab-i:link,
.fab-i:visited { color: var(--fg); text-decoration: none; }

.fab-i[aria-current="page"] { border-color: var(--fg); color: var(--fg-hi); }

.fab-t:hover,
.fab-i:hover {
	background: var(--bg-2);
	border-color: var(--fg);
}

.fab-t:focus-visible,
.fab-i:focus-visible {
	outline: 1px dashed var(--fg-hi);
	outline-offset: 2px;
}

.fab-l { font-size: 10px; }

/* 未読・未受け取りの印(電報の件数・出勤簿の「!」。mail-badge.js・daily-badge.js)は項目の右上に重ねる */
.fab-i { position: relative; }
.fab-i > .news-new {
	position: absolute;
	top: -5px;
	right: -4px;
	margin: 0;
	vertical-align: baseline;
}

/* 「文字だけ」の設定ではアイコンを出さない(.pi は消える)。畳んだボタンは文字で代わりに */
html.kb-arts-off .fab-t::before { content: "▦"; font-size: 16px; } /* ヘッダーの [≡ メニュー] と紛れないよう ≡ にしない(2026-11-16) */

/* 狭い画面(759px 以下)では左へ伸ばさず、畳むボタンの上へ縦に積む(2026-11-12 制作者の指摘③: 左へ伸びると本文の文字に掛かる)。
   項目が増えて画面の高さに入らないときは、近道の中だけ縦にスクロールする(上端はヘッダーの帯ぶん空ける)。
   畳むボタンは開いていても「›」ではなく「⌄」(下へ畳む向き) */
@media (max-width: 759px) {
	.fab {
		flex-direction: column;
		align-items: flex-end;
	}
	.fab-menu {
		flex-direction: column;
		align-items: stretch;
		max-height: calc(100vh - 40px - 4px - 16px - 56px - max(env(safe-area-inset-bottom, 0px), var(--kb-sa-b, 0px)) - max(env(safe-area-inset-top, 0px), var(--kb-sa-t, 0px)) - var(--fab-lift, 0px));
		max-height: calc(100dvh - 40px - 4px - 16px - 56px - max(env(safe-area-inset-bottom, 0px), var(--kb-sa-b, 0px)) - max(env(safe-area-inset-top, 0px), var(--kb-sa-t, 0px)) - var(--fab-lift, 0px));
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
	}
	.fab-menu .fab-i {
		flex: 0 0 auto;
		min-width: 48px;
	}
	.fab[data-open="1"] .fab-t { width: 48px; }
	.fab-x { transform: rotate(90deg); }
}

@media print {
	.fab { display: none; }
}

/* ------------------------------------------------------------ 共用線(全体チャット)と、ほかの部品の住み分け(docs/chat-design.md §3.2・DESIGN.md §4.13)
   左下のボタン・左の引き出しそのものの見た目は assets/css/gchat.css(gchat.js が読み込む)。ここは近道・トースト・フッターとの重なりだけ。
   html[data-gchat] は boot.js が描く前に付ける(off = 出さない / closed = ボタンだけ / open = 引き出しを開いている)。 */
/* PC のトーストは左下(幅 360px)で、左下のボタン(40×44px)と重なるので、ボタンがある間は上へ逃がす。引き出しを開いている間は引き出しの右へ */
@media (min-width: 760px) {
	html[data-gchat="closed"] .toasts,
	html[data-gchat="open"] .toasts { bottom: calc(60px + max(env(safe-area-inset-bottom, 0px), var(--kb-sa-b, 0px))); }
}
@media (min-width: 760px) and (min-height: 501px) {
	html[data-gchat="open"] .toasts { left: calc(var(--gc-w, 320px) + 12px); bottom: 12px; }
}
/* スマホ(画面いっぱいの引き出し)を開いている間は近道を隠す(引き出しが覆う) */
@media (max-width: 759px), (max-height: 500px) {
	html[data-gchat="open"] .fab { display: none; }
}
/* 防壁構築・侵入構築(PC)のカタログは画面の高さいっぱいの列の中でスクロールし、下端が左下のボタンに掛かる。
   一覧の末尾にボタンの高さぶんの余白を足し、最後の行もボタンの上まで送れるようにする(ボタンは動かさない) */
@media (min-width: 760px) {
	html[data-gchat="closed"] .col-cat .entries { padding-bottom: 56px; }
}
/* 近道が無くても左下のボタンがあれば、ページの末尾にボタンの高さぶんの余白(末尾の操作がボタンの下に隠れない) */
html[data-gchat="closed"] .site-footer { padding-bottom: calc(28px + 48px + max(env(safe-area-inset-bottom, 0px), var(--kb-sa-b, 0px))); }

/* ------------------------------------------------------------ 出勤簿の合図(2026-11-12 制作者の決定 C。assets/js/daily-badge.js・daily-strip.js)
   今日の当直手当が未受け取りの間: ヘッダーの「出勤簿」に琥珀の小さな印(電報の件数の印と同じ置き方)、
   トップの「出勤簿」ボタンと出勤簿の帯は琥珀でやわらかく明滅。動きを減らす設定では明滅させず、琥珀の枠と印だけ。
   トップの帯の [x](今日は閉じる)を押した日は明滅を止める(.is-daily-quiet。印は残す)。 */
/* 番小屋・遠征・日課の「!」も同じ琥珀の四角で点滅しない(DESIGN.md §3.2。2026-11-23 日課の統合で、赤の点滅になっていたのを揃えた) */
.news-new.daily-new,
.news-new.base-new,
.news-new.exp-new,
.news-new.nikka-new {
	background: var(--warn);
	color: #0b000f;
	animation: none; /* 印は点滅させない(明滅はトップのボタンと帯だけ) */
}

.mode-nav .mode-daily.is-daily-due,
.dl-strip.is-due {
	border-color: var(--warn);
	box-shadow: 0 0 0 1px var(--warn), 0 0 10px rgba(232, 193, 90, .35);
}

.mode-nav .mode-daily.is-daily-due:not(.mode-primary) { color: var(--warn); }

@keyframes daily-cue {
	0%, 100% { box-shadow: 0 0 0 1px var(--warn), 0 0 4px rgba(232, 193, 90, .2); background-color: rgba(232, 193, 90, .04); }
	50% { box-shadow: 0 0 0 2px var(--warn), 0 0 16px rgba(232, 193, 90, .6); background-color: rgba(232, 193, 90, .18); }
}

@media (prefers-reduced-motion: no-preference) {
	.mode-nav .mode-daily.is-daily-due:not(.is-daily-quiet),
	.dl-strip.is-due {
		animation: daily-cue 1.8s ease-in-out infinite;
	}
}

/* 底無階段の入口(未解放と分かっているとき。assets/js/corridor-view.js の markCorrLock): 少し沈めて鍵の印 */
.mode-nav .mode-corridor { border-color: #6a4a3d; }
.mode-nav .mode-jobs { border-color: #6a5a3d; }
.mode-nav .mode-expedition { border-color: #3d5a6a; }
.mode-nav .mode-pursuit { border-color: #6a5a2d; }
.mode-nav .mode-base { border-color: #2d5a4a; }
/* 番小屋の入口: 満杯・完成の印があるとき(assets/js/base-badge.js) */
.mode-base.is-base-alert, .pf-go.is-base.is-base-alert { border-color: var(--warn); color: var(--warn); }
.mode-nav .mode-nikka { border-color: #4a5a2d; }
/* 日課の入口: 今日まだ遊んでいないとき(assets/js/nikka-badge.js) */
.mode-nikka.is-nikka-fresh, .pf-go.is-nikka.is-nikka-fresh { border-color: var(--warn); color: var(--warn); }
.mode-corridor.is-locked, .mode-jobs.is-locked, .mode-expedition.is-locked, .mode-pursuit.is-locked, .fab-i.is-locked, .pf-go.is-locked { opacity: .6; }
.mode-corridor.is-locked::after, .mode-jobs.is-locked::after, .mode-expedition.is-locked::after, .mode-pursuit.is-locked::after, .fab-i.is-locked::after, .pf-go.is-locked::after { content: " (未解放)"; font-size: .8em; color: var(--warn); }
/* 帰ってきた遠征がある入口(assets/js/expedition-badge.js) */
.mode-expedition.is-exp-back { border-color: var(--warn); color: var(--warn); }
.fab-i.is-locked::after { content: ""; }

/* ============================================================ 大潮の四夜の入口(assets/js/tide-badge.js。開催の予定があるときだけ出る) */

.boardlist .group a.is-tide-open { color: var(--cyan); }
.mode-nav .mode-tide { border-color: #3d6a8a; }
.mode-nav .mode-tide.is-tide-open { color: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), 0 0 10px rgba(111, 214, 232, .35); }
.tide-entry { margin: 8px 0; }
.tide-entry[hidden] { display: none; }
.tide-strip {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	padding: 8px 10px;
	border: 1px solid #3d6a8a;
	background: linear-gradient(90deg, rgba(29, 58, 90, .55), rgba(16, 35, 61, .25));
	color: var(--fg);
	text-align: left;
	text-decoration: none;
}
.tide-strip:link, .tide-strip:visited { color: var(--fg); text-decoration: none; }
.tide-strip:hover, .tide-strip:focus-visible { background: linear-gradient(90deg, rgba(29, 58, 90, .8), rgba(16, 35, 61, .4)); }
.tide-strip-k { color: var(--cyan); font-weight: bold; }
.tide-strip-d { flex: 1 1 16em; min-width: 0; font-size: var(--fs-s); color: var(--sub); }
.tide-strip-t { color: var(--warn); font-size: var(--fs-s); white-space: nowrap; }
.tide-strip .pi { margin: 0; }
.tide-strip.is-open {
	border-color: var(--cyan);
	background: linear-gradient(90deg, #1d3a5a, #10233d 70%, #2a1a08);
	box-shadow: 0 0 0 1px var(--cyan), 0 0 12px rgba(111, 214, 232, .3);
}
.tide-strip.is-open .tide-strip-d { color: #cfe6f5; }
@keyframes tide-cue {
	0%, 100% { box-shadow: 0 0 0 1px var(--cyan), 0 0 6px rgba(111, 214, 232, .2); }
	50% { box-shadow: 0 0 0 2px var(--cyan), 0 0 18px rgba(111, 214, 232, .55); }
}
@media (prefers-reduced-motion: no-preference) {
	.tide-strip.is-open { animation: tide-cue 2.4s ease-in-out infinite; }
}

/* 「標準品は入手次第解体する」の切り替え(assets/js/auto-std.js。結果画面・保管庫・引揚場。2026-11-15) */
.auto-std { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--fs-s); }
.auto-std-l { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.auto-std-cb { width: 16px; height: 16px; margin: 0; accent-color: var(--cyan); }
.auto-std-note:empty { display: none; }
.ops-auto-std { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line, #333); }
.sv-auto { margin: 4px 0; color: var(--muted); }

/* ------------------------------------------------------------ 手配防壁のサムネ(ボスの姿。assets/js/boss-thumb.js。当直表・お知らせで共通)
   128px の絵を 1/2 = 64px で(整数倍のまま)。枠は outline(border にすると絵の大きさが変わる)で、色は札の色に合わせる:
   ふつう = 赤 / 大型の補正の枠 = 黄 / 常設 = 線 / 未解放 = 暗い線とシルエット。「カードの絵: 文字だけ」では出さない。
   下の角に落ちる2種類のカードの絵(24px。左下 = 侵入用・右下 = 防壁用)を重ねる。news.html・roster.html は art.css を読まないので
   重ねる絵(art.js の .kb-art)の見た目もここに書く */
.boss-thumb {
	position: relative;
	display: block;
	width: 64px;
	height: 64px;
	overflow: hidden;
	background: var(--bg);
	outline: 2px solid var(--alert);
	outline-offset: -2px;
}
.boss-thumb-b { display: block; width: 64px; height: 64px; image-rendering: pixelated; }
.boss-thumb.is-fixed { outline-color: var(--line-hi); }
.boss-thumb.is-big { outline-color: var(--warn); }
.boss-thumb.is-daily { outline-color: var(--fg); }
.boss-thumb.is-env { outline-color: var(--cyan, var(--fg)); }
.boss-thumb.is-warn { outline-color: var(--warn); }
.boss-thumb-b.is-px2 { image-rendering: pixelated; } /* ジョブの絵(32px)は 2倍で */
.boss-thumb.is-locked { outline-color: var(--line); }
.boss-thumb.is-locked .boss-thumb-b,
.boss-thumb.is-locked .boss-thumb-c { filter: brightness(0) contrast(1); opacity: .55; }
html:not(.kb-arts) .boss-thumb { display: none; }

.boss-thumb-c {
	position: absolute;
	bottom: 2px;
	width: 24px;
	height: 24px;
	background: var(--bg-deep, var(--bg));
	box-shadow: 0 0 0 1px var(--bg);
	pointer-events: none;
}
.boss-thumb-c.is-intruder { left: 2px; }
.boss-thumb-c.is-barrier { right: 2px; }
.boss-thumb-c .kb-art {
	--art-c: var(--line-hi);
	position: relative;
	display: block;
	width: 24px;
	height: 24px;
	overflow: hidden;
	box-shadow: inset 0 0 0 1px var(--line);
}
.boss-thumb-c .kb-art-img { display: block; width: 100%; height: 100%; image-rendering: auto; }
.boss-thumb-c .kb-art-img.is-hold { visibility: hidden; }
.boss-thumb-c .kb-art[data-kind="frame"] { --art-c: var(--fg); }
.boss-thumb-c .kb-art[data-kind="core"] { --art-c: var(--alert); }
.boss-thumb-c .kb-art[data-kind="program"] { --art-c: var(--cyan); }
.boss-thumb-c .kb-art[data-kind="shell"] { --art-c: var(--warn); }
.boss-thumb-c .kb-art[data-kind="trait"] { --art-c: var(--sub); }
.boss-thumb-c .kb-art-ph { position: absolute; inset: 0; border: 1px solid var(--art-c); opacity: .55; }
/* 未解放のカード(そのプレイヤーには出ない): 暗くして × の印 */
.boss-thumb-c.is-off .kb-art { filter: grayscale(1); opacity: .45; }
.boss-thumb-x {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: var(--alert);
	font: bold 16px/1 var(--mono, monospace);
	text-shadow: 0 0 2px var(--bg), 0 0 2px var(--bg);
}

/* 防壁構築: 公開中の防壁の「防衛成功の報酬」の1行 */
.pub-note { margin: 4px 10px 0; font-size: var(--fs-s); }

/* ============================================================ ジョブの名札(assets/js/job-view.js の jobTag。名前の横に付ける) */

.job-ic { display: inline-block; width: var(--s, 32px); height: var(--s, 32px); image-rendering: pixelated; vertical-align: middle; flex: none; }
.job-ic.is-none { visibility: hidden; }
html.kb-arts-off .job-ic:not(.job-tag-ic) { display: none; }
html.kb-arts-off .job-tag-ic { display: none; }
/* 解体の断片の上乗せ「[絵]屑拾い +150」(job-view.js の jobBonusEl。2026-11-23) */
.job-bonus { display: inline-flex; align-items: center; gap: 3px; color: var(--sub); white-space: nowrap; vertical-align: middle; }
html.kb-arts-off .job-bonus-ic { display: none; }
.vt-dis-bonus, .vt-batch-bonus, .vt-bulk-bonus, .ri-bonus, .sv-bonus { font-size: var(--fs-s); color: var(--sub); white-space: nowrap; }
.job-tag { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 0 5px 0 3px; border: 1px solid var(--line-hi); color: var(--sub); font-size: var(--fs-xs); line-height: 1.5; white-space: nowrap; vertical-align: middle; }
.job-tag-m { color: var(--warn); letter-spacing: -.1em; }
.job-tag-n { color: var(--fg); }
/* 構成ごとのジョブ(assets/js/job-pick.js。docs/job-loadout-design.md §2.4・DESIGN.md §4.17)
   札 .jl-chip: 1 行・省略(押して替えても行の高さが変わらない)。指定なし = 就いているジョブを薄く・使えないジョブ = 琥珀 */
.jl-chip { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; min-width: 0; padding: 0 5px 0 3px; border: 1px solid var(--line-hi); color: var(--fg); font-size: var(--fs-xs); line-height: 1.5; white-space: nowrap; vertical-align: middle; overflow: hidden; }
.jl-chip-n { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.jl-chip.is-none { color: var(--sub); border-style: dashed; border-color: var(--line); }
.jl-chip.is-none .job-ic, .jl-opt-ic.is-dim { opacity: .5; }
.jl-chip.is-other { border-color: var(--fg); color: var(--fg-hi); }
.jl-chip.is-bad { color: var(--warn); border-color: var(--warn); }
.jl-chip.is-bad .job-ic { opacity: .6; }
/* 出撃準備の「ジョブ: …」の 1 行(選んだ構成で戦うジョブ) */
.jl-line .jl-line-ic { margin-right: 3px; }
.jl-line-note { color: var(--sub); }
.jl-line.is-bad .jl-line-note { color: var(--warn); }
/* 選ぶ欄(カードの詳細と同じ出し方: PC は押したボタンの下に吹き出し・759px 以下は下からのシート) */
.jl-pop .ci-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.jl-pop-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.jl-only { flex: none; padding: 0 3px; border: 1px solid currentColor; font-size: var(--fs-xs); font-weight: normal; line-height: 1.4; white-space: nowrap; opacity: .85; }
.jl-pop-b { padding: 6px; overflow-y: auto; overscroll-behavior: contain; }
.jl-opts { display: grid; gap: 4px; }
.jl-opt { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 4px 8px; border: 1px solid var(--line-hi); background: var(--bg); color: var(--fg); font: inherit; font-size: var(--fs-s); text-align: left; cursor: pointer; }
.jl-opt:hover, .jl-opt:focus-visible { border-color: var(--fg); background: var(--bg-2); outline: none; }
.jl-opt[aria-checked="true"] { border-color: var(--fg-hi); background: var(--bg-2); box-shadow: inset 3px 0 0 var(--fg); }
.jl-opt:disabled { cursor: wait; opacity: .6; }
.jl-opt-m { display: flex; flex-direction: column; min-width: 0; }
.jl-opt-m b { color: var(--fg-hi); font-weight: normal; }
.jl-opt-m small { font-size: var(--fs-xs); overflow-wrap: anywhere; }
.jl-cur { margin-left: 6px; padding: 0 3px; border: 1px solid var(--line-hi); color: var(--sub); font-size: var(--fs-xs); }
.jl-msg { margin: 6px 2px 0; min-height: 1.5em; color: var(--sub); font-size: var(--fs-xs); }
.jl-msg:empty { display: none; }
.jl-msg.is-err { color: var(--alert-hi); }
.jl-pop.is-sheet .jl-opt { min-height: 48px; font-size: var(--fs-m); }
/* 保存欄の「ジョブ」の行(侵入構築・防壁構築。1 クリックのボタン。選んだ札は --fg-hi の枠になるだけ) */
.jl-slot.is-wait { min-height: 46px; }
.jl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 8px; padding: 6px 0; border-bottom: 1px dotted var(--line); }
.jl-row-k { display: inline-flex; align-items: center; gap: 4px; color: var(--fg); font-size: var(--fs-s); white-space: nowrap; }
.jl-row-k .jl-only { color: var(--sub); }
.jl-row-v { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.jl-pick { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 8px; border: 1px solid var(--line-hi); background: var(--bg-1); color: var(--fg); font: inherit; font-size: var(--fs-s); white-space: nowrap; cursor: pointer; }
.jl-pick:hover, .jl-pick:focus-visible { border-color: var(--fg); outline: none; }
.jl-pick[aria-checked="true"] { border-color: var(--fg-hi); color: var(--fg-hi); background: var(--bg-2); box-shadow: inset 0 -2px 0 var(--fg); }
.jl-row-why { flex-basis: 100%; color: var(--warn); font-size: var(--fs-xs); }
.jl-row-why:empty { display: none; }
@media (max-width: 759px) {
	.jl-pick { min-height: 40px; }
}
html.kb-arts-off .jl-chip .job-ic, html.kb-arts-off .jl-opt-ic, html.kb-arts-off .jl-line-ic, html.kb-arts-off .ops-gain-jic { display: none; }
/* オーラ(第3弾。名札の aura = 灯の数 3・7・10 のとき): 緑白に光る枠(大潮1位の金色と見分ける) */
.job-tag.job-aura { border-color: #96ec96; color: var(--fg-hi); box-shadow: 0 0 6px rgba(206, 255, 190, .6), inset 0 0 4px rgba(206, 255, 190, .3); animation: job-aura 2.4s ease-in-out infinite; }
@keyframes job-aura { 0%, 100% { box-shadow: 0 0 4px rgba(206, 255, 190, .45), inset 0 0 3px rgba(206, 255, 190, .2); } 50% { box-shadow: 0 0 10px rgba(244, 255, 236, .85), inset 0 0 5px rgba(206, 255, 190, .45); } }
@media (prefers-reduced-motion: reduce) { .job-tag.job-aura { animation: none; } }
html.kb-motion-low .job-tag.job-aura { animation: none; }
/* 称号「〈芯火一閃〉」(名前の前。job-view.js の titleTag)・称号の札の絵 */
.job-title { color: #cfffc0; font-size: .92em; white-space: nowrap; margin-right: 2px; letter-spacing: .02em; }
.job-title-ic { width: 16px; height: 16px; image-rendering: pixelated; vertical-align: middle; flex: none; }
html.kb-arts-off .job-title-ic { display: none; }

/* 灯の輪(オーラ。job-view.js の auraWrap): プロフィール画像の上に、連番の絵(64×64 × 12 コマ)を CSS の steps で回す。
   演出の動きを減らす設定(html.kb-motion-low)・OS の prefers-reduced-motion・画面の外(.is-away)では止める。小さいサムネは止まった絵 */
.job-av { position: relative; display: inline-block; line-height: 0; vertical-align: middle; }
.job-av.has-aura::before { content: ""; position: absolute; inset: -6%; border-radius: 50%; background: radial-gradient(circle, rgba(206, 255, 190, .18) 30%, rgba(150, 236, 150, 0) 70%); pointer-events: none; animation: job-glow 2.6s ease-in-out infinite; }
.job-av.has-aura.is-small::before { inset: -10%; animation: none; opacity: .8; }
.job-ring { position: absolute; left: -20%; top: -20%; width: 140%; height: 140%; z-index: 1; pointer-events: none; background-repeat: no-repeat; background-size: 1200% 100%; background-position: 0 0;
	image-rendering: pixelated; animation: job-ring 1.32s steps(12, jump-none) infinite; }
.job-ring.is-small { left: -26%; top: -26%; width: 152%; height: 152%; background-size: 100% 100%; animation: none; }
.job-ring.is-away, .job-ring.is-still { animation-play-state: paused; }
.job-av.has-aura.aura-10 .job-ring:not(.is-small) { filter: drop-shadow(0 0 3px rgba(206, 255, 190, .55)); }
@keyframes job-ring { from { background-position: 0 0; } to { background-position: 100% 0; } }
@keyframes job-glow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .job-ring, .job-av.has-aura::before { animation: none; } }
html.kb-motion-low .job-ring, html.kb-motion-low .job-av.has-aura::before { animation: none; }
html.kb-arts-off .job-ring, html.kb-arts-off .job-av.has-aura::before { display: none; }
/* 小さいプロフィール画像(班員の一覧・フレンドの一覧。job-view.js の miniAvatar) */
.job-av-mini { width: 24px; height: 24px; display: inline-grid; place-items: center; background: var(--bg-deep); box-shadow: inset 0 0 0 1px var(--line); }
.job-av-mini > .job-ic, .job-av-mini > .kb-art { width: 24px; height: 24px; --art: 24px; }
/* art.css を読まないページ(班)でも 24px に収める */
.job-av-mini > .kb-art { overflow: hidden; line-height: 0; }
.job-av-mini > .kb-art img, .job-av-mini > .kb-art canvas { display: block; width: 24px; height: 24px; image-rendering: pixelated; }
.job-mini-none { color: var(--muted); font-size: 12px; font-weight: bold; line-height: 24px; }


/* ------------------------------------------------------------ 深部(底無階段・追討・遠征)は作戦記録の第4章を終えるまで出さない(2026-11-19 制作者の要望)
   boot.js が描く前に <html data-deep="0|1"> を付ける(控え kb.deep.u。api/boot.php の deep で assets/js/api.js noteDeep が更新)。
   控えが無い・未ログインは 0(隠す)。JS が無いときは印が付かず、見える。 */
html[data-deep="0"] .nc[data-cat="deep"],
html[data-deep="0"] [data-corr-btn],
html[data-deep="0"] [data-pursuit-btn],
html[data-deep="0"] [data-exp-btn],
html[data-deep="0"] [data-deep-only] {
	display: none !important;
}

/* ------------------------------------------------------------ 番小屋は序章(既定)を終えるまで出さない(docs/base-design.md §1・docs/ui-design.md §3.13)
   深部と同じ仕組み: boot.js が描く前に <html data-base="0|1"> を付ける(控え kb.base.u。api/boot.php の base で assets/js/api.js noteBase が更新)。
   ヘッダーの「補給」の番小屋(区切りの / も)・トップのボタン・近道・設定の並び替えの候補・マイページのタイル。 */
html[data-base="0"] [data-base-only] {
	display: none !important;
}

/* ================================================================
 * 重ね打ち(凸)の星・幅・戦闘ログの上振れ(assets/js/totsu-view.js。DESIGN.md §4.3)
 * 星は琥珀(--warn)、重ね打ちできない個体は灰(--muted)。上限が出た数字は 1 秒だけ光る(動きを減らす設定では光らせない)
 * ================================================================ */
.tz-stars {
	display: inline-block;
	margin-left: 4px;
	font-size: var(--fs-s);
	letter-spacing: -.04em;
	white-space: nowrap;
	color: var(--muted);
}
.tz-stars.is-on { color: var(--warn); }
.tz-stars.is-none { color: var(--muted); }
button.tz-stars {
	padding: 0 4px;
	border: 1px solid var(--line);
	background: var(--bg-1);
	font: inherit;
	font-size: var(--fs-s);
	cursor: help;
}
button.tz-stars.is-none { border-style: dashed; }
.tz-ranges { margin: 4px 0; padding: 0; list-style: none; }
.tz-ranges li { display: flex; gap: 6px; align-items: baseline; }
.tz-ranges li::before { content: "> "; color: var(--muted); }
.tz-roll { white-space: nowrap; }
.tz-max {
	color: var(--warn);
	text-shadow: 0 0 6px rgba(232, 193, 90, .85);
	animation: tz-glow 1s ease-out 2;
}
@keyframes tz-glow {
	0% { text-shadow: 0 0 12px rgba(232, 193, 90, 1); }
	100% { text-shadow: 0 0 4px rgba(232, 193, 90, .5); }
}
.kb-art[data-stars]::after {
	content: attr(data-stars);
	position: absolute;
	right: 0;
	bottom: 0;
	padding: 0 1px;
	font-size: 9px;
	line-height: 1.1;
	color: var(--warn);
	background: rgba(7, 0, 9, .82);
	pointer-events: none;
}
.kb-art--xs[data-stars]::after,
.kb-art--sm[data-stars]::after { font-size: 7px; }
.kb-art--lg[data-stars]::after,
.kb-art--xl[data-stars]::after { font-size: 12px; padding: 1px 2px; }
@media (prefers-reduced-motion: reduce) {
	.tz-max { animation: none; }
}

/* ------------------------------------------------------------ 日課も序章(既定)を終えるまで出さない(docs/nikka-design.md・docs/ui-design.md §3.13)
   番小屋と同じ仕組み: boot.js が描く前に <html data-nikka="0|1"> を付ける(控え kb.nikka.u。api/boot.php の nikka で assets/js/api.js noteNikka が更新)。
   ヘッダーの「補給」の日課(区切りの / も)・トップのボタン・近道・設定の並び替えの候補・マイページのタイル・当直表の行。 */
html[data-nikka="0"] [data-nikka-only] {
	display: none !important;
}
/* ------------------------------------------------------------ 融通所は取引が有効な間だけ出す(docs/trade-design.md §9.5。既定は無効)
   番小屋と同じ仕組み: boot.js が描く前に <html data-trade="0|1"> を付ける(控え kb.trade.u。api/boot.php の trade_enabled で assets/js/api.js noteTrade が更新)。
   ヘッダーの「補給」の融通所(区切りの / も)・近道・設定の候補と交流の欄・[融通所で呼ぶ]・当直照会のページの番号の行の横の入口。 */
html[data-trade="0"] [data-trade-only] {
	display: none !important;
}
@media (max-width: 640px) {
	/* 補給は 出勤簿・配給所・引揚場 + 日課・番小屋・融通所(出し分け)。3つずつ並べ、出ているのがちょうど4つ(出し分けの1つだけが出ている)のときだけ2つずつ */
	html[data-nikka="0"][data-base="0"]:not([data-trade="0"]) .boardlist .group:has(> .gb) .nc[data-cat="supply"] .nc-l a,
	html[data-nikka="0"][data-trade="0"]:not([data-base="0"]) .boardlist .group:has(> .gb) .nc[data-cat="supply"] .nc-l a,
	html[data-base="0"][data-trade="0"]:not([data-nikka="0"]) .boardlist .group:has(> .gb) .nc[data-cat="supply"] .nc-l a { flex-basis: calc((100% - 4px) / 2); }
}

/* ------------------------------------------------------------ 合同照会(ワールドボス)は第3章を終え、サーバーが有効にしている間だけ出す(docs/worldboss-design.md §2.2・DESIGN.md §4.15)
   番小屋と同じ仕組み: boot.js が描く前に <html data-wb="0|1"> を付ける(控え kb.wb.u。api/boot.php の wboss で assets/js/api.js noteWboss が更新)。
   ヘッダーの「当直」の合同照会(区切りの / も)・トップのボタン・近道・設定の並び替えの候補・マイページのタイルと記章の欄・当直表の行。 */
html[data-wb="0"] [data-wb-only] {
	display: none !important;
}
/* ------------------------------------------------------------ 水際(拠点の占領)は第2章を終え、サーバーが有効にしている間だけ出す(docs/outpost-design.md §2.8・DESIGN.md §4.16)
   合同照会と同じ仕組み: boot.js が描く前に <html data-hold="0|1"> を付ける(控え kb.hold.u。api/boot.php の hold で assets/js/api.js noteHold が更新)。
   ヘッダーの「当直」の水際(区切りの / も)・トップのボタン・近道・設定の並び替えの候補・マイページのタイル・当直表の行。
   いま効いている効果(ヘッダーの帯域の札の灯)は未解放の人にも出す(全プレイヤーに効くため)。 */
html[data-hold="0"] [data-hold-only] {
	display: none !important;
}
/* お知らせの種類の札「合同照会」(塗り。浮上と同じ琥珀の系統だが、区別のため縁取りの地) */
.news-kind[data-kind="wboss"] { background: var(--bg); color: var(--warn); border: 1px solid var(--warn); }
/* お知らせの種類の札「水際」(灯の緑白の縁取り。合同照会の琥珀と見分ける) */
.news-kind[data-kind="hold"] { background: var(--bg); color: #cfffc0; border: 1px solid #96ec96; }

/* ================================================================
 * 合同照会(ワールドボス)の共有の部品(assets/js/wboss-view.js・wboss-badge.js。DESIGN.md §4.15)
 * 合同照会のページ・当直表の行・出撃準備と決着の箱・お知らせ・マイページの記章で使う。ページだけのものは wboss.css
 * ================================================================ */
/* 残り体力のバー: 塗りは残りの割合。目盛りは節目 75/50/25%(細)と形態の境 50/20%(太)。形態二は琥珀、形態三は琥珀に赤い縁(危険) */
.wb-bar {
	position: relative;
	height: 14px;
	border: 1px solid var(--line-hi);
	background: var(--bg-2);
	overflow: hidden;
}
.wb-bar.is-big { height: 22px; }
.wb-bar-v {
	position: absolute;
	inset: 0 auto 0 0;
	background: var(--fg);
	transition: width .9s cubic-bezier(.2, .7, .2, 1);
}
.wb-bar[data-form="2"] .wb-bar-v,
.wb-bar[data-form="3"] .wb-bar-v { background: var(--warn); }
.wb-bar[data-form="3"] { border-color: var(--alert); }
.wb-bar-hit {
	position: absolute;
	top: 0;
	bottom: 0;
	background: #fff3c4;
	opacity: 0;
	pointer-events: none;
}
.wb-bar-hit.is-on { animation: wb-hit 1.4s ease-out forwards; }
@keyframes wb-hit { 0% { opacity: .95; } 100% { opacity: 0; } }
.wb-bar-t {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 1px;
	margin-left: -1px;
	background: rgba(7, 0, 9, .75);
	pointer-events: none;
}
.wb-bar-t.is-form { width: 2px; background: var(--bg-deep); box-shadow: 0 0 0 1px rgba(232, 193, 90, .45); }
.wb-hp { display: grid; gap: 2px; min-width: 0; }
.wb-hp-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0; }
.wb-hp-k { color: var(--sub); font-size: var(--fs-s); }
.wb-hp-pct { color: var(--fg-hi); font-size: 26px; line-height: 1.1; font-family: var(--display); letter-spacing: .02em; }
.wb-hp-n { margin-left: auto; font-size: var(--fs-s); }
.wb-hp-cur { color: var(--fg-hi); }
.wb-hp-scale { position: relative; height: 1.2em; margin: 0; font-size: var(--fs-xs); color: var(--muted); }
.wb-hp-sc { position: absolute; top: 0; transform: translateX(-50%); }
.wb-hp-sc.is-form { color: var(--warn); }
/* 形態の札 */
.wb-form { display: inline-block; padding: 0 5px; border: 1px solid var(--line-hi); color: var(--fg-hi); font-size: var(--fs-xs); white-space: nowrap; }
.wb-form.is-f2 { border-color: var(--warn); color: var(--warn); }
.wb-form.is-f3 { border-color: var(--alert); color: var(--warn); background: var(--alert-bg); }
/* 届け出の枠(pi-wb-slot / pi-wb-slot-off。「文字だけ」では ●●●○○○) */
.wb-slots { display: inline-flex; align-items: center; gap: 1px; color: var(--warn); letter-spacing: .08em; white-space: nowrap; vertical-align: -3px; }
.wb-slots-t { display: none; }
html.kb-arts-off .wb-slots-t { display: inline; }
/* 主局の絵(型 × 形態。枠は先に取る。読めないときは型の札) */
.wb-fig {
	display: inline-grid;
	place-items: center;
	flex: 0 0 auto;
	width: var(--wb-fig, 128px);
	height: var(--wb-fig, 128px);
	border: 1px solid var(--line-hi);
	background: var(--bg-deep);
	overflow: hidden;
}
.wb-fig img { width: 100%; height: 100%; image-rendering: pixelated; }
.wb-fig.is-down { background: #05070d; }
.wb-fig-ph { display: grid; place-items: center; gap: 4px; color: var(--sub); font-size: var(--fs-s); }
html.kb-arts-off .wb-fig img { display: none; }
/* 報酬・名前 */
.wb-rw .cur-w { white-space: nowrap; }
.wb-who.is-anon { color: var(--sub); }
/* ヘッダーなどの「!」は .news-new の形のまま(点滅しない) */
/* 記章(マイページ・合同照会のページ): 32px の絵 + 月の数字。とどめは右上の「止」、上位 10% は琥珀の二重枠 */
.wb-embs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.wb-emb { display: grid; justify-items: center; gap: 2px; width: 48px; }
.wb-emb-i {
	position: relative;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--line-hi);
	background: var(--bg-1);
}
.wb-emb-p { position: relative; display: block; width: 32px; height: 32px; }
.wb-emb-o { position: absolute; inset: 0; }
html:not(.kb-arts-off) .wb-emb-l { display: none; } /* とどめは絵(pi-wb-badge-kill)で。「文字だけ」では「止」 */
.wb-emb.is-join .wb-emb-i { opacity: .7; border-style: dashed; }
.wb-emb.is-kill .wb-emb-i { border-color: var(--fg); }
.wb-emb.is-top .wb-emb-i { border: 2px double var(--warn); }
.wb-emb-m {
	position: absolute;
	left: 1px;
	bottom: 0;
	padding: 0 2px;
	color: var(--fg-hi);
	background: rgba(7, 0, 9, .82);
	font-size: var(--fs-xs);
	line-height: 1.2;
}
.wb-emb-l {
	position: absolute;
	top: -1px;
	right: -1px;
	padding: 0 2px;
	color: var(--bg);
	background: var(--warn);
	font-size: var(--fs-xs);
	line-height: 1.2;
}
.wb-emb-t { color: var(--sub); font-size: var(--fs-xs); }
html.kb-arts-off .wb-emb-i .pi { display: none; }
/* 出撃準備・決着の箱(作戦記録の画面。大潮の .ops-tide の形を借りる) */
.ops-wb-info { display: grid; gap: 6px; min-width: 0; }
.ops-wb-note { margin: 4px 0; font-size: var(--fs-s); }
.ops-wb-after { color: var(--warn); font-size: var(--fs-s); }
.ops-wb .wb-bar { margin: 6px 0; }
.ops-wb .ops-tide-done.is-kill { color: var(--fg-hi); }
@media (prefers-reduced-motion: reduce) {
	.wb-bar-v { transition: none; }
	.wb-bar-hit.is-on { animation: none; }
}
html.kb-motion-low .wb-bar-v { transition: none; }
html.kb-motion-low .wb-bar-hit.is-on { animation: none; }
/* お知らせの主局の欄(assets/js/news.js) */
.news-wb { display: grid; gap: 6px; justify-items: start; }
.news-wb-live { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; font-size: var(--fs-s); }
.news-wb-live:empty { display: none; }
.news-wb-live .wb-bar { flex: 1 1 100%; max-width: 360px; }
/* 当直表の合同照会の行(assets/js/roster.js) */
.rs-wb .wb-bar { margin: 3px 0; max-width: 360px; }
/* マイページの合同照会のタイルの今月の累計(見出しの行の右。折り返さない = 届いても高さが変わらない) */
.pf-go.is-wboss .wb-tile-n { margin-left: auto; padding-left: 6px; color: var(--warn); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* タイル・ボタンに付く「!」は重ねる(縦に並ぶタイルの中に行を足さない = 付いても高さが変わらない) */
.pf-go.is-wboss { position: relative; }
.pf-go.is-wboss > .wb-new { position: absolute; top: 3px; right: 3px; margin: 0; }

/* ================================================================
 * 水際(拠点の占領)の共有の部品(assets/js/hold-view.js・hold-badge.js。DESIGN.md §4.16)
 * 水際のページ・当直表の行・出撃準備と決着の箱・ヘッダーの帯域の札で使う。ページだけのものは hold.css。
 * 灯の色は灯の緑白(DESIGN.md §4.12。点いている #cfffc0・残り灯 #96ec96 の淡い緑)。押し返しで戻った分だけ赤(危険)
 * ================================================================ */
/* 局の灯(16px。絵は絵の担当の assets/art/hold/lamp_on|keep|fight|off.gif(6 コマ。keep は 1 コマ)。「文字だけ」では三つ灯の点を CSS で描く)。
   data-s: on(点いている)| keep(残り灯)| fight(取り合い中)| off(消えている)| fall(消えた直後)| lock(要が閉じている) */
.hd-lamp {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 1px;
	flex: none;
	width: 16px;
	height: 16px;
	vertical-align: -3px;
	background: center / 16px 16px no-repeat;
	image-rendering: pixelated;
}
.hd-lamp.is-big { width: 32px; height: 32px; background-size: 32px 32px; gap: 2px; }
.hd-lamp.is-s { margin: 0 -2px; } /* 帯域の札・配給所の札: 絵は 16px のまま(整数倍)、透明の余白の分だけ詰める */
.hd-lamp > i { display: block; width: 4px; height: 4px; background: var(--line); }
.hd-lamp.is-big > i { width: 8px; height: 8px; }
.hd-lamp.is-s > i { width: 3px; height: 3px; }
.hd-lamp[data-s="on"] > i { background: #cfffc0; box-shadow: 0 0 3px rgba(207, 255, 192, .7); }
.hd-lamp[data-s="keep"] > i { background: #96ec96; opacity: .6; }
.hd-lamp[data-s="fight"] > i:first-child { background: var(--warn); }
.hd-lamp[data-s="fight"] > i { background: var(--line-hi); }
.hd-lamp[data-s="fall"] > i { background: var(--bg-deep); box-shadow: 0 0 0 1px var(--alert-hi); }
.hd-lamp[data-s="lock"] > i { background: var(--bg-2); box-shadow: 0 0 0 1px var(--line); }
html:not(.kb-arts-off) .hd-lamp[data-s="on"] { background-image: url("../art/hold/lamp_on.gif"); }
html:not(.kb-arts-off) .hd-lamp[data-s="keep"] { background-image: url("../art/hold/lamp_keep.gif"); }
html:not(.kb-arts-off) .hd-lamp[data-s="fight"] { background-image: url("../art/hold/lamp_fight.gif"); }
html:not(.kb-arts-off) .hd-lamp[data-s="off"],
html:not(.kb-arts-off) .hd-lamp[data-s="fall"],
html:not(.kb-arts-off) .hd-lamp[data-s="lock"] { background-image: url("../art/hold/lamp_off.gif"); }
html:not(.kb-arts-off) .hd-lamp[data-s="lock"] { opacity: .45; }
html:not(.kb-arts-off) .hd-lamp[data-s="fall"] { box-shadow: 0 0 0 1px var(--alert-hi); }
html:not(.kb-arts-off) .hd-lamp > i { display: none; }
/* 動きを減らす設定: 灯の絵(6 コマ)を止まった 16px のアイコン(絵の担当の hold_lamp_*.png)に替える */
html.kb-motion-low:not(.kb-arts-off) .hd-lamp[data-s="on"] { background-image: url("../art/ui/hold_lamp_on.png"); }
html.kb-motion-low:not(.kb-arts-off) .hd-lamp[data-s="keep"] { background-image: url("../art/ui/hold_lamp_keep.png"); }
html.kb-motion-low:not(.kb-arts-off) .hd-lamp[data-s="fight"] { background-image: url("../art/ui/hold_lamp_fight.png"); }
html.kb-motion-low:not(.kb-arts-off) .hd-lamp[data-s="off"],
html.kb-motion-low:not(.kb-arts-off) .hd-lamp[data-s="fall"],
html.kb-motion-low:not(.kb-arts-off) .hd-lamp[data-s="lock"] { background-image: url("../art/ui/hold_lamp_off.png"); }
@media (prefers-reduced-motion: reduce) {
	html:not(.kb-arts-off) .hd-lamp[data-s="on"] { background-image: url("../art/ui/hold_lamp_on.png"); }
	html:not(.kb-arts-off) .hd-lamp[data-s="keep"] { background-image: url("../art/ui/hold_lamp_keep.png"); }
	html:not(.kb-arts-off) .hd-lamp[data-s="fight"] { background-image: url("../art/ui/hold_lamp_fight.png"); }
	html:not(.kb-arts-off) .hd-lamp[data-s="off"],
	html:not(.kb-arts-off) .hd-lamp[data-s="fall"],
	html:not(.kb-arts-off) .hd-lamp[data-s="lock"] { background-image: url("../art/ui/hold_lamp_off.png"); }
}
.hd-lamps { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; }

/* 局のバー: 取り合い = 進度(--fg)・節目 25/50/75 の目盛り・足場(越えた節目。押し返しはここより下へ戻らない = 琥珀の線)。
   点いている = 灯の保ち(緑白)。要が閉じている間は灰色。読み直しで動いたら、動いた分を一瞬だけ光らせる(戻り = 赤・進み = 緑白。点滅ではなく 1 回だけ薄れる) */
.hd-bar {
	position: relative;
	height: 14px;
	border: 1px solid var(--line-hi);
	background: var(--bg-2);
	overflow: hidden;
}
.hd-bar.is-big { height: 20px; }
.hd-bar-v {
	position: absolute;
	inset: 0 auto 0 0;
	background: var(--fg);
	transition: width .9s cubic-bezier(.2, .7, .2, 1);
}
.hd-bar[data-stage="held"] { border-color: #96ec96; }
.hd-bar[data-stage="held"] .hd-bar-v { background: linear-gradient(90deg, #96ec96, #cfffc0); }
.hd-bar[data-stage="locked"] .hd-bar-v { background: var(--line-hi); }
.hd-bar-fx {
	position: absolute;
	top: 0;
	bottom: 0;
	opacity: 0;
	pointer-events: none;
}
.hd-bar-fx.is-down { background: var(--alert); animation: hd-fx 1.6s ease-out forwards; }
.hd-bar-fx.is-up { background: #f4ffe8; animation: hd-fx 1.4s ease-out forwards; }
@keyframes hd-fx { 0% { opacity: .95; } 100% { opacity: 0; } }
.hd-bar-t {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 1px;
	margin-left: -1px;
	background: rgba(7, 0, 9, .75);
	pointer-events: none;
}
.hd-bar-floor {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 2px;
	margin-left: -1px;
	background: var(--warn);
	pointer-events: none;
}
.hd-bar-floor[hidden] { display: none; }
/* 動いた量の札(枠は常に取る = 出ても下が動かない) */
.hd-delta { display: inline-block; min-width: 5.5em; font-size: var(--fs-xs); white-space: nowrap; }
.hd-delta[data-k="same"] { visibility: hidden; }
.hd-delta[data-k="up"], .hd-delta[data-k="cap"] { color: var(--fg-hi); }
.hd-delta[data-k="down"], .hd-delta[data-k="fall"] { color: var(--alert-hi); }
/* 効果の札([絵] 開始時の演算力 +1)。消えている = 薄く・残り灯 = 淡い緑 */
.hd-fx { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-size: var(--fs-s); color: var(--sub); }
.hd-fx.is-lit { color: #cfffc0; }
.hd-fx.is-keep { color: #96ec96; }
.hd-fx.is-off { color: var(--muted); }
.hd-fx-s { padding: 0 4px; border: 1px solid currentColor; font-size: var(--fs-xs); white-space: nowrap; }
.hd-stage { display: inline-block; padding: 0 5px; border: 1px solid var(--line-hi); font-size: var(--fs-xs); white-space: nowrap; }
.hd-stage.is-held { border-color: #96ec96; color: #cfffc0; }
.hd-stage.is-retake { border-color: var(--warn); color: var(--warn); }
.hd-stage.is-locked { color: var(--muted); }
/* ヘッダーの入口の印(押し上げの間は「!」の代わりに小さな波。点滅しない) */
.hd-wave { display: inline-flex; margin-left: 2px; vertical-align: -3px; }
html.kb-arts-off .hd-wave::after { content: "~"; color: var(--alert-hi); }
/* 帯域の札の灯(一時強化の欄の右)と吹き出しの「水際の灯」の欄 */
.st-chip-h { display: inline-flex; align-items: center; gap: 1px; margin-left: 4px; }
.st-chip-h[hidden] { display: none; }
.st-chip-hn { display: none; margin-left: 2px; color: #cfffc0; font-size: var(--fs-xs); }
.st-tip-hold { display: grid; gap: 3px; margin-top: 4px; padding-top: 5px; border-top: 1px solid var(--line); }
.st-tip-hold[hidden] { display: none; }
.st-tip-hold .st-tip-h { display: inline-flex; align-items: center; gap: 4px; }
.st-hold-r .k { display: inline-flex; align-items: center; gap: 3px; color: #cfffc0; white-space: normal; }
.st-hold-r.is-keep .k { color: #96ec96; }
.st-hold-s { color: var(--sub); font-size: var(--fs-xs); white-space: nowrap; }
.st-hold-off.is-now { color: var(--alert-hi); }
.st-tip:has(.st-tip-hold:not([hidden])) { width: 19.5em; }
@media (max-width: 559px) {
	/* 狭い幅: 灯は 1 つ + 数だけ(帯域を残す) */
	.st-chip-h[data-n] > .hd-lamp:not(:first-child) { display: none; }
	.st-chip-h[data-n]:not([data-n="1"]) > .st-chip-hn { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
	.hd-bar-v { transition: none; }
	.hd-bar-fx.is-down, .hd-bar-fx.is-up { animation: none; opacity: 0; }
}
html.kb-motion-low .hd-bar-v { transition: none; }
html.kb-motion-low .hd-bar-fx.is-down, html.kb-motion-low .hd-bar-fx.is-up { animation: none; opacity: 0; }
/* 当直表の水際の行(assets/js/roster.js)。5 つの灯は名前の右に 1 行で(折り返しても行の中) */
.rs-hd-l { display: inline-flex; margin-left: 8px; vertical-align: middle; }
.rs-hd-off { color: var(--alert-hi); }
/* マイページの水際のタイルの今週の累計・トップのボタン・タイルの「!」(重ねる = 付いても高さが変わらない。合同照会と同じ) */
.pf-go.is-hold .hd-tile-n { margin-left: auto; padding-left: 6px; color: #cfffc0; font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pf-go.is-hold { position: relative; }
.pf-go.is-hold > .hd-new, .pf-go.is-hold > .hd-wave { position: absolute; top: 3px; right: 3px; margin: 0; }
/* 配給所の一時強化の品に添える灯の札(水際の灯と同じ種類で、点いている間は上乗せにならない。assets/js/shop.js holdOverlap) */
.sh-hold { display: inline-flex; align-items: center; gap: 3px; padding: 0 4px; border: 1px solid #96ec96; color: #cfffc0; font-size: var(--fs-xs); white-space: nowrap; }
/* 結果の照会値の行の灯の上乗せ(中継塔の灯。増配の札の隣。緑白の縁取り) */
.ops-xp-hd { margin-left: 6px; padding: 0 4px; border: 1px solid #96ec96; color: #cfffc0; font-size: var(--fs-xs); white-space: nowrap; }
