:root {
	--bg: #1F1F1F;
	--accent: #8ab4f8;
	--card: #303134;
	--muted: #9aa0a6
}

/* Reduce default h1 spacing so first post aligns with others */
h1 {
	margin: 0 0 8px;
	font-weight: 600
}

/* Mobile-first layout */
body {
	background: var(--bg);
	font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
	max-width: 100%;
	margin: 0 auto;
	padding: 12px;
	color: #e8eaed;
	box-sizing: border-box
}

.post {
	display: flex;
	align-items: center;
	margin: 12px 0;
	border-bottom: 1px solid #3c4043;
	padding-bottom: 12px
}

.thumbs {
	display: flex;
	flex-direction: row;
	gap: 8px;
	width: 100%;
	overflow: auto
}

.thumbs.grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	width: 100%
}

.thumb {
	width: 75px;
	height: 75px;
	object-fit: cover;
	flex: 0 0 75px
}

.thumb.single {
	width: 150px;
	height: 150px
}

.post-btn {
	background: #303134;
	color: #e8eaed;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 12px 18px;
	font-size: 16px;
	cursor: pointer;
	transition: border 0.2s;
}

.post-btn:active {
	border: 1px solid #5f6368;
}

@media (hover: hover) {
	.post-btn:hover {
		background: #3c4043
	}
}

/* Primary action button (blue) used for投稿 and メッセージ送信 */
.primary-btn {
	background: var(--accent);
	color: #07203a;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 12px 18px;
	font-size: 16px;
	cursor: pointer;
	transition: border 0.2s;
}

.primary-btn:active {
	border: 1px solid #5f6368;
}

@media (hover: hover) {
	.primary-btn:hover {
		filter: brightness(0.95)
	}
}

/* center helper for buttons */
.btn-center {
	text-align: center;
	margin-top: 12px
}

.top-controls {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: stretch;
	margin-bottom: 0
}

.search-input {
	background: #303134;
	color: #e8eaed;
	border: 1px solid #5f6368;
	border-radius: 8px;
	padding: 12px 16px;
	font-size: 16px;
	width: 100%;
	box-sizing: border-box
}

.search-input::placeholder {
	color: #9aa0a6;
	font-size: 14px
}

.divider {
	border-bottom: 1px solid #3c4043;
	margin: 8px auto;
	width: 100%
}

.pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: 12px 0
}

.page-btn {
	background: #303134;
	color: #e8eaed;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 0 16px;
	font-size: 14px;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	box-sizing: border-box;
	transition: border 0.2s;
}

.page-btn:active:not(:disabled) {
	border: 1px solid #5f6368;
}

@media (hover: hover) {
	.page-btn:hover:not(:disabled) {
		background: #3c4043
	}
}

.page-btn:disabled {
	opacity: 0.3;
	cursor: not-allowed;
	pointer-events: none
}

.page-input {
	background: #303134;
	color: #e8eaed;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 0 10px;
	font-size: 16px;
	width: 72px;
	text-align: center;
	height: 44px;
	box-sizing: border-box;
	transition: all 0.2s;
	outline: none;
	caret-color: #ffffff;
}

.page-input:focus {
	border: 1px solid #5f6368;
}

.page-input::placeholder {
	color: #9aa0a6;
	font-size: 14px
}

.delete-btn {
	background: #303134 !important;
	color: #e8eaed !important;
	border: 1px solid #5f6368 !important;
	margin-top: 6px;
	padding: 4px 8px;
	font-size: 12px;
	cursor: pointer;
	border-radius: 4px
}

.delete-btn:hover {
	background: #3c4043 !important
}

/* small passcode input used on thread detail for deletion */
.delete-pass-input {
	width: auto;
	max-width: 160px;
	display: inline-block;
	border-radius: 8px;
	border: 1px solid #5f6368;
	background: var(--card);
	color: #e8eaed;
	font-size: 16px;
	box-sizing: border-box;
	height: 44px;
	padding: 0 12px
}

/* control wrapping the pass input and the adjacent delete button */
.delete-pass-control {
	display: inline-flex;
	gap: 8px;
	align-items: center
}

