/* 鉱物図鑑プラグイン
   ブレークポイントはSWELLに合わせる：SP 〜599px / TAB 600〜959px / PC 960px〜 */

.mz-tree {
	--mz-main: var(--color_main, #2b6cb0);
	--mz-text: var(--color_text, #333);
	--mz-muted: #6f675d; /* 以下、サイトの生成りの紙の配色に合わせる */
	--mz-line: #cbbfa9;
	--mz-border: #ddd3c2;
	--mz-bg: #fbf9f4;
	--mz-soft: #efe8db;
	--mz-tag-fg: #8a5a00;
	--mz-tag-bg: #fff3d6;
	position: relative;
	margin: 0 0 2em;
	color: var(--mz-text);
	font-size: 15px;
	line-height: 1.6;
}

.mz-tree button {
	font: inherit;
	color: inherit;
	cursor: pointer;
}

.mz-error {
	padding: 8px 12px;
	background: #fdecea;
	color: #b3261e;
	border-radius: 6px;
}

/* ---------- 操作バー ---------- */
.mz-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin-bottom: 10px;
}

.mz-seg {
	display: inline-flex;
	background: var(--mz-bg);
	border: 1px solid var(--mz-border);
	border-radius: 8px;
	overflow: hidden;
}

.mz-seg button {
	padding: 6px 14px;
	background: none;
	border: 0;
	border-right: 1px solid var(--mz-border);
	font-size: 14px;
	white-space: nowrap;
}

.mz-seg button:last-child {
	border-right: 0;
}

.mz-seg button.is-active {
	background: var(--mz-main);
	color: #fff;
}

.mz-actions {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
}

.mz-btn {
	padding: 6px 12px;
	background: var(--mz-bg);
	border: 1px solid var(--mz-border);
	border-radius: 8px;
	font-size: 14px;
	white-space: nowrap;
}

.mz-seg button:not(.is-active):hover,
.mz-btn:hover {
	background: var(--mz-soft);
}

.mz-tree button:focus-visible {
	outline: 2px solid var(--mz-main);
	outline-offset: 1px;
}

.mz-tree .mz-status {
	margin: 0 0 0 auto;
	color: var(--mz-muted);
	font-size: 13px;
}

/* 表示する鉱物：［入門 72種］［定番 189種］［すべて 382種］ */
.mz-rank {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.mz-rank-label {
	color: var(--mz-muted);
	font-size: 13px;
	white-space: nowrap;
}
.mz-rank-n {
	margin-left: 5px;
	font-size: 12px;
	opacity: 0.75;
}
/* 絞っているときの注意と「すべて表示する」 */
.mz-status-part {
	margin-left: 10px;
	color: var(--mz-text, #2e2a25);
}
.mz-tree .mz-status-part button {
	margin-left: 6px;
	padding: 0;
	background: none;
	border: 0;
	color: var(--mz-main);
	font-size: 13px;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}
/* 開いているのに隠れている子の数（+2） */
.mz-node .mz-t-more {
	fill: var(--mz-main);
	font-size: 12px;
	font-weight: 400;
}
.mz-more {
	margin-left: 6px;
	color: var(--mz-main);
	font-size: 12px;
}

.mz-tree:not([data-view="graph"]) .mz-only-graph,
.mz-tree:not([data-tab="classify"]) .mz-only-tree,
.mz-tree[data-tab="map"] .mz-hide-map,
.mz-tree:not([data-tab="classify"]) .mz-sub[data-for="classify"],
.mz-tree:not([data-tab="search"]) .mz-sub[data-for="search"] {
	display: none;
}

/* ---------- 大きいタブ（分類／さがす／地図） ---------- */
.mz-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 14px;
	border-bottom: 2px solid var(--mz-border);
}

.mz-tabs button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	margin-bottom: -2px;
	padding: 10px 26px;
	background: none;
	border: 0;
	border-bottom: 3px solid transparent;
	color: var(--mz-muted);
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.05em;
}

/* タブのアイコン（線で描く。色は文字と同じ） */
.mz-tab-icon {
	flex: none;
	width: 20px;
	height: 20px;
}

/* SWELL側の svg の塗り指定に負けないよう、中の図形まで直接指定する */
.mz-tree .mz-tab-icon,
.mz-tree .mz-tab-icon * {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.mz-tabs button:hover {
	color: var(--mz-text);
}

.mz-tabs button.is-active {
	border-bottom-color: var(--mz-main);
	color: var(--mz-main);
}

/* ---------- 地図 ---------- */
.mz-tree .mz-coming {
	margin: 0;
	padding: 80px 20px;
	color: var(--mz-muted);
	text-align: center;
}

.mz-map-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--mz-border);
}

