/* ECET Prep — friendly, motivating, fast. One font family, no framework. */
:root {
	color-scheme: light dark;
	--bg: light-dark(#fffaf2, #15130f);
	--card: light-dark(#ffffff, #201d18);
	--ink: light-dark(#1d1a16, #f5efe6);
	--mute: light-dark(#6b6358, #b5ab9d);
	--line: light-dark(#eee5d6, #332e27);
	--brand: light-dark(#ff5a1f, #ff7a45);
	--brand-ink: #ffffff;
	--brand-soft: light-dark(#ffe6da, #3d2216);
	--sun: light-dark(#ffc23d, #ffcb57);
	--sun-soft: light-dark(#fff1c9, #3a2f12);
	--go: light-dark(#14a46b, #3ccf8e);
	--go-soft: light-dark(#d8f5e7, #12301f);
	--sky: light-dark(#2f6ff6, #6d9bff);
	--sky-soft: light-dark(#e0eaff, #18233d);
	--radius: 18px;
	--shadow: 0 1px 0 var(--line), 0 8px 24px -16px rgb(60 40 10 / 0.25);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 16px/1.55 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
	overflow-x: clip;
}
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(32px, 6vw, 52px); font-weight: 900; }
h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 900; }
h3 { font-size: 18px; font-weight: 800; }
p { margin: 0 0 12px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 max(16px, 4vw); }
.mute { color: var(--mute); }
.hidden { display: none !important; }

/* Top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 20px; text-decoration: none; }
.logo svg { width: 34px; height: 34px; flex: none; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 900; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Buttons and inputs */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0;
	background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 800;
	text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 color-mix(in srgb, var(--brand) 70%, #000);
	transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--brand) 70%, #000); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
label { display: block; font-weight: 800; margin-bottom: 6px; }
input, select {
	width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; font-size: 16px;
	color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 12px;
}
.field { margin-bottom: 18px; }
.hint { font-size: 14px; color: var(--mute); margin-top: 4px; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(18px, 3vw, 28px); }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

/* Countdown + streak tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 12px; }
.tile { border-radius: 16px; padding: 14px 16px; }
.tile b { display: block; font-size: clamp(30px, 5vw, 40px); font-weight: 900; line-height: 1; white-space: nowrap; }
.tile span { font-size: 14px; font-weight: 700; }
.t-brand { background: var(--brand-soft); color: var(--ink); }
.t-brand b { color: var(--brand); }
.t-sun { background: var(--sun-soft); }
.t-go { background: var(--go-soft); }
.t-go b { color: var(--go); }
.t-sky { background: var(--sky-soft); }
.t-sky b { color: var(--sky); }

/* Progress rings */
.ring {
	--p: 0; --c: var(--brand);
	width: 76px; height: 76px; border-radius: 50%; flex: none;
	background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0);
	display: grid; place-items: center;
}
.ring::before { content: ""; grid-area: 1 / 1; width: 58px; height: 58px; border-radius: 50%; background: var(--card); }
.ring b { grid-area: 1 / 1; font-weight: 900; font-size: 17px; z-index: 1; }
.subject { display: flex; gap: 16px; align-items: center; }
.subject h3 { margin-bottom: 2px; }
.pill { display: inline-block; font-size: 13px; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--sky-soft); color: var(--sky); }

/* Chapter list */
details.chapters { margin-top: 14px; border-top: 2px dashed var(--line); padding-top: 10px; }
details.chapters summary { cursor: pointer; font-weight: 800; color: var(--brand); list-style: none; min-height: 32px; display: flex; align-items: center; }
details.chapters summary::-webkit-details-marker { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { font-size: 14px; padding: 6px 12px; border-radius: 999px; background: var(--bg); border: 1.5px solid var(--line); }
.chip small { color: var(--mute); font-weight: 700; }

/* Banners */
.banner { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 18px; border-radius: 16px; background: var(--sun-soft); font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 10; max-width: calc(100% - 32px); }

footer.site { padding: 32px 0; font-size: 14px; color: var(--mute); }

@media (prefers-reduced-motion: no-preference) {
	.pop { animation: pop 0.5s cubic-bezier(.2, 1.4, .4, 1) both; }
	@keyframes pop { from { transform: scale(0.9); opacity: 0; } }
}

/* Section tabs under the header */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 14px; scrollbar-width: none; }
.tabs a { flex: none; min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px; font-weight: 800; text-decoration: none; color: var(--mute); background: var(--card); box-shadow: inset 0 0 0 2px var(--line); }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--bg); box-shadow: none; }

/* Badges */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.badge { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 14px 10px; border-radius: 16px; background: var(--sun-soft); }
.badge i { font-style: normal; font-size: 30px; line-height: 1; }
.badge b { font-weight: 900; }
.badge small { font-size: 13px; color: var(--mute); font-weight: 700; }
.badge.locked { background: var(--bg); box-shadow: inset 0 0 0 2px var(--line); }
.badge.locked i { filter: grayscale(1); opacity: 0.45; }
