/*
 * LearnNest Store components. Works with any theme; the LearnNest Kids theme sets the tokens.
 */
:root {
	--ln-primary: #2563eb;
	--ln-primary-dark: #1d4ed8;
	--ln-secondary: #0d9488;
	--ln-accent: #f59e0b;
	--ln-bg: #f8fafc;
	--ln-card: #ffffff;
	--ln-text: #0f172a;
	--ln-muted: #475569;
	--ln-border: #e2e8f0;
	--ln-success: #15803d;
	--ln-success-bg: #dcfce7;
	--ln-warn-bg: #fffbeb;
	--ln-warn-border: #fcd34d;
	--ln-danger: #b91c1c;
	--ln-radius: 16px;
	--ln-radius-sm: 10px;
	--ln-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
	--ln-tap: 48px;
}

.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important; }
.ln-hp { position: absolute; left: -9999px; height: 1px; overflow: hidden; }

/* ---------- Buttons ---------- */
.ln-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5em;
	min-height: var(--ln-tap); padding: .7em 1.25em; border-radius: 12px;
	border: 2px solid transparent; font: inherit; font-weight: 700; line-height: 1.2;
	text-decoration: none !important; cursor: pointer; text-align: center;
	background: var(--ln-card); color: var(--ln-text);
	transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.ln-btn:hover { transform: translateY(-1px); }