.mz-map.hide-closed .mz-mine.is-closed,
.mz-map.hide-closed .mz-star.is-closed,
.mz-map.famous-only .mz-mine:not(.is-famous) {
	display: none;
}

/* 鉱山地帯（二重丸）は内側を抜く */
.mz-mine--district {
	fill-rule: evenodd;
}

/* 名産地の★ */
.mz-star {
	fill: #f2b705;
	stroke: #8a6400;
	stroke-width: 0.8px;
	vector-effect: non-scaling-stroke;
	cursor: pointer;
}

.mz-star-icon polygon {
	fill: #f2b705;
	stroke: #8a6400;
	stroke-width: 0.8;
}

.mz-btn .mz-star-icon,
.mz-chip .mz-star-icon {
	margin-right: 3px;
}

.mz-map-famous.is-active .mz-star-icon polygon {
	stroke: #fff;
}

.mz-d-famous .mz-star-icon {
	margin-right: 4px;
}

.mz-map-famous.is-active,
.mz-map-closed.is-active,
.mz-map-scale.is-active {
	background: var(--mz-main);
	border-color: var(--mz-main);
	color: #fff;
}

.mz-map-box {
	background: #e3e8e4;
}

.mz-map-svg {
	display: block;
	width: 100%;
	height: auto;
	max-height: 76vh;
	cursor: grab;
	touch-action: none;
}

.mz-map-svg:active {
	cursor: grabbing;
}

.mz-sea {
	fill: #dfe6e2;
}

.mz-grat {
	fill: none;
	stroke: #cfd8d2;
	stroke-width: 0.5px;
	vector-effect: non-scaling-stroke;
}

.mz-land {
	fill: #f3eee4;
	stroke: #b9bfb4;
	stroke-width: 0.6px;
	vector-effect: non-scaling-stroke;
	cursor: pointer;
}

/* 登録した鉱物がある国は少し濃く */
.mz-land.has-data {
	fill: #eae2d2;
}

.mz-land:hover {
	fill: #e0d5c0;
}

