.credits-expiry {
	list-style: none;
	margin: 0 0 1em;
	padding: 0;
	color: #666;
	font-size: 0.9em;
}

.credits-buy-intro {
	margin: 0 0 1.5em;
	color: #555;
}

.credits-buy-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.credits-buy-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1 1 160px;
	max-width: 220px;
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 8px;
	padding: 24px 16px;
	text-align: center;
}

.credits-buy-card-amount {
	font-size: 2.2em;
	font-weight: 700;
	line-height: 1.1;
}

.credits-buy-card-amount-label {
	font-size: 0.85em;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 12px;
}

.credits-buy-card-price {
	font-size: 1.2em;
	font-weight: 600;
	margin-bottom: 16px;
}

.credits-buy-card-button {
	/* full width of its card, and centred in it - the shared rule above is an
	   inline-block sized to its text */
	width: 100%;
	display: block;
	text-align: center;
}

.credits-how-it-works {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin: 0 0 1.75em;
	padding-bottom: 1.5em;
	border-bottom: 1px solid #e6e6e6;
}

.credits-how-step {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	flex: 1 1 200px;
}

.credits-how-step-icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--boothjunkie-primary, #7a9ee0);
	color: #fff;
	font-weight: 700;
	font-size: 0.85em;
}

.credits-how-step-text {
	font-size: 0.9em;
	color: #444;
	line-height: 1.4;
	padding-top: 3px;
}

.credits-amount-credit {
	color: #2a8000;
}

.credits-amount-debit {
	color: #a00;
}

.credits-autotopup-failed {
	color: #a00;
	font-weight: 600;
}

.credits-pagination {
	margin-top: 1em;
}

.credits-pagination a,
.credits-pagination span {
	display: inline-block;
	padding: 4px 9px;
	margin-right: 4px;
}

.credits-pagination .credits-page-current {
	font-weight: 600;
}

.credits-tab-panel {
	background: #f8f8f8;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 24px;
	min-height: 420px;
	box-sizing: border-box;
}

.credits-hero-balance {
	margin-bottom: 20px;
}

