* {
	margin: 0;
	padding: 0;
	/*	user-select: none;*/
	outline: none;
	box-sizing: border-box;
}

html,
body {
	width: 100%;
	min-width: 100vw;
	min-height: 100vh;
	overflow-y: auto;
	font-family: "HiraKakuProN-W3", "メイリオ", "ＭＳ ゴシック", sans-serif;
	background-color: #140f0d;
	color: #e8edf3;
}

.scrollbar_fade {
	overflow-y: auto;
	scrollbar-gutter: stable;
}

.scrollbar_fade::-webkit-scrollbar {
	width: 8px;
}

.scrollbar_fade::-webkit-scrollbar-track {
	background: transparent;
}

.scrollbar_fade::-webkit-scrollbar-thumb {
	background-color: transparent;
	border-radius: 4px;
}

.scrollbar_fade:hover::-webkit-scrollbar-thumb {
	background-color: rgba(130, 140, 160, 0.45);
}

.scrollbar_fade {
	scrollbar-width: thin;
	scrollbar-color: transparent transparent;
}

.scrollbar_fade:hover {
	scrollbar-color: rgba(130, 140, 160, 0.45) transparent;
}


@keyframes typing_blink {

	0%,
	80%,
	100% {
		opacity: 0.3;
		transform: scale(1);
	}

	40% {
		opacity: 1;
		transform: scale(1.4);
	}
}

.typing_indicator {
	display: flex;
	gap: 6px;
	padding: 5px 10px;
}

.typing_indicator span {
	display: inline-block;
	width: 6px;
	height: 6px;
	background: #7d8798;
	border-radius: 50%;
	animation: typing_blink 1.4s infinite;
}

.typing_indicator span:nth-child(2) {
	animation-delay: 0.2s;
}

.typing_indicator span:nth-child(3) {
	animation-delay: 0.4s;
}


#loading_overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99;
}

.loading_box {
	text-align: center;
	color: #fff;
}

.progress_circle {
	width: 150px;
	height: 150px;
	transform: rotate(-90deg);
}

.progress_circle circle {
	fill: none;
	stroke-width: 10;
	r: 45;
	cx: 50;
	cy: 50;
}

.progress_circle .progress_bg {
	stroke: #444;
}

.progress_circle .progress_fore {
	stroke-linecap: round;
	stroke-dasharray: 283;
	stroke-dashoffset: 283;
	transition: stroke-dashoffset 0.3s;
}

.progress_text {
	margin-top: -100px;
	font-size: 32px;
	font-weight: bold;
	position: relative;
}

.btn {
	display: flex;
	justify-content: start;
	align-items: center;
	font-size: 20px;
	border: none;
	border-radius: 1.5em;
	background-color: #b3472f;
	color: #fff7ef;
	transition: all 0.2s ease;
	padding: .2em 2em;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
}

.btn:hover {
	background-color: #d16a3a;
	color: #ffffff;
	box-shadow: 0 0 0 1px rgba(255, 210, 140, 0.35), 0 0 18px rgba(227, 124, 66, 0.55), 0 8px 20px rgba(0, 0, 0, 0.38);
	cursor: pointer;
}

.btn img {
	vertical-align: middle;
	width: 2em;
	height: 2em;
	margin-right: 1em;
	background-size: cover;
}

/* footer (non-top pages) */
#footer.footer-centered {
	margin-top: 32px;
	padding: 28px 0 36px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	text-align: center;
	border-top: 1px solid #3a2a21;
	color: #d7deea;
}

#footer.footer-centered .footer_links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75em;
	color: inherit;
}

#footer.footer-centered .footer_links a {
	padding: 6px 12px;
	border-radius: 999px;
	background: #2a1a14;
	color: #f0c46a;
	font-weight: 600;
	text-decoration: none;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#footer.footer-centered .footer_links a:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 22px rgba(0, 0, 0, 0.32);
}

#footer.footer-centered .footer_links span {
	display: none;
}

#footer.footer-centered .copyright {
	margin: 0;
	color: #8f98a8;
	font-size: 0.95rem;
}


/* Global Header */
#global-header {
	position: sticky;
	top: 0;
	left: 0;
	width: 100%;
	height: 64px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 24px;
	background-color: rgba(42, 24, 18, 0.92);
	backdrop-filter: blur(8px);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
	z-index: 9999;
}

.header-left .header-logo {
	display: flex;
	align-items: center;
	text-decoration: none;
	color: #e8edf3;
	font-weight: 600;
	font-size: 1.2rem;
	gap: 12px;
	font-family: "Quicksand", sans-serif;
}

.header-left .header-logo img {
	height: 64px;
	width: auto;
	border-radius: 12px;
}