.mz-land.is-sel {
	fill: color-mix(in srgb, var(--mz-main) 22%, #f3eee4);
}

/* 鉱山・産地のドット：塗り＝稼働中・産地、白抜き＝閉山 */
.mz-mine {
	fill: var(--c);
	stroke: rgba(0, 0, 0, 0.55);
	cursor: pointer;
	transition: opacity 0.2s;
}

.mz-mine.is-closed {
	fill: #fff;
	stroke: var(--c);
}

.mz-mine:hover,
.mz-mine.is-sel {
	stroke: var(--mz-main);
}

.mz-mine.is-dim {
	opacity: 0.15;
}

.mz-map-key {
	display: inline-block;
	flex: none;
	width: 11px;
	height: 11px;
	background: var(--c, #8a6bb5);
	border: 1px solid rgba(0, 0, 0, 0.45);
	border-radius: 50%;
}

.mz-map-key.is-closed {
	background: #fff;
	border: 2px solid var(--c, #8a6bb5);
}

.mz-tree .mz-map-legend {
	margin: 0;
	padding: 8px 12px 10px;
	border-top: 1px solid var(--mz-border);
}

/* 形のアイコン（凡例・チップ・鉱山カード） */
.mz-shape {
	flex: none;
	vertical-align: -2px;
}

.mz-map-legend .mz-shape {
	margin-right: 2px;
}

.mz-d-shape .mz-shape {
	display: block;
	width: 44px;
	height: 44px;
}

.mz-tree .mz-map-note {
	margin: 0;
	padding: 0 12px 10px;
	color: var(--mz-muted);
	font-size: 12px;
}

.mz-tree .mz-d-foot,
.mz-cardpop .mz-d-foot{
	margin: 14px 0 0;
	color: var(--mz-muted);
	font-size: 12px;
	line-height: 1.6;
}

/* 鉱物カードから鉱山・国に戻るボタン */
.mz-tree .mz-d-back,
.mz-cardpop .mz-d-back{
	margin: 0 0 10px;
	padding: 2px 10px;
	background: var(--mz-soft);
	border: 0;
	border-radius: 999px;
	color: var(--mz-main);
	font-size: 13px;
}

/* ---------- 表示エリア ---------- */
.mz-stage {
	position: relative;
	background: var(--mz-bg);
	border: 1px solid var(--mz-border);
	border-radius: 12px;
	overflow: hidden;
}

.mz-graph,
.mz-list,
.mz-index,
.mz-filter,
.mz-map {
	display: none;
}

.mz-tree[data-view="graph"] .mz-graph,
.mz-tree[data-view="list"] .mz-list,
.mz-tree[data-view="kana"] .mz-index,
.mz-tree[data-view="abc"] .mz-index,
.mz-tree[data-view="color"] .mz-index,
.mz-tree[data-view="no"] .mz-index,
.mz-tree[data-view="filter"] .mz-filter,
.mz-tree[data-view="map"] .mz-map {
	display: block;
}

/* ---------- 絞込み ---------- */
.mz-filter {
	padding: 14px 16px 20px;
}

.mz-f-panel {
	padding: 14px 16px;
	background: var(--mz-soft);
	border-radius: 10px;
}

.mz-f-body {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px 28px;
}

.mz-f-row {
	grid-column: 1 / -1;
	min-width: 0;
}

.mz-f-row--half {
	grid-column: auto;
}

.mz-tree .mz-f-label {
	display: block;
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 700;
}

/* 項目の見出し（PCでは押しても何も起きない。スマホでは開閉ボタン） */
.mz-tree .mz-f-fold {
	padding: 0;
	background: none;
	border: 0;
	cursor: default;
	text-align: left;
}

.mz-f-sel {
	display: none;
}

/* 条件をクリア（条件欄の一番下） */
.mz-f-actions {
	grid-column: 1 / -1;
	text-align: right;
}

.mz-f-mode {
	margin-left: 6px;
	padding: 0 6px;
	border: 1px solid var(--mz-border);
	border-radius: 4px;
	background: var(--mz-bg);
	color: var(--mz-muted);
	font-size: 12px;
	font-weight: 400;
}

.mz-tree .mz-f-kw {
	width: 100%;
	max-width: 520px;
	padding: 8px 12px;
	background: var(--mz-bg);
	border: 1px solid var(--mz-border);
	border-radius: 8px;
	font-size: 16px;
}

.mz-tree .mz-f-kw:focus {
	border-color: var(--mz-main);
	outline: none;
}

.mz-tree .mz-f-note {
	margin: 4px 0 0;
	color: var(--mz-muted);
	font-size: 12px;
}

.mz-f-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.mz-f-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px;
	background: var(--mz-bg);
	border: 1px solid var(--mz-border);
	border-radius: 999px;
	font-size: 14px;
	line-height: 1.4;
}

.mz-f-chip:hover {
	border-color: var(--mz-main);
}

.mz-f-chip.is-active {
	background: var(--mz-main);
	border-color: var(--mz-main);
	color: #fff;
}

.mz-f-chip .mz-dot {
	width: 12px;
	height: 12px;
}

.mz-f-chips--el .mz-f-chip b {
	margin-right: 2px;
}

.mz-tree .mz-filter select {
	padding: 5px 8px;
	background: var(--mz-bg);
	border: 1px solid var(--mz-border);
	border-radius: 6px;
	font-size: 14px;
}

.mz-tree .mz-f-more {
	margin-top: 8px;
}

.mz-f-range {
	display: flex;
	align-items: center;
	gap: 8px;
}

.mz-tree .mz-f-count {
	margin: 14px 0 6px;
	font-weight: 700;
}

.mz-tree .mz-f-none {
	grid-column: 1 / -1;
	padding: 20px 0;
	color: var(--mz-muted);
	text-align: center;
}

.mz-tree .mz-f-results li::before {
	content: none;
}

/* ---------- 索引（五十音／ABC） ---------- */
.mz-index {
	padding: 12px 16px 20px;
}

.mz-i-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--mz-border);
}

.mz-i-jump {
	min-width: 34px;
	padding: 4px 8px;
	background: var(--mz-bg);
	border: 1px solid var(--mz-border);
	border-radius: 6px;
	font-size: 15px;
	text-align: center;
}

