/* Creator Tools — one shared stylesheet for all five calculators.
   Light theme, deep green accent (#0b6e4f, the final brand colour).
   No webfonts, no images, no external requests. */

.ct-tool {
	--ct-accent: #0b6e4f;
	--ct-accent-soft: #e6f4ee;
	--ct-ink: #1a1a1a;
	--ct-muted: #5b6470;
	--ct-line: #e3e6e8;
	--ct-card: #ffffff;
	box-sizing: border-box;
	color: var(--ct-ink);
	line-height: 1.55;
	font-size: 16px;
	margin: 0 0 24px;
}
.ct-tool *,
.ct-tool *::before,
.ct-tool *::after { box-sizing: inherit; }

.ct-tool .ct-card {
	background: var(--ct-card);
	border: 1px solid var(--ct-line);
	border-radius: 14px;
	padding: 20px;
	margin-bottom: 20px;
}
.ct-tool .ct-card h2 { margin-top: 0; font-size: 19px; }

.ct-tool .ct-tabs { display: flex; gap: 8px; margin-bottom: 6px; }
.ct-tool .ct-tab {
	flex: 1;
	appearance: none;
	border: 1px solid var(--ct-line);
	background: #fff;
	color: var(--ct-muted);
	font: inherit;
	font-weight: 700;
	font-size: 15px;
	padding: 11px 10px;
	border-radius: 10px;
	cursor: pointer;
	min-height: 44px;
}
.ct-tool .ct-tab.ct-active {
	background: var(--ct-accent);
	border-color: var(--ct-accent);
	color: #fff;
}

.ct-tool label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	margin: 16px 0 6px;
}
.ct-tool label .ct-val { color: var(--ct-accent); font-weight: 800; }
.ct-tool label.ct-check {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-weight: 600;
}
.ct-tool label.ct-check input[type="checkbox"] {
	width: 22px;
	height: 22px;
	accent-color: var(--ct-accent);
	flex: none;
}

.ct-tool input[type="range"] { width: 100%; accent-color: var(--ct-accent); height: 36px; }
.ct-tool input[type="number"],
.ct-tool select {
	width: 100%;
	padding: 10px 12px;
	font-size: 16px;
	font: inherit;
	border: 1px solid var(--ct-line);
	border-radius: 8px;
	min-height: 44px;
	background: #fff;
	color: var(--ct-ink);
}
.ct-tool input:focus-visible,
.ct-tool select:focus-visible,
.ct-tool .ct-tab:focus-visible {
	outline: 2px solid var(--ct-accent);
	outline-offset: 1px;
}

.ct-tool .ct-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.ct-tool .ct-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) {
	.ct-tool .ct-row3,
	.ct-tool .ct-grid2 { grid-template-columns: 1fr; }
}

/* Results */
.ct-tool .ct-results {
	background: var(--ct-accent-soft);
	border: 1px solid #bfe3d2;
	border-radius: 14px;
	padding: 20px;
	margin-bottom: 12px;
}
.ct-tool .ct-results-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}
.ct-tool .ct-results h2 {
	margin: 0 0 4px;
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--ct-accent);
}
.ct-tool .ct-curwrap label {
	margin: 0 0 4px;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--ct-accent);
}
.ct-tool .ct-big { font-size: 34px; font-weight: 800; line-height: 1.15; }
.ct-tool .ct-sub { color: var(--ct-muted); font-size: 14px; margin: 2px 0 12px; }
.ct-tool .ct-stat {
	background: #fff;
	border: 1px solid var(--ct-line);
	border-radius: 10px;
	padding: 12px 14px;
}
.ct-tool .ct-stat .ct-k { font-size: 13px; color: var(--ct-muted); }
.ct-tool .ct-stat .ct-v { font-size: 20px; font-weight: 800; }
.ct-tool .ct-stat .ct-t { font-size: 13px; color: var(--ct-muted); margin-top: 2px; }
.ct-tool .ct-note { font-size: 13px; color: var(--ct-muted); }

