/* Music Royalty Calculator
   Visual idea: a payout statement. Money arriving is read down one ledger,
   money leaving down another, and the balance sits at the top in the same
   place a bank puts it. Hairlines and tabular figures do the structural work
   instead of cards and shadows. */

.tbt-rc {
	--rc-ink: #14110f;
	--rc-body: #3d3833;
	--rc-muted: #7a736c;
	--rc-rule: #e2ddd5;
	--rc-rule-soft: #efebe5;
	--rc-paper: #ffffff;
	--rc-tint: #f8f6f2;
	--rc-in: #1f6f52;
	--rc-out: #a5402c;
	--rc-focus: #1f6f52;

	color: var(--rc-body);
	background: var(--rc-paper);
	border-top: 3px solid var(--rc-ink);
	border-bottom: 1px solid var(--rc-rule);
	padding: 28px 0 34px;
	margin: 32px 0;
	font-size: 16px;
	line-height: 1.55;
	font-variant-numeric: tabular-nums;
	-webkit-text-size-adjust: 100%;
}

.tbt-rc *,
.tbt-rc *::before,
.tbt-rc *::after {
	box-sizing: border-box;
}

/* ------------------------------------------------------------------ header */

.tbt-rc__head {
	margin: 0 0 22px;
}

.tbt-rc__title {
	margin: 0 0 6px;
	font-size: clamp( 1.5rem, 1.2rem + 1.4vw, 2.1rem );
	line-height: 1.15;
	letter-spacing: -0.015em;
	color: var(--rc-ink);
	font-weight: 700;
}

.tbt-rc__sub {
	margin: 0;
	max-width: 62ch;
	color: var(--rc-muted);
}

/* ------------------------------------------------------------------ fields */

.tbt-rc__controls {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 190px, 1fr ) );
	gap: 16px 20px;
	margin-bottom: 26px;
}

.tbt-rc__controls--two {
	grid-template-columns: repeat( auto-fit, minmax( 240px, 1fr ) );
	margin-bottom: 12px;
}

.tbt-rc__field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}

.tbt-rc__field label {
	font-size: 0.85rem;
	color: var(--rc-muted);
	font-weight: 500;
	line-height: 1.3;
}

.tbt-rc__unit {
	color: var(--rc-rule);
	color: #a49c93;
}

.tbt-rc-input {
	width: 100%;
	padding: 9px 11px;
	font: inherit;
	font-size: 0.98rem;
	color: var(--rc-ink);
	background: var(--rc-paper);
	border: 1px solid var(--rc-rule);
	border-radius: 3px;
	font-variant-numeric: tabular-nums;
	appearance: auto;
}

.tbt-rc-input:focus-visible,
.tbt-rc-btn:focus-visible,
.tbt-rc-link:focus-visible {
	outline: 2px solid var(--rc-focus);
	outline-offset: 2px;
}

.tbt-rc-input:hover {
	border-color: #cdc6bd;
}

/* ------------------------------------------------------------------ panels */

.tbt-rc__panel {
	border-top: 1px solid var(--rc-rule);
	padding-top: 20px;
	margin-bottom: 26px;
}

.tbt-rc__panel-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px 18px;
	margin-bottom: 16px;
}

.tbt-rc__panel-head h3 {
	margin: 0;
	font-size: 1.06rem;
	font-weight: 700;
	color: var(--rc-ink);
	letter-spacing: -0.01em;
}

.tbt-rc__panel-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.tbt-rc__group + .tbt-rc__group {
	margin-top: 20px;
}

.tbt-rc__group-title {
	margin: 0 0 10px;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--rc-muted);
	padding-bottom: 5px;
	border-bottom: 1px dashed var(--rc-rule-soft);
}

.tbt-rc__group-grid {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 175px, 1fr ) );
	gap: 14px 18px;
}

.tbt-rc__hint,
.tbt-rc__note {
	margin: 14px 0 0;
	font-size: 0.87rem;
	color: var(--rc-muted);
	max-width: 68ch;
}

