/* ==========================================================================
   BootBB refresh: the same layout, still square and flat.
   A crisper font, white surfaces with hairline dividers, a quiet column bar
   instead of the black one, cleaner breadcrumb and welcome bar, flat outlined
   post buttons, calmer quotes, a readable footer, focus rings. Headings, links
   and the bottom bars keep the chosen colour scheme's colours.
   ========================================================================== */

html[data-bs-theme] {
	--rf-page: var(--bb-gray-30); --rf-card: var(--bs-white); --rf-row: var(--bs-white); --rf-row-2: var(--bb-gray-20); --rf-hover: var(--bb-gray-20);
	--rf-line: var(--bb-gray-90); --rf-line-2: var(--bb-gray-130); --rf-text: var(--bb-slate-870); --rf-muted: var(--bb-slate-570); --rf-faint: var(--bb-slate-410);
	--rf-bar: var(--bb-gray-60); --rf-bar-text: var(--bb-slate-660); --rf-quote: var(--bb-gray-20); --rf-accent: var(--bb-blue-500);
	--rf-shadow: 0 1px 2px rgba(var(--bs-black-rgb), 0.05);
	--rf-ring: var(--bb-blue-500);
}
html[data-bs-theme="dark"] {
	--rf-page: var(--bb-gray-950); --rf-card: var(--bb-gray-930); --rf-row: var(--bb-gray-930); --rf-row-2: var(--bb-slate-910); --rf-hover: var(--bb-slate-870);
	--rf-line: var(--bb-slate-830); --rf-line-2: var(--bb-slate-770); --rf-text: var(--bb-gray-90); --rf-muted: var(--bb-slate-310); --rf-faint: var(--bb-slate-440);
	--rf-bar: var(--bb-slate-870); --rf-bar-text: var(--bb-slate-270); --rf-quote: var(--bb-slate-910); --rf-accent: var(--bb-cyan-320);
	--rf-shadow: 0 1px 2px rgba(var(--bs-black-rgb), 0.4);
	--rf-ring: var(--bb-cyan-320);
}

/* Page and type: Open Sans (shipped in vendor/open-sans; the successor of the Droid Sans BootBB was drawn with), a
   little more air. Fields and buttons follow the page's font */
