/* ==========================================================================
   Phones and tablets: below 768px everything stacks to the screen's width
   and nothing makes the page scroll sideways.
   ========================================================================== */

input.textbox, select, textarea, .sceditor-container, .select2-container { max-width: 100%; }
.post_body, .post_content, .signature, blockquote, .codeblock { overflow-wrap: anywhere; }
.post_body img, .signature img { max-width: 100%; height: auto; }
.codeblock code, .codeblock pre { white-space: pre-wrap; }

@media (max-width: 767.98px) {
	/* The header panel and page edges */
	main.container, #panel .container, #footer .container, #copyright .container { padding-left: 10px; padding-right: 10px; }
	#panel .upper { line-height: 1.6; }
	#panel .upper .btn { margin-bottom: 4px; }
	.navigation { margin: 15px 0; }

	/* Forms: the label above its field */
	.rowbit:has(> .formbit_label), #quickreply_e .rowbit { flex-wrap: wrap; }
	.rowbit > .formbit_label, .rowbit > .formbit_field, #quickreply_e .rowbit > [data-width] { width: 100% !important; text-align: left !important; }
	.rowbit > .formbit_label { padding-bottom: 0; }

	/* Thread lists: the reply and view counts are left out on phones, so are their headings */
	.tcat .threadbit_stats { display: none; }

	/* Forum lists: the posts count stays on one line */
	.rowbit.row > .col-2 { white-space: nowrap; font-size: 12px; text-align: right; }

	/* A forum's heading: its name, then its links */
	.threadlist_thread_option { flex-direction: column; gap: 4px; }
	.threadlist_thread_option .float_right { float: none !important; margin-right: 0 !important; font-weight: normal; font-size: 12px; }
	.threadlist_thread_option .float_right a { display: inline-block; margin: 0 12px 2px 0; }

	/* MyBB's tables: as wide as the screen, scrolling inside their box when they must */
	table.tborder { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
	table.tborder > tbody, table.tborder > thead { display: table; width: 100%; }

	/* Inline moderation and the jump menus wrap under each other */
	.float_right, .float_left { max-width: 100%; }
	#footer .foot { margin-bottom: 10px; }
	#copyright .container > div { float: none !important; text-align: center; padding: 4px 0; }
}