.tbt-rc__note:empty {
	display: none;
}

.tbt-rc__adv {
	margin-top: 16px;
	border-top: 1px dashed var(--rc-rule-soft);
	padding-top: 12px;
}

.tbt-rc__adv summary {
	cursor: pointer;
	font-size: 0.9rem;
	color: var(--rc-in);
	font-weight: 600;
}

.tbt-rc__grid {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 200px, 1fr ) );
	gap: 14px 18px;
	margin-top: 14px;
}

/* ----------------------------------------------------------------- buttons */

.tbt-rc__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin: 26px 0 8px;
}

.tbt-rc-btn {
	display: inline-block;
	padding: 13px 26px;
	font: inherit;
	font-weight: 600;
	font-size: 1rem;
	color: #fff;
	background: var(--rc-ink);
	border: 1px solid var(--rc-ink);
	border-radius: 3px;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.tbt-rc-btn:hover {
	background: #000;
	color: #fff;
}

.tbt-rc-btn--quiet {
	color: var(--rc-body);
	background: transparent;
	border-color: var(--rc-rule);
	font-weight: 500;
}

.tbt-rc-btn--quiet:hover {
	background: var(--rc-tint);
	color: var(--rc-ink);
}

.tbt-rc-btn--cta {
	background: var(--rc-in);
	border-color: var(--rc-in);
}

.tbt-rc-btn--cta:hover {
	background: #185840;
}

.tbt-rc-link {
	padding: 0;
	font: inherit;
	font-size: 0.87rem;
	color: var(--rc-in);
	background: none;
	border: 0;
	border-bottom: 1px solid currentColor;
	cursor: pointer;
	line-height: 1.3;
}

.tbt-rc-link:hover {
	color: var(--rc-ink);
}

/* ----------------------------------------------------------------- results */

.tbt-rc__results[hidden] {
	display: none;
}

.tbt-rc__results {
	margin-top: 30px;
	border-top: 1px solid var(--rc-rule);
	padding-top: 26px;
}

.tbt-rc__big {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 20px 22px;
	background: var(--rc-tint);
	border-left: 4px solid var(--rc-in);
}

.tbt-rc__big-label {
	font-size: 0.86rem;
	color: var(--rc-muted);
}

.tbt-rc__big-value {
	font-size: clamp( 2rem, 1.4rem + 3vw, 3.1rem );
	line-height: 1.05;
	font-weight: 700;
	color: var(--rc-ink);
	letter-spacing: -0.03em;
}

.tbt-rc__big-sub {
	font-size: 0.92rem;
	color: var(--rc-muted);
	margin-top: 4px;
}

.tbt-rc__chips {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 150px, 1fr ) );
	gap: 1px;
	margin-top: 1px;
	background: var(--rc-rule-soft);
}

.tbt-rc__chip {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 14px;
	background: var(--rc-paper);
}

.tbt-rc__chip-k {
	font-size: 0.78rem;
	color: var(--rc-muted);
}

.tbt-rc__chip-v {
	font-size: 1.08rem;
	font-weight: 700;
	color: var(--rc-ink);
}

.tbt-rc__empty {
	margin: 0;
	padding: 16px 18px;
	background: var(--rc-tint);
	border-left: 4px solid var(--rc-out);
	color: var(--rc-body);
}

.tbt-rc__h3 {
	margin: 34px 0 12px;
	font-size: 1.02rem;
	font-weight: 700;
	color: var(--rc-ink);
	letter-spacing: -0.01em;
}

.tbt-rc__tablewrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.tbt-rc__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.93rem;
	margin: 0;
}

.tbt-rc__table th,
.tbt-rc__table td {
	padding: 9px 12px 9px 0;
	text-align: right;
	border-bottom: 1px solid var(--rc-rule-soft);
	white-space: nowrap;
	vertical-align: top;
}