.ln-btn:active { transform: none; }
.ln-btn:focus-visible, .ln-chip:focus-visible, .ln-class-card:focus-visible, .ln-subject-card:focus-visible { outline: 3px solid var(--ln-accent); outline-offset: 2px; }
.ln-btn-primary { background: var(--ln-primary); color: #fff !important; }
.ln-btn-primary:hover { background: var(--ln-primary-dark); }
.ln-btn-success { background: var(--ln-success); color: #fff !important; }
.ln-btn-success:hover { background: #166534; }
.ln-btn-outline { border-color: var(--ln-primary); color: var(--ln-primary) !important; background: var(--ln-card); }
.ln-btn-outline:hover { background: #eff6ff; }
.ln-btn-ghost { border-color: var(--ln-border); color: var(--ln-text) !important; background: var(--ln-card); }
.ln-btn-ghost:hover { border-color: var(--ln-primary); color: var(--ln-primary) !important; }
.ln-btn-lg { font-size: 1.08rem; min-height: 54px; padding: .8em 1.4em; }
.ln-btn-sm { min-height: 38px; padding: .4em .9em; font-size: .9rem; }
.ln-btn-block { width: 100%; }
.ln-btn[disabled], .ln-btn.is-busy { opacity: .65; cursor: progress; }
.ln-btn svg { flex: none; }
.ln-icon-btn { display: inline-grid; place-items: center; width: var(--ln-tap); height: var(--ln-tap); border-radius: 12px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.ln-icon-btn:hover { background: #f1f5f9; }
.ln-link { font-weight: 700; color: var(--ln-primary); text-decoration: none; display: inline-flex; align-items: center; gap: .25em; }
.ln-link:hover { text-decoration: underline; }
.ln-linkish { background: none; border: 0; padding: 0; color: var(--ln-primary); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ---------- Sections & grids ---------- */
.ln-section { margin: 2.5rem 0; }
.ln-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.ln-section-head h2 { margin: 0; }
.ln-grid-products { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .ln-grid-products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1080px) { .ln-grid-products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }

/* ---------- Product card ---------- */
.ln-card-product { display: flex; flex-direction: column; background: var(--ln-card); border: 1px solid var(--ln-border); border-radius: var(--ln-radius); overflow: hidden; box-shadow: var(--ln-shadow); transition: box-shadow .2s, transform .2s; min-width: 0; }
.ln-card-product:hover { box-shadow: 0 8px 28px rgba(15, 23, 42, .12); transform: translateY(-2px); }
.ln-card-media { position: relative; display: block; aspect-ratio: 3 / 4; background: #eef2ff; overflow: hidden; }
.ln-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0 !important; }
.ln-badge { position: absolute; top: 10px; left: 10px; background: var(--ln-accent); color: #3b2300; font-size: .75rem; font-weight: 800; padding: .3em .7em; border-radius: 999px; letter-spacing: .02em; }
.ln-badge-new { background: #a7f3d0; color: #064e3b; }
.ln-badge-answer-key { background: #e0e7ff; color: #312e81; }
.ln-badge-teacher { background: #fce7f3; color: #831843; }
.ln-badge-exam { background: #fee2e2; color: #7f1d1d; }
.ln-card-body { display: flex; flex-direction: column; gap: .35rem; padding: 12px 12px 14px; flex: 1; }
@media (min-width: 720px) { .ln-card-body { padding: 14px 16px 16px; } }
.ln-card-kicker { margin: 0; font-size: .78rem; font-weight: 700; color: var(--ln-secondary-text, #0f766e); text-transform: uppercase; letter-spacing: .04em; }
.ln-card-title { margin: 0; font-size: 1rem; line-height: 1.3; }
.ln-card-title a { color: var(--ln-text); text-decoration: none; }
.ln-card-title a:hover { color: var(--ln-primary); }
.ln-card-meta { margin: 0; font-size: .88rem; color: var(--ln-muted); }
.ln-card-price { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: auto; padding-top: .35rem; }
.ln-price { font-weight: 800; font-size: 1.15rem; color: var(--ln-text); }
.ln-price-lg { font-size: 2rem; }
.ln-price-free { color: var(--ln-success); font-weight: 800; font-size: 1.1rem; }
.ln-price-old { color: var(--ln-muted); font-size: .9rem; }
.ln-off { background: var(--ln-success-bg); color: #14532d; font-weight: 800; font-size: .75rem; padding: .2em .55em; border-radius: 999px; }
.ln-format { margin-left: auto; background: #f1f5f9; color: var(--ln-muted); font-weight: 700; font-size: .72rem; padding: .25em .6em; border-radius: 6px; }
.ln-card-actions { display: grid; gap: 8px; margin-top: .5rem; }
.ln-card-actions .ln-btn { min-height: 44px; padding: .55em .8em; font-size: .95rem; }
.ln-grid-books .ln-card-media { aspect-ratio: 3 / 4; }

/* ---------- Class & subject cards ---------- */
.ln-class-grid ul, .ln-subject-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ln-class-grid ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 560px) { .ln-class-grid ul { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 960px) { .ln-class-grid ul { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 14px; } }
.ln-class-card { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 96px; padding: 14px 8px; border-radius: var(--ln-radius); background: var(--ln-card); border: 2px solid var(--ln-border); color: var(--ln-text); text-decoration: none; font-weight: 800; text-align: center; transition: border-color .15s, transform .15s, box-shadow .15s; }
.ln-class-card:hover, .ln-class-card[aria-current] { border-color: var(--ln-accent, #2563eb); transform: translateY(-2px); box-shadow: var(--ln-shadow); }
.ln-class-icon { background: #eff6ff; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--ln-accent) 14%, #fff); color: var(--ln-accent); }
.ln-class-num { font-size: 1.35rem; font-weight: 900; }
.ln-class-name { font-size: .98rem; }
.ln-subject-grid ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .ln-subject-grid ul { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .ln-subject-grid ul { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.ln-subject-card { background: #f8fafc; border: 2px solid #e2e8f0; display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 14px; border-radius: var(--ln-radius); text-decoration: none; color: var(--ln-text); font-weight: 800; background: color-mix(in srgb, var(--ln-accent) 9%, #fff); border: 2px solid color-mix(in srgb, var(--ln-accent) 22%, #fff); transition: transform .15s, box-shadow .15s; }
.ln-subject-card:hover { transform: translateY(-2px); box-shadow: var(--ln-shadow); border-color: var(--ln-accent); }
.ln-subject-icon { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--ln-accent); color: #fff; }
.ln-subject-icon img { width: 36px; height: 36px; object-fit: contain; }
.ln-combine-note { margin: 0 0 .75rem; color: var(--ln-muted); }

/* ---------- How it works ---------- */
.ln-how { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 720px) { .ln-how { grid-template-columns: repeat(3, 1fr); } }
.ln-how li { position: relative; background: var(--ln-card); border: 1px solid var(--ln-border); border-radius: var(--ln-radius); padding: 22px 20px; box-shadow: var(--ln-shadow); }
.ln-how h3 { margin: .6rem 0 .25rem; font-size: 1.15rem; }
.ln-how p { margin: 0; color: var(--ln-muted); }
.ln-how-num { position: absolute; top: 16px; right: 18px; font-weight: 900; font-size: 2rem; color: #e2e8f0; }
.ln-how-icon { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: #eff6ff; color: var(--ln-primary); }
.ln-how li:nth-child(2) .ln-how-icon { background: #ecfdf5; color: var(--ln-secondary); }
.ln-how li:nth-child(3) .ln-how-icon { background: #fffbeb; color: #b45309; }

/* ---------- Single product ---------- */
.ln-badge-inline { display: inline-block; margin: 0 0 .5rem; font-size: .8rem; font-weight: 800; padding: .3em .8em; border-radius: 999px; background: var(--ln-accent); color: #3b2300; }
.ln-facts { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 1rem 0; padding: 0; }
@media (min-width: 560px) { .ln-facts { grid-template-columns: 1fr 1fr; } }
.ln-fact { display: flex; gap: .5rem; align-items: baseline; margin: 0; }
.ln-fact dt { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--ln-muted); min-width: 7.2em; }
.ln-fact dt svg { color: var(--ln-primary); position: relative; top: 3px; }
.ln-fact dd { margin: 0; font-weight: 600; }
.ln-purchase { background: var(--ln-card); border: 1px solid var(--ln-border); border-radius: var(--ln-radius); padding: 18px; box-shadow: var(--ln-shadow); margin: 1rem 0 1.5rem; }
.ln-purchase-price { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.ln-bundle-worth { width: 100%; margin: 0; color: var(--ln-muted); font-weight: 600; }
.ln-purchase-actions { display: grid; gap: 10px; }
.ln-purchase-actions form { margin: 0; }
.ln-digital-note { display: flex; gap: .5rem; align-items: flex-start; margin: 1rem 0 .5rem; padding: .7rem .85rem; border-radius: var(--ln-radius-sm); background: #eff6ff; color: #1e3a8a; font-weight: 600; font-size: .95rem; }
.ln-digital-note svg { flex: none; margin-top: 2px; }
.ln-trust-mini { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .4rem; color: var(--ln-muted); font-size: .92rem; }
.ln-trust-mini li { display: flex; align-items: center; gap: .5rem; }
.ln-trust-mini svg { color: var(--ln-success); }
.ln-owned { display: flex; align-items: center; gap: .5rem; margin: 0; font-weight: 700; color: var(--ln-success); }
.ln-hint { margin: .25rem 0 0; color: var(--ln-muted); font-size: .9rem; }
.ln-error { color: var(--ln-danger); font-weight: 700; }
.ln-free-gate { display: grid; gap: .5rem; }
.ln-free-gate input[type=email] { min-height: var(--ln-tap); }
.ln-consent { display: flex; gap: .5rem; align-items: flex-start; font-size: .9rem; color: var(--ln-muted); }
.ln-consent input { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.ln-checklist-list { list-style: none; padding: 0; display: grid; gap: .5rem; }
.ln-checklist-list li { display: flex; gap: .55rem; align-items: flex-start; }
.ln-checklist-list svg { color: var(--ln-success); flex: none; margin-top: 3px; }
.ln-bundle-items { list-style: none; padding: 0; display: grid; gap: 10px; }
.ln-bundle-items li { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--ln-border); border-radius: 12px; background: var(--ln-card); }
.ln-bundle-items img { width: 56px; height: auto; border-radius: 8px; }
.ln-bundle-items small { display: block; color: var(--ln-muted); }
.ln-sample-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 1rem 0; }
.ln-sample-strip img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--ln-border); box-shadow: var(--ln-shadow); }
.ln-steps-list { padding-left: 1.3rem; display: grid; gap: .4rem; }
.ln-faq details { border: 1px solid var(--ln-border); border-radius: 12px; background: var(--ln-card); margin-bottom: 8px; }
.ln-faq summary { cursor: pointer; padding: 14px 16px; font-weight: 700; min-height: var(--ln-tap); list-style-position: outside; }
.ln-faq details p { margin: 0; padding: 0 16px 14px; color: var(--ln-muted); }

/* Sticky purchase bar */
.ln-sticky-buy { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--ln-card); border-top: 1px solid var(--ln-border); box-shadow: 0 -6px 20px rgba(15, 23, 42, .1); }
.ln-sticky-buy[hidden] { display: none; }
.ln-sticky-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ln-sticky-name { font-size: .85rem; color: var(--ln-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln-sticky-buy form { margin: 0; }
body.ln-sticky-on { padding-bottom: 76px; }
body.ln-sticky-on .ln-wa-float { bottom: 140px; }

/* ---------- Dialogs ---------- */
dialog.ln-preview, dialog.ln-filter-dialog { border: 0; padding: 0; border-radius: var(--ln-radius); box-shadow: 0 30px 80px rgba(15, 23, 42, .35); color: var(--ln-text); background: var(--ln-card); }
dialog::backdrop { background: rgba(15, 23, 42, .55); }
.ln-modal-open { overflow: hidden; }
dialog.ln-preview { width: min(980px, 96vw); height: min(90vh, 1100px); }
dialog.ln-preview[open] { display: flex; flex-direction: column; }
.ln-preview-head, .ln-dialog-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--ln-border); }
.ln-preview-head h2, .ln-dialog-head h2 { margin: 0 auto 0 0; font-size: 1.1rem; }
dialog.ln-preview iframe { flex: 1; width: 100%; border: 0; background: #f1f5f9; }
dialog.ln-filter-dialog { width: min(560px, 100vw); max-height: 92vh; margin: auto; }
dialog.ln-filter-dialog[open] { display: flex; flex-direction: column; }
dialog.ln-filter-dialog form { display: flex; flex-direction: column; min-height: 0; max-height: 92vh; }
@media (max-width: 599px) { dialog.ln-filter-dialog { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: var(--ln-radius) var(--ln-radius) 0 0; } }
.ln-dialog-body { overflow: auto; padding: 8px 18px; }
.ln-dialog-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--ln-border); }
.ln-dialog-foot .ln-btn-primary { flex: 1; }
.ln-dialog-body fieldset { border: 0; margin: 0 0 1rem; padding: 0; }
.ln-dialog-body legend { font-weight: 800; margin-bottom: .5rem; }
.ln-check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.ln-check-pill { position: relative; }
.ln-check-pill input { position: absolute; opacity: 0; inset: 0; }
.ln-check-pill span { display: inline-flex; align-items: center; min-height: 42px; padding: .4em .9em; border-radius: 999px; border: 2px solid var(--ln-border); font-weight: 700; cursor: pointer; }
.ln-check-pill input:checked + span { border-color: var(--ln-primary); background: #eff6ff; color: var(--ln-primary); }
.ln-check-pill input:checked + span::before { content: "✓"; margin-right: .35em; }
.ln-check-pill input:focus-visible + span { outline: 3px solid var(--ln-accent); outline-offset: 2px; }
.ln-range { display: flex; gap: 12px; }
.ln-range label { display: grid; gap: 4px; flex: 1; font-weight: 600; color: var(--ln-muted); }
.ln-range input { min-height: var(--ln-tap); width: 100%; }

/* ---------- Filters ---------- */
.ln-filters { margin: 0 0 1.25rem; }
.ln-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.ln-chip { --ln-accent: var(--ln-primary); display: inline-flex; align-items: center; gap: .35rem; flex: none; min-height: 42px; padding: .35em 1em; border-radius: 999px; border: 2px solid var(--ln-border); background: var(--ln-card); color: var(--ln-text); font-weight: 700; text-decoration: none; white-space: nowrap; }
.ln-chip svg { color: var(--ln-accent); }
.ln-chip:hover { border-color: var(--ln-accent); }
.ln-chip.is-active { background: var(--ln-primary); border-color: var(--ln-primary); color: #fff; }
.ln-chip.is-active svg { color: #fff; }
.ln-filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ln-filter-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--ln-primary); color: #fff; font-size: .78rem; }
.ln-sort { display: flex; align-items: center; gap: 8px; margin: 0; }
.ln-sort label { font-weight: 700; color: var(--ln-muted); }
.ln-sort select { min-height: 44px; border-radius: 10px; }
.ln-active-filters { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; padding: 0; }

/* ---------- Search suggestions ---------- */
.ln-has-suggest { position: relative; }
.ln-suggest { position: absolute; z-index: 80; top: calc(100% + 6px); left: 0; right: 0; background: var(--ln-card); border: 1px solid var(--ln-border); border-radius: 14px; box-shadow: 0 20px 50px rgba(15, 23, 42, .18); padding: 6px; max-height: min(70vh, 520px); overflow: auto; text-align: left; }
.ln-suggest a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ln-text); text-decoration: none; min-height: 44px; }
.ln-suggest a:hover, .ln-suggest a[aria-selected=true] { background: #eff6ff; }
.ln-suggest img, .ln-suggest-ph { width: 40px; height: 52px; object-fit: cover; border-radius: 6px; background: #e2e8f0; flex: none; }
.ln-suggest-name { display: block; font-weight: 700; line-height: 1.25; }
.ln-suggest-meta { display: block; font-size: .82rem; color: var(--ln-muted); }
.ln-suggest-price { margin-left: auto; font-weight: 800; white-space: nowrap; }
.ln-suggest-shortcut { font-weight: 800; color: var(--ln-primary) !important; }
.ln-suggest-all { justify-content: center; font-weight: 800; color: var(--ln-primary) !important; border-top: 1px solid var(--ln-border); border-radius: 0 0 10px 10px !important; }
.ln-suggest-note { margin: 6px 10px; font-size: .9rem; color: var(--ln-muted); }

/* ---------- Payment status ---------- */
.ln-status { max-width: 760px; margin: 0 auto; }
.ln-status-hero { text-align: center; padding: 1rem 0 1.25rem; }
.ln-status-hero h1 { margin: .5rem 0 .25rem; font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.2; }
.ln-status-hero p { margin: 0; color: var(--ln-muted); font-weight: 600; }
.ln-status-icon { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--ln-success-bg); color: var(--ln-success); }
.ln-status-verifying .ln-status-icon, .ln-status-review .ln-status-icon { background: #fef3c7; color: #b45309; }
.ln-status-failed .ln-status-icon, .ln-status-cancelled .ln-status-icon, .ln-status-unpaid .ln-status-icon { background: #fee2e2; color: var(--ln-danger); }
.ln-status-missing .ln-status-icon { background: #e0e7ff; color: var(--ln-primary); }
@media (prefers-reduced-motion: no-preference) {
	.ln-spin-wrap svg { animation: ln-turn 2.4s ease-in-out infinite; }
	@keyframes ln-turn { 0%, 40% { transform: rotate(0); } 50%, 90% { transform: rotate(180deg); } 100% { transform: rotate(180deg); } }
}
.ln-status-sub { text-align: center; font-size: 1.2rem; margin: .5rem 0 1rem; }
.ln-dl-list { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 12px; }
.ln-dl-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px; background: var(--ln-card); border: 1px solid var(--ln-border); border-radius: var(--ln-radius); box-shadow: var(--ln-shadow); }
.ln-dl-item img { width: 64px; height: auto; border-radius: 8px; }
@media (min-width: 600px) { .ln-dl-item { grid-template-columns: 88px minmax(0, 1fr); } .ln-dl-item img { width: 88px; } }
.ln-dl-file { display: grid; gap: 6px; }
.ln-dl-file + .ln-dl-file { padding-top: 10px; border-top: 1px dashed var(--ln-border); }
.ln-dl-name { margin: 0; font-weight: 600; color: var(--ln-muted); font-size: .92rem; }
.ln-dl-body { display: grid; gap: 8px; flex: 1; min-width: 0; }
.ln-dl-body h3 { margin: 0; font-size: 1.05rem; }
.ln-size { font-weight: 500; opacity: .9; }
.ln-status-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 1rem 0; }
@media (max-width: 559px) { .ln-status-actions .ln-btn { width: 100%; } }
.ln-status-help { background: #f8fafc; border: 1px solid var(--ln-border); border-radius: var(--ln-radius); padding: 6px 16px; }
.ln-status-help p { display: flex; gap: .6rem; align-items: flex-start; color: var(--ln-muted); }
.ln-status-help svg { color: var(--ln-primary); flex: none; margin-top: 3px; }
.ln-alert { border-radius: var(--ln-radius-sm); padding: 4px 16px; margin: 1rem 0; border: 1px solid; }
.ln-alert p { margin: .7rem 0; }
.ln-alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.ln-alert-warn { background: var(--ln-warn-bg); border-color: var(--ln-warn-border); color: #78350f; }
.ln-alert-success { background: var(--ln-success-bg); border-color: #86efac; color: #14532d; }
p.ln-alert { padding: .8rem 1rem; }
.ln-order-summary { margin: 1.5rem 0; border: 1px solid var(--ln-border); border-radius: var(--ln-radius-sm); background: var(--ln-card); }
.ln-order-summary summary { cursor: pointer; padding: 12px 16px; font-weight: 700; }
.ln-order-summary ul { list-style: none; margin: 0; padding: 0 16px 12px; }
.ln-order-summary li { display: flex; justify-content: space-between; gap: 1rem; padding: 6px 0; border-top: 1px dashed var(--ln-border); }
.ln-order-summary .ln-total { font-weight: 800; }

/* ---------- Library ---------- */
.ln-library-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 1rem; }
.ln-library-head h2 { margin: 0; }
.ln-library-search { display: flex; align-items: center; gap: 8px; border: 2px solid var(--ln-border); border-radius: 12px; padding: 0 12px; background: var(--ln-card); }
.ln-library-search input { border: 0 !important; outline: 0; min-height: 44px; background: transparent; box-shadow: none !important; }
.ln-lib-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .ln-lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 720px) { .ln-lib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .ln-lib-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ln-lib-card { display: flex; flex-direction: column; background: var(--ln-card); border: 1px solid var(--ln-border); border-radius: var(--ln-radius); overflow: hidden; box-shadow: var(--ln-shadow); }
.ln-lib-cover { aspect-ratio: 3 / 4; background: #eef2ff; }
.ln-lib-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ln-lib-body { padding: 12px; display: grid; gap: 8px; }
.ln-lib-body h3 { margin: 0; font-size: 1rem; line-height: 1.3; }
.ln-lib-meta { margin: 0; color: var(--ln-muted); font-size: .88rem; }
.ln-lib-expiry { color: var(--ln-muted); }
.ln-lib-help { display: flex; align-items: center; gap: .5rem; margin-top: 1.5rem; }
.ln-empty { text-align: center; padding: 2.5rem 1rem; background: var(--ln-card); border: 2px dashed var(--ln-border); border-radius: var(--ln-radius); color: var(--ln-muted); }
.ln-empty svg { color: var(--ln-primary); }
.ln-empty h2, .ln-empty h3 { color: var(--ln-text); }

/* Guest library + recovery */
.ln-guest-library { background: var(--ln-card); border: 1px solid var(--ln-border); border-radius: var(--ln-radius); padding: 18px; margin-bottom: 1.5rem; box-shadow: var(--ln-shadow); }
.ln-guest-intro h2 { margin-top: 0; }
.ln-recover label { display: block; font-weight: 700; margin-bottom: .35rem; }
.ln-inline-form { display: flex; flex-wrap: wrap; gap: 10px; }
.ln-inline-form input { flex: 1 1 240px; min-height: var(--ln-tap); }
.ln-or { display: flex; align-items: center; gap: 12px; color: var(--ln-muted); font-weight: 700; margin: 1.25rem 0 0; }
.ln-or::before, .ln-or::after { content: ""; flex: 1; height: 1px; background: var(--ln-border); }

/* Help & contact */
.ln-help-topics { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ln-contact-lines { list-style: none; padding: 0; display: grid; gap: .5rem; }
.ln-contact-lines li { display: flex; align-items: center; gap: .5rem; }
.ln-contact { max-width: 620px; display: grid; gap: .25rem; }
.ln-contact label { display: block; font-weight: 700; margin-bottom: .3rem; }
.ln-contact input, .ln-contact select, .ln-contact textarea { width: 100%; min-height: var(--ln-tap); }

/* Free page */
.ln-free-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 1rem; }
.ln-free-filters label { display: grid; gap: 4px; font-weight: 700; color: var(--ln-muted); }
.ln-free-filters select { min-height: var(--ln-tap); min-width: 180px; }
.ln-count { color: var(--ln-muted); font-weight: 600; }
.ln-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 1.5rem 0; }

/* Checkout */
.ln-digital-note p { margin: 0; }
.woocommerce-checkout .ln-digital-note { margin-bottom: 1rem; }
.ln-hidden-country { display: none !important; }

/* WhatsApp */
.ln-wa-float { position: fixed; z-index: 55; right: 16px; bottom: 84px; display: inline-flex; align-items: center; gap: .4rem; padding: 12px 16px; border-radius: 999px; background: #0f7a40; color: #fff !important; font-weight: 800; text-decoration: none; box-shadow: 0 10px 24px rgba(18, 140, 74, .35); }
.ln-wa-float:hover { background: #0b6534; }
.ln-wa-float:focus-visible { outline: 3px solid var(--ln-accent); outline-offset: 3px; }
@media (min-width: 900px) { .ln-wa-float { bottom: 24px; } }

@media (prefers-reduced-motion: reduce) {
	.ln-btn, .ln-card-product, .ln-class-card, .ln-subject-card { transition: none; }
	.ln-btn:hover, .ln-card-product:hover, .ln-class-card:hover, .ln-subject-card:hover { transform: none; }
}
@media (max-width: 479px) {
	.ln-subject-card { flex-direction: column; justify-content: center; text-align: center; gap: 6px; padding: 12px 6px; min-height: 96px; font-size: .95rem; line-height: 1.2; }
	.ln-subject-icon { width: 42px; height: 42px; }
}

/* Library: one row per purchase on phones (placed last to win the cascade). */
@media (max-width: 599px) {
	.ln-lib-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: start; }
	.ln-lib-cover { aspect-ratio: 3 / 4; }
	.ln-lib-cover img { height: auto; }
}