html[data-bs-theme] body {
	background: var(--rf-page); color: var(--rf-text);
	font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
html[data-bs-theme] :is(input, select, textarea, button, .tcat, .smalltext, .thead, #copyright, #copyright *:not(.bi), #footer *:not(.bi)) { font-family: inherit; }
html[data-bs-theme] .smalltext { color: var(--rf-muted); }
html[data-bs-theme] :is(a, button, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--rf-ring); outline-offset: 2px; }

/* Header */
html[data-bs-theme] .site-navbar { background: var(--rf-card); border-bottom: 1px solid var(--rf-line); }
html[data-bs-theme] .site-navbar .navbar-nav > li > a { font-weight: 500; color: var(--rf-muted); }
html[data-bs-theme] .site-navbar .navbar-nav > li > a:hover, html[data-bs-theme] .site-navbar .navbar-nav > li > a:focus { color: var(--bs-white); }

/* Welcome bar and breadcrumb */
html[data-bs-theme] #panel .upper { background: var(--rf-card); border-bottom: 1px solid var(--rf-line); color: var(--rf-muted); padding: 10px 0; }
html[data-bs-theme] #panel .upper .btn { font-weight: 500; }
html[data-bs-theme] .breadcrumb { background: var(--rf-card); border: 1px solid var(--rf-line); border-left: 3px solid var(--rf-accent); color: var(--rf-muted); padding: 9px 14px; box-shadow: var(--rf-shadow); }
html[data-bs-theme] .breadcrumb > li + li::before { content: "\203A\00a0"; color: var(--rf-faint); }
html[data-bs-theme] main { padding-top: 22px; }

/* Blocks */
html[data-bs-theme] .tborder { background: var(--rf-card); border: 1px solid var(--rf-line); box-shadow: var(--rf-shadow); margin-bottom: 20px; }
html[data-bs-theme] .thead { padding: 11px 14px; letter-spacing: .01em; }
html[data-bs-theme] .thead h5, html[data-bs-theme] .thead h3 { margin: 0; font-size: 15px; }
html[data-bs-theme] .tcat { background: var(--rf-bar); color: var(--rf-bar-text); border-bottom: 1px solid var(--rf-line); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 8px 14px; }
html[data-bs-theme] .tcat a:link, html[data-bs-theme] .tcat a:visited { color: var(--rf-bar-text); }
html[data-bs-theme] *[class*="trow"] { background: var(--rf-row); color: var(--rf-text); border: 0; border-bottom: 1px solid var(--rf-line); }
html[data-bs-theme] div[class*="trow"] { border-left: 0; border-right: 0; }
html[data-bs-theme] .trow_sep { background: var(--rf-row-2); color: var(--rf-bar-text); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 7px 14px; }
html[data-bs-theme] .rowbit { transition: background .15s; }
html[data-bs-theme] .tbody > .rowbit:hover, html[data-bs-theme] .inline_row:hover { background: var(--rf-hover); }

/* Forum and thread rows */
html[data-bs-theme] .tbody > .rowbit { padding-top: 10px; padding-bottom: 10px; }
html[data-bs-theme] .rowbit h5 { font-weight: 600; }
html[data-bs-theme] .forum_off i, html[data-bs-theme] .forum_offclose i, html[data-bs-theme] .forum_offlink i { opacity: .55; }
html[data-bs-theme] .threadbit_stats { color: var(--rf-muted); font-variant-numeric: tabular-nums; }
html[data-bs-theme] .author, html[data-bs-theme] .thread_start_datetime { color: var(--rf-muted); }

/* Board statistics */
html[data-bs-theme] .countup { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Posts */
html[data-bs-theme] .post { background: var(--rf-card); border-bottom: 1px solid var(--rf-line-2); }
html[data-bs-theme] .post .post_author { background: var(--rf-row-2); border: 0; border-bottom: 1px solid var(--rf-line); padding: 12px 14px; }
html[data-bs-theme] .post .post_author div.author_avatar img { border: 1px solid var(--rf-line-2); padding: 0; background: var(--rf-card); }
html[data-bs-theme] .post .post_author div.author_statistics { color: var(--rf-muted); line-height: 1.6; }
html[data-bs-theme] .post .post_head { border: 0; padding: 10px 14px 0; }
html[data-bs-theme] .post .post_head span.post_date { color: var(--rf-faint); }
html[data-bs-theme] .post_body { background: transparent; color: var(--rf-text); font-size: 15px; line-height: 1.7; padding: 8px 14px 16px; }
html[data-bs-theme] .post_controls { background: transparent; border: 0; border-top: 1px solid var(--rf-line); padding: 8px 10px; }
html[data-bs-theme] .postbit_buttons > a:link, html[data-bs-theme] .postbit_buttons > a:visited {
	background: var(--rf-card); background-image: none; color: var(--rf-text); border: 1px solid var(--rf-line-2); padding: 3px 9px; font-size: 12.5px; font-weight: 500;
}
html[data-bs-theme] .postbit_buttons > a:hover { border-color: var(--rf-accent); color: var(--rf-accent); }

/* Quotes and code */
html[data-bs-theme] blockquote, html[data-bs-theme] .mycode_quote { background: var(--rf-quote); border: 0; border-left: 3px solid var(--rf-line-2); padding: 10px 14px; margin: 8px 0 14px; color: var(--rf-text); }
html[data-bs-theme] blockquote cite, html[data-bs-theme] .mycode_quote cite { border: 0; padding: 0 0 6px; margin: 0 0 6px; font-size: 12.5px; font-style: normal; font-weight: 600; color: var(--rf-muted); background: transparent; }
html[data-bs-theme] blockquote blockquote { background: var(--rf-card); }
html[data-bs-theme] .codeblock { background: var(--rf-row-2); border: 1px solid var(--rf-line); }

/* Buttons, fields, pages */
html[data-bs-theme] button, html[data-bs-theme] input.button, html[data-bs-theme] .button {
	background: var(--rf-card); background-image: none; color: var(--rf-text); border: 1px solid var(--rf-line-2); padding: 5px 12px; font-family: inherit;
}
html[data-bs-theme] input.button:hover, html[data-bs-theme] .button:hover { border-color: var(--rf-accent); color: var(--rf-accent); }
html[data-bs-theme] .site-navbar button, html[data-bs-theme] .navbar-forumhead button { background: transparent; border-color: transparent; padding: 0 6px; }
html[data-bs-theme] .site-navbar .navbar-toggler { border-color: var(--rf-line-2); padding: 6px 10px; }
html[data-bs-theme] input.textbox, html[data-bs-theme] select, html[data-bs-theme] textarea {
	background: var(--rf-card); color: var(--rf-text); border: 1px solid var(--rf-line-2); padding: 5px 9px; font-family: inherit;
}
html[data-bs-theme] :is(input.textbox, select, textarea):focus { border-color: var(--rf-ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rf-ring) 20%, transparent); outline: 0; }
html[data-bs-theme] .pagination a { background: var(--rf-card); border: 1px solid var(--rf-line-2); padding: 4px 10px; }
html[data-bs-theme] .pagination .pagination_current { background: var(--rf-accent); border: 1px solid var(--rf-accent); color: var(--bs-white); padding: 4px 10px; }

/* Footer */
html[data-bs-theme] #footer { background: var(--rf-bar); border-top: 1px solid var(--rf-line); color: var(--rf-muted); }
html[data-bs-theme] #footer .foot h3 { color: var(--rf-text); font-size: 18px; font-weight: 600; }
html[data-bs-theme] #footer .foot p { color: var(--rf-muted); }
html[data-bs-theme] #copyright { background: var(--bb-slate-870); color: var(--bb-slate-190); }

/* Heading links stay white on the colour scheme's bar (the dark rules lighten every link, these too) */
html[data-bs-theme] .thead a:link, html[data-bs-theme] .thead a:visited, html[data-bs-theme] .thead a:hover { color: var(--bs-white); }

/* Form boxes (fieldsets): a clean panel with its heading as a strip inside, dividers from edge to edge, labels on the left */
html[data-bs-theme] fieldset { border: 1px solid var(--rf-line); background: var(--rf-card); padding: 0; margin: 0 0 14px; min-width: 0; }
html[data-bs-theme] fieldset > legend {
	float: left; width: 100%; margin: 0; padding: 9px 14px; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--rf-text);
	background: var(--rf-row-2); border: 0; border-bottom: 1px solid var(--rf-line);
}
html[data-bs-theme] fieldset > legend + * { clear: left; }
html[data-bs-theme] fieldset > .rowbit, html[data-bs-theme] fieldset > div[class*="trow"] { margin: 0; padding: 8px 14px; border-bottom: 1px solid var(--rf-line); }
html[data-bs-theme] fieldset > .rowbit:last-child, html[data-bs-theme] fieldset > div[class*="trow"]:last-child { border-bottom: 0; }
html[data-bs-theme] fieldset .formbit_label.align_right { text-align: left; padding-right: 12px; }
html[data-bs-theme] fieldset .formbit_label { color: var(--rf-muted); font-weight: 500; }

