/* LEAD Linguistic: IELTS band calculator. Every rule is scoped under .tl-band. */

.tl-band {
	--bc-hd: var(--hd, 78px);
	container: bc / inline-size;
	position: relative;
	display: block;
	width: 100%;
	max-width: 1180px;
	margin-inline: auto;
	color: var(--ink);
	font-family: var(--f-body);
	font-size: 1.0625rem;
	line-height: 1.6;
	text-align: left;
	scroll-margin-top: calc(var(--bc-hd) + 14px);
}
.tl-band *, .tl-band *::before, .tl-band *::after { box-sizing: border-box; }
.tl-band p { margin: 0 0 1em; }
.tl-band h3 { margin: 0; font-weight: 400; }
.tl-band button, .tl-band input, .tl-band output { font: inherit; color: inherit; }
.tl-band svg { display: inline-block; max-width: none; }
.tl-band [hidden] { display: none !important; }
.tl-band :focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; border-radius: 4px; }
.tl-band .bc-vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.tl-band .bc-hand { font-family: var(--f-hand); font-weight: 400; color: var(--red); line-height: 1.25; }
.tl-band .btn { touch-action: manipulation; }

/* Tabs: two index tabs on top of the sheet */
.tl-band .bc-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding-left: clamp(0px, 6cqi, 88px); position: relative; z-index: 2; }
.tl-band .bc-tab {
	display: inline-flex; align-items: center; gap: 9px; min-height: 48px; padding: 12px 20px 14px; margin: 0;
	border: 0; border-radius: 12px 12px 0 0; background: var(--lilac); color: var(--ink-2);
	font-weight: 700; font-size: .98rem; line-height: 1.2; cursor: pointer; text-align: left;
	transform: translateY(6px); transition: transform .3s var(--ease), background-color .2s, color .2s;
}
.tl-band .bc-tab .ic { width: 18px; height: 18px; flex: none; }
.tl-band .bc-tab:hover { transform: translateY(2px); color: var(--ink); }
.tl-band .bc-tab.is-on { background: var(--purple); color: var(--sheet); transform: none; }
.tl-band .bc-tab:focus-visible { outline-offset: 2px; }

.tl-band .bc-panel { display: grid; gap: 26px; align-items: start; }

/* The score sheet */
.tl-band .bc-sheet {
	position: relative; background-color: var(--sheet); border-radius: 4px 4px 6px 6px; box-shadow: var(--shadow-paper);
	border-top: 8px solid var(--purple);
	padding: clamp(20px, 3cqi, 30px) clamp(16px, 3.4cqi, 40px) clamp(22px, 3cqi, 30px) 88px;
}
.tl-band .bc-sheet::before {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background-image:
		linear-gradient(90deg, transparent 60px, var(--margin) 60px, var(--margin) 62px, transparent 62px),
		radial-gradient(circle at 28px 18%, var(--paper-2) 8px, transparent 9px),
		radial-gradient(circle at 28px 50%, var(--paper-2) 8px, transparent 9px),
		radial-gradient(circle at 28px 82%, var(--paper-2) 8px, transparent 9px);
}
.tl-band .bc-sheet > * { position: relative; }
.tl-band .bc-sheet__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 18px; margin: 0 0 6px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.tl-band .bc-sheet__head > span:first-child { font-family: var(--f-display); font-size: 1.3rem; line-height: 1.2; }
.tl-band .bc-sheet__head .bc-hand { font-size: 1.15rem; transform: rotate(-1.5deg); }
.tl-band .bc-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 14px 0 0; padding: 12px 14px; border-radius: 8px; background: var(--paper); }
.tl-band .bc-total__lab { font-weight: 700; font-size: .95rem; }
.tl-band .bc-total b { font-family: var(--f-display); font-weight: 400; font-size: 1.7rem; line-height: 1; }
.tl-band .bc-total .bc-hand { font-size: 1.15rem; }
.tl-band .bc-total__go { display: inline-flex; align-items: center; min-height: 44px; padding: 0; margin: 0 0 0 auto; border: 0; background: none; color: var(--purple); font-weight: 700; font-size: .92rem; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.tl-band .bc-sheet__foot { margin: 16px 0 0; font-size: .88rem; line-height: 1.5; color: var(--muted); max-width: 46em; }

.tl-band .bc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "lab band" "mod mod" "ctl ctl"; align-items: center; gap: 6px 14px; padding: 16px 0 14px; border-bottom: 1.5px solid var(--rule); }
.tl-band .bc-row__lab { grid-area: lab; min-width: 0; }
.tl-band .bc-row__name { display: block; font-family: var(--f-display); font-size: clamp(1.25rem, 2.6cqi, 1.5rem); line-height: 1.15; }
.tl-band .bc-row__unit { display: block; font-size: .86rem; line-height: 1.4; color: var(--muted); margin-top: 2px; }
.tl-band .bc-row .bc-switch { grid-area: mod; }
.tl-band .bc-row__ctl { grid-area: ctl; display: flex; align-items: center; gap: 14px; min-width: 0; }
.tl-band .bc-row__band { grid-area: band; margin: 0; }

