/**
 * Team HQ front-end styles.
 *
 * THEME-AGNOSTIC BY DESIGN. This stylesheet must sit inside whatever theme the
 * shop runs, light or dark, without being told which. rudebits.net is white text
 * on black; the first version of this file assumed the opposite and forced white
 * panel backgrounds, which put white labels on a white card and made the driver
 * page unreadable.
 *
 * The rules that keep it working anywhere:
 *
 *   1. Never set a text colour. Text inherits from the theme, so it is always
 *      readable against whatever the theme painted behind it.
 *   2. Never set an opaque background. Surfaces are mid-grey at low alpha —
 *      rgba(128,128,128,x) reads as a slightly lighter panel on a dark theme and
 *      a slightly darker one on a light theme, from a single value.
 *   3. Borders and rules are the same mid-grey at higher alpha.
 *   4. Where a colour has to carry meaning (an error, a warning), it goes on a
 *      border and a faint wash, never on the text.
 *   5. Leave form controls to the theme. Only widths and spacing here.
 */

/* Surfaces and lines, derived from nothing but grey and alpha. */
.rbth-dash,
.rbth-application {
	--rbth-surface: rgba(128, 128, 128, .10);
	--rbth-surface-2: rgba(128, 128, 128, .16);
	--rbth-line: rgba(128, 128, 128, .30);
	--rbth-line-soft: rgba(128, 128, 128, .20);
	--rbth-error: #d9534f;
	--rbth-info: #3f92d2;
	--rbth-warn: #d9534f;
}

.rbth-dash {
	display: flex;
	flex-direction: column;
	gap: 1.5em;
}

/* Panels --------------------------------------------------------------- */

.rbth-panel {
	border: 1px solid var(--rbth-line);
	border-radius: 4px;
	padding: 1.2em 1.4em;
	background: var(--rbth-surface);
}

.rbth-panel h3 {
	margin-top: 0;
	font-size: 1.1em;
}

.rbth-muted {
	opacity: .75;
	font-size: .9em;
}

/* Summary -------------------------------------------------------------- */

.rbth-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 1.6em;
}

.rbth-stat {
	display: flex;
	flex-direction: column;
	gap: .15em;
	min-width: 8em;
}

.rbth-stat__k {
	font-size: .78em;
	text-transform: uppercase;
	letter-spacing: .07em;
	opacity: .7;
}

.rbth-stat__v {
	font-size: 1.5em;
	font-weight: 600;
	line-height: 1.1;
}

/* Rates ---------------------------------------------------------------- */

.rbth-rates {
	list-style: none;
	margin: 0 0 1em;
	padding: 0;
}

.rbth-rates li {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	padding: .45em 0;
	border-bottom: 1px solid var(--rbth-line-soft);
}

.rbth-rates li:last-child {
	border-bottom: 0;
}

/* Allowance meter ------------------------------------------------------ */

.rbth-meter {
	display: block;
	height: 10px;
	border-radius: 5px;
	background: var(--rbth-surface-2);
	border: 1px solid var(--rbth-line-soft);
	overflow: hidden;
	margin: .3em 0 .8em;
}

.rbth-meter__fill {
	display: block;
	height: 100%;
	background: currentColor;
	opacity: .6;
}

/* Tables --------------------------------------------------------------- */

.rbth-table {
	width: 100%;
	border-collapse: collapse;
	margin: .6em 0 0;
	font-size: .94em;
}

.rbth-table th,
.rbth-table td {
	text-align: left;
	padding: .5em .6em;
	border-bottom: 1px solid var(--rbth-line-soft);
}

.rbth-table th {
	font-size: .8em;
	text-transform: uppercase;
	letter-spacing: .05em;
	opacity: .7;
}

.rbth-table tr:last-child td {
	border-bottom: 0;
}

.rbth-table .rbth-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* Threads and results -------------------------------------------------- */

