/* TLS Engine: base component styles (full design system comes in Phase 4). */
.tls-preview{position:relative}
.tls-preview::after{content:"";position:absolute;left:0;right:0;bottom:0;height:120px;background:linear-gradient(to bottom,rgba(255,255,255,0),#fff);pointer-events:none}
.tls-paywall{margin:2rem 0;padding:2rem 1.5rem;border-radius:16px;background:#142a6f;color:#fff;text-align:center;box-shadow:0 12px 32px rgba(20,42,111,.25)}
.tls-paywall__eyebrow{margin:0 0 .5rem;font-size:.8rem;letter-spacing:.12em;text-transform:uppercase;color:#d9bf98}
.tls-paywall__title{margin:0 0 .75rem;color:#fff}
.tls-paywall__text{margin:0 auto .5rem;max-width:36rem;color:#e6ebf5}
.tls-paywall__sw{margin:0 0 1.25rem;font-style:italic;color:#c9d2e6}
.tls-paywall__actions{display:flex;flex-wrap:wrap;gap:.75rem;justify-content:center;margin:0}
.tls-btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:.7rem 1.4rem;border-radius:999px;font-weight:600;text-decoration:none}
.tls-btn--gold{background:#b38d5e;color:#111518}
.tls-btn--gold:hover,.tls-btn--gold:focus-visible{background:#c9a273;color:#111518}
.tls-btn--ghost{border:1px solid rgba(255,255,255,.5);color:#fff}
.tls-btn--ghost:hover,.tls-btn--ghost:focus-visible{border-color:#fff;color:#fff}
.tls-btn:focus-visible{outline:3px solid #d9bf98;outline-offset:2px}
/* Buttons: extra variants */
.tls-btn{border:0;cursor:pointer;font:inherit;line-height:1.2;gap:.4rem}
.tls-btn--navy{background:#142a6f;color:#fff}
.tls-btn--navy:hover,.tls-btn--navy:focus-visible{background:#1d3a91;color:#fff}
.tls-btn--ghost-dark{background:transparent;border:1px solid #142a6f;color:#142a6f}
.tls-btn--locked{background:#edeff2;color:#687279}
.tls-btn small{font-weight:500;opacity:.8}

/* Quiz */
.tls-quiz{margin:2rem 0;scroll-margin-top:90px}
.tls-quiz__intro,.tls-quiz__card{padding:1.5rem;border:1px solid #e3e7ee;border-radius:16px;background:#fff;box-shadow:0 8px 24px rgba(17,21,24,.06)}
.tls-quiz__intro{text-align:center}
.tls-quiz__meta{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center;margin:0 0 1rem}
.tls-quiz__meta span{padding:.3rem .75rem;border-radius:999px;background:#f3f5f9;color:#142a6f;font-size:.85rem;font-weight:600}
.tls-quiz__login{display:block;margin-top:.75rem;font-size:.9rem}
.tls-quiz__head{display:flex;justify-content:space-between;align-items:center;font-size:.85rem;font-weight:600;color:#687279}
.tls-quiz__timer{padding:.2rem .6rem;border-radius:8px;background:#142a6f;color:#fff;font-variant-numeric:tabular-nums}
.tls-quiz__timer.is-low{background:#b42318}
.tls-quiz__bar{height:6px;margin:.6rem 0 1.2rem;border-radius:99px;background:#edeff2;overflow:hidden}
.tls-quiz__bar span{display:block;height:100%;background:linear-gradient(90deg,#142a6f,#b38d5e);transition:width .3s}
.tls-quiz__q{font-size:1.1rem;font-weight:600;color:#111518;margin-bottom:1rem}
.tls-quiz__q p{margin:0 0 .5rem}
.tls-quiz__options{display:grid;gap:.6rem}
.tls-quiz__opt{display:flex;gap:.75rem;align-items:flex-start;width:100%;min-height:48px;padding:.8rem 1rem;border:1.5px solid #dfe4ec;border-radius:12px;background:#fff;color:#111518;text-align:left;font:inherit;cursor:pointer;transition:border-color .15s,background .15s}
.tls-quiz__opt:hover:not(:disabled){border-color:#142a6f}
.tls-quiz__opt:focus-visible{outline:3px solid #b38d5e;outline-offset:2px}
.tls-quiz__opt.is-selected{border-color:#142a6f;background:#f2f5fc}
.tls-quiz__opt.is-correct{border-color:#1a7f4b;background:#ecf8f1}
.tls-quiz__opt.is-wrong{border-color:#b42318;background:#fdf0ef}
.tls-quiz__opt:disabled{cursor:default;opacity:1}
.tls-quiz__key{flex:0 0 28px;height:28px;border-radius:50%;background:#142a6f;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:.8rem;font-weight:700}
.tls-quiz__feedback{margin-top:1rem;padding:1rem;border-radius:12px;border-left:4px solid}
.tls-quiz__feedback.is-correct{background:#ecf8f1;border-color:#1a7f4b}
.tls-quiz__feedback.is-wrong{background:#fdf0ef;border-color:#b42318}
.tls-quiz__verdict{margin:0 0 .4rem;font-weight:700}
.tls-quiz__expl p{margin:0 0 .4rem}
.tls-quiz__nav{display:flex;flex-wrap:wrap;gap:.6rem;justify-content:flex-end;margin-top:1.2rem}
.tls-quiz__results{text-align:center}
.tls-quiz__score{margin:0;font-size:2.5rem;color:#142a6f}
.tls-quiz__score span{display:block;font-size:1rem;color:#b38d5e;font-weight:700}
.tls-quiz__msg{color:#687279}
.tls-quiz__weak,.tls-quiz__upsell{margin:1rem 0;padding:1rem;border-radius:12px;background:#f9fafb;text-align:left}
.tls-quiz__upsell{background:#142a6f;color:#fff;text-align:center}
.tls-quiz__review{margin:1.2rem 0;text-align:left}
.tls-quiz__review summary{cursor:pointer;font-weight:700;color:#142a6f}
.tls-quiz__ritem{margin-top:1rem;padding:1rem;border-radius:12px;border-left:4px solid}
.tls-quiz__ritem.is-correct{background:#ecf8f1;border-color:#1a7f4b}
.tls-quiz__ritem.is-wrong{background:#fdf0ef;border-color:#b42318}
.tls-quiz__error{color:#b42318;font-weight:600}

/* Template downloads */
.tls-downloads{margin:2rem 0;padding:1.5rem;border-radius:16px;background:#f9fafb;border:1px solid #e3e7ee}
.tls-downloads__title{margin:0 0 .8rem;font-weight:700;color:#142a6f}
.tls-downloads__btns{display:flex;flex-wrap:wrap;gap:.6rem}
.tls-downloads__note{margin:.8rem 0 0;font-size:.85rem;color:#687279}
@media (max-width:600px){.tls-quiz__nav .tls-btn,.tls-downloads__btns .tls-btn{flex:1 1 100%}}
/* ---------- My Library: download box, protected reader, library page (v0.4.0) ---------- */
.tls-dl{margin:40px 0 0;padding:26px;border-radius:18px;background:#f6f7f9;border:1px solid #e3e6eb;font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif}
.tls-dl__head{display:flex;gap:16px;align-items:flex-start}
.tls-dl__head>.tlh-ico{width:44px;height:44px;padding:10px;border-radius:12px;background:#142a6f;color:#d9bf98;flex:none}
.tls-dl h2.tls-dl__title{margin:0 0 6px;font-family:"Yeseva One",Georgia,serif;font-weight:400;font-size:1.35rem;color:#142a6f}
.tls-dl__text{margin:0;color:#687279;line-height:1.6}
.tls-dl__sw{margin:4px 0 0;font-style:italic;color:#87643a}
.tls-dl__btns{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0 0}
.tls-dl__btns .tls-btn{display:inline-flex;align-items:center;gap:8px}
.tls-dl__btns .tlh-ico,.tls-dl__note .tlh-ico,.tls-lib .tlh-ico{width:18px;height:18px}
.tls-dl__credit{flex-basis:100%;margin:4px 0 0;font-size:.88rem;color:#87643a}
.tls-dl__note{display:flex;gap:8px;align-items:center;margin:16px 0 0;font-size:.86rem;color:#687279}
.tls-lib-msg{flex-basis:100%;margin:6px 0 0;font-size:.88rem;color:#b3261e}
.is-owned{pointer-events:auto}
.tls-protect{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;background-repeat:repeat;background-size:340px 200px}
@media print{.tls-protect{display:none!important}body:has(.tls-protect)::after{content:"Printing is not available for members-only notes.";display:block;padding:40px;font:16px Arial,sans-serif}}
.tls-lib{font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;max-width:860px}
.tls-lib__intro{display:flex;gap:10px;align-items:center;padding:14px 18px;border-radius:12px;background:#edeff2;color:#142a6f;font-weight:600}
.tls-lib__group{margin:28px 0 0}
.tls-lib h2.tls-lib__h{font-family:"Yeseva One",Georgia,serif;font-weight:400;font-size:1.4rem;color:#142a6f;margin:0 0 10px}
.tls-lib__h small{font-family:system-ui,sans-serif;font-size:.75rem;letter-spacing:.06em;text-transform:uppercase;color:#87643a;margin-left:8px}
.tls-lib__list{margin:0;padding-left:22px;line-height:2}
.tls-lib__list a{color:#142a6f;font-weight:600}
.tls-lib__list small{color:#687279}
.tls-lib--empty{padding:28px;border:1px dashed #d9bf98;border-radius:16px;background:#fbf8f3}
.tls-btn--ghost-dark{border:2px solid #142a6f;color:#142a6f!important;background:#fff}

/* Paywall: single-topic download option */
.tls-btn--dl{display:inline-flex;align-items:center;gap:.45rem}
.tls-btn--dl svg{width:18px;height:18px;flex:0 0 18px}

.tls-install{display:flex;gap:14px;align-items:flex-start;padding:18px 20px;border-radius:15px;background:#142a6f;color:#fff;margin:0 0 18px}.tls-install[hidden]{display:none}.tls-install__icon{flex:0 0 44px;height:44px;border-radius:50%;background:#b38d5e;color:#142a6f;display:flex;align-items:center;justify-content:center}.tls-install__icon svg{width:22px;height:22px}.tls-install__body p{margin:0}.tls-install__title{font-weight:700;font-size:1.05rem}.tls-install__text{opacity:.92;margin-top:4px!important;line-height:1.5}.tls-install__sw{font-style:italic;color:#e3cfb3;margin-top:4px!important}.tls-install__help{margin-top:10px!important;padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.1);font-size:.92rem;line-height:1.5}.tls-install__actions{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:14px!important}.tls-install__later{background:none;border:0;color:#fff;text-decoration:underline;font-weight:600;cursor:pointer;padding:6px 2px}.tls-lib__note{display:flex;gap:8px;align-items:center;color:#5b6475;font-size:.9rem;margin:0 0 8px}.tls-lib__note svg{width:16px;height:16px}