.mz-i-jump:hover {
	border-color: var(--mz-main);
	color: var(--mz-main);
}

.mz-i-jump.is-empty {
	border-color: transparent;
	color: #c4c8cf;
}

/* 色の索引：見出しボタンと見出しに色見本 */
.mz-i-nav.is-color .mz-i-jump {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 12px 4px 8px;
}

/* No.の索引：章の注釈と、名前の前の番号 */
.mz-i-note {
	margin: 0 0 4px;
	color: var(--mz-muted);
	font-size: 13px;
	line-height: 1.7;
}

.mz-i-no {
	flex: none;
	min-width: 2em;
	color: var(--mz-muted);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}

.mz-i-jump.is-empty .mz-dot {
	opacity: 0.35;
}

.mz-i-head .mz-dot {
	margin-right: 8px;
	vertical-align: -2px;
}

.mz-i-count {
	margin-left: 6px;
	color: var(--mz-muted);
	font-size: 13px;
	font-weight: 400;
}

.mz-i-group {
	scroll-margin-top: 90px; /* SWELLの固定ヘッダー分 */
}

.mz-tree .mz-i-head {
	margin: 16px 0 6px;
	padding: 2px 10px;
	background: var(--mz-soft);
	border-left: 4px solid var(--mz-main);
	border-radius: 2px;
	font-size: 16px;
	font-weight: 700;
}