/* Fields, selects and buttons on one line share one height */
html[data-bs-theme] :is(input.textbox, input[type="text"], input[type="password"], input[type="email"], input[type="search"], input[type="url"], input[type="number"], select:not([multiple]):not([size]), input.button, button.button, .button) {
	box-sizing: border-box; min-height: 34px; line-height: 1.3; vertical-align: middle;
}
html[data-bs-theme] :is(input.button, button.button, .button) { padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; justify-content: center; }
html[data-bs-theme] select:not([multiple]):not([size]) { padding-top: 0; padding-bottom: 0; }

/* The copyright bar: its text and the theme / language choosers on one centred line */
html[data-bs-theme] #copyright .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; }
html[data-bs-theme] #copyright .container::after { display: none; }
html[data-bs-theme] #copyright .float-start { order: 0; float: none; }
html[data-bs-theme] #copyright .float-end { order: 1; float: none; display: flex; align-items: center; gap: 6px; }
html[data-bs-theme] #copyright .float-end form { display: flex; align-items: center; gap: 6px; margin: 0; }
html[data-bs-theme] #copyright :is(select, input.button, button) { min-height: 28px; font-size: 12.5px; padding-top: 0; padding-bottom: 0; }
html[data-bs-theme] #copyright input.button { padding: 0 10px; }
@media (max-width: 767.98px) {
	html[data-bs-theme] #copyright .container { justify-content: center; text-align: center; }
	html[data-bs-theme] fieldset .formbit_label { padding-bottom: 2px; }
}

/* MyBB's dialogs (jQuery Modal) are the one frame; the box inside them, and a box inside another box, draws none */
html[data-bs-theme] .blocker .modal, html[data-bs-theme] .modal[style*="inline-block"] {
	padding: 0; border: 1px solid var(--rf-line); border-radius: 0; overflow: hidden; background: var(--rf-card); box-shadow: 0 12px 36px rgba(var(--bs-black-rgb), 0.25);
}
html[data-bs-theme] .modal .tborder, html[data-bs-theme] .tborder .tborder { border: 0; box-shadow: none; margin: 0; }
html[data-bs-theme] .modal .thead { padding-right: 48px; }
html[data-bs-theme] .modal a.close-modal { top: 9px; right: 10px; width: 24px; height: 24px; background-size: contain; z-index: 2; }