.credits-hero-balance-label {
	display: block;
	font-size: 0.9em;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.credits-hero-balance-value {
	font-size: 2.6em;
	font-weight: 700;
	line-height: 1.2;
}

.credits-hero-balance-unit {
	font-size: 1.1em;
	color: #666;
	margin-left: 4px;
}

/* [credits_balance] - the full dashboard's .credits-tab-panel assumes room
   for hero-stats/usage-chart below the balance (hence its 420px min-height),
   which would leave this compact standalone panel mostly empty space, so
   both are overridden here. */
.credits-balance-panel {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	min-height: 0;
	padding-top: 16px;
	padding-bottom: 16px;
}

.credits-balance-panel .credits-hero-balance {
	margin-bottom: 0;
}

/* Matches .bjae-button from the Booth Junkie Account Extras plugin's
   Licences/Galleries tables, so a button looks the same regardless of
   which plugin's panel it's sitting in. */
/* Buy now is the same button as every other one on these screens. It only
   ever set its own width, so it was falling through to the browser's own
   grey-and-outset-border default - the one control on the page not wearing
   the house style. */
.credits-button,
.credits-buy-card-button {
	display: inline-block;
	flex: 0 0 auto;
	padding: 6px 14px;
	background: var(--boothjunkie-primary, #7a9ee0);
	color: #fff;
	border: none;
	border-radius: 5px;
	text-decoration: none;
	font-size: 0.85em;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.credits-button:hover,
.credits-buy-card-button:hover {
	/* brightness(), not a second hardcoded darker hex: --boothjunkie-primary
	   can be changed from the shared Booth Junkie Branding settings at any
	   time, so the hover shade needs to adapt rather than staying pinned
	   to a value that only matched the old blue. */
	filter: brightness(0.88);
	color: #fff;
}

.credits-hero-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 20px;
}

.credits-hero-stat {
	flex: 1 1 200px;
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 6px;
	padding: 12px 14px;
}

.credits-hero-stat-label {
	display: block;
	font-size: 0.8em;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 6px;
}

.credits-hero-stat-value {
	display: block;
	font-weight: 600;
}

.credits-hero-stat-muted {
	color: #999;
	font-weight: 400;
}

.credits-hero-stat-note {
	display: block;
	font-size: 0.85em;
	color: #666;
	margin-top: 4px;
}

.credits-hero-stat-link {
	display: inline-block;
	font-size: 0.85em;
	margin-top: 6px;
}

.credits-badge {
	display: inline-block;
	font-size: 0.75em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 3px 9px;
	border-radius: 999px;
}

.credits-badge-active {
	background: #e6f4ea;
	color: #1e7e34;
}

.credits-badge-warning {
	background: #fdecea;
	color: #a00;
}

.credits-badge-inactive {
	background: #eee;
	color: #888;
}

.credits-usage-chart {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	height: 140px;
	padding-top: 10px;
	border-top: 1px solid #e6e6e6;
}

.credits-usage-bar-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1 1 0;
	height: 100%;
}

.credits-usage-bar-track {
	display: flex;
	align-items: flex-end;
	flex: 1 1 auto;
	width: 100%;
	max-width: 32px;
}

.credits-usage-bar {
	width: 100%;
	min-height: 2px;
	background: var(--boothjunkie-primary, #7a9ee0);
	border-radius: 3px 3px 0 0;
}

.credits-usage-value {
	font-size: 0.8em;
	color: #666;
	margin-top: 6px;
}

.credits-usage-label {
	font-size: 0.8em;
	color: #999;
}

.credits-tab-nav {
	display: flex;
	gap: 4px;
	border-bottom: 1px solid #ddd;
	margin-bottom: 20px;
}

.credits-tab-link {
	display: inline-block;
	padding: 10px 16px;
	text-decoration: none;
	color: #555;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}

.credits-tab-link.is-active {
	color: #111;
	font-weight: 600;
	border-bottom-color: var(--boothjunkie-primary, #7a9ee0);
}

.credits-tab-panel h3 {
	margin-top: 0;
}

/* Matches .bjae-flex-row from the Booth Junkie Account Extras plugin -
   defined here too so it still works on a page that only loads this
   plugin's CSS. General-purpose "place these shortcodes side by side,
   sharing the available width" wrapper, e.g.
   <div class="bjae-flex-row">[credits_balance] [wsdesk_open_tickets]</div> -
   block-level panels never do this just by sitting inside the same <p>. */
.bjae-flex-row {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

.bjae-flex-row > * {
	flex: 1 1 260px;
}

/* [ai_costs] / the "AI Costs" tab on the full Credits dashboard - one card
   per model, echoing .credits-buy-card's card treatment so pricing reads
   consistently everywhere on the account page, but left-aligned (a model
   name + optional sentence of "best for" copy doesn't sit well centered
   the way a single big number does). The "how this works" explanation
   above the grid reuses .credits-how-it-works/.credits-how-step as-is
   (already styled, see the Buy Credits tab above) rather than introducing
   a second version of the same 1-2-3 step pattern. */
.credits-pricing-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 1em;
}

.credits-pricing-card {
	flex: 1 1 220px;
	max-width: 280px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 8px;
	padding: 18px 16px;
}

.credits-pricing-card-name {
	font-weight: 700;
	color: #222;
}

.credits-pricing-card-cost {
	display: inline-block;
	font-size: 0.8em;
	font-weight: 600;
	color: #fff;
	background: var(--boothjunkie-primary, #7a9ee0);
	padding: 3px 10px;
	border-radius: 999px;
}

.credits-pricing-card-note {
	margin: 0;
	font-size: 0.88em;
	color: #666;
	line-height: 1.4;
}

.credits-pricing-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.credits-pricing-actions-label {
	font-size: 0.9em;
	color: #555;
	margin-right: 4px;
}

/* A lower-emphasis alternative to the plain (blue-filled) .credits-button,
   for a secondary action sitting next to a primary one - e.g. "Buy More
   Credits" (primary) vs "Set Up Auto Top-up" (secondary) here. */
.credits-button-secondary {
	background: #fff;
	color: var(--boothjunkie-primary, #7a9ee0);
	border: 1px solid var(--boothjunkie-primary, #7a9ee0);
}

.credits-button-secondary:hover {
	background: #f4f7fd;
	filter: brightness(0.88);
}

/* Spacing for a browser without flex gap - Safari below 14.1. See the matching
   block in booth-junkie-account-extras/assets/css/bjae-frontend.css, which also
   owns .bjae-flex-row and sets the html class this depends on. Repeated here
   because either stylesheet may be the one that ends up last. */
html.bjae-no-flexgap .bjae-flex-row {
	margin-top: -16px;
	margin-left: -8px;
	margin-right: -8px;
	/* The children below carry a bottom margin so they clear each other when the
	   row wraps. Nothing cancelled it, so on the browser that uses this fallback
	   - and only there - the row sat 16px lower than the panels beneath it, and
	   the gap above the logo panel read as noticeably bigger than the one below
	   it. This takes that last row's margin back off. */
}

html.bjae-no-flexgap .bjae-flex-row > * {
	margin: 16px 8px 0;
}

/* Every flex container on these screens that leans on gap. Directions and
   amounts were read off the computed styles rather than the source. The ones
   that wrap get the gutter form - a margin on every child and the container
   pulled back by the same amount - because spacing only the later siblings
   would indent the first card of each wrapped row. */

/* stacked */
html.bjae-no-flexgap .credits-pricing-card > * + * { margin-top: 8px }

/* side by side, never wrapping */
html.bjae-no-flexgap .credits-how-step > * + *    { margin-left: 12px }
html.bjae-no-flexgap .credits-tab-nav > * + *     { margin-left: 4px }
html.bjae-no-flexgap .credits-usage-chart > * + * { margin-left: 10px }

/* side by side and able to wrap */
/* The gutter hangs from the top of each child, with the container pulled up by
   the same amount, rather than from the bottom.

   Hanging it below looked equivalent and was not. .credits-how-it-works carries
   a bottom border - the horizontal rule under the steps - and the children's
   bottom margins sit inside the box, above it. The container's cancelling
   -20px then pulled whatever followed up over that line, which is why the buy
   cards, the top-up field and the model blocks all appeared to sit above the
   rule. Hung from the top, the first row's margin is cancelled against the
   element above, wrapped rows still clear each other, and nothing is added
   below the last row for a border to be pushed away from. */
html.bjae-no-flexgap .credits-hero-stats,
html.bjae-no-flexgap .credits-buy-grid,
html.bjae-no-flexgap .credits-pricing-grid  { margin-top: -16px; margin-right: -16px }
html.bjae-no-flexgap .credits-hero-stats > *,
html.bjae-no-flexgap .credits-buy-grid > *,
html.bjae-no-flexgap .credits-pricing-grid > *  { margin: 16px 16px 0 0 }

html.bjae-no-flexgap .credits-how-it-works      { margin-top: -20px; margin-right: -20px }
html.bjae-no-flexgap .credits-how-it-works > *  { margin: 20px 20px 0 0 }

/* Spaced between siblings rather than with a gutter: this row is a label and
   two buttons, and a gutter would fight the 18px that separates it from the
   blocks above - the container is pulled up by the same property that puts it
   there. */
html.bjae-no-flexgap .credits-pricing-actions > * + * { margin-left: 10px }

/* the tab strip wraps below, so it needs the gutter form too */
html.bjae-no-flexgap .credits-tab-nav       { margin-top: -4px; margin-right: -4px }
html.bjae-no-flexgap .credits-tab-nav > *   { margin: 4px 4px 0 0 }

/* ---------------------------------------------------------------------------
   Below desktop.

   Three things go wrong once the panel is narrower than the design assumed. */
@media (max-width: 1199px) {
	/* The tab strip is five tabs on one unbreakable line - 521px of them - so on
	   a phone it was both wrapping its labels into stacks of words and still
	   coming out wider than the screen it is on, which is what forced the whole
	   page to scroll sideways. Two to a row instead, each keeping its label on
	   one line. Five tabs means the last one takes a row of its own and fills
	   it, which reads as deliberate rather than left over. */
	.credits-tab-nav {
		flex-wrap: wrap;
	}

	/* The cards are capped at 220px and 280px, which is right when several share
	   a row and wrong when two of them have a whole panel to themselves - a third
	   of the width sat empty. Uncapped they take whatever the row has, which is
	   what makes four model blocks fit across a tablet in landscape instead of
	   folding into a 2x2 with a gap down the side. */
	.credits-buy-card,
	.credits-pricing-card {
		max-width: none;
	}

	/* The model blocks become a grid here rather than a flex row. Flex cannot say
	   "four or two, never three and a stranded fourth": whatever basis fits four
	   across a tablet in landscape also fits three across one in portrait, and the
	   fourth then wraps alone and stretches the full width. A grid track of
	   minmax(210px, 1fr) gives four columns at 899px and two at 643px, and any
	   leftover card takes a column rather than the whole row.

	   Grid gap has worked since Safari 12, so this also steps out of the flex-gap
	   fallback - which is what the two rules below turn off for it. */
	.credits-pricing-grid {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		grid-gap: 16px;
		gap: 16px;
	}

	html.bjae-no-flexgap .credits-pricing-grid     { margin-top: 0; margin-right: 0 }
	html.bjae-no-flexgap .credits-pricing-grid > * { margin: 0 }

	/* and centred, for the case where they do not fill the row */
	.credits-buy-grid,
	.credits-pricing-grid {
		justify-content: center;
	}
}

/* Two across on a tablet held upright, four on its side, one on a phone -
   stated outright rather than left to auto-fit. auto-fit cannot make that jump:
   any track size that fits four across 899px also fits three across 674px, so
   the fourth block stranded itself on a row of its own. The column count is the
   thing being decided here, so it is the thing to write down. */
@media (min-width: 901px) and (max-width: 1199px) and (max-height: 820px) {
	.credits-pricing-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 560px) {
	.credits-pricing-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 700px) {
	.credits-tab-nav > * {
		flex: 1 1 calc(50% - 4px);
		white-space: nowrap;
		text-align: center;
		justify-content: center;
	}
}

@media (max-width: 1199px) {
	/* Twelve months of bars will not fit a phone, and each bar refuses to shrink
	   below its own month label - flex items floor at their content unless told
	   otherwise - so the chart was 343px wide inside a 280px panel and pushed the
	   whole page sideways. The chart scrolls within itself instead: the bars keep
	   a width you can read, and the page does not move. */
	.credits-usage-chart {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* Grow to share the panel, but never shrink past the point where a month
	   label still fits. 0 0 auto pinned every bar at 34px, so on a tablet the
	   twelve of them came to 408px of a 899px chart and the rest sat empty -
	   the scroll was there for the phone and the width went missing everywhere
	   else. Growing fills the panel; refusing to shrink is what makes it
	   overflow, and overflow is what gives the scroll something to do. */
	.credits-usage-bar-wrap {
		flex: 1 0 34px;
		min-width: 34px;
	}
}

/* "Running low?" and its buttons sat straight against the blocks above them. */
.credits-pricing-actions {
	margin-top: 18px;
}