/* make the adjacent delete button match the pass input height and use nav-btn text size */
.delete-action {
	display: inline-flex;
	align-items: center;
	height: 44px;
	padding: 0 14px;
	font-size: 14px;
	border-radius: 8px;
	background: var(--card);
	color: #e8eaed;
	border: 1px solid #5f6368;
	cursor: pointer
}

.delete-action:hover {
	background: #3c4043
}

a {
	color: #ffffff;
	text-decoration: none
}

a:hover {
	text-decoration: none
}

.footer {
	margin-top: 20px
}

.nav-links {
	display: flex;
	gap: 10px;
	margin-top: 10px
}

.nav-btn {
	background: #303134;
	color: #e8eaed;
	border: 1px solid transparent;
	padding: 8px 16px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	text-decoration: none;
	display: inline-block;
	height: 44px;
	line-height: 28px;
	box-sizing: border-box;
	transition: border 0.2s;
}

.nav-btn:active {
	border: 1px solid #5f6368;
}

.nav-btn:hover {
	background: #3c4043;
	text-decoration: none
}

input,
textarea,
select {
	display: block;
	width: 100%;
	padding: 10px;
	border: 1px solid #5f6368;
	border-radius: 8px;
	background: #303134;
	color: #e8eaed;
	margin: 8px 0;
	box-sizing: border-box
}

/* Hide number input spinners */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
	-webkit-appearance: none !important;
	appearance: none !important;
	margin: 0 !important;
}

input[type=number] {
	-moz-appearance: textfield !important;
	appearance: textfield !important;
}

/* inline number inputs (height/weight/age) used in post form */
.inline-numbers {
	display: flex;
	gap: 8px
}

.inline-numbers label {
	flex: 1;
	margin: 0
}

.inline-numbers input {
	width: 100%;
	box-sizing: border-box;
	height: 44px;
	padding: 0 12px
}

.post-content-inline {
	color: #e8eaed;
	white-space: pre-wrap;
	margin-left: 8px
}

.post .extras {
	color: #9aa0a6;
	margin-left: 8px
}

/* Poster extras shown next to the name (height/weight/age) */
.poster-extras {
	color: #9aa0a6;
	margin-left: 12px;
	font-size: 13px
}

/* area index: horizontal rows with wrapping */
.areas-by-region {
	display: flex;
	flex-direction: column;
	gap: 8px
}

.region-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px
}

.region-row a {
	padding: 8px 10px;
	border-radius: 6px;
	background: transparent;
	color: #ffffff;
	text-decoration: none;
	font-size: 16px
}

.region-row a:active,
.region-row a:focus {
	outline: 2px solid rgba(138, 180, 248, 0.18)
}

/* Slightly gray muted areas (subtle) */
.region-row a.muted-area {
	color: #e6e6e6 !important;
	opacity: 0.92
}

/* ensure post items are touch-friendly */
.posts-list {
	list-style: none;
	padding: 0
}

.post-item {
	padding: 10px 0;
	margin: 0;
	border-bottom: 1px solid #3c4043
}

/* show a single separator above the first item so top post matches others */
.posts-list>.post-item:first-child {
	border-top: 1px solid #3c4043
}

/* Restore row layout for wider screens */
@media (min-width:600px) {
	.top-controls {
		flex-direction: row;
		align-items: center;
		justify-content: space-between
	}

	.top-controls .post-btn {
		flex: 0 0 auto
	}

	.search-input {
		width: 250px
	}
}

/* Controls-right: keep category select and post button on same line */
.controls-right {
	display: flex;
	gap: 8px;
	align-items: center
}

.controls-right {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-bottom: 12px
}

.category-select {
	padding: 10px;
	border-radius: 8px;
	background: var(--card);
	color: #e8eaed;
	border: 1px solid #5f6368;
	font-size: 16px;
	width: auto;
	min-width: 120px;
	max-width: 240px
}

.pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: 12px 0;
	flex-wrap: nowrap;
	white-space: nowrap;
	overflow-x: auto
}