/* Selected for moderation: a tinted row with a coloured edge, no padding added */
html[data-bs-theme] { --rf-selected: var(--bb-yellow-20); --rf-selected-edge: var(--bb-yellow-270); }
html[data-bs-theme="dark"] { --rf-selected: var(--bb-stone-840); --rf-selected-edge: var(--bb-yellow-400); }
html[data-bs-theme] .post.trow_selected { background: var(--rf-selected); padding: 0; box-shadow: inset 4px 0 0 var(--rf-selected-edge); }
html[data-bs-theme] .post.trow_selected .post_author, html[data-bs-theme] .post.trow_selected .post_body, html[data-bs-theme] .post.trow_selected .post_controls { background: transparent; }
html[data-bs-theme] .inline_row.trow_selected, html[data-bs-theme] .inline_row.trow_selected > *, html[data-bs-theme] *[class*="trow"].trow_selected { background: var(--rf-selected); }
html[data-bs-theme] .inline_row.trow_selected { box-shadow: inset 4px 0 0 var(--rf-selected-edge); }

/* Bootstrap's close button keeps its own look: the theme's button styles (gradient, dark fill) are not for it */
html[data-bs-theme] .btn-close { background: transparent var(--bs-btn-close-bg) center / 1em auto no-repeat; border: 0; border-radius: .375rem; box-shadow: none; color: var(--bs-btn-close-color); width: 1em; height: 1em; padding: .25em; }
html[data-bs-theme] .btn-close:hover { background-color: transparent; opacity: var(--bs-btn-close-hover-opacity); }

/* Content lines up with the headings: rows and bars take the heading's side padding (a row made of cells leaves it to them) */
html[data-bs-theme] .tcat { padding: 8px 14px; }
html[data-bs-theme] *[class*="trow"]:not(.post, fieldset) { padding: 8px 14px; }
html[data-bs-theme] *[class*="trow"]:not(.post, fieldset):has(> [class*="trow"]) { padding: 0; }
/* The side menus' icons sit in a 28px box: the row's padding leaves the glyph in line with the heading */
html[data-bs-theme] :is(.usercp_nav, .modcp_nav) :is(.trow1, .trow2) { padding-left: 8px; }

/* Collapse buttons in headings: the arrow sits at the right edge, centred on the heading */
html[data-bs-theme] .thead:has(> .expcolimage) { display: flex; align-items: center; gap: 10px; }
html[data-bs-theme] .thead:has(> .expcolimage) > :not(.expcolimage) { margin: 0; }
html[data-bs-theme] .thead > .expcolimage { order: 2; margin-left: auto; float: none; display: flex; align-items: center; }
html[data-bs-theme] .thead > .expcolimage img { position: static !important; top: auto !important; display: block; }

/* The cookie notice: a card fixed to the bottom of the window until it is accepted */
html[data-bs-theme] .cookie-notice { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1080; display: flex; justify-content: center; opacity: 0; transform: translateY(16px); transition: opacity .25s, transform .25s; pointer-events: none; }
html[data-bs-theme] .cookie-notice[hidden] { display: none; }
html[data-bs-theme] .cookie-notice.is-shown { opacity: 1; transform: none; pointer-events: auto; }
html[data-bs-theme] .cookie-notice-inner { width: 100%; max-width: 880px; display: flex; align-items: center; gap: 12px 18px; padding: 14px 18px; background: var(--rf-card); color: var(--rf-text); border: 1px solid var(--rf-line); border-radius: 14px; box-shadow: 0 10px 30px rgba(var(--bs-black-rgb), 0.18); }
html[data-bs-theme] .cookie-notice-inner > .bi { flex: 0 0 auto; font-size: 26px; line-height: 1; color: var(--bb-accent); }
html[data-bs-theme] .cookie-notice-inner p { flex: 1 1 auto; margin: 0; text-align: left; font-size: 14px; line-height: 1.5; color: var(--rf-muted); }
html[data-bs-theme] .cookie-notice-inner a { color: var(--bb-accent); font-weight: 600; }
html[data-bs-theme] .cookie-notice .cookie-notice-accept { flex: 0 0 auto; background: var(--bb-accent); color: var(--bs-white); border: 0; border-radius: 8px; padding: 8px 22px; font-weight: 600; }
html[data-bs-theme] .cookie-notice .cookie-notice-accept:hover, html[data-bs-theme] .cookie-notice .cookie-notice-accept:focus-visible { filter: brightness(1.08); color: var(--bs-white); }
@media (max-width: 575.98px) {
	html[data-bs-theme] .cookie-notice { left: 10px; right: 10px; bottom: 10px; }
	html[data-bs-theme] .cookie-notice-inner { flex-wrap: wrap; }
	html[data-bs-theme] .cookie-notice .cookie-notice-accept { width: 100%; }
}

/* Collapse arrows on the light section bars (User CP / Mod CP menus): MyBB's white arrow turns grey in light mode */
html[data-bs-theme="light"] .tcat .expcolimage img { filter: brightness(0) opacity(.45); }
