/* 喪中はがき 文例メーカー */
.nbm-form, .nbm-editor {
	--nbm-ink: #3d3a45;
	--nbm-sub: #6b6675;
	--nbm-line: #d9d4e0;
	--nbm-bg: #f7f5fa;
	--nbm-accent: #6a5a86;
	--nbm-accent-soft: #ece7f3;
	border: 1px solid var(--nbm-line);
	background: var(--nbm-bg);
	border-radius: 10px;
	padding: 16px;
	margin: 1.4em 0;
	color: var(--nbm-ink);
	box-sizing: border-box;
}
.nbm-form *, .nbm-editor * { box-sizing: border-box; }
.nbm-form-title { font-weight: 700; font-size: 1.05em; margin: 0 0 .3em; }
.nbm-form-lead { font-size: .88em; color: var(--nbm-sub); margin: 0 0 1em; line-height: 1.6; }
.nbm-field { display: block; margin: 0 0 .9em; }
.nbm-label { display: block; font-size: .85em; font-weight: 700; margin-bottom: .35em; }
.nbm-row { display: flex; gap: 10px; flex-wrap: wrap; }
.nbm-row .nbm-field { flex: 1 1 150px; }
.nbm-row .nbm-field-s { flex: 0 1 110px; }
.nbm-input, .nbm-textarea {
	width: 100%;
	font-size: 16px; /* iPhoneで拡大されないように */
	padding: 10px 12px;
	border: 1px solid var(--nbm-line);
	border-radius: 8px;
	background: #fff;
	color: var(--nbm-ink);
	font-family: inherit;
}
.nbm-input:focus, .nbm-textarea:focus { outline: 2px solid var(--nbm-accent); outline-offset: 1px; }
.nbm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.nbm-chip {
	min-width: 52px;
	min-height: 40px;
	padding: 6px 12px;
	border: 1px solid var(--nbm-line);
	border-radius: 999px;
	background: #fff;
	color: var(--nbm-ink);
	font-size: 15px;
	cursor: pointer;
	line-height: 1.2;
}
.nbm-chip.nbm-on { background: var(--nbm-accent); border-color: var(--nbm-accent); color: #fff; }
.nbm-note { font-size: .82em; color: var(--nbm-sub); margin: .4em 0 .8em; line-height: 1.6; }

.nbm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 8px 16px;
	border-radius: 8px;
	border: 1px solid #6a5a86;
	background: #6a5a86;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	line-height: 1.2;
}
.nbm-btn-sub { background: #fff; color: #6a5a86; }
.nbm-btn.nbm-done { background: #3f7a5a; border-color: #3f7a5a; color: #fff; }

.nbm-ex {
	border: 1px solid #d9d4e0;
	border-left: 4px solid #a99bc0;
	background: #fff;
	border-radius: 8px;
	padding: 14px 16px 12px;
	margin: 1em 0 1.4em;
}
.nbm-ex.nbm-mine { border-left-color: #6a5a86; background: #fbfaff; }
.nbm-ex-text { margin: 0 0 12px; line-height: 2; letter-spacing: .02em; word-break: break-all; }
.nbm-ex-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nbm-ex-actions .nbm-btn { flex: 1 1 160px; }

.nbm-warn { margin: .6em 0 0; padding-left: 1.2em; font-size: .88em; line-height: 1.6; color: #8a3b2e; }
.nbm-warn li { margin-bottom: .3em; }
.nbm-warn .nbm-ok { color: #3f7a5a; list-style: none; margin-left: -1.2em; }
.nbm-textarea { line-height: 1.9; resize: vertical; }

@media (prefers-color-scheme: dark) {
	/* Cocoonはライト固定のため、ここでは色を変えない */
}
@media (max-width: 480px) {
	.nbm-form, .nbm-editor { padding: 14px 12px; }
	.nbm-ex { padding: 12px; }
	.nbm-ex-text { font-size: 15px; }
}

/* 使い方の3段（入れる → 変わる → コピー） */
.nbm-how { list-style: none !important; display: flex; gap: 8px; margin: 4px 0 12px !important; padding: 0 !important; counter-reset: none; }
.nbm-how-step {
	flex: 1 1 0;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 12px 8px 10px !important;
	margin: 0 !important;
	background: #fff;
	border: 1px solid var(--nbm-line);
	border-radius: 8px;
	text-align: center;
	line-height: 1.5 !important;
}
.nbm-how-step::before { display: none !important; }
.nbm-how-step + .nbm-how-step::after {
	content: "";
	position: absolute;
	left: -9px;
	top: 50%;
	width: 10px;
	height: 10px;
	border-top: 2px solid #a99bc0;
	border-right: 2px solid #a99bc0;
	transform: translate(-2px, -50%) rotate(45deg);
	background: none;
}
.nbm-how-no {
	position: absolute; left: 6px; top: 6px;
	width: 20px; height: 20px; border-radius: 50%;
	background: var(--nbm-accent); color: #fff;
	font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.nbm-how-pic { display: flex; gap: 4px; align-items: center; justify-content: center; min-height: 44px; font-size: 12px; }
.nbm-how-chip { padding: 3px 10px; border-radius: 999px; background: var(--nbm-accent); color: #fff; font-weight: 700; }
.nbm-how-in { padding: 3px 10px; border: 1px solid var(--nbm-line); border-radius: 6px; background: #fff; }
.nbm-how-card { display: block; padding: 6px 8px; border-left: 3px solid var(--nbm-accent); background: #fbfaff; font-size: 11px; line-height: 1.6; text-align: left; }
.nbm-how-card mark, .nbm-hl { background: linear-gradient(transparent 55%, #e3d9f2 55%); color: inherit; padding: 0 1px; font-weight: 700; }
.nbm-how-copy { padding: 5px 10px; border-radius: 6px; background: var(--nbm-accent); color: #fff; font-weight: 700; font-size: 11px; }
.nbm-how-txt { font-size: 12.5px; color: var(--nbm-ink); font-weight: 700; }
.nbm-how-txt b { color: var(--nbm-accent); }

/* 入力欄の中の見本 */
.nbm-preview-wrap { margin: 6px 0 12px; padding: 12px; border: 1px dashed #b3a7c6; border-radius: 8px; background: #fff; }
.nbm-preview-h { margin: 0 0 4px !important; font-size: .9em; font-weight: 700; color: var(--nbm-accent); }
.nbm-preview-h span { font-weight: 400; color: var(--nbm-sub); font-size: .9em; }
.nbm-preview-wrap .nbm-ex { margin: 6px 0 8px; }
.nbm-jump {
	display: block; width: 100%;
	min-height: 40px; padding: 8px 12px;
	border: 0; border-radius: 8px;
	background: var(--nbm-accent-soft); color: var(--nbm-accent);
	font-size: 14px; font-weight: 700; cursor: pointer;
}
.nbm-jump[hidden] { display: none; }

/* 変わった瞬間に、ふわっと光らせる */
@keyframes nbmFlash { 0% { box-shadow: 0 0 0 0 rgba(106, 90, 134, .45); background: #f3eefa; } 100% { box-shadow: 0 0 0 10px rgba(106, 90, 134, 0); } }
.nbm-ex.nbm-flash { animation: nbmFlash .9s ease-out; }

@media (max-width: 600px) {
	.nbm-how { flex-direction: column; gap: 14px; }
	.nbm-how-step { flex-direction: row; text-align: left; padding: 10px 10px 10px 34px !important; }
	.nbm-how-step + .nbm-how-step::after { left: 50%; top: -11px; transform: translateX(-50%) rotate(135deg); }
	.nbm-how-no { top: 50%; transform: translateY(-50%); }
	.nbm-how-pic { flex: 0 0 120px; }
	.nbm-how-txt { flex: 1 1 auto; }
}


/* v1.4.0 差出人・年齢・名前・二人目 */
.nbm-opts { margin-top: 14px; }
.nbm-seg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 6px 0 0; }
.nbm-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 0.95em; cursor: pointer; line-height: 1.6; }
.nbm-opt input { margin: 0; width: 1.05em; height: 1.05em; accent-color: var(--nbm-accent, #6a5a86); }
.nbm-sub { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid #d9d4e0; background: #fbfaff; border-radius: 0 6px 6px 0; }
.nbm-sub[hidden] { display: none; }
.nbm-sub-label { flex-basis: 100%; font-size: 0.85em; color: #6b6675; }
.nbm-note { font-size: 0.85em; color: #6b6675; margin: 6px 0 0; line-height: 1.6; }
.nbm-note:empty { display: none; }
.nbm-two { margin-top: 14px; border-top: 1px dashed #d9d4e0; padding-top: 10px; }
.nbm-two summary { cursor: pointer; font-weight: bold; font-size: 0.95em; }
.nbm-two[open] summary { margin-bottom: 6px; }
@media (prefers-color-scheme: dark) {
	.nbm-sub-label, .nbm-note { color: #aaa; }
}


/* v1.4.1 文例の数の案内 */
.nbm-count { margin: 6px 0 10px; padding: 8px 12px; background: #fbfaff; border: 1px solid #d9d4e0; border-radius: 6px; font-size: 0.95em; line-height: 1.7; }
.nbm-count[hidden] { display: none; }
.nbm-count b { color: var(--nbm-accent, #6a5a86); }


/* v1.5.0 この文面でデザインを選ぶ・画面下の帯 */
.nbm-pick { background: #3f7a5a; border-color: #3f7a5a; color: #fff; }
.nbm-pick[hidden] { display: none; }
.nbm-pick::after { content: " ↓"; }
.nbm-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990; background: #fff; border-top: 2px solid #3f7a5a; box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); font-size: 14px; color: #3d3a45; }
.nbm-bar[hidden] { display: none; }
.nbm-bar-main { max-width: 760px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.nbm-bar-label { flex: 1 1 220px; min-width: 0; line-height: 1.5; }
.nbm-bar-label b { color: #3f7a5a; }
.nbm-bar-btns { display: flex; align-items: center; gap: 6px; }
.nbm-bar .nbm-btn { min-height: 38px; padding: 6px 12px; font-size: 13px; }
.nbm-bar #nbm-bar-copy { background: #3f7a5a; border-color: #3f7a5a; }
.nbm-bar-x { border: 0; background: none; color: #6b6675; font-size: 22px; line-height: 1; min-width: 38px; min-height: 38px; cursor: pointer; }
.nbm-bar-text { max-width: 760px; margin: 8px auto 0; padding: 8px 10px; background: #fbfaff; border: 1px solid #d9d4e0; border-radius: 6px; font-size: 13px; line-height: 1.8; white-space: pre-line; max-height: 40vh; overflow: auto; }
.nbm-bar-text[hidden] { display: none; }
.nbm-bar-msg { max-width: 760px; margin: 4px auto 0; font-size: 12px; line-height: 1.6; color: #3f7a5a; }
.nbm-bar-msg:empty { display: none; }
@media (max-width: 520px) {
	.nbm-bar-label { flex-basis: 100%; }
	.nbm-bar-btns { width: 100%; }
	.nbm-bar-btns .nbm-btn { flex: 1; }
}


/* v1.5.1 ボタンを一本化 */
.nbm-btn[hidden] { display: none; }
