/* ==========================================================================
   数秘×守護色 鑑定書作成ツール
   - 鑑定書（.nr-sheet）は font-size を基準にした em 指定で、画面幅に合わせて全体が縮尺する
   - 印刷時は鑑定書だけを A4 1枚に出す（@media print）
   ========================================================================== */

/* ---------- 入力 ---------- */
.nr-input {
	padding: 24px 20px 20px;
}

.nr-lead {
	text-align: center;
	font-weight: 700;
	color: #333;
	margin: 0 0 14px;
}

.nr-birth {
	display: flex;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.nr-field {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.nr-select {
	font-size: 16px;
	padding: 10px 12px;
	border: 2px solid #e0e0e0;
	border-radius: 10px;
	background: #fff;
	color: #333;
	min-width: 84px;
}

.nr-select:focus {
	outline: none;
	border-color: #9b8bd8;
}

.nr-unit {
	font-size: 14px;
	color: #666;
}

.nr-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	max-width: 560px;
	margin: 0 auto 14px;
}

.nr-fields label {
	display: block;
	font-size: 13px;
	color: #555;
	font-weight: 700;
}

.nr-fields input {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin-top: 6px;
	font-size: 16px;
	font-weight: 400;
	padding: 10px 12px;
	border: 2px solid #e0e0e0;
	border-radius: 10px;
	background: #fff;
	color: #333;
}

.nr-fields input:focus {
	outline: none;
	border-color: #9b8bd8;
}

.nr-field-hint {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	font-weight: 400;
	color: #888;
}

.nr-use {
	border: 0;
	padding: 0;
	margin: 0 auto 10px;
	max-width: 560px;
	text-align: center;
}

.nr-use legend {
	font-size: 13px;
	font-weight: 700;
	color: #555;
	margin-bottom: 8px;
	width: 100%;
	text-align: center;
}

.nr-use-options {
	display: flex;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
}

.nr-use-option {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: 2px solid #e0e0e0;
	border-radius: 999px;
	font-size: 14px;
	color: #444;
	cursor: pointer;
	background: #fff;
}

.nr-use-option:has(input:checked) {
	border-color: #9b8bd8;
	background: #f4f1fb;
	color: #4a3f80;
	font-weight: 700;
}

.nr-use-option input {
	margin: 0;
}

.nr-option {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	justify-content: center;
	font-size: 13px;
	color: #666;
	margin: 6px auto 16px;
	max-width: 560px;
	cursor: pointer;
}

.nr-btn {
	display: block;
	width: 100%;
	max-width: 420px;
	margin: 0 auto;
	padding: 14px 20px;
	font-size: 17px;
	font-weight: 700;
	color: #fff;
	background: linear-gradient(135deg, #7b6bd6 0%, #5d4bb3 100%);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(93, 75, 179, 0.25);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nr-btn:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(93, 75, 179, 0.3);
}

.nr-btn:disabled {
	background: #ccc;
	box-shadow: none;
	cursor: not-allowed;
}

.nr-note {
	text-align: center;
	font-size: 12px;
	color: #888;
	margin: 12px 0 0;
}

/* ---------- 結果 ---------- */
.nr-result {
	padding: 16px 12px 24px;
}

.nr-edit-hint {
	text-align: center;
	font-size: 13px;
	color: #6a5bb5;
	background: #f4f1fb;
	border-radius: 10px;
	padding: 8px 12px;
	margin: 0 auto 14px;
	max-width: 640px;
}

/* ---------- 鑑定書 ---------- */
.nr-sheet {
	--nr-theme: #7b6bd6;
	--nr-theme-soft: rgba(123, 107, 214, 0.1);
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 640px;
	margin: 0 auto;
	background: #fff;
	color: #333;
	border: 1px solid #e6e6e6;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	font-size: clamp(10.5px, 2.45vw, 15px);
	line-height: 1.7;
	overflow: hidden;
}

.nr-sheet-band {
	background: var(--nr-theme-soft);
	border-bottom: 0.4em solid var(--nr-theme);
	text-align: center;
	padding: 1.6em 1em 1.2em;
}

.nr-sheet-kicker {
	display: block;
	font-size: 0.95em;
	letter-spacing: 0.2em;
	color: #666;
}

.nr-sheet-title {
	margin: 0.2em 0 0;
	font-size: 2.2em;
	letter-spacing: 0.4em;
	text-indent: 0.4em;
	font-weight: 700;
	color: #333;
	line-height: 1.3;
}

.nr-sheet-body {
	padding: 1.6em 2em 0;
}

.nr-sheet-name {
	margin: 0;
	font-size: 1.5em;
	font-weight: 700;
	color: #222;
}

.nr-sheet-birth {
	margin: 0.2em 0 0;
	font-size: 0.95em;
	color: #555;
}

.nr-number {
	display: flex;
	align-items: center;
	gap: 1.4em;
	margin-top: 1.4em;
}

.nr-num-circle {
	flex: 0 0 auto;
	width: 6.4em;
	height: 6.4em;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1em;
	font-weight: 700;
	color: #fff;
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.nr-num-circle span {
	font-size: 3em;
	line-height: 1;
}

.nr-num-circle-light {
	color: #333;
}

.nr-num-text {
	min-width: 0;
}

.nr-num-label {
	margin: 0;
	font-size: 0.85em;
	color: #888;
}

.nr-num-title {
	margin: 0.1em 0 0;
	font-size: 1.7em;
	font-weight: 700;
	color: #222;
	line-height: 1.3;
}

.nr-num-en {
	margin: 0;
	font-size: 0.85em;
	color: #999;
}

.nr-num-kw {
	margin: 0.4em 0 0;
	font-size: 0.95em;
	color: #555;
}

.nr-steps {
	margin: 1em 0 0;
	font-size: 0.8em;
	color: #888;
	word-break: break-all;
}

.nr-rarity {
	display: inline-block;
	margin-left: 0.6em;
}

.nr-catch {
	margin: 0.8em 0 0;
	font-size: 1.05em;
	color: #333;
}

/* 守護色ブロック */
.nr-color {
	margin-top: 1.4em;
	background: var(--nr-theme-soft);
	border-radius: 1em;
	padding: 1.2em 1.3em;
	display: grid;
	grid-template-columns: 6em 1fr;
	gap: 0.6em 1.2em;
}

.nr-color-swatch {
	width: 6em;
	height: 6em;
	border-radius: 0.8em;
	grid-row: 1 / span 2;
}

.nr-color-swatch-light {
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.nr-color-head {
	min-width: 0;
}

.nr-color-label {
	margin: 0;
	font-size: 0.8em;
	color: #888;
}

.nr-color-name {
	margin: 0.1em 0 0;
	font-size: 1.3em;
	font-weight: 700;
	color: #222;
	line-height: 1.3;
}

.nr-color-en {
	margin: 0;
	font-size: 0.8em;
	color: #999;
}

.nr-color-kw {
	margin: 0.3em 0 0;
	font-size: 0.85em;
	color: #666;
}

.nr-color-note {
	margin: 0;
	font-size: 0.8em;
	color: #888;
}

.nr-palette {
	display: flex;
	gap: 0.35em;
	margin-top: 0.2em;
	grid-column: 1;
	justify-content: center;
}

.nr-pal {
	width: 0.9em;
	height: 0.9em;
	border-radius: 50%;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.nr-color-text {
	grid-column: 1 / -1;
	margin: 0.2em 0 0;
	font-size: 0.95em;
	color: #444;
}

/* 4つの読み解き */
.nr-sections {
	margin-top: 1.4em;
}

.nr-section {
	margin: 0 0 1.1em;
}

.nr-section h3 {
	margin: 0 0 0.3em;
	padding-left: 0.7em;
	border-left: 0.35em solid var(--nr-theme);
	font-size: 1.05em;
	font-weight: 700;
	color: #333;
	line-height: 1.4;
}

.nr-section p {
	margin: 0;
	font-size: 0.95em;
	color: #444;
}

.nr-compat {
	margin-top: 0.4em;
	font-size: 0.9em;
	color: #555;
}

.nr-compat strong {
	display: block;
	color: #333;
}

.nr-compat span {
	display: inline-block;
	margin-right: 0.8em;
}

/* 鑑定士からのひとこと */
.nr-message {
	margin-top: 1.2em;
	border: 2px solid var(--nr-theme);
	border-radius: 0.9em;
	padding: 0.8em 1.1em 0.9em;
}

.nr-message h3 {
	margin: 0 0 0.2em;
	font-size: 0.85em;
	font-weight: 700;
	color: #888;
}

.nr-message p {
	margin: 0;
	min-height: 1.7em;
	font-size: 0.95em;
	color: #333;
}

/* 編集できる欄の見た目：印刷・画像には出ない */
.nr-sheet [contenteditable] {
	outline: none;
	border-radius: 0.3em;
	transition: background 0.15s ease;
}

.nr-sheet [contenteditable]:hover {
	background: rgba(123, 107, 214, 0.06);
}

.nr-sheet [contenteditable]:focus {
	background: rgba(123, 107, 214, 0.1);
	box-shadow: 0 0 0 2px rgba(123, 107, 214, 0.35);
}

.nr-sheet [contenteditable]:empty::before {
	content: attr(data-placeholder);
	color: #b5b5b5;
}

/* フッター（発行日・注記・透かし） */
.nr-sheet-foot {
	margin-top: 1.4em;
	background: #f6f6f6;
	padding: 1em 2em 1.1em;
	font-size: 0.8em;
	color: #666;
}

.nr-sheet-foot p {
	margin: 0;
}

.nr-foot-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3em 1.6em;
	color: #555;
}

.nr-disclaimer {
	margin-top: 0.5em !important;
	font-size: 0.9em;
	color: #999;
}

.nr-watermark {
	margin-top: 0.4em !important;
	font-size: 0.95em;
	color: #888;
	letter-spacing: 0.02em;
}

/* 薄い印（透かし） */
.nr-stamp {
	position: absolute;
	right: 1.2em;
	bottom: 6.2em;
	font-size: 0.8em;
	color: #000;
	opacity: 0.08;
	letter-spacing: 0.15em;
	transform: rotate(-12deg);
	pointer-events: none;
	user-select: none;
	font-weight: 700;
}

/* ---------- ボタン・Pro案内 ---------- */
.nr-result .action-section {
	margin-top: 18px;
}

.nr-pro {
	max-width: 640px;
	margin: 18px auto 0;
	background: #fffaf0;
	border: 1px solid #f0dcb0;
	border-radius: 12px;
	padding: 14px 16px;
	font-size: 13px;
	color: #555;
}

.nr-pro-title {
	margin: 0 0 4px;
	font-weight: 700;
	color: #333;
	font-size: 14px;
}

.nr-pro p {
	margin: 0;
}

.nr-pro-link {
	display: inline-block;
	margin-top: 8px;
	font-weight: 700;
	color: #8a5a00;
	text-decoration: underline;
}

.nr-pro-business {
	border-color: #e0b860;
	box-shadow: 0 0 0 3px rgba(224, 184, 96, 0.2);
}

/* ---------- 解説 ---------- */
.nr-items-list {
	margin: 0;
	padding-left: 1.4em;
}

.nr-items-list li {
	margin-bottom: 4px;
}

.nr-num-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.nr-num-table th,
.nr-num-table td {
	border: 1px solid #e8e8e8;
	padding: 8px 10px;
	text-align: left;
	vertical-align: top;
}

.nr-num-table th {
	background: #f7f5fc;
	white-space: nowrap;
}

.nr-num-dot {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	vertical-align: middle;
	margin-right: 6px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* ---------- スマホ ---------- */
@media (max-width: 600px) {
	.nr-fields {
		grid-template-columns: 1fr;
	}

	.nr-result {
		padding: 12px 6px 20px;
	}

	.nr-sheet-body {
		padding: 1.4em 1.4em 0;
	}

	.nr-sheet-foot {
		padding: 0.9em 1.4em 1em;
	}
}

/* ---------- 印刷：鑑定書の複製（.nr-print-root）だけを A4 1枚に ---------- */
/* 画面では複製を見えない位置に置き、高さを測って文字サイズを決めるためだけに使う */
.nr-print-root {
	position: absolute;
	left: -10000px;
	top: 0;
	width: 190mm;
	visibility: hidden;
}

.nr-print-root .nr-sheet {
	width: 190mm;
	max-width: none;
	margin: 0;
	border: 0;
	box-shadow: none;
	font-size: 10.6pt;
	line-height: 1.6;
}

@media print {
	@page {
		size: A4 portrait;
		margin: 9mm 10mm;
	}

	body.nr-printing {
		background: #fff !important;
		margin: 0;
		padding: 0;
	}

	body.nr-printing > *:not(.nr-print-root) {
		display: none !important;
	}

	.nr-print-root {
		position: static;
		left: auto;
		visibility: visible;
		width: 190mm;
	}

	.nr-print-root .nr-sheet {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
		page-break-inside: avoid;
		overflow: visible;
	}
}