/* Verdict label (engagement benchmarks, RPM niche context) */
.ct-tool .ct-verdict {
	display: inline-block;
	font-weight: 800;
	font-size: 15px;
	padding: 6px 14px;
	border-radius: 999px;
	margin: 4px 0 10px;
	background: #fff;
	border: 1px solid var(--ct-line);
}
.ct-tool .ct-verdict:empty { display: none; }
.ct-tool .ct-verdict--poor { color: #b3261e; border-color: #b3261e; }
.ct-tool .ct-verdict--average { color: #8a5a00; border-color: #c98a04; }
.ct-tool .ct-verdict--good { color: var(--ct-accent); border-color: var(--ct-accent); }
.ct-tool .ct-verdict--excellent { color: #fff; background: var(--ct-accent); border-color: var(--ct-accent); }

/* Trust strip */
.ct-tool .ct-truststrip {
	text-align: center;
	font-size: 13.5px;
	background: #fff;
	border: 1px solid var(--ct-line);
	border-radius: 10px;
	padding: 10px 14px;
	margin: 0 0 20px;
}

/* Tables (scroll inside their own box on small screens) */
.ct-tool .ct-tablewrap { overflow-x: auto; }
.ct-tool table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ct-tool th,
.ct-tool td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--ct-line); }
.ct-tool th {
	color: var(--ct-muted);
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .03em;
}
.ct-tool tr.ct-current { background: var(--ct-accent-soft); font-weight: 700; }

/* Ad slots — invisible while empty (no markup is printed at all) */
.ct-tool .ct-ad,
.ct-ad { margin: 0 0 20px; text-align: center; }

/* Mobile sticky summary bar (YouTube Money Calculator) */
.ct-tool .ct-stickybar { display: none; }
@media (max-width: 640px) {
	.ct-tool .ct-stickybar {
		display: flex;
		align-items: baseline;
		gap: 8px;
		flex-wrap: wrap;
		position: sticky;
		top: 0;
		z-index: 9;
		background: var(--ct-accent-soft);
		border: 1px solid #bfe3d2;
		border-radius: 10px;
		padding: 10px 14px;
		margin-bottom: 16px;
		box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
	}
	.ct-tool .ct-stickybar .ct-sb-k {
		font-size: 12px;
		text-transform: uppercase;
		letter-spacing: .04em;
		color: var(--ct-accent);
		font-weight: 700;
	}
	.ct-tool .ct-stickybar strong { font-size: 19px; }
	.ct-tool .ct-stickybar .ct-sb-t { font-size: 13px; color: var(--ct-muted); }
	.ct-tool .ct-big { font-size: 28px; }
}

/* Three-area desktop layout (v1.0.2): inputs top-left, the tool's
   data tables below them in the same column, and the results panel
   on the right spanning both rows, sticky. v1.0.1 put only inputs +
   results in the grid, so the wrapper was exactly as tall as the
   results panel itself and the sticky panel had zero travel room —
   it scrolled away with the page. Now the left column (inputs +
   tables) is much taller than the panel, so the panel genuinely
   sticks and travels alongside it. max-height + overflow-y keep a
   panel that is taller than the viewport fully reachable through
   its own subtle internal scroll. Tools that render no data tables
   (YouTube RPM, Instagram Money) simply leave the "tables" area
   empty; their panels stick for as long as the inputs column lasts
   and stay reachable via the same max-height rule.
   Applies at 1024px and up only — below that .ct-layout is a plain
   block, the DOM order (inputs → results → tables) is the reading
   order, and the stacked layout plus the mobile sticky summary bar
   behave exactly as before. */
@media (min-width: 1024px) {
	.ct-tool .ct-layout {
		display: grid;
		grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
		grid-template-areas:
			"inputs results"
			"tables results";
		gap: 20px;
		align-items: start;
		margin-bottom: 20px;
	}
	.ct-tool .ct-layout > .ct-card {
		grid-area: inputs;
		margin-bottom: 0;
	}
	.ct-tool .ct-layout > .ct-tables { grid-area: tables; }
	.ct-tool .ct-layout > .ct-tables .ct-card { margin-bottom: 0; }
	.ct-tool .ct-layout > .ct-results {
		grid-area: results;
		position: sticky;
		top: 24px;
		align-self: start;
		margin-bottom: 0;
		max-height: calc(100vh - 48px);
		overflow-y: auto;
	}
}

/* ------------------------------------------------------------------
   v1.0.3 — visual-QA fixes. CSS-only, plus one markup move in
   class-ct-tools.php (Instagram Engagement's benchmark table now
   renders below the layout). No JS, rate, settings-field or formula
   change. Everything below either adds new rules or overrides an
   earlier rule of equal specificity by coming later in the file.
   ------------------------------------------------------------------ */

/* 1 · Unified range-slider styling. v1.0.2 set only accent-color,
   which browsers render inconsistently — some sliders showed a green
   fill, others none. Every slider now gets the same track and thumb
   treatment in both engines; Firefox additionally fills the track up
   to the thumb via ::-moz-range-progress. (A value-tracking fill in
   WebKit would need a JS-set CSS variable; the no-JS-change rule for
   this release rules that out, so WebKit tracks are a uniform soft
   green with the same solid thumb on every slider.) */
.ct-tool input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	cursor: pointer;
}
.ct-tool input[type="range"]::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 999px;
	background: var(--ct-accent-soft);
	border: 1px solid #bfe3d2;
}
.ct-tool input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 22px;
	height: 22px;
	margin-top: -8px;
	border-radius: 50%;
	background: var(--ct-accent);
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.ct-tool input[type="range"]::-moz-range-track {
	height: 6px;
	border-radius: 999px;
	background: var(--ct-accent-soft);
	border: 1px solid #bfe3d2;
}
.ct-tool input[type="range"]::-moz-range-progress {
	height: 6px;
	border-radius: 999px;
	background: var(--ct-accent);
}
.ct-tool input[type="range"]::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--ct-accent);
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