.tbt-rc__table th:first-child,
.tbt-rc__table td:first-child {
	text-align: left;
	white-space: normal;
	padding-left: 0;
}

.tbt-rc__table thead th {
	font-size: 0.79rem;
	font-weight: 600;
	color: var(--rc-muted);
	border-bottom: 1px solid var(--rc-rule);
}

.tbt-rc__table tbody tr.is-total td {
	border-top: 2px solid var(--rc-ink);
	border-bottom: 0;
	padding-top: 11px;
	font-weight: 600;
	color: var(--rc-ink);
}

.tbt-rc__table tbody tr.is-unavailable td {
	color: var(--rc-muted);
}

.tbt-rc__flag {
	font-size: 0.76rem;
	color: var(--rc-out);
	border: 1px solid currentColor;
	border-radius: 2px;
	padding: 0 5px;
	white-space: nowrap;
}

.tbt-rc__muted {
	color: var(--rc-muted);
	font-weight: 400;
	font-size: 0.86em;
}

.tbt-rc__verdict {
	margin: 14px 0 0;
	padding: 13px 16px;
	background: var(--rc-tint);
	border-left: 4px solid var(--rc-ink);
	font-size: 0.95rem;
	color: var(--rc-ink);
	max-width: 70ch;
}

.tbt-rc__cta {
	margin: 26px 0 0;
}

.tbt-rc__cta[hidden] {
	display: none;
}

.tbt-rc__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 18px;
	margin-top: 24px;
	padding-top: 14px;
	border-top: 1px solid var(--rc-rule-soft);
}

.tbt-rc__copied {
	font-size: 0.85rem;
	color: var(--rc-in);
}

.tbt-rc__copied[hidden] {
	display: none;
}

.tbt-rc__disclaimer {
	margin: 14px 0 0;
	font-size: 0.83rem;
	color: var(--rc-muted);
	max-width: 72ch;
}

/* --------------------------------------------------------------------- ads */

.tbt-rc-ad {
	margin: 34px 0;
	padding-top: 8px;
	clear: both;
}

.tbt-rc-ad__label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.72rem;
	color: #9c948b;
	letter-spacing: 0.04em;
}

.tbt-rc-ad__slot {
	overflow: hidden;
}

.tbt-rc-ad--deferred.is-visible .tbt-rc-ad__slot {
	min-height: 100px;
}

.tbt-rc-ad--deferred:not( .is-visible ) {
	display: none;
}

/* Keep a clear gap between anything clickable in the tool and an ad unit, so
   a mis-tap on Calculate can never land on an ad. */
.tbt-rc__actions + .tbt-rc-ad,
.tbt-rc__foot + .tbt-rc-ad,
.tbt-rc__cta + .tbt-rc-ad {
	margin-top: 48px;
}

/* ------------------------------------------------------------------ mobile */

@media ( max-width: 600px ) {
	.tbt-rc {
		font-size: 15px;
		padding: 22px 0 26px;
	}

	.tbt-rc__group-grid {
		grid-template-columns: repeat( auto-fit, minmax( 140px, 1fr ) );
		gap: 12px 14px;
	}

	.tbt-rc__big {
		padding: 16px 16px;
	}

	.tbt-rc__actions .tbt-rc-btn {
		flex: 1 1 100%;
		text-align: center;
	}

	.tbt-rc__table {
		font-size: 0.88rem;
	}
}

/* ------------------------------------------------------------------- print */

@media print {
	.tbt-rc {
		border: 0;
		padding: 0;
	}

	.tbt-rc__controls,
	.tbt-rc__panel,
	.tbt-rc__actions,
	.tbt-rc__foot,
	.tbt-rc__cta,
	.tbt-rc-ad {
		display: none !important;
	}

	.tbt-rc__results {
		border-top: 0;
		padding-top: 0;
	}

	.tbt-rc__tablewrap {
		overflow: visible;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.tbt-rc * {
		transition: none !important;
	}
}
