/* UNDER LAYERS — 電報(mail.html)。kb.css の .box / .band / .btn・.pi(16px のドット絵アイコン)を使う。docs/api.md §31 */

.ml-main {
	max-width: 860px;
}

.ml-lead {
	margin: 4px 0 0;
	font-size: var(--fs-s);
}

.pi-ho-new { background-image: url("../art/ui/ho_new.png"); }
.pi-ho-open { background-image: url("../art/ui/ho_open.png"); } /* 受け取ったもの(枠の見出し) */

.ml-app {
	display: grid;
	gap: 12px;
}

.ml-box {
	margin: 0;
}

/* ---------------------------------------------------------------- 上の帯(件数・すべて受け取る) */

.ml-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 10px;
}

.ml-count {
	margin: 0;
	font-size: var(--fs-m);
}

.ml-count b {
	color: var(--warn);
	font-size: var(--fs-l);
}

/* ---------------------------------------------------------------- 一覧(1件 = details) */

.ml-list {
	display: grid;
	gap: 6px;
}

.ml-item {
	border: 1px solid var(--line);
	background: var(--bg-deep);
}

.ml-item.is-new {
	border-color: var(--line-hi);
	box-shadow: inset 3px 0 0 var(--warn);
}

.ml-item.is-expired {
	opacity: .72;
}

.ml-sum {
	display: grid;
	grid-template-columns: 32px minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	cursor: pointer;
	list-style: none;
}

.ml-sum::-webkit-details-marker {
	display: none;
}

.ml-sum:hover,
.ml-sum:focus-visible {
	background: rgba(127, 221, 87, .06);
}

.ml-sum-main {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.ml-subj {
	overflow-wrap: anywhere;
	color: var(--fg-hi);
}

.ml-meta {
	font-size: var(--fs-xs);
	overflow-wrap: anywhere;
}

.ml-state {
	display: inline-block;
	padding: 0 4px;
	border: 1px solid currentColor;
	font-family: var(--mono);
	font-size: 10px;
	vertical-align: 1px;
	white-space: nowrap;
}

.ml-state.is-new { color: var(--warn); }
.ml-state.is-got { color: var(--muted); }
.ml-state.is-expired { color: var(--alert-hi); }

.ml-chev {
	color: var(--muted);
	transition: transform .15s;
}

.ml-item[open] .ml-chev {
	transform: rotate(90deg);
}

.ml-body {
	display: grid;
	gap: 10px;
	padding: 4px 12px 12px 52px;
}

.ml-text {
	margin: 0;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	line-height: 1.7;
}

/* 本文の書式(運営が打った電報だけ。lib/MailFormat.php・assets/js/mail-format.js。DESIGN.md §2「電報の本文のリンク」)
   リンクは一目で分かるよう、ふつうのリンク(--sub・下線なし)と分けて --cyan・実線の下線・薄い地・16px のアイコン。外部は ho_linkx で別タブ */
.ml-em {
	color: var(--fg-hi);
	font-weight: bold;
	background: rgba(166, 240, 138, .1);
	padding: 0 2px;
}

.ml-text a.ml-link:link,
.ml-text a.ml-link:visited {
	color: var(--cyan);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	background: rgba(111, 214, 232, .1);
	padding: 0 3px 0 2px;
	word-break: break-all;
}

.ml-text a.ml-link:hover,
.ml-text a.ml-link:focus-visible {
	color: var(--bg);
	background: var(--cyan);
	text-decoration: none;
	outline: 1px solid var(--cyan);
}

.ml-link-ic {
	display: inline-block;
	width: 16px;
	height: 16px;
	margin-right: 3px;
	vertical-align: -3px;
	image-rendering: pixelated;
}

html.kb-arts-off .ml-link-ic { display: none; }

/* ---------------------------------------------------------------- 添え荷 */

.ml-h3 {
	margin: 0 0 6px;
	color: var(--fg);
	font-size: var(--fs-s);
	font-weight: normal;
	letter-spacing: .08em;
}

.ml-glist {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ml-g {
	display: grid;
	grid-template-columns: 32px minmax(0, 1fr);
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	border: 1px solid var(--line);
	background: var(--bg);
}

.ml-g-main {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.ml-g-name {
	overflow-wrap: anywhere;
}

.ml-g-n {
	color: var(--warn);
}

.ml-g-text {
	font-size: var(--fs-xs);
	overflow-wrap: anywhere;
}

.ml-gicon {
	display: block;
	width: 32px;
	height: 32px;
	image-rendering: pixelated;
}

.ml-gicon.is-blank {
	border: 1px dashed var(--line);
}

html.kb-arts-off .ml-gicon {
	visibility: hidden;
}

.ml-noattach {
	margin: 0;
	font-size: var(--fs-s);
}

.ml-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.ml-exp {
	color: var(--sub);
	font-size: var(--fs-s);
}

.ml-exp.is-soon {
	color: var(--warn);
}

.ml-done {
	margin-left: auto;
	color: var(--muted);
	font-size: var(--fs-s);
}

.ml-done.is-gone {
	color: var(--alert-hi);
}

.ml-claim {
	margin-left: auto;
}

.ml-empty {
	margin: 12px 0;
	text-align: center;
}

.ml-note,
.ml-res-note {
	margin: 10px 0 0;
	font-size: var(--fs-xs);
}

.ml-pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 10px 0 0;
}

/* ---------------------------------------------------------------- 受け取ったもの */

.ml-result .band {
	background: var(--warn);
}

.ml-res {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ml-res-mail {
	overflow-wrap: anywhere;
}

.ml-gains {
	margin: 4px 0 0;
	padding-left: 1.2em;
}

.ml-gain {
	color: var(--fg-hi);
}

.ml-gain.is-boost {
	color: var(--cyan);
}

@media (max-width: 520px) {
	.ml-body {
		padding: 4px 10px 12px;
	}

	.ml-sum {
		gap: 8px;
		padding: 8px;
	}

	.ml-foot .btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ml-chev {
		transition: none;
	}
}

/* 抽出品の個体の添え荷(保管庫と同じ形の行 ops/items.js の .x-row を中に置く。横幅いっぱい) */
.ml-g.is-instance {
	grid-column: 1 / -1;
	grid-template-columns: minmax(0, 1fr);
	align-items: stretch;
	gap: 4px;
}

.ml-inst {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: start;
	gap: 8px;
	min-width: 0;
}

.ml-inst .x-row {
	min-width: 0;
	border-top: 0;
	border-right: 0;
	border-bottom: 0;
	padding: 0 0 0 8px;
	background: none;
}

.ml-inst-side {
	display: grid;
	justify-items: end;
	gap: 2px;
	white-space: nowrap;
}

.ml-inst-dest {
	font-size: var(--fs-xs);
}

.ml-g.is-sealed {
	border-style: dashed;
}

.ml-sealed {
	margin: 0;
	padding: 3px 6px;
	border-left: 2px solid var(--warn);
	color: var(--warn);
	font-size: var(--fs-xs);
}

.ml-inst-note {
	margin: 6px 0 0;
	font-size: var(--fs-xs);
}