.mz-tree .mz-i-list {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mz-tree .mz-i-list li {
	margin: 0;
	padding: 0;
}

.mz-tree .mz-i-list li::before {
	content: none;
	display: none;
}

.mz-i-item {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 5px 6px;
	line-height: 1.5;
	background: none;
	border: 0;
	border-radius: 6px;
	text-align: left;
}

.mz-i-item:hover {
	background: var(--mz-soft);
}

.mz-i-item.is-selected {
	background: color-mix(in srgb, var(--mz-main) 12%, transparent);
}

.mz-i-label {
	min-width: 0;
}

/* 和名の読み */
.mz-yomi {
	margin-left: 2px;
	color: var(--mz-muted);
	font-size: 0.72em;
	font-weight: 400;
}

.mz-graph {
	height: 64vh; /* 初期表示で大分類が収まる高さ */
	min-height: 480px;
	background:
		radial-gradient(circle, #e6ddcc 1px, transparent 1px) 0 0 / 22px 22px,
		var(--mz-bg);
}

.mz-graph svg {
	display: block;
	width: 100%;
	height: 100%;
	cursor: grab;
	touch-action: none;
}

.mz-graph svg:active {
	cursor: grabbing;
}

/* ツリー図のノードと線 */
.mz-link {
	fill: none;
	stroke: var(--mz-line);
	stroke-width: 1.4px;
}

.mz-link.is-informal {
	stroke-dasharray: 4 3;
}

.mz-node {
	cursor: pointer;
	outline: none;
}

.mz-node circle {
	fill: var(--mz-bg);
	stroke: var(--mz-main);
	stroke-width: 1.6px;
}

.mz-node--class.is-collapsed circle,
.mz-node--root circle {
	fill: var(--mz-main);
}

.mz-node.is-informal.mz-node--class circle {
	stroke-dasharray: 2 2;
}

.mz-node text {
	fill: var(--mz-text);
	font-size: 14px;
	paint-order: stroke;
	stroke: var(--mz-bg);
	stroke-width: 4px;
	stroke-linejoin: round;
}

.mz-node--class text {
	font-weight: 600;
}

.mz-node--root text {
	font-size: 16px;
	font-weight: 700;
}

.mz-node .mz-t-tag {
	fill: var(--mz-tag-fg);
	font-size: 12px;
	font-weight: 400;
}

/* 分類の元素・化学式（硫化鉱物 → S など） */
.mz-node .mz-t-sign {
	fill: var(--mz-main);
	font-size: 13px;
	font-weight: 600;
	opacity: 0.75;
}

.mz-sign {
	display: inline-block;
	margin-left: 8px;
	padding: 0 7px;
	background: var(--mz-soft);
	border-radius: 4px;
	color: var(--mz-main);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.7;
	vertical-align: 1px;
}

.mz-node .mz-t-count {
	fill: var(--mz-muted);
	font-size: 12px;
	font-weight: 400;
}

.mz-node:hover .mz-t-name,
.mz-node.is-selected .mz-t-name {
	fill: var(--mz-main);
}

.mz-node.is-selected circle,
.mz-node:focus-visible circle {
	stroke-width: 3.5px;
}

.mz-node--mineral.is-selected circle {
	stroke: var(--mz-main) !important;
}

/* ---------- リスト（SWELLの ul/li 装飾を打ち消す） ---------- */
.mz-tree .mz-list {
	padding: 8px 12px 12px;
}

.mz-tree .mz-list ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mz-tree .mz-list li {
	position: static;
	margin: 0;
	padding: 0;
}

.mz-tree .mz-list li::before {
	content: none;
	display: none;
}

.mz-tree .mz-list details > ul {
	margin-left: 9px;
	padding-left: 14px;
	border-left: 1px solid var(--mz-border);
}

.mz-tree .mz-list summary {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 4px;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
	list-style: none;
}

.mz-tree .mz-list summary::-webkit-details-marker {
	display: none;
}

.mz-tree .mz-list summary::before {
	content: "";
	flex: none;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 5px 0 5px 7px;
	border-color: transparent transparent transparent var(--mz-main);
	transition: transform 0.15s;
}

.mz-tree .mz-list details[open] > summary::before {
	transform: rotate(90deg);
}

.mz-tree .mz-list summary:hover {
	background: var(--mz-soft);
}

.mz-l-count {
	margin-left: auto;
	padding: 0 8px;
	background: var(--mz-soft);
	border-radius: 10px;
	color: var(--mz-muted);
	font-size: 13px;
	font-weight: 400;
}

.mz-l-item {
	display: flex;
	align-items: center;
	gap: 4px 10px;
	width: 100%;
	padding: 6px 6px;
	background: none;
	border: 0;
	border-radius: 6px;
	text-align: left;
}

.mz-l-item:hover {
	background: var(--mz-soft);
}

.mz-l-item.is-selected {
	background: color-mix(in srgb, var(--mz-main) 12%, transparent);
}

.mz-l-item .mz-dot {
	align-self: center;
}

/* 名前2行（上＝和名、下＝カタカナ名、同じ扱い） */
.mz-l-names,
.mz-d-names,
.mz-chip-names {
	display: flex;
	flex-direction: column;
	line-height: 1.4;
}

.mz-l-names {
	min-width: 9em;
}

.mz-l-en {
	color: var(--mz-muted);
	font-size: 13px;
}

.mz-l-f {
	margin-left: auto;
	color: var(--mz-muted);
	font-size: 13px;
	white-space: nowrap;
}

.mz-tree .mz-list .mz-l-var {
	margin-left: 13px;
	padding-left: 14px;
	border-left: 1px dashed var(--mz-line);
}

/* ---------- 共通パーツ ---------- */
.mz-dot {
	display: inline-block;
	flex: none;
	width: 14px;
	height: 14px;
	background: var(--c);
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

/* 詳細カードを開いている間は、右下の固定ボタン（上へ戻る・ふりがな）を本文と同じ層に下げる。
   SWELL の本文（#content）は z-index:1 の層なので、カードの z-index をいくら上げてもボタン（99）より前に出られないため。
   → カードと重なる所ではボタンがカードの後ろに隠れ、重ならなければそのまま押せる */
body.mz-detail-open .p-fixBtnWrap,
body.mz-detail-open .mf-rubyfix {
	z-index: 0;
}

/* 無色・透明：白と区別できるように、透けて見える斜線のガラス玉風にする */
.mz-dot--clear {
	background:
		linear-gradient(135deg, rgba(255, 255, 255, 0.95) 30%, rgba(200, 220, 235, 0.6) 50%, rgba(255, 255, 255, 0.95) 70%),
		#eef3f7;
	box-shadow: inset 0 0 0 1px rgba(80, 110, 140, 0.45);
}

.mz-d-colors {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
}

.mz-d-color {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
}

.mz-hint {
	margin-left: 8px;
	color: var(--mz-muted);
	font-size: 12px;
}

.mz-d-countries {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	align-content: flex-start;
	gap: 4px 6px;
}

.mz-country {
	padding: 0 8px;
	background: var(--mz-soft);
	border-radius: 4px;
	white-space: nowrap;
}

/* 日本で採れる鉱物は目立たせる */
.mz-country.is-jp {
	background: #fdecea;
	color: #b3261e;
	font-weight: 700;
}

.mz-d-color .mz-dot {
	width: 12px;
	height: 12px;
}

.mz-tag {
	display: inline-block;
	padding: 0 5px;
	background: var(--mz-tag-bg);
	border-radius: 4px;
	color: var(--mz-tag-fg);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.6;
	white-space: nowrap;
	vertical-align: 1px;
}

/* ---------- 詳細パネル ---------- */
.mz-detail {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 100; /* 右下の固定ボタン（99）より手前 */
	width: 340px;
	max-width: calc(100% - 24px);
	max-height: calc(100% - 24px);
	overflow: auto;
	padding: 18px 18px 16px;
	background: var(--mz-bg);
	border: 1px solid var(--mz-border);
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.mz-detail[hidden] {
	display: none;
}

/* リスト表示ではページが長くなるので画面に固定 */
.mz-tree:not([data-view="graph"]) .mz-detail {
	position: fixed;
	top: auto;
	right: 24px;
	bottom: 24px;
	z-index: 10000; /* SWELLのトップへ戻るボタンより上 */
	max-height: 70vh;
}

.mz-d-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 32px;
	height: 32px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 50%;
	color: var(--mz-muted);
	font-size: 21px;
	line-height: 32px;
}

.mz-d-close:hover {
	background: var(--mz-soft);
}

.mz-d-head {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 14px;
	padding-right: 28px;
}

.mz-d-swatch {
	flex: none;
	width: 48px;
	height: 48px;
	background: var(--c);
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.12);
}

.mz-d-names {
	font-size: 19px;
	font-weight: 700;
}

.mz-tree .mz-d-en,
.mz-cardpop .mz-d-en{
	margin: 2px 0 0;
	color: var(--mz-muted);
	font-size: 14px;
}

.mz-tree .mz-d-list,
.mz-cardpop .mz-d-list{
	display: grid;
	grid-template-columns: 6em 1fr; /* 「主な産出国」が1行に収まる幅 */
	gap: 6px 10px;
	margin: 0 0 12px;
	font-size: 14px;
}

.mz-tree .mz-d-list dt,
.mz-cardpop .mz-d-list dt{
	margin: 0;
	color: var(--mz-muted);
	font-weight: 400;
}

.mz-tree .mz-d-list dd,
.mz-cardpop .mz-d-list dd{
	margin: 0;
}

.mz-d-formula {
	font-size: 16px;
}

.mz-d-formula small {
	margin-left: 6px;
	color: var(--mz-muted);
	font-size: 12px;
}

.mz-sep {
	margin: 0 4px;
	color: var(--mz-muted);
}

.mz-tree .mz-d-note,
.mz-cardpop .mz-d-note{
	margin: 0 0 12px;
	padding: 10px 12px;
	background: var(--mz-soft);
	border-radius: 8px;
	font-size: 14px;
}

.mz-tree .mz-d-sub,
.mz-cardpop .mz-d-sub{
	margin: 12px 0 6px;
	color: var(--mz-muted);
	font-size: 13px;
}

.mz-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.mz-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 5px 12px 5px 8px;
	background: var(--mz-bg);
	border: 1px solid var(--mz-border);
	border-radius: 10px;
	font-size: 13px;
	text-align: left;
}

.mz-chip:hover {
	border-color: var(--mz-main);
}

/* 記事へのリンク（記事がある鉱物だけ） */
.mz-tree .mz-d-more,
.mz-cardpop .mz-d-more{
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 16px;
	padding: 10px 16px;
	background: var(--mz-main);
	border-radius: 8px;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
}

.mz-tree .mz-d-more:hover,
.mz-cardpop .mz-d-more:hover{
	opacity: 0.85;
}

.mz-has-article {
	flex: none;
	margin-left: auto;
	padding: 0 6px;
	border: 1px solid var(--mz-main);
	border-radius: 4px;
	color: var(--mz-main);
	font-size: 12px;
	line-height: 1.6;
}

.mz-l-item .mz-has-article {
	margin-left: 0;
}

/* ---------- 凡例 ---------- */
.mz-tree .mz-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	margin: 10px 0 0;
	padding: 0;
	color: var(--mz-muted);
	font-size: 13px;
	list-style: none;
}