.rbth-thread {
	border: 1px solid var(--rbth-line);
	border-radius: 4px;
	padding: .8em 1.1em;
	margin: .6em 0;
	background: var(--rbth-surface);
}

.rbth-thread > summary {
	cursor: pointer;
	font-weight: 600;
	padding: .1em 0;
}

.rbth-thread[open] > summary {
	margin-bottom: .6em;
	padding-bottom: .6em;
	border-bottom: 1px solid var(--rbth-line-soft);
}

.rbth-thread__subject {
	margin-right: .4em;
}

.rbth-msg {
	border-left: 3px solid var(--rbth-line);
	padding: .4em 0 .4em .9em;
	margin: .8em 0;
}

.rbth-msg--team {
	border-left-color: currentColor;
	opacity: 1;
}

.rbth-msg__meta {
	font-size: .8em;
	opacity: .7;
	margin-bottom: .2em;
}

/* Chips ---------------------------------------------------------------- */

.rbth-chip {
	display: inline-block;
	font-size: .72em;
	text-transform: uppercase;
	letter-spacing: .06em;
	padding: .1em .6em;
	border-radius: 1em;
	border: 1px solid var(--rbth-line);
	background: var(--rbth-surface-2);
	opacity: .85;
	vertical-align: middle;
}

.rbth-chip--reply,
.rbth-chip--approved {
	border-color: currentColor;
	opacity: 1;
}

/* Forms ---------------------------------------------------------------- */

.rbth-form {
	margin: .8em 0 0;
}

.rbth-form p {
	margin: 0 0 1em;
}

.rbth-form label {
	display: block;
	font-size: .88em;
	font-weight: 600;
	opacity: .85;
	margin-bottom: .3em;
}

/* Widths and spacing only — the theme owns how a field actually looks. */
.rbth-form input[type="text"],
.rbth-form input[type="email"],
.rbth-form input[type="number"],
.rbth-form input[type="date"],
.rbth-form input[type="file"],
.rbth-form select,
.rbth-form textarea {
	width: 100%;
	max-width: 34em;
}

.rbth-form--reply textarea {
	display: block;
	margin-bottom: .6em;
}

/* Keep the reply button under its textarea rather than floating beside it. */
.rbth-form--reply button {
	display: inline-block;
}

.rbth-field--consent label {
	display: flex;
	gap: .5em;
	align-items: flex-start;
	font-size: .92em;
	font-weight: 400;
}

.rbth-field--consent input {
	width: auto;
	margin-top: .25em;
}

.rbth-req {
	opacity: .55;
}

/* The honeypot has to be in the markup but never seen or focusable. */
.rbth-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Notices -------------------------------------------------------------- */

.rbth-notice {
	padding: .8em 1.1em;
	border-radius: 4px;
	border-left: 4px solid var(--rbth-line);
	background: var(--rbth-surface);
	margin-bottom: 1em;
}

/* Meaning goes on the edge and a faint wash, never on the text — text has to
   stay whatever colour the theme made it, or it stops being readable. */
.rbth-notice--error {
	border-left-color: var(--rbth-error);
	background: rgba(217, 83, 79, .14);
}

.rbth-notice--info {
	border-left-color: var(--rbth-info);
	background: rgba(63, 146, 210, .12);
}

.rbth-callout--warn {
	padding: .8em 1.1em;
	border-left: 4px solid var(--rbth-warn);
	background: rgba(217, 83, 79, .14);
	border-radius: 4px;
	margin-bottom: 1em;
}

/* Assets --------------------------------------------------------------- */

.rbth-assets {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rbth-assets li {
	padding: .5em 0;
	border-bottom: 1px solid var(--rbth-line-soft);
}

.rbth-assets li:last-child {
	border-bottom: 0;
}

/* Application form ----------------------------------------------------- */

.rbth-application {
	max-width: 44em;
}

.rbth-application__intro {
	opacity: .85;
	margin-bottom: 1.4em;
}

.rbth-field {
	margin-bottom: 1.1em;
}
