/* ============================================================
   SignDeaf — Single Sign Page (Duolingo-inspired design)
   ============================================================ */

/* ── Base reset for sign page ── */
.signdeaf-page {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	background:
		radial-gradient(circle at top left, rgba(255,255,255,.92), rgba(255,255,255,0) 30%),
		linear-gradient(180deg, #f8f6f1 0%, #f2f0ea 100%);
	min-height: 100vh;
	color: #1f2937;
}

/* ── Back bar ── */
.sd-back-bar {
	background: rgba(255,255,255,.9);
	border-bottom: 1px solid #e7e5e4;
	backdrop-filter: blur(8px);
	padding: 12px 0;
}
.sd-back-bar .sd-container {
	display: flex;
	align-items: center;
	gap: 16px;
}
.sd-back-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #57534e;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	padding: 8px 16px;
	border-radius: 999px;
	transition: background 0.15s;
}
.sd-back-link:hover {
	background: #f3f4f6;
	color: #111827;
	text-decoration: none;
}
.sd-back-link svg { flex-shrink: 0; }

/* ── Container ── */
.sd-container {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ── Hero / main grid ── */
.sd-hero {
	padding: 34px 0 18px;
}
.sd-hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.98fr);
	gap: 30px;
	align-items: start;
}
@media (max-width: 768px) {
	.sd-hero-grid { grid-template-columns: 1fr; }
}
.sd-hero-side {
	display: grid;
	gap: 18px;
	align-content: start;
}
.sd-hero-side-free {
	height: 100%;
}
.sd-hero-side-free .sd-info-card {
	height: 100%;
}
.sd-video-stack {
	display: grid;
	gap: 18px;
	align-content: start;
	height: auto;
}

@media (min-width: 981px) {
	.sd-video-stack {
		position: sticky;
		top: 96px;
	}
}

/* ── Video card ── */
.sd-video-card {
	background: rgba(255,255,255,.94);
	border: 1px solid rgba(17,24,39,.08);
	border-radius: 24px;
	overflow: hidden;
	box-shadow: 0 16px 36px rgba(15,23,42,.08);
	position: relative;
}
.sd-video-inner {
	position: relative;
	background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
	aspect-ratio: 16/9;
	display: flex;
	align-items: center;
	justify-content: center;
}
.sd-video-inner video {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}
.sd-video-inner .sd-video-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	color: #a5b4fc;
}
.sd-video-placeholder svg { opacity: 0.5; }
.sd-video-placeholder span { font-size: 13px; }

/* Speed controls */
.sd-speed-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-top: 1px solid #ece7e1;
	background: #fcfbf8;
}
.sd-speed-label {
	font-size: 12px;
	color: #78716c;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.sd-speed-buttons {
	display: flex;
	gap: 6px;
}
.sd-speed-btn {
	padding: 5px 12px;
	border-radius: 999px;
	border: 1px solid #d6d3d1;
	background: #fff;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	color: #57534e;
	transition: all 0.15s;
}
.sd-speed-btn:hover,
.sd-speed-btn.active {
	border-color: #111827;
	color: #111827;
	background: #f5f5f4;
}

/* Source attribution in video */
.sd-video-attribution {
	padding: 10px 18px;
	font-size: 11px;
	color: #78716c;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.sd-video-attribution a {
	color: #111827;
	text-decoration: none;
	font-weight: 500;
}
.sd-video-attribution a:hover { text-decoration: underline; }

/* ── Info card ── */
.sd-info-card {
	background: rgba(255,255,255,.94);
	border: 1px solid rgba(17,24,39,.08);
	border-radius: 24px;
	padding: 28px;
	box-shadow: 0 16px 36px rgba(15,23,42,.06);
}