.tl-band .bc-range { -webkit-appearance: none; appearance: none; flex: 1 1 auto; min-width: 0; width: 100%; height: 44px; margin: 0; padding: 0; background: transparent; cursor: pointer; }
.tl-band .bc-range:focus-visible { outline: none; }
.tl-band .bc-range::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--purple) var(--p, 50%), rgba(30, 20, 48, .14) var(--p, 50%)); }
.tl-band .bc-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: var(--sheet); border: 3px solid var(--purple); box-shadow: 0 3px 8px -2px rgba(30, 20, 48, .35); transition: transform .2s var(--ease), box-shadow .2s; }
.tl-band .bc-range:hover::-webkit-slider-thumb { transform: scale(1.08); }
.tl-band .bc-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px var(--lilac-2), 0 3px 8px -2px rgba(30, 20, 48, .35); }
.tl-band .bc-range::-moz-range-track { height: 6px; border-radius: 99px; background: rgba(30, 20, 48, .14); }
.tl-band .bc-range::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--purple); }
.tl-band .bc-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--sheet); border: 3px solid var(--purple); box-shadow: 0 3px 8px -2px rgba(30, 20, 48, .35); }
.tl-band .bc-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 5px var(--lilac-2); }

.tl-band .bc-num {
	flex: none; width: 3.4em; min-height: 46px; padding: 4px 2px 2px; margin: 0;
	border: 0; border-bottom: 2px solid rgba(30, 20, 48, .25); border-radius: 0; background: transparent;
	font-family: var(--f-hand); font-size: 1.45rem; line-height: 1; color: var(--pen); text-align: center;
	-moz-appearance: textfield; appearance: textfield;
}
.tl-band .bc-num::-webkit-outer-spin-button, .tl-band .bc-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tl-band .bc-num:focus { outline: none; border-bottom-color: var(--purple); background: var(--lilac); border-radius: 4px 4px 0 0; }

.tl-band .bc-mark { position: relative; display: inline-grid; place-items: center; width: 70px; height: 54px; font-family: var(--f-hand); font-weight: 700; font-size: 1.55rem; line-height: 1; color: var(--red); font-variant-numeric: tabular-nums; }
.tl-band .bc-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--red); stroke-width: 2.4; stroke-linecap: round; pointer-events: none; }

.tl-band .bc-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--paper-2); justify-self: start; margin: 4px 0 2px; }
.tl-band .bc-switch__opt { position: relative; cursor: pointer; }
.tl-band .bc-switch__opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tl-band .bc-switch__opt span { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 16px; border-radius: 999px; font-size: .92rem; font-weight: 700; color: var(--ink-2); transition: background-color .2s, color .2s; }
.tl-band .bc-switch__opt input:checked + span { background: var(--ink); color: var(--paper); }
.tl-band .bc-switch__opt input:focus-visible + span { outline: 3px solid var(--purple); outline-offset: 2px; }
.tl-band .bc-row--mod { grid-template-areas: "lab lab" "mod mod"; }

