/* =========================================================
   BLOOM グループ共通トースト（WordPress 用） v2.0 — bloom-toast.js と対
   仕様の正本: ~/handoff/ui-vessel/TOAST-SPEC.md
   形・余白・字・動きは全サイト同じ。サイトごとに上書きするのは下の --bt-* だけ。
   動き: Motion Prompt #056 トースト を上寄せに置き換えた型（上から 12px 下りて現れ・上へ消える）
         ＋ 成功のチェックだけ #001 ポップイン を小さく。動かすのは transform と opacity だけ。
   ========================================================= */
:root {
	--bt-top: calc(72px + env(safe-area-inset-top, 0px) + 8px); /* ヘッダーの高さ＋ノッチ＋8px */
	--bt-width: 420px;
	--bt-accent: #1558c7;   /* ブランドの主色（情報アイコン・操作ボタン） */
	--bt-ink: #0b1f44;      /* 文字 */
	--bt-muted: #5b6b82;    /* 2 行目・閉じる */
	--bt-bg: #ffffff;
	--bt-border: #e3e8ef;
	--bt-radius: 12px;
	--bt-shadow: 0 10px 30px rgba(15, 30, 60, 0.12), 0 1px 2px rgba(15, 30, 60, 0.06);
	--bt-font: inherit;
	--bt-success: #1f9d6b;
	--bt-warning: #b26a00;
	--bt-error: #d14343;
	--bt-error-border: #f3c9c9;
	--bt-z: 100000;
}

.bt-region {
	position: fixed;
	top: var(--bt-top);
	left: 50%;
	transform: translateX(-50%);
	z-index: var(--bt-z);
	width: min(var(--bt-width), calc(100vw - 32px));
	pointer-events: none;
	font-family: var(--bt-font);
}
.bt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.bt-toast {
	pointer-events: auto;
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 13px 14px;
	background: var(--bt-bg);
	color: var(--bt-ink);
	border: 1px solid var(--bt-border);
	border-radius: var(--bt-radius);
	box-shadow: var(--bt-shadow);
	cursor: default;
	opacity: 0;
	transform: translateY(-12px);
	transition: opacity 240ms cubic-bezier(0.22, 1, 0.36, 1), transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform, opacity;
}
.bt-toast.is-in { opacity: 1; transform: translateY(0); }
.bt-toast.is-out {
	opacity: 0;
	transform: translateY(-8px);
	transition-duration: 180ms;
	transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.bt-toast--error { border-color: var(--bt-error-border); }

.bt-icon { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; color: var(--bt-accent); display: inline-flex; }
.bt-icon svg { width: 20px; height: 20px; display: block; }
.bt-toast--success .bt-icon { color: var(--bt-success); }
.bt-toast--warning .bt-icon { color: var(--bt-warning); }
.bt-toast--error .bt-icon { color: var(--bt-error); }
.bt-toast--success.is-in .bt-icon svg { animation: bt-pop 320ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes bt-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.bt-body { flex: 1 1 auto; min-width: 0; }
.bt-msg {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0;
	line-break: strict;
	word-break: auto-phrase;
	text-wrap: pretty;
	overflow-wrap: break-word;
}
.bt-desc { margin: 2px 0 0; font-size: 13px; font-weight: 400; line-height: 1.55; color: var(--bt-muted); line-break: strict; word-break: auto-phrase; text-wrap: pretty; }

/* 操作ボタン（元に戻す・見る など）：塗らない文字のボタン。当たり判定は 44px */
.bt-action {
	flex: 0 0 auto;
	position: relative;
	align-self: center;
	margin: -4px -2px -4px 4px;
	padding: 6px 8px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--bt-accent);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
}
.bt-action:hover { background: color-mix(in srgb, var(--bt-accent) 8%, transparent); }
.bt-action::after, .bt-close::after {
	content: "";
	position: absolute;
	top: 50%; left: 50%;
	width: max(100%, 44px); height: max(100%, 44px);
	transform: translate(-50%, -50%);
}
.bt-close {
	flex: 0 0 auto;
	position: relative;
	align-self: center;
	width: 28px; height: 28px;
	margin: -4px -6px -4px 0;
	padding: 4px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--bt-muted);
	cursor: pointer;
}
.bt-close svg { width: 20px; height: 20px; display: block; }
.bt-close:hover { background: rgba(15, 30, 60, 0.06); color: var(--bt-ink); }
.bt-action:focus-visible, .bt-close:focus-visible { outline: 2px solid var(--bt-accent); outline-offset: 2px; }

.bt-spinner {
	width: 18px; height: 18px; margin: 1px;
	box-sizing: border-box;
	border-radius: 50%;
	border: 2px solid color-mix(in srgb, var(--bt-accent) 22%, transparent);
	border-top-color: var(--bt-accent);
	animation: bt-spin 0.8s linear infinite;
}
@keyframes bt-spin { to { transform: rotate(360deg); } }

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

@media (prefers-reduced-motion: reduce) {
	.bt-toast, .bt-toast.is-in, .bt-toast.is-out { transform: none; transition: opacity 120ms linear; }
	.bt-toast--success.is-in .bt-icon svg { animation: none; }
	.bt-spinner { animation-duration: 1.6s; }
}
@media print { .bt-region { display: none; } }