.category-select,
.post-btn {
	height: 44px;
	box-sizing: border-box
}

.search-input {
	flex: 1 1 auto
}

/* bottom-placed search near nav links */
.search-bottom {
	max-width: 900px;
	margin: 12px auto;
	display: flex;
	gap: 8px;
	align-items: center
}

.search-bottom .search-input {
	flex: 1
}

/* Force post button text to be horizontal and not vertical */
.post-btn {
	writing-mode: horizontal-tb !important;
	transform: none !important;
	white-space: nowrap
}

/* Post title sizing to resemble sample.html */
.post-item a {
	font-weight: 600;
	font-size: 16px;
	color: #ffffff;
	display: block
}

.post-item .meta {
	font-size: 12px;
	color: var(--muted);
	margin-top: 6px
}

.category-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 12px;
	color: #fff;
	margin-right: 8px
}

.category-badge.small {
	padding: 4px 8px;
	border-radius: 10px;
	font-size: 12px
}

.delete-btn.small {
	padding: 6px 8px;
	font-size: 12px;
	border-radius: 6px
}

.post-title {
	font-weight: 600;
	font-size: 16px;
	color: #ffffff;
	display: block;
	flex: 1 1 auto;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden
}

.post-meta-line .post-id {
	margin-right: 6px;
	color: #9aa0a6
}

.post-meta-line {
	margin-top: 6px
}

.meta-id {
	display: inline-block;
	margin-right: 14px
}

.meta-time {
	display: inline-block
}

button {
	cursor: pointer
}

.container {
	max-width: 900px;
	margin: 0 auto
}

/* Post form card similar to sample.html */
.post-form {
	background: #171717;
	padding: 20px;
	border-radius: 8px;
	border: 1px solid #5f6368;
	margin: 20px auto 24px;
	max-width: 680px;
	box-sizing: border-box
}

.post-form input,
.post-form textarea,
.post-form select {
	background: #303134;
	color: #e8eaed;
	border: 1px solid transparent;
	font-size: 16px;
	transition: border 0.2s;
	outline: none;
	caret-color: #ffffff;
}

.post-form input:focus,
.post-form textarea:focus,
.post-form select:focus {
	border: 1px solid #5f6368;
}

.intro-box {
	background: var(--card);
	border: 1px solid #5f6368;
	padding: 12px;
	border-radius: 8px;
	margin-bottom: 14px;
	color: #e8eaed
}

.back-btn {
	background: #303134;
	color: #e8eaed;
	border: 1px solid transparent;
	text-decoration: none;
	padding: 8px 16px;
	border-radius: 8px;
	font-size: 14px;
	display: inline-block;
	height: 44px;
	line-height: 28px;
	box-sizing: border-box;
	transition: all 0.2s;
	margin-bottom: 4px
}

@media (hover: hover) {
	.back-btn:hover {
		background: #3c4043;
	}
}

.back-btn:active,
.back-btn:focus {
	border: 1px solid #5f6368;
}

.terms {
	margin-top: 12px;
	margin-bottom: 16px;
	padding: 15px;
	background: var(--card);
	border-radius: 8px;
	border: 1px solid #5f6368
}

.message {
	padding: 12px;
	border-radius: 6px;
	margin: 16px 0;
	text-align: center
}

.message.success {
	background: #1e4620;
	border: 1px solid #4caf50;
	color: #81c784
}

.message.error {
	background: #4a1e1e;
	border: 1px solid #f44336;
	color: #ef5350
}

/* Absolute border removal for forms */
.post-form,
.search-panel {
	border: none !important;
}

.post-form input,
.post-form textarea,
.post-form select,
.search-panel input,
.search-panel select {
	border: 1px solid transparent;
	/* Hide borders by default with spacing */
	caret-color: #ffffff;
}

/* Ensure focus states are preserved despite global resets */
.post-form input:focus,
.post-form textarea:focus,
.post-form select:focus,
.search-panel input:focus,
.search-panel select:focus {
	border: 1px solid #5f6368 !important;
}