/* 文章の流れで折り返す（flex にすると、文字やふりがなの塊ごとに別の箱になって崩れるため） */
.mz-tree .mz-legend li {
	display: block;
	margin: 0;
	padding: 0;
	line-height: 1.7;
}
.mz-tree .mz-legend .mz-legend-dot,
.mz-tree .mz-legend .mz-legend-dash {
	display: inline-block;
	margin-right: 6px;
	vertical-align: middle;
}
@media (max-width: 599px) {
	.mz-tree .mz-legend {
		flex-direction: column;
		gap: 4px;
		font-size: 12px;
	}
}

.mz-tree .mz-legend li::before {
	content: none;
	display: none;
}

.mz-legend-dot {
	width: 12px;
	height: 12px;
	background: conic-gradient(#c1272d, #e8a317, #1e8a5a, #1f4ba5, #9b59b6, #c1272d);
	border-radius: 50%;
}

.mz-legend-dash {
	width: 22px;
	border-top: 2px dashed var(--mz-line);
}

/* ---------- PC（960px〜）：本文幅を超えて画面幅いっぱいに広げる ---------- */
@media (min-width: 960px) {
	.mz-tree {
		width: min(1400px, calc(100vw - 80px));
		margin-left: calc(50% - min(700px, 50vw - 40px));
	}
}

/* ---------- TAB（600〜959px） ---------- */
@media (max-width: 959px) {
	.mz-graph {
		height: 66vh;
		min-height: 460px;
	}

	.mz-tree .mz-i-list {
		grid-template-columns: repeat(3, 1fr);
	}

	/* 詳細は下からのシート（横に出すと図が隠れるため） */
	.mz-detail,
	.mz-tree:not([data-view="graph"]) .mz-detail {
		position: fixed;
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 10000; /* SWELLのトップへ戻るボタンより上 */
		width: auto;
		max-width: 720px;
		max-height: 55vh;
		margin: 0 auto;
		padding: 22px 20px calc(16px + env(safe-area-inset-bottom));
		border-radius: 16px 16px 0 0;
		box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
	}

	.mz-detail::before {
		content: "";
		position: absolute;
		top: 8px;
		left: 50%;
		width: 40px;
		height: 4px;
		margin-left: -20px;
		background: var(--mz-border);
		border-radius: 2px;
	}
}

/* ---------- SP（〜599px） ---------- */
@media (max-width: 599px) {
	.mz-toolbar {
		gap: 8px;
	}

	.mz-seg {
		flex: 1 1 auto;
	}

	.mz-seg button {
		flex: 1;
		padding: 8px 6px;
	}

	.mz-actions {
		width: 100%;
	}

	.mz-btn {
		flex: 1;
		padding: 8px 6px;
	}

	.mz-tree .mz-status {
		width: 100%;
		margin: 0;
	}

	.mz-graph {
		height: 62vh;
		min-height: 380px;
	}

	.mz-tree .mz-list {
		padding: 4px 6px 8px;
	}

	.mz-tree .mz-list details > ul {
		margin-left: 6px;
		padding-left: 10px;
	}

	.mz-l-item {
		flex-wrap: wrap;
		padding: 8px 4px;
	}

	.mz-l-f {
		display: none;
	}

	.mz-index {
		padding: 8px 10px 16px;
	}

	.mz-tree .mz-i-list {
		grid-template-columns: repeat(2, 1fr);
		gap: 0 6px;
	}

	.mz-i-nav {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
	}

	/* 絞込み：条件は1列にし、項目ごとに見出しで開閉する（キーワードは常に表示） */
	.mz-filter {
		padding: 10px 10px 16px;
	}

	.mz-f-panel {
		padding: 12px 14px;
	}

	.mz-f-body {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.mz-f-row--kw {
		padding-bottom: 10px;
	}

	.mz-f-row--half {
		grid-column: 1 / -1;
	}

	.mz-f-row--fold {
		border-top: 1px solid var(--mz-border);
	}

	.mz-tree .mz-f-fold {
		display: flex;
		align-items: center;
		width: 100%;
		margin: 0;
		padding: 11px 0;
		cursor: pointer;
	}

	.mz-tree .mz-f-fold::after {
		content: "＋";
		margin-left: 10px;
		color: var(--mz-muted);
		font-weight: 400;
	}

	.mz-f-row--fold.is-open .mz-f-fold::after {
		content: "－";
	}

	/* 閉じていても、選んでいる内容が見出しの横で分かるようにする */
	.mz-f-sel {
		display: block;
		overflow: hidden;
		margin-left: auto;
		color: var(--mz-main);
		font-size: 13px;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.mz-f-row--fold .mz-f-content {
		display: none;
		padding-bottom: 12px;
	}

	.mz-f-row--fold.is-open .mz-f-content {
		display: block;
	}

	.mz-f-actions {
		padding-top: 10px;
		border-top: 1px solid var(--mz-border);
	}

	.mz-i-nav.is-color {
		grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	}

	.mz-i-nav.is-no {
		grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
	}

	/* 地図：スマホは縦長の枠にして、最初から拡大して表示する */
	.mz-map-box {
		height: 60vh;
		min-height: 360px;
	}

	.mz-map-svg {
		height: 100%;
		max-height: none;
	}

	.mz-tabs button {
		flex: 1;
		padding: 10px 4px;
		font-size: 16px;
	}

	.mz-i-jump {
		min-width: 0;
		padding: 6px 0;
	}

	.mz-detail,
	.mz-tree:not([data-view="graph"]) .mz-detail {
		max-height: 70vh;
		padding: 22px 16px calc(16px + env(safe-area-inset-bottom));
	}
}

/* ---------- カードの写真（出典付き・押すと拡大） ---------- */
.mz-tree .mz-d-photo,
.mz-cardpop .mz-d-photo{
	margin: 0 0 12px;
}
.mz-tree .mz-d-photo img,
.mz-cardpop .mz-d-photo img{
	display: block;
	width: 100%;
	height: 170px;
	object-fit: cover;
	border-radius: 6px;
	background: #000;
}
.mz-tree .mz-d-credit,
.mz-cardpop .mz-d-credit{
	margin-top: 4px;
	color: var(--mz-muted);
	font-size: 10.5px;
	line-height: 1.5;
}
.mz-tree .mz-d-credit a,
.mz-cardpop .mz-d-credit a{
	color: inherit;
	text-decoration: underline;
}

/* ---------- 記事の中で鉱物名を押したときのカード（図鑑の詳細カードと共通の見た目） ---------- */
.mz-cardpop {
	--mz-main: var(--color_main, #2f5d50);
	--mz-text: var(--color_text, #2e2a25);
	--mz-muted: #6f675d;
	--mz-line: #cbbfa9;
	--mz-border: #ddd3c2;
	--mz-bg: #fbf9f4;
	--mz-soft: #efe8db;
	--mz-tag-fg: #8a5a00;
	--mz-tag-bg: #fff3d6;
	color: var(--mz-text);
	font-size: 15px;
	line-height: 1.6;
}
.mz-cardpop button {
	font: inherit;
	color: inherit;
	cursor: pointer;
}
/* PC：鉱物名の近くに出す（位置はJSで指定）。タブレット・スマホは図鑑と同じ下からのシート */
@media (min-width: 960px) {
	.mz-detail.mz-cardpop {
		position: absolute;
		top: auto;
		right: auto;
		z-index: 100001;
		max-width: calc(100vw - 32px);
		max-height: min(600px, calc(100vh - 16px));
	}
}
.mz-detail.mz-cardpop {
	z-index: 100001;
}

/* 地図の「名もなき坑道」（採掘ゲーム。assets/tree.js の showNameless） */
.mz-nameless {
	cursor: pointer;
}
.mz-nameless circle {
	fill: transparent;
	stroke: none;
}
.mz-nameless text {
	fill: #6b4f2e;
	stroke: #f7f2e8;
	stroke-width: 2.2px;
	paint-order: stroke;
	font-family: Georgia, serif;
	font-size: 11px;
	font-weight: 700;
	pointer-events: none;
}
.mz-nameless:hover text {
	fill: #b5874a;
}
/* カードの見出しの「？」 */
.mz-nameless__q {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	color: #6b4f2e;
	font-family: Georgia, serif;
	font-size: 17px;
	font-weight: 700;
	line-height: 1;
}
.mz-nameless__txt {
	margin: 12px 0 14px;
	font-size: 13px;
	line-height: 1.85;
	color: #5d564d;
}
a.mz-nameless__go {
	display: inline-block;
	padding: 9px 22px;
	border-radius: 999px;
	background: #2b2620;
	color: #f3d9a4 !important;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none !important;
}
a.mz-nameless__go:hover {
	background: #4a3b2c;
}