/* Title & badges */
.sd-word-title {
	font-size: 42px;
	font-weight: 800;
	color: #111827;
	line-height: 1.1;
	margin: 0 0 12px;
	letter-spacing: -0.02em;
}
.sd-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}
.sd-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.sd-badge-language  { background: #f5f3ff; color: #5b21b6; }
.sd-badge-beginner  { background: #d1fae5; color: #065f46; }
.sd-badge-intermediate { background: #fef3c7; color: #92400e; }
.sd-badge-advanced  { background: #fee2e2; color: #991b1b; }
.sd-badge-category  { background: #ecfeff; color: #155e75; }
.sd-badge-class     { background: #f5f5f4; color: #44403c; }

/* Word class italic */
.sd-word-class {
	font-size: 14px;
	color: #78716c;
	font-style: italic;
	margin-bottom: 20px;
}

/* Description */
.sd-excerpt {
	font-size: 16px;
	line-height: 1.65;
	color: #44403c;
	margin-bottom: 22px;
	padding-bottom: 22px;
	border-bottom: 1px solid #ece7e1;
}

/* ── How to sign it — redesigned ── */
.sd-how-to {
	margin-bottom: 20px;
}
.sd-how-to-title {
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: #7c3aed;
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 7px;
}
.sd-how-to-title::before {
	content: '';
	display: inline-block;
	width: 3px;
	height: 14px;
	background: linear-gradient(180deg,#7c3aed,#a855f7);
	border-radius: 999px;
}
.sd-how-to-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 9px;
}
@media (max-width: 480px) {
	.sd-how-to-grid { grid-template-columns: 1fr; }
}
.sd-detail-pill {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	background: #fff;
	border-radius: 16px;
	padding: 13px 14px;
	border: 1.5px solid #f1f5f9;
	transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
	cursor: default;
	position: relative;
	overflow: hidden;
}
.sd-detail-pill::before {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 2px;
	background: var(--pill-accent, linear-gradient(90deg,#7c3aed,#a855f7));
	opacity: 0;
	transition: opacity .18s ease;
}
.sd-detail-pill:hover {
	border-color: #ddd6fe;
	box-shadow: 0 8px 24px rgba(124,58,237,.1);
	transform: translateY(-2px);
}
.sd-detail-pill:hover::before { opacity: 1; }

/* Per-icon accent colours */
.sd-detail-pill:nth-child(1) { --pill-accent: linear-gradient(90deg,#7c3aed,#a855f7); }
.sd-detail-pill:nth-child(1) .sd-detail-icon-wrap { background: #f5f3ff; }
.sd-detail-pill:nth-child(2) { --pill-accent: linear-gradient(90deg,#0ea5e9,#38bdf8); }
.sd-detail-pill:nth-child(2) .sd-detail-icon-wrap { background: #f0f9ff; }
.sd-detail-pill:nth-child(3) { --pill-accent: linear-gradient(90deg,#10b981,#34d399); }
.sd-detail-pill:nth-child(3) .sd-detail-icon-wrap { background: #f0fdf4; }
.sd-detail-pill:nth-child(4) { --pill-accent: linear-gradient(90deg,#f59e0b,#fbbf24); }
.sd-detail-pill:nth-child(4) .sd-detail-icon-wrap { background: #fffbeb; }
.sd-detail-pill:nth-child(5) { --pill-accent: linear-gradient(90deg,#ec4899,#f472b6); }
.sd-detail-pill:nth-child(5) .sd-detail-icon-wrap { background: #fdf2f8; }

.sd-detail-icon-wrap {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	background: #f5f3ff;
	font-size: 17px;
	line-height: 1;
}
/* Legacy: keep old sd-detail-icon for any direct emoji usage */
.sd-detail-icon {
	font-size: 18px;
	flex-shrink: 0;
	margin-top: 1px;
}
.sd-detail-body { flex: 1; min-width: 0; }
.sd-detail-label {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .07em;
	color: #94a3b8;
	margin-bottom: 3px;
}
.sd-detail-value {
	font-size: 13px;
	font-weight: 700;
	color: #1e293b;
	line-height: 1.4;
}

/* Practice button */
.sd-practice-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px;
	border-radius: 14px;
	background: linear-gradient(135deg, #111827, #374151);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.15s, box-shadow 0.15s;
	box-shadow: 0 10px 22px rgba(17,24,39,.18);
	margin-top: 4px;
}
.sd-practice-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 30px rgba(17,24,39,.24);
	color: #fff;
	text-decoration: none;
}
.sd-practice-btn:active { transform: translateY(0); }

/* ── Info actions — redesigned ── */
.sd-info-actions {
	margin-bottom: 22px;
	display: grid;
	gap: 10px;
}

/* Hero learn button */
.sd-learn-hero-btn {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 16px 20px;
	border-radius: 18px;
	background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #5b21b6 100%);
	border: none;
	cursor: pointer;
	color: #fff;
	text-align: left;
	box-shadow: 0 12px 28px rgba(124,58,237,.32);
	transition: transform .15s ease, box-shadow .15s ease;
	position: relative;
	overflow: hidden;
}
.sd-learn-hero-btn::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(255,255,255,.14), transparent 55%);
	pointer-events: none;
}
.sd-learn-hero-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 16px 36px rgba(124,58,237,.44);
	color: #fff;
}
.sd-learn-hero-btn.sd-learned {
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	box-shadow: 0 12px 28px rgba(16,185,129,.32);
}
.sd-learn-icon { font-size: 24px; flex-shrink: 0; }
.sd-learn-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sd-learn-main { font-size: 16px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.sd-learn-sub  { font-size: 11px; font-weight: 600; opacity: .76; letter-spacing: .01em; }
.sd-learn-arrow { flex-shrink: 0; opacity: .7; }

/* Save + Rating row */
.sd-actions-row {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 10px;
	align-items: stretch; /* stretch so both reach the same height */
}

.sd-fav-hero-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 0 16px;
	border-radius: 14px;
	border: 1.5px solid #e2e8f0;
	background: #fff;
	color: #64748b;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	transition: all .15s ease;
	box-shadow: 0 2px 8px rgba(15,23,42,.06);
}
.sd-fav-hero-btn:hover {
	border-color: #f43f5e;
	color: #f43f5e;
	background: #fff1f3;
	box-shadow: 0 4px 14px rgba(244,63,94,.12);
}
.sd-fav-hero-btn.active {
	border-color: #f43f5e;
	color: #f43f5e;
	background: #fff1f3;
}

.sd-rating-inline {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 11px 14px;
	background: #fafafa;
	border-radius: 14px;
	border: 1.5px solid #f1f5f9;
	justify-content: space-between;
}
.sd-rating-inline-label {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: #94a3b8;
	white-space: nowrap;
}

.sd-actions-help {
	font-size: 12px;
	color: #94a3b8;
	margin: 2px 0 0;
	line-height: 1.55;
	font-weight: 500;
}
.sd-actions-help a {
	color: #7c3aed;
	font-weight: 700;
	text-decoration: none;
}
.sd-actions-help a:hover { text-decoration: underline; }

/* ── Sections below hero ── */
.sd-sections {
	padding: 0 0 48px;
}
.sd-section {
	background: #fff;
	border: 1px solid rgba(17,24,39,.06);
	border-radius: 22px;
	padding: 28px;
	box-shadow: 0 10px 26px rgba(15,23,42,.05);
	margin-bottom: 20px;
}
.sd-section-title {
	font-size: 18px;
	font-weight: 700;
	color: #111827;
	margin: 0 0 20px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.sd-section-title span {
	font-size: 20px;
}

/* ── Related signs grid ── */
.sd-related-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
}
@media (max-width: 900px) {
	.sd-related-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 540px) {
	.sd-related-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
.sd-related-card {
	background: #fff;
	border-radius: 16px;
	padding: 0;
	text-align: center;
	text-decoration: none;
	color: #1f2937;
	border: 1.5px solid #f1f5f9;
	transition: border-color .18s, transform .18s, box-shadow .18s;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	overflow: hidden;
	position: relative;
}
.sd-related-card::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 16px;
	background: linear-gradient(135deg, rgba(124,58,237,.04), transparent 60%);
	opacity: 0;
	transition: opacity .18s;
}
.sd-related-card:hover {
	border-color: #c4b5fd;
	transform: translateY(-4px);
	box-shadow: 0 12px 28px rgba(124,58,237,.14);
	color: #111827;
	text-decoration: none;
}
.sd-related-card:hover::before { opacity: 1; }
.sd-related-thumb {
	width: 100%;
	height: 80px;
	object-fit: cover;
	background: #e5e7eb;
	display: block;
}
.sd-related-thumb-placeholder {
	width: 100%;
	height: 80px;
	background: linear-gradient(135deg, #ede9fe, #ddd6fe);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
}
.sd-related-card-body {
	padding: 10px 10px 12px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
}
.sd-related-word {
	font-size: 13px;
	font-weight: 700;
	color: #1f2937;
	line-height: 1.3;
}
.sd-related-badge {
	font-size: 10px;
	color: #6d28d9;
	background: #ede9fe;
	padding: 2px 9px;
	border-radius: 999px;
	font-weight: 700;
	letter-spacing: .03em;
}

/* ── Taxonomy breadcrumbs ── */
.sd-tax-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.sd-tax-list a {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 999px;
	background: #f5f5f4;
	color: #44403c;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.15s;
	border: 1px solid transparent;
}
.sd-tax-list a:hover {
	background: #fff;
	color: #111827;
	border-color: #d6d3d1;
	text-decoration: none;
}

/* ── Did you know tip ── */
.sd-tip {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	background: linear-gradient(135deg, #fff 0%, #f5f5f4 100%);
	border-radius: 16px;
	padding: 20px 22px;
	border: 1px solid #e7e5e4;
}
.sd-tip-icon {
	font-size: 28px;
	flex-shrink: 0;
}
.sd-tip-body { flex: 1; }
.sd-tip-title {
	font-size: 14px;
	font-weight: 700;
	color: #111827;
	margin-bottom: 4px;
}
.sd-tip-text {
	font-size: 14px;
	color: #44403c;
	line-height: 1.6;
}

/* ── Legal + Attribution combined card ── */
.sd-legal-card {
	background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 100%);
	border: 1px solid rgba(165,180,252,.18);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.06);
}
.sd-legal-card-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 22px 14px;
	border-bottom: 1px solid rgba(165,180,252,.1);
}
.sd-legal-card-icon {
	width: 38px;
	height: 38px;
	background: linear-gradient(135deg, rgba(124,58,237,.35), rgba(99,102,241,.25));
	border: 1px solid rgba(165,180,252,.25);
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.sd-legal-card-title {
	font-size: 13px;
	font-weight: 800;
	color: #e0e7ff;
	letter-spacing: .03em;
	line-height: 1.2;
}
.sd-legal-card-subtitle {
	font-size: 11px;
	color: #818cf8;
	font-weight: 500;
	margin-top: 2px;
}
.sd-legal-card-body {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
}
@media (max-width: 600px) {
	.sd-legal-card-body { grid-template-columns: 1fr; }
}
.sd-legal-section {
	padding: 16px 22px 20px;
	font-size: 12.5px;
	color: #a5b4fc;
	line-height: 1.75;
}
.sd-legal-section + .sd-legal-section {
	border-left: 1px solid rgba(165,180,252,.1);
}
@media (max-width: 600px) {
	.sd-legal-section + .sd-legal-section {
		border-left: none;
		border-top: 1px solid rgba(165,180,252,.1);
	}
}
.sd-legal-section-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: #818cf8;
	margin-bottom: 8px;
}
.sd-legal-section-label svg { flex-shrink: 0; }
.sd-legal-section a {
	color: #c4b5fd;
	font-weight: 700;
	text-decoration: none;
}
.sd-legal-section a:hover {
	color: #e0e7ff;
	text-decoration: underline;
}

/* ── Animations ── */
@keyframes sd-pop-in {
	0%   { opacity: 0; transform: scale(0.9) translateY(12px); }
	100% { opacity: 1; transform: scale(1) translateY(0); }
}
.sd-info-card,
.sd-video-card { animation: sd-pop-in 0.35s ease both; }
.sd-info-card  { animation-delay: 0.06s; }

/* ── Sign counter pill ── */
.sd-views-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: #f3f4f6;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 12px;
	color: #78716c;
	font-weight: 500;
}

/* ── Skeleton loader ── */
@keyframes sd-shimmer {
	0%   { background-position: -600px 0; }
	100% { background-position: 600px 0; }
}
.sd-skel-title,
.sd-skel-line {
	border-radius: 6px;
	margin-bottom: 12px;
	background: linear-gradient(90deg, #f0eeff 25%, #e4dcff 50%, #f0eeff 75%);
	background-size: 600px 100%;
	animation: sd-shimmer 1.4s infinite linear;
}
.sd-skel-title { height: 28px; width: 70%; margin-bottom: 18px; }
.sd-skel-line  { height: 16px; width: 100%; }

/* ── AI content fade-in ── */
@keyframes sd-ai-fadein {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}
.sd-ai-fade-in { animation: sd-ai-fadein 0.45s ease both; }

/* ── AI-generated content block ── */
.sd-ai-content {
	background: #fff;
	border: 1px solid rgba(17,24,39,.06);
	border-radius: 22px;
	padding: 36px 40px;
	box-shadow: 0 10px 26px rgba(15,23,42,.05);
	margin-bottom: 20px;
	line-height: 1.75;
	color: #374151;
}
.sd-ai-content h2 {
	font-size: 22px;
	font-weight: 800;
	color: #1a1a2e;
	margin: 32px 0 12px;
	padding-top: 28px;
	border-top: 2px solid #f3f4f6;
}
.sd-ai-content h2:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}
.sd-ai-content h3 {
	font-size: 16px;
	font-weight: 700;
	color: #6d28d9;
	margin: 20px 0 8px;
}
.sd-ai-content p {
    margin: 0 0 14px;
    font-size: 15px;
    justify-self: center;
}
.sd-ai-content ul, .sd-ai-content ol {
	margin: 0 0 16px 0;
	padding-left: 22px;
}
.sd-ai-content li {
	margin-bottom: 6px;
	font-size: 15px;
}
.sd-ai-content strong { color: #1a1a2e; }
@media (max-width: 640px) {
	.sd-ai-content { padding: 24px 20px; }
	.sd-ai-content h2 { font-size: 18px; }
}

/* ── CEFR & Frequency badges ── */
.sd-badge-cefr  { background: #ecfdf5; color: #065f46; }
.sd-badge-freq  { background: #fff7ed; color: #92400e; }

/* ── Word relations (synonyms/antonyms) ── */
.sd-word-relations {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 18px;
	padding-bottom: 20px;
	border-bottom: 1px solid #f1f5f9;
}
.sd-wr-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.sd-wr-head {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .08em;
	padding: 3px 10px 3px 8px;
	border-radius: 999px;
	width: fit-content;
}
.sd-wr-head svg { flex-shrink: 0; }
.sd-wr-head-syn {
	background: linear-gradient(135deg, #ede9fe, #f5f3ff);
	color: #6d28d9;
	border: 1px solid #ddd6fe;
}
.sd-wr-head-ant {
	background: linear-gradient(135deg, #fff1f2, #fce7f3);
	color: #be123c;
	border: 1px solid #fecdd3;
}
.sd-wr-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}
.sd-wr-pill {
	display: inline-flex;
	align-items: center;
	padding: 5px 13px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: transform .15s, box-shadow .15s, background .15s;
	line-height: 1.3;
}
.sd-wr-pill:hover {
	transform: translateY(-2px);
	text-decoration: none;
}
.sd-wr-pill-syn {
	background: #ede9fe;
	color: #5b21b6;
	border: 1.5px solid #c4b5fd;
}
.sd-wr-pill-syn:hover {
	background: #ddd6fe;
	box-shadow: 0 4px 14px rgba(124,58,237,.2);
	color: #4c1d95;
}
.sd-wr-pill-ant {
	background: #fff1f2;
	color: #be123c;
	border: 1.5px solid #fecdd3;
}
.sd-wr-pill-ant:hover {
	background: #ffe4e6;
	box-shadow: 0 4px 14px rgba(225,29,72,.18);
	color: #9f1239;
}

/* ── AI section ── */
.sd-section-ai {
	border-left: 4px solid #7c3aed;
	background: linear-gradient(135deg, #faf5ff 0%, #fff 60%);
}
.sd-practice-box {
	background: #ede9fe;
	border-radius: 12px;
	padding: 16px 18px;
	margin-bottom: 12px;
}
.sd-practice-box-title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #6d28d9;
	margin-bottom: 6px;
}
.sd-practice-box p { margin: 0; font-size: 14px; color: #4c1d95; line-height: 1.65; }
.sd-correction-box {
	background: #fff8f8;
	border: 1.5px solid #fecaca;
	border-radius: 12px;
	padding: 14px 16px;
}

/* ── Grammar grid ── */
.sd-grammar-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 10px;
}
.sd-grammar-item {
	background: #f9fafb;
	border-radius: 10px;
	padding: 12px 14px;
	border: 1px solid #f3f4f6;
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.sd-grammar-label {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: #9ca3af;
}
.sd-grammar-value {
	font-size: 14px;
	font-weight: 600;
	color: #374151;
}

/* ── Context rows ── */
.sd-context-row {
	background: #f0fdf4;
	border: 1.5px solid #bbf7d0;
	border-radius: 10px;
	padding: 12px 16px;
	font-size: 14px;
	color: #374151;
	line-height: 1.6;
	margin-bottom: 10px;
}
.sd-context-row strong { color: #065f46; margin-right: 4px; }

/* ── Mobile improvements ── */
@media (max-width: 640px) {
	.sd-word-title { font-size: 32px; }
	.sd-hero { padding: 20px 0 16px; }
	.sd-info-card { padding: 20px; }
	.sd-section { padding: 20px; }
	.sd-grammar-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Loop button ── */
.sd-loop-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 12px;
	border-radius: 999px;
	border: 2px solid #e5e7eb;
	background: #fff;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	color: #6b7280;
	transition: all 0.15s;
	line-height: 1;
}
.sd-loop-btn:hover { border-color: #7c3aed; color: #7c3aed; background: #ede9fe; }
.sd-loop-btn.active {
	border-color: #7c3aed;
	color: #fff;
	background: linear-gradient(135deg, #7c3aed, #a855f7);
	box-shadow: 0 2px 8px rgba(124,58,237,.3);
}
.sd-loop-btn.active svg { stroke: #fff; }

/* ── Visual Frame Breakdown ── */
.sd-frames-section { margin-bottom: 20px; }
.sd-frames-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}
@media (max-width: 580px) {
	.sd-frames-grid { grid-template-columns: 1fr; gap: 12px; }
}
.sd-frame-item { text-align: center; }
.sd-frame-img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 12px;
	background: #1a1a2e;
	border: 2.5px solid #e5e7eb;
	transition: border-color 0.15s, box-shadow 0.15s;
	display: block;
}
.sd-frame-img:hover {
	border-color: #c4b5fd;
	box-shadow: 0 4px 16px rgba(124,58,237,.18);
}
.sd-frame-label {
	font-size: 12px;
	font-weight: 700;
	color: #374151;
	margin-top: 9px;
	margin-bottom: 4px;
}
.sd-frame-badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	padding: 3px 10px;
	border-radius: 999px;
}
.sd-frame-badge-start { background: #d1fae5; color: #065f46; }
.sd-frame-badge-mid   { background: #ede9fe; color: #6d28d9; }
.sd-frame-badge-end   { background: #fee2e2; color: #991b1b; }

/* ── Rating panel ── */
.sd-learning-tracker {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	padding: 14px 16px;
	background: #fafaf9;
	border-radius: 14px;
	margin-bottom: 12px;
	border: 1px solid #ece7e1;
}
.sd-rating-panel {
	display: grid;
	justify-items: center;
	gap: 8px;
	padding: 18px 18px 16px;
	background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
	border: 1px solid rgba(147,197,253,.55);
	border-radius: 20px;
	text-align: center;
	box-shadow: 0 14px 28px rgba(59,130,246,.08);
}
.sd-rating-panel-label {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: #2563eb;
}
.sd-rating-label {
	font-size: 12px;
	color: #475569;
	text-align: center;
	font-weight: 700;
}
.sd-practice-count {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #57534e;
	font-weight: 500;
}
.sd-practice-copy {
	display: grid;
	gap: 3px;
	min-width: 0;
}
.sd-practice-count-num {
	font-size: 28px;
	font-weight: 800;
	color: #111827;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}
.sd-practice-save-note {
	font-size: 11px;
	line-height: 1.45;
	color: #78716c;
}
.sd-practice-save-note a {
	color: #111827;
	font-weight: 700;
	text-decoration: none;
}
.sd-practice-save-note a:hover {
	text-decoration: underline;
}

/* ── Difficulty star rating ── */
.sd-star-rating {
	display: flex;
	gap: 3px;
	justify-content: center;
}
.sd-star {
	font-size: 20px;
	cursor: pointer;
	transition: transform 0.1s;
	line-height: 1;
	user-select: none;
	-webkit-user-select: none;
}
.sd-star:hover { transform: scale(1.25); }
.sd-star.inactive { filter: grayscale(1) opacity(0.28); }
.sd-star.active   { filter: none; transform: none; }
.sd-star.active:hover { transform: scale(1.2); }

/* ── Progress HUD — gaming style, blue palette ── */
@keyframes sd-pp-blink {
	0%, 100% { opacity: 1; }
	50%       { opacity: .3; }
}
@keyframes sd-pp-scan {
	0%   { transform: translateY(-100%); }
	100% { transform: translateY(300%); }
}
@keyframes sd-pp-glow-pulse {
	0%, 100% { opacity: .6; transform: scale(1); }
	50%       { opacity: 1;  transform: scale(1.05); }
}

.sd-progress-preview-panel {
	background:
		radial-gradient(ellipse at top left, rgba(14,165,233,.18) 0%, transparent 55%),
		radial-gradient(ellipse at bottom right, rgba(56,189,248,.12) 0%, transparent 50%),
		linear-gradient(160deg, #020617 0%, #0c1a3a 45%, #0a2a4a 100%);
	border-radius: 20px;
	border: 1px solid rgba(56,189,248,.22);
	box-shadow: 0 0 0 1px rgba(56,189,248,.06) inset, 0 20px 44px rgba(2,6,23,.55);
	padding: 18px;
	display: grid;
	gap: 14px;
	position: relative;
	overflow: hidden;
	font-family: inherit;
}
/* Scan line effect */
.sd-progress-preview-panel::after {
	content: '';
	position: absolute;
	left: 0; right: 0;
	height: 40px;
	background: linear-gradient(180deg, transparent, rgba(56,189,248,.04), transparent);
	pointer-events: none;
	animation: sd-pp-scan 4s linear infinite;
}

/* ── Top bar ── */
.sd-pp-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 12px;
	border-bottom: 1px solid rgba(56,189,248,.12);
}
.sd-pp-topbar-left {
	display: flex;
	align-items: center;
	gap: 7px;
}
.sd-pp-live-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #38bdf8;
	box-shadow: 0 0 6px #38bdf8;
	animation: sd-pp-blink 1.8s ease-in-out infinite;
	flex-shrink: 0;
}
.sd-pp-topbar-label {
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .12em;
	color: #7dd3fc;
	text-transform: uppercase;
}
.sd-pp-topbar-status {
	font-size: 9px;
	font-weight: 800;
	letter-spacing: .1em;
	color: #38bdf8;
	text-transform: uppercase;
	background: rgba(56,189,248,.1);
	border: 1px solid rgba(56,189,248,.2);
	padding: 3px 8px;
	border-radius: 999px;
}

/* ── Level + XP ── */
.sd-pp-level-section {
	display: flex;
	align-items: center;
	gap: 12px;
}
.sd-pp-level-badge {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}
.sd-pp-level-ring {
	width: 48px;
	height: 48px;
	position: relative;
	flex-shrink: 0;
}
.sd-pp-ring-svg {
	width: 100%;
	height: 100%;
}
.sd-pp-ring-num {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: 900;
	color: #38bdf8;
	text-shadow: 0 0 10px rgba(56,189,248,.7);
}
.sd-pp-level-num {
	font-size: 11px;
	font-weight: 900;
	letter-spacing: .1em;
	color: #7dd3fc;
	line-height: 1;
	margin-bottom: 2px;
}
.sd-pp-level-title {
	font-size: 13px;
	font-weight: 700;
	color: #e0f2fe;
}
.sd-pp-xp-block { flex: 1; min-width: 0; }
.sd-pp-xp-topline {
	display: flex;
	justify-content: space-between;
	margin-bottom: 5px;
}
.sd-pp-xp-val {
	font-size: 11px;
	font-weight: 800;
	color: #38bdf8;
	letter-spacing: .04em;
}
.sd-pp-xp-next {
	font-size: 10px;
	font-weight: 600;
	color: #475569;
}
.sd-pp-xp-track {
	height: 6px;
	background: rgba(56,189,248,.1);
	border-radius: 999px;
	overflow: visible;
	margin-bottom: 4px;
	position: relative;
	border: 1px solid rgba(56,189,248,.15);
}
.sd-pp-xp-fill {
	height: 100%;
	background: linear-gradient(90deg, #0ea5e9, #38bdf8);
	border-radius: 999px;
	box-shadow: 0 0 8px rgba(56,189,248,.6);
	transition: width .6s ease;
}
.sd-pp-xp-glow {
	position: absolute;
	top: -2px; right: 0;
	width: 8px; height: 10px;
	background: #38bdf8;
	border-radius: 50%;
	opacity: 0;
	filter: blur(3px);
}
.sd-pp-xp-hint {
	font-size: 10px;
	color: #334155;
	font-weight: 600;
}

/* ── Stats grid ── */
.sd-pp-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 7px;
}
.sd-pp-stat {
	background: rgba(14,165,233,.07);
	border: 1px solid rgba(56,189,248,.12);
	border-radius: 12px;
	padding: 10px 6px 8px;
	text-align: center;
	transition: border-color .18s ease, background .18s ease;
}
.sd-pp-stat:hover {
	border-color: rgba(56,189,248,.3);
	background: rgba(14,165,233,.12);
}
.sd-pp-stat-icon {
	font-size: 14px;
	line-height: 1;
	margin-bottom: 4px;
	opacity: .7;
}
.sd-pp-stat-num {
	font-size: 18px;
	font-weight: 900;
	color: #7dd3fc;
	line-height: 1;
	margin-bottom: 4px;
	letter-spacing: .04em;
	font-variant-numeric: tabular-nums;
	text-shadow: 0 0 12px rgba(56,189,248,.4);
}
.sd-pp-stat-label {
	font-size: 9px;
	font-weight: 800;
	color: #334155;
	text-transform: uppercase;
	letter-spacing: .08em;
}
.sd-pp-stat-streak .sd-pp-stat-num { color: #fb923c; text-shadow: 0 0 12px rgba(251,146,60,.4); }

/* ── Missions ── */
.sd-pp-missions {
	background: rgba(14,165,233,.05);
	border: 1px solid rgba(56,189,248,.1);
	border-radius: 12px;
	padding: 12px 14px;
}
.sd-pp-missions-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}
.sd-pp-missions-title {
	font-size: 9px;
	font-weight: 900;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #38bdf8;
}
.sd-pp-missions-badge {
	font-size: 10px;
	font-weight: 800;
	color: #334155;
	background: rgba(56,189,248,.08);
	border: 1px solid rgba(56,189,248,.14);
	padding: 2px 7px;
	border-radius: 999px;
}
.sd-pp-mission-list { display: grid; gap: 7px; }
.sd-pp-mission {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 11px;
	color: #64748b;
	font-weight: 600;
	line-height: 1.45;
}
.sd-pp-mission-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	border: 1.5px solid #1e40af;
	flex-shrink: 0;
	margin-top: 3px;
}
.sd-pp-mission em {
	font-style: normal;
	color: #38bdf8;
	font-weight: 700;
	margin-left: 4px;
}

/* ── CTA buttons ── */
.sd-pp-cta {
	display: grid;
	gap: 8px;
}
.sd-pp-btn-primary {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 20px;
	border-radius: 12px;
	background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
	color: #fff !important;
	font-size: 14px;
	font-weight: 800;
	text-decoration: none;
	border-color: transparent !important;
	box-shadow: 0 0 0 1px rgba(56,189,248,.3) inset, 0 10px 24px rgba(14,165,233,.35) !important;
	transition: transform .15s ease, box-shadow .15s ease;
	letter-spacing: -.01em;
	position: relative;
	overflow: hidden;
}
.sd-pp-btn-glow {
	position: absolute;
	top: 0; left: -100%;
	width: 60%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
	animation: sd-pp-glow-pulse 2.4s ease-in-out infinite;
	pointer-events: none;
}
.sd-pp-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 0 0 1px rgba(56,189,248,.4) inset, 0 14px 32px rgba(14,165,233,.5) !important;
	color: #fff !important;
	text-decoration: none;
}
.sd-pp-btn-ghost {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 11px 20px;
	border-radius: 12px;
	background: rgba(56,189,248,.06) !important;
	border: 1px solid rgba(56,189,248,.16) !important;
	color: #7dd3fc !important;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	transition: background .15s ease;
}
.sd-pp-btn-ghost:hover {
	background: rgba(56,189,248,.12) !important;
	color: #bae6fd !important;
	text-decoration: none;
}

.sd-toc-hero {
	padding: 0 0 22px;
}

.sd-toc-card {
	margin-top: 0;
	padding: 22px;
	border-radius: 24px;
	background:
		radial-gradient(circle at top left, rgba(59,130,246,.14), transparent 32%),
		radial-gradient(circle at bottom right, rgba(245,158,11,.12), transparent 28%),
		linear-gradient(135deg, #fff 0%, #f8fbff 100%);
	border: 1px solid rgba(17,24,39,.08);
	box-shadow: 0 18px 36px rgba(15,23,42,.08);
}
.sd-toc-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}
.sd-toc-kicker {
	margin-bottom: 6px;
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: #3b82f6;
}
.sd-toc-title {
	margin: 0;
	font-size: 24px;
	line-height: 1.1;
	color: #111827;
	letter-spacing: -.02em;
}
.sd-toc-note {
	font-size: 13px;
	color: #6b7280;
	font-weight: 600;
	text-align: right;
}
.sd-toc-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
}
.sd-toc-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-radius: 16px;
	background: #fff;
	border: 1px solid #dbeafe;
	color: #111827;
	font-size: 13px;
	font-weight: 800;
	text-decoration: none;
	transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.sd-toc-link:hover {
	transform: translateY(-1px);
	background: #eff6ff;
	border-color: #93c5fd;
	box-shadow: 0 10px 22px rgba(59,130,246,.12);
	color: #111827;
	text-decoration: none;
}
@media (max-width: 640px) {
	.sd-actions-row { grid-template-columns: 1fr; }
	.sd-pp-stats .sd-pp-stat-num { font-size: 18px; }
	.sd-toc-head {
		flex-direction: column;
		align-items: flex-start;
	}
	.sd-toc-note {
		text-align: left;
	}
	.sd-toc-grid {
		grid-template-columns: 1fr;
	}
}

.sd-ai-loading-note {
	display: flex;
	flex-direction: column;
	gap: 8px;
	text-align: left;
	padding: 18px 20px;
	margin: 0 0 24px;
	border: 1px solid #e7e5e4;
	border-radius: 18px;
	background: linear-gradient(135deg, #fff 0%, #f5f5f4 100%);
	color: #57534e;
	font-size: 13px;
	line-height: 1.6;
	box-shadow: 0 8px 22px rgba(15,23,42,.05);
}
.sd-ai-loading-note strong {
	font-size: 16px;
	font-weight: 700;
	color: #111827;
}

.sd-hero-scroll {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 16px;
	padding: 14px 18px;
	border: 1px solid #e7e5e4;
	border-radius: 999px;
	background: rgba(255,255,255,.75);
	color: #57534e;
}
.sd-hero-scroll-copy {
	font-size: 13px;
	line-height: 1.5;
}
.sd-hero-scroll-copy strong {
	color: #111827;
}
.sd-hero-scroll-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	background: #111827;
	color: #fff;
	font-size: 16px;
	animation: sd-scroll-nudge 1.8s ease-in-out infinite;
}
@keyframes sd-scroll-nudge {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(4px); }
}
@media (max-width: 768px) {
	.sd-hero-scroll {
		border-radius: 18px;
		align-items: flex-start;
	}
}