/* The result card */
.tl-band .bc-card {
	position: relative; background: var(--sheet); border-radius: 6px; border-top: 10px solid var(--red);
	padding: clamp(22px, 3cqi, 32px) clamp(18px, 3cqi, 32px) clamp(22px, 3cqi, 28px);
	box-shadow: 0 30px 60px -34px rgba(30, 20, 48, .55), 0 2px 2px rgba(30, 20, 48, .05);
}
.tl-band .bc-card__lab { margin: 0; font-weight: 700; color: var(--ink-2); font-size: 1rem; }
.tl-band .bc-big { position: relative; display: inline-block; margin: 10px 0 0 6px; padding: 8px 34px 6px 24px; }
.tl-band .bc-big__n { position: relative; display: block; font-family: var(--f-display); font-size: clamp(4.4rem, 13cqi, 6.4rem); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tl-band .bc-big__ring { position: absolute; left: -4%; top: -10%; width: 108%; height: 124%; overflow: visible; fill: none; stroke: var(--red); stroke-width: 3.2; stroke-linecap: round; pointer-events: none; }
.tl-band .bc-big__ring path { vector-effect: non-scaling-stroke; }
.tl-band .bc-card__name { margin: 14px 0 18px; font-size: 1.6rem; transform: rotate(-2deg); transform-origin: left; }

.tl-band .bc-round { padding: 16px 0 6px; border-top: 1.5px dashed rgba(30, 20, 48, .2); }
.tl-band .bc-round__sum { margin: 0 0 4px; font-family: var(--f-mono); font-size: .92rem; color: var(--ink-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tl-band .bc-round__say { margin: 4px 0 0; font-size: .95rem; line-height: 1.5; color: var(--ink-2); }

.tl-band .bc-ruler { position: relative; height: 92px; margin: 0 18px; }
.tl-band .bc-ruler__line { position: absolute; left: 0; right: 0; top: 50px; height: 2px; background: var(--ink); }
.tl-band .bc-ruler__zone { position: absolute; top: 42px; height: 18px; border-radius: 3px 8px 4px 10px; transition: background-color .3s; }
.tl-band .bc-ruler__zone[data-z="0"] { left: 0; width: 25%; }
.tl-band .bc-ruler__zone[data-z="1"] { left: 25%; width: 50%; }
.tl-band .bc-ruler__zone[data-z="2"] { left: 75%; width: 25%; }
.tl-band .bc-ruler__zone.is-on { background: var(--sun); mix-blend-mode: multiply; }
.tl-band .bc-ruler__tick { position: absolute; top: 44px; width: 0; height: 14px; border-left: 1.5px solid rgba(30, 20, 48, .45); }
.tl-band .bc-ruler__tick.is-major { top: 40px; height: 22px; border-left-width: 2px; border-left-color: var(--ink); }
.tl-band .bc-ruler__tick b, .tl-band .bc-ruler__tick i { position: absolute; top: 26px; left: 0; transform: translateX(-50%); font-family: var(--f-mono); font-style: normal; white-space: nowrap; }
.tl-band .bc-ruler__tick b { font-size: .86rem; font-weight: 700; color: var(--ink); }
.tl-band .bc-ruler__tick i { top: 20px; font-size: .72rem; color: var(--muted); }
.tl-band .bc-ruler__land { position: absolute; top: 51px; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 2.5px solid var(--red); border-radius: 48% 52% 46% 54%; transform: rotate(-12deg); transition: left .35s var(--ease); }
.tl-band .bc-ruler__you { position: absolute; top: 51px; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--pen); transition: left .35s var(--ease); }
.tl-band .bc-ruler__you em { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-family: var(--f-hand); font-style: normal; font-size: 1.15rem; line-height: 1; color: var(--pen); white-space: nowrap; }
.tl-band .bc-ruler__you::after { content: ""; position: absolute; left: 50%; bottom: 8px; width: 1.5px; height: 10px; background: var(--pen); }

.tl-band .bc-aim { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 18px 0 16px; padding: 12px 14px; border-radius: 8px; background: var(--paper); }
.tl-band .bc-aim__lab { font-weight: 700; font-size: .95rem; }
.tl-band .bc-aim__ctl { display: inline-flex; align-items: center; gap: 6px; }
.tl-band .bc-aim__v { min-width: 2.6em; text-align: center; font-family: var(--f-hand); font-weight: 700; font-size: 1.6rem; line-height: 1; color: var(--pen); }
.tl-band .bc-step { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; margin: 0; border-radius: 50%; border: 2px solid var(--ink); background: var(--sheet); cursor: pointer; transition: background-color .2s, color .2s; }
.tl-band .bc-step .ic { width: 18px; height: 18px; }
.tl-band .bc-step:hover:not([disabled]) { background: var(--ink); color: var(--paper); }
.tl-band .bc-step[disabled] { opacity: .35; cursor: not-allowed; }
.tl-band .bc-wa { width: 100%; white-space: normal; text-align: center; }
.tl-band .bc-wa .ic { width: 20px; height: 20px; }

/* Work backwards */
.tl-band .bc-need { padding: 16px 0 6px; border-bottom: 1.5px solid var(--rule); }
.tl-band .bc-need__t { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 14px; margin: 0 0 6px; }
.tl-band .bc-need__name { font-family: var(--f-display); font-size: 1.4rem; line-height: 1.15; }
.tl-band .bc-need__name small { font-family: var(--f-body); font-size: .85rem; color: var(--muted); margin-left: 4px; }
.tl-band .bc-need__v { color: var(--ink-2); }
.tl-band .bc-need__v b { font-family: var(--f-hand); font-weight: 700; font-size: 2rem; line-height: 1; color: var(--red); margin: 0 2px; }
.tl-band .bc-need__ruler { position: relative; height: 46px; margin: 4px 8px 0; }
.tl-band .bc-need__ruler::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 12px; background: repeating-linear-gradient(90deg, rgba(30, 20, 48, .4) 0 1.5px, transparent 1.5px 12.5%); border-bottom: 2px solid var(--ink); }
.tl-band .bc-need__zone { position: absolute; top: 8px; right: 0; height: 16px; background: var(--lilac-2); mix-blend-mode: multiply; border-radius: 2px; transition: left .35s var(--ease); }
.tl-band .bc-need__pin { position: absolute; top: 2px; width: 3px; height: 26px; margin-left: -1.5px; border-radius: 2px; background: var(--red); transition: left .35s var(--ease); }
.tl-band .bc-need__scale { position: absolute; left: 0; right: 0; top: 26px; display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: .72rem; color: var(--muted); }
.tl-band .bc-need__scale i { font-style: normal; width: 0; display: flex; justify-content: center; }
.tl-band .bc-need__note { margin: 14px 0 18px; font-size: 1.15rem; transform: rotate(-1.5deg); transform-origin: left; }

.tl-band .bc-explain { margin-top: clamp(26px, 4cqi, 40px); padding: 0 4px; display: grid; gap: 4px 40px; }
.tl-band .bc-explain__h { font-family: var(--f-display); font-size: clamp(1.3rem, 2.6cqi, 1.6rem); line-height: 1.15; margin-bottom: 8px; }
.tl-band .bc-explain p { color: var(--ink-2); font-size: .98rem; max-width: 40em; margin: 0 0 .8em; }
.tl-band .bc-explain .bc-explain__small { font-size: .9rem; color: var(--muted); }

/* Container sizes */
@container bc (max-width: 620px) {
	.tl-band .bc-sheet { padding-left: 50px; padding-right: 16px; }
	.tl-band .bc-sheet::before {
		background-image:
			linear-gradient(90deg, transparent 34px, var(--margin) 34px, var(--margin) 36px, transparent 36px),
			radial-gradient(circle at 16px 18%, var(--paper-2) 6px, transparent 7px),
			radial-gradient(circle at 16px 50%, var(--paper-2) 6px, transparent 7px),
			radial-gradient(circle at 16px 82%, var(--paper-2) 6px, transparent 7px);
	}
	.tl-band .bc-tabs { flex-wrap: nowrap; }
	.tl-band .bc-tab { flex: 1 1 0; padding: 10px 12px 12px; font-size: .88rem; gap: 7px; }
	.tl-band .bc-tab .ic { display: none; }
	.tl-band .bc-ruler { margin: 0 12px; }
	.tl-band .bc-mark { width: 62px; height: 50px; font-size: 1.4rem; }
}
@container bc (min-width: 621px) {
	.tl-band .bc-row { grid-template-columns: minmax(170px, .9fr) minmax(0, 1.5fr) auto; grid-template-areas: "lab ctl band" "lab mod band"; gap: 4px 22px; }
	.tl-band .bc-row--mod { grid-template-columns: minmax(170px, .9fr) minmax(0, 1.5fr); grid-template-areas: "lab mod"; }
	.tl-band .bc-row .bc-switch { margin: 0; }
}
@container bc (min-width: 940px) {
	.tl-band .bc-panel { grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr); gap: 34px; }
	.tl-band .bc-card { position: sticky; top: calc(var(--bc-hd) + 14px); transform: rotate(.6deg); margin-top: 18px; }
	.tl-band .bc-explain { grid-template-columns: 1fr 1fr; }
	.tl-band .bc-total { display: none; }
	.tl-band .bc-explain__h { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
	.tl-band *, .tl-band *::before, .tl-band *::after { animation: none !important; transition: none !important; }
}