.header-right .btn-header-login {
	display: inline-block;
	padding: 8px 24px;
	font-size: 14px;
	font-weight: 600;
	background-color: #b3472f;
	color: #f7faff;
	border-radius: 99px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.header-right .btn-header-login:hover {
	background-color: #d16a3a;
	transform: translateY(-1px);
	box-shadow: 0 0 0 1px rgba(255, 210, 140, 0.35), 0 0 18px rgba(227, 124, 66, 0.55), 0 8px 20px rgba(0, 0, 0, 0.38);
}

.header-right .user-link {
	display: block;
	text-decoration: none;
}

.header-right .user-icon {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #3d2c24;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	transition: transform 0.2s ease;
}

.header-right .user-icon:hover {
	transform: scale(1.05);
}

.header-right .user-icon-placeholder {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: #3a2a24;
	color: #d3dbe6;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	border: 2px solid #3d2c24;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}


/* Legal page specifically needs padding as it has text */
body.legal-page {
	padding-top: 64px;
}


/* Header User Menu */
.header-user-menu-container {
	position: relative;
}

.header-user-menu {
	position: absolute;
	top: 100%;
	right: 0;
	width: 200px;
	background-color: #221712;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
	padding: 8px 0;
	margin-top: 8px;
	z-index: 10000;
	border: 1px solid rgba(255, 220, 180, 0.12);
}

/* Arrow indicator (optional, but looks nice) */
.header-user-menu::before {
	content: '';
	position: absolute;
	top: -6px;
	right: 14px;
	width: 12px;
	height: 12px;
	background-color: #221712;
	transform: rotate(45deg);
	border-top: 1px solid rgba(255, 220, 180, 0.12);
	border-left: 1px solid rgba(255, 220, 180, 0.12);
}

.header-user-menu-item {
	display: block;
	padding: 10px 16px;
	color: #dce3ec;
	text-decoration: none;
	font-size: 14px;
	transition: background-color 0.2s, color 0.2s;
	text-align: left;
}

.header-user-menu-item:hover {
	background-color: #352018;
	color: #f0c46a;
}

.header-user-menu-separator {
	height: 1px;
	background-color: #3a2a21;
	margin: 6px 0;
}

/* --- Generic UI Components (from account.css) --- */

/* Buttons */
.btn-sm {
	padding: 6px 12px;
	font-size: 13px;
	border-radius: 6px;
	border: 1px solid #3d2c24;
	background: #2a1a14;
	cursor: pointer;
	transition: all 0.2s;
	text-decoration: none;
	color: #e8edf3;
	display: inline-block;
}

.btn-sm:not(:disabled):hover {
	background: #3d2c24;
	color: #fff;
	transform: translateY(-1px);
}

.btn-sm:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.btn-primary {
	background: #b3472f;
	border-color: #b3472f;
	color: #fff;
}

.btn-primary:not(:disabled):hover {
	background: #d16a3a;
	box-shadow: 0 0 12px rgba(227, 124, 66, 0.4);
}

.btn-danger {
	color: #ff6b6b;
	border-color: #5a2e2e;
	background: rgba(90, 46, 46, 0.3);
}

.btn-danger:not(:disabled):hover {
	background: rgba(224, 36, 36, 0.2);
	border-color: #ff6b6b;
}

.btn-secondary {
	padding: 8px 16px;
	font-size: 14px;
	border-radius: 6px;
	border: 1px solid #3d2c24;
	background: transparent;
	color: #8f98a8;
	cursor: pointer;
	transition: all 0.2s;
}

.btn-secondary:not(:disabled):hover {
	background: rgba(255, 255, 255, 0.05);
	color: #e8edf3;
}

/* Input Fields */
.form-group {
	margin-bottom: 15px;
}

.form-input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #3d2c24;
	background: #0a0807;
	border-radius: 8px;
	font-size: 15px;
	box-sizing: border-box;
	transition: border-color 0.2s;
	color: #e8edf3;
}

.form-input:focus {
	border-color: #b3472f;
	outline: none;
	box-shadow: 0 0 0 3px rgba(179, 71, 47, 0.25);
}

/* Toggle Switch */
.toggle-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
}

.toggle-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #3d2c24;
	transition: .4s;
	border-radius: 24px;
	border: 1px solid #4e3830;
}

.slider:before {
	position: absolute;
	content: "";
	height: 16px;
	width: 16px;
	left: 3px;
	bottom: 3px;
	background-color: #8f98a8;
	transition: .4s;
	border-radius: 50%;
}

input:checked+.slider {
	background-color: #b3472f;
	border-color: #b3472f;
}

input:checked+.slider:before {
	transform: translateX(20px);
	background-color: #fff;
}

input:disabled+.slider {
	background-color: #1a1512;
	border-color: #3d2c24;
	cursor: not-allowed;
}

input:disabled+.slider:before {
	background-color: #4a4a4a;
}

/* Modal (Generic) */
.modal {
	position: fixed;
	z-index: 1000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(0, 0, 0, 0.8);
	display: flex;
	align-items: center;
	justify-content: center;
}

.modal-content {
	background: #1f1815;
	border: 1px solid #3d2c24;
	border-radius: 16px;
	width: 90%;
	max-width: 500px;
	box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
	display: flex;
	flex-direction: column;
}

.modal-header {
	padding: 15px 20px;
	border-bottom: 1px solid #3d2c24;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.modal-header h3 {
	margin: 0;
	font-size: 18px;
	color: #e8edf3;
}

.close {
	color: #8f98a8;
	font-size: 28px;
	font-weight: bold;
	cursor: pointer;
}

.close:hover,
.close:focus {
	color: #e8edf3;
	text-decoration: none;
	cursor: pointer;
}

.modal-body {
	padding: 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
}

.modal-footer {
	padding: 15px 20px;
	border-top: 1px solid #3d2c24;
	display: flex;
	justify-content: flex-end;

	/* Status Badge */
	.status-badge {
		display: inline-block;
		padding: 3px 10px;
		font-size: 11px;
		font-weight: 600;
		line-height: 1;
		color: #f0c46a;
		border: 1px solid #f0c46a;
		border-radius: 99px;
		background: rgba(240, 196, 106, 0.1);
		white-space: nowrap;
	}