/* 2 · Grid cells may shrink (min-width: 0) so selects and inputs never
   force a column wider than its track, and labels inside the two- and
   three-column input grids reserve two lines of height — a label that
   wraps (TikTok's longer labels, the RPM row) no longer pushes its
   input out of line with its neighbours. The reservation is dropped
   when the grids stack to one column on small phones, where there is
   nothing to align with. */
.ct-tool .ct-row3 > div,
.ct-tool .ct-grid2 > div { min-width: 0; }
.ct-tool .ct-row3 > div > label,
.ct-tool .ct-grid2 > div > label { min-height: 44px; }
@media (max-width: 560px) {
	.ct-tool .ct-row3 > div > label,
	.ct-tool .ct-grid2 > div > label { min-height: 0; }
}

/* 3 · YouTube RPM: the niche <select> gets a wider third column so
   "No niche / not sure" is never truncated in the three-column row.
   (min-width: 561px keeps the ≤560px one-column stack untouched.) */
@media (min-width: 561px) {
	.ct-tool--youtube-rpm .ct-row3 { grid-template-columns: 1fr 1fr 1.5fr; }
}

/* 4 · Results header: heading and currency control share one centre
   line (was align-items: flex-end, which left the "YOUR RPM" heading
   and the "CURRENCY" label on different baselines), and the currency
   dropdown grows to fill its share of the header row instead of
   sitting at ~40% of the panel width with dead space beside it. */
.ct-tool .ct-results-head { align-items: center; }
.ct-tool .ct-results-head h2 { margin-bottom: 0; }
.ct-tool .ct-curwrap { flex: 1 1 180px; max-width: 340px; }

/* 5 · Results stat cards stretch to equal heights within their row,
   and long values wrap gracefully inside the card instead of breaking
   the row unevenly (Instagram Money's "…per post"). */
.ct-tool .ct-results .ct-grid2 { align-items: stretch; }
.ct-tool .ct-big,
.ct-tool .ct-stat .ct-v { overflow-wrap: break-word; }

/* 6 · Instagram Engagement on desktop: its benchmark table now renders
   full-width BELOW the layout (markup change in class-ct-tools.php),
   so this tool's grid is a single inputs/results row — no empty
   "tables" row is reserved for it. The other tools keep their
   in-column tables and the two-row grid exactly as in v1.0.2. */
@media (min-width: 1024px) {
	.ct-tool--instagram-engagement .ct-layout {
		grid-template-areas: "inputs results";
	}
}

/* 7 · Small screens. (a) Tighter plugin tables — smaller type and
   cell padding — so most fit their card without sideways scrolling;
   a table that is still genuinely too wide keeps scrolling inside
   its own .ct-tablewrap box (overflow-x: auto, set above), never
   the page. (b) The YouTube Money summary bar becomes a true fixed
   bottom bar: it used to be sticky at the top of the tool, where it
   covered the Long-form/Shorts tabs and, further down, table headers
   while scrolling. Fixed to the bottom with the same solid soft-green
   background it overlays nothing at the top of the tool, and the tool
   wrapper gains bottom padding so the bar can never hide the tool's
   own last rows (the Rates & sources box) at the end of the page. */
@media (max-width: 640px) {
	.ct-tool table { font-size: 13px; }
	.ct-tool th,
	.ct-tool td { padding: 7px 6px; }
	.ct-tool th { font-size: 11.5px; }
	.ct-tool .ct-tablewrap { -webkit-overflow-scrolling: touch; }

	.ct-tool .ct-stickybar {
		position: fixed;
		top: auto;
		left: 12px;
		right: 12px;
		bottom: 12px;
		z-index: 40;
		margin: 0;
		border-radius: 12px;
		background: var(--ct-accent-soft);
		box-shadow: 0 6px 20px rgba(0, 0, 0, .16);
	}
	.ct-tool--youtube-money { padding-bottom: 96px; }
}
