:root {
    --lw-ink: #203029;
    --lw-green: #355e4b;
    --lw-green-dark: #284a3a;
    --lw-cream: #f4efe5;
    --lw-paper: #fffdf8;
    --lw-mustard: #d9a441;
    --lw-border: #ded7ca;
    --lw-soft: #ebe4d7;
    --lw-muted: #6f746f;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--lw-ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
button, input, select { font: inherit; }

.lw-landing-body, .lw-app-body { background: var(--lw-cream); min-height: 100vh; }
.lw-public-header { background: rgba(255,253,248,.96); border-bottom: 1px solid var(--lw-border); }
.lw-public-inner, .lw-app-header-inner { max-width: 1380px; margin: 0 auto; padding: 18px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.lw-logo { font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -1.6px; color: var(--lw-green-dark); }
.lw-logo span { color: var(--lw-mustard); }
.lw-logo-small { font-size: 29px; }
.lw-tagline, .lw-header-sub { color: var(--lw-muted); font-size: 14px; }
.lw-public-actions { display: flex; align-items: center; gap: 14px; }
.lw-language-select { min-height: 34px; border: 1px solid var(--lw-border); border-radius: 8px; background: #fff; color: var(--lw-ink); padding: 5px 30px 5px 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.lw-language-select:focus { outline: 2px solid rgba(53,94,75,.18); outline-offset: 1px; }

.lw-hero { max-width: 1260px; margin: 0 auto; min-height: 620px; padding: 78px 32px; display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 72px; }
.lw-eyebrow { text-transform: uppercase; letter-spacing: .13em; color: var(--lw-green); font-size: 12px; font-weight: 800; margin-bottom: 10px; }
.lw-hero h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(44px, 5vw, 72px); line-height: 1.02; letter-spacing: -2px; margin: 0 0 24px; color: #1f3028; }
.lw-hero-copy > p { max-width: 720px; font-size: 20px; line-height: 1.65; color: #515b55; }
.lw-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

.lw-btn { border: 0; border-radius: 10px; min-height: 46px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; cursor: pointer; transition: .16s ease; text-transform: none; box-shadow: none; }
.lw-btn:hover { transform: translateY(-1px); }
.lw-btn-primary { background: var(--lw-green); color: #fff; }
.lw-btn-primary:hover { background: var(--lw-green-dark); color: #fff; }
.lw-btn-secondary { background: transparent; color: var(--lw-green-dark); border: 1px solid var(--lw-green); }
.lw-btn-full { width: 100%; margin-top: 18px; }

.lw-demo-card { position: relative; background: var(--lw-paper); border: 1px solid var(--lw-border); border-radius: 18px; padding: 36px; box-shadow: 0 24px 70px rgba(45,55,48,.12); font-family: Georgia, "Times New Roman", serif; font-size: 19px; line-height: 1.8; }
.lw-demo-top { display: flex; gap: 6px; margin-bottom: 25px; }
.lw-demo-top span { width: 9px; height: 9px; background: var(--lw-soft); border-radius: 50%; }
.lw-demo-title { font-size: 30px; font-weight: 700; margin-bottom: 20px; line-height: 1.2; }
.lw-demo-word { position: relative; border-bottom: 2px dotted var(--lw-mustard); cursor: help; }
.lw-demo-tip { position: absolute; left: 50%; bottom: calc(100% + 9px); transform: translateX(-50%); width: 240px; background: #23362d; color: white; border-radius: 10px; padding: 12px 14px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: 13px; line-height: 1.4; box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.lw-demo-tip small { opacity: .8; }
.lw-demo-selection { background: #f1e6c9; padding: 8px 10px; border-radius: 5px; margin-top: 22px; }
.lw-demo-explain { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: 12px; color: var(--lw-muted); margin-top: 8px; }
.lw-feature-strip { border-top: 1px solid var(--lw-border); border-bottom: 1px solid var(--lw-border); background: rgba(255,253,248,.6); display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; padding: 25px max(28px, calc((100vw - 1200px)/2)); color: #536058; }
.lw-feature-strip b { color: var(--lw-mustard); margin-right: 8px; }
.lw-footer { text-align: center; color: var(--lw-muted); font-size: 12px; padding: 34px; }

.lw-modal-backdrop, .lw-explain-backdrop, .lw-news-backdrop { display: none; position: fixed; inset: 0; z-index: 10000; background: rgba(26,37,31,.55); align-items: center; justify-content: center; padding: 20px; }
.lw-modal-backdrop.show, .lw-explain-backdrop.show, .lw-news-backdrop.show { display: flex; }
.lw-modal-card, .lw-explain-card { position: relative; width: min(460px, 100%); background: var(--lw-paper); border-radius: 16px; padding: 30px; box-shadow: 0 25px 75px rgba(0,0,0,.25); }
.lw-modal-card h2 { font-family: Georgia, "Times New Roman", serif; margin: 0 0 4px; font-size: 30px; }
.lw-modal-card label { display: block; font-size: 13px; font-weight: 700; margin: 16px 0 6px; }
.lw-modal-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; color: #7b817c; font-family: Arial, sans-serif; font-size: 30px; line-height: 1; cursor: pointer; }
.lw-form-error { display: block; color: #a23535; font-weight: 600; font-size: 13px; margin: 8px 0; }
.lw-help, .lw-small { font-size: 12px; }
.lw-muted { color: var(--lw-muted); }

.lw-app-header { background: var(--lw-paper); border-bottom: 1px solid var(--lw-border); position: sticky; top: 0; z-index: 100; }
.lw-user-area { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.lw-logout { color: var(--lw-green); font-weight: 700; }
.lw-app-shell { max-width: 1500px; margin: 0 auto; padding: 26px; display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 24px; align-items: start; }
/* Sidebar: keep Stories and Words visible as two independent scroll areas on desktop. */
.lw-sidebar { position: sticky; top: 100px; display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; height: calc(100vh - 120px); max-height: calc(100vh - 120px); overflow: hidden; padding-right: 2px; }
.lw-side-card { background: rgba(255,253,248,.78); border: 1px solid var(--lw-border); border-radius: 14px; padding: 16px; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#historyList, #savedWordsList { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; }
#historyList::-webkit-scrollbar, #savedWordsList::-webkit-scrollbar { width: 0; height: 0; display: none; }
.lw-side-card h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: #59645e; margin: 0 0 12px; }
.lw-side-card-head { display: flex; align-items: center; justify-content: space-between; }
.lw-pill { min-width: 25px; height: 25px; padding: 0 7px; border-radius: 999px; background: var(--lw-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.lw-history-row { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 26px; align-items: center; gap: 3px; }
.lw-history-item { display: block; min-width: 0; text-decoration: none !important; color: var(--lw-ink); padding: 10px; border-radius: 9px; margin: 2px 0; transition: .15s; }
.lw-history-item:hover { background: #eee8dc; color: var(--lw-ink); }
.lw-history-item.active { background: #e4eadf; }
.lw-history-title { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1.25; }
.lw-history-meta { display: block; color: var(--lw-muted); font-size: 11px; margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }
.lw-saved-word { border-top: 1px solid #e8e1d6; padding: 9px 2px; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; align-items: center; gap: 7px; font-size: 13px; }
.lw-saved-word span { color: var(--lw-muted); text-align: right; overflow-wrap: anywhere; }
.lw-saved-word-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; min-width: 26px; }
.lw-pronounce-button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--lw-green); display: inline-flex; align-items: center; justify-content: center; font-family: "Segoe UI Symbol", "Apple Color Emoji", sans-serif; font-size: 15px; line-height: 1; cursor: pointer; opacity: .62; transition: background .15s ease, color .15s ease, opacity .15s ease, transform .15s ease; }
.lw-pronounce-button:hover, .lw-pronounce-button:focus { background: #e7eee9; color: var(--lw-green-dark); opacity: 1; outline: none; transform: scale(1.04); }
.lw-pronounce-button:active { transform: scale(.94); }
.lw-delete-item { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #9a9a91; font-family: Arial, sans-serif; font-size: 18px; line-height: 22px; text-align: center; cursor: pointer; opacity: .38; transition: .15s ease; }
.lw-delete-item:hover, .lw-delete-item:focus { opacity: 1; color: #9b3f3f; background: #f5e6e3; outline: none; }
.lw-history-row:hover .lw-delete-item, .lw-saved-word:hover .lw-delete-item { opacity: .8; }
.lw-delete-item:disabled { opacity: .2; cursor: default; }

.lw-main { min-width: 0; }
.lw-create-card, .lw-reader-card, .lw-empty-card { background: var(--lw-paper); border: 1px solid var(--lw-border); border-radius: 16px; box-shadow: 0 8px 28px rgba(49,59,52,.055); }
.lw-create-card { padding: 22px; margin-bottom: 22px; }
.lw-create-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.lw-create-head h1 { font-family: Georgia, "Times New Roman", serif; font-size: 29px; margin: 0; }
.lw-create-tip { color: var(--lw-muted); font-size: 12px; max-width: 350px; text-align: right; }
.lw-form-stack { display: grid; gap: 12px; }
.lw-form-row { display: grid; gap: 12px; align-items: end; }
.lw-form-row label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 5px; color: #5e6862; }
.lw-form-row-topic { grid-template-columns: minmax(340px, 2.25fr) minmax(220px, .9fr) minmax(170px, .72fr); }
.lw-form-row-options { grid-template-columns: repeat(3, minmax(175px, 1fr)) minmax(520px, auto); }
.lw-topic-field, .lw-genre-field, .lw-level-field { min-width: 0; }
.lw-input { min-height: 44px; border-radius: 9px; border-color: #d9d3c8; background: #fff; font-size: 14px; }
/* MDB versions used by the existing site can hide styled selects unless browser-default is present.
   Keep Langwhich selects native and explicit so they are visible without JS initialization. */
select.lw-select { display: block !important; width: 100% !important; height: 44px !important; min-height: 44px !important; padding: 7px 30px 7px 10px !important; border: 1px solid #d9d3c8 !important; border-radius: 9px !important; background-color: #fff !important; color: var(--lw-ink) !important; opacity: 1 !important; visibility: visible !important; -webkit-appearance: menulist !important; appearance: auto !important; }
.lw-generate-btn { min-height: 44px; white-space: nowrap; }

.lw-generate-actions { display: flex; gap: 8px; align-items: stretch; }
.lw-news-open-btn { min-height: 44px; white-space: nowrap; }
.lw-hidden-submit { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; }

.lw-news-card { position: relative; width: min(850px, 100%); max-height: 88vh; overflow: auto; background: var(--lw-paper); border-radius: 16px; padding: 30px; box-shadow: 0 25px 75px rgba(0,0,0,.25); }
.lw-news-card h2 { font-family: Georgia, "Times New Roman", serif; margin: 0 0 8px; font-size: 30px; }
.lw-news-intro { margin: 0; color: var(--lw-muted); line-height: 1.55; }
.lw-news-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 16px; }
.lw-news-controls label, .lw-favorite-source-form label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 5px; color: #5e6862; }
.lw-news-favorite-actions { display: flex; gap: 14px; align-items: center; margin: -4px 0 14px; }
.lw-link-button { padding: 0; border: 0; background: transparent; color: var(--lw-green); font-size: 12px; font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.lw-link-button:hover { color: var(--lw-green-dark); }
.lw-link-danger { color: #9a4d49; }
.lw-favorite-source-form { background: #f5f1e8; border: 1px solid #e4ddd1; border-radius: 11px; padding: 14px; margin: 0 0 14px; }
.lw-favorite-source-grid { display: grid; grid-template-columns: minmax(170px, .75fr) minmax(280px, 1.7fr) auto; gap: 10px; align-items: end; }
.lw-favorite-add-cell { display: flex; align-items: end; }
.lw-btn-small { min-height: 44px; padding: 9px 15px; white-space: nowrap; }
.lw-favorite-hint { color: var(--lw-muted); font-size: 11px; line-height: 1.45; margin-top: 8px; }
.lw-news-status { min-height: 21px; color: var(--lw-muted); font-size: 13px; margin: 6px 0 10px; }
.lw-news-headlines { display: grid; gap: 9px; max-height: 52vh; overflow: auto; padding-right: 4px; }
.lw-news-item { width: 100%; border: 1px solid #e4ddd1; background: #fff; color: var(--lw-ink); border-radius: 11px; padding: 14px 16px; text-align: left; cursor: pointer; transition: .15s ease; }
.lw-news-item:hover, .lw-news-item:focus { border-color: #b8c6bc; background: #f7f9f4; outline: none; transform: translateY(-1px); }
.lw-news-item-title { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 700; line-height: 1.3; }
.lw-news-item-meta { display: block; color: var(--lw-muted); font-size: 11px; margin-top: 5px; text-transform: uppercase; letter-spacing: .05em; }
.lw-news-item-summary { display: block; color: #58625c; font-size: 13px; line-height: 1.45; margin-top: 7px; }
.lw-news-item-action { display: block; color: var(--lw-green); font-size: 12px; font-weight: 800; margin-top: 8px; }
.lw-news-footnote { border-top: 1px solid #ebe4d8; margin-top: 16px; padding-top: 12px; color: var(--lw-muted); font-size: 11px; line-height: 1.45; }
.lw-reader-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.lw-story-source { color: var(--lw-green); font-size: 12px; font-weight: 700; text-decoration: none; }
.lw-story-source:hover { color: var(--lw-green-dark); text-decoration: underline; }
.lw-error-block { background: #fff0ef; border: 1px solid #f2c9c5; border-radius: 8px; padding: 8px 10px; }
.lw-error-block:empty { display: none; }

.lw-empty-card { min-height: 430px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; color: var(--lw-muted); }
.lw-empty-card h2 { font-family: Georgia, "Times New Roman", serif; color: var(--lw-ink); margin: 16px 0 8px; }
.lw-empty-icon { width: 66px; height: 66px; border-radius: 50%; background: #e7eadf; display: flex; align-items: center; justify-content: center; color: var(--lw-green); font-family: Georgia, "Times New Roman", serif; font-size: 26px; font-weight: 700; }

.lw-reader-card { padding: 40px clamp(28px, 6vw, 88px) 70px; }
.lw-reader-header { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding-bottom: 24px; margin-bottom: 32px; border-bottom: 1px solid #e7e0d4; }
.lw-reader-meta { font-size: 12px; font-weight: 800; color: var(--lw-green); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 7px; }
.lw-reader-header h2 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; margin: 0; }
.lw-reader-help { color: var(--lw-muted); font-size: 12px; text-align: right; }
.lw-dot-word { border-bottom: 2px dotted var(--lw-mustard); color: var(--lw-ink); }
.lw-story-text { max-width: 820px; margin: 0 auto; font-family: Georgia, "Times New Roman", serif; font-size: 21px; line-height: 1.86; letter-spacing: .005em; color: #27332d; user-select: text; }
.lw-story-text p { margin: 0 0 1.35em; }
.lw-word { border-bottom: 2px dotted var(--lw-mustard); cursor: help; background: linear-gradient(to top, rgba(217,164,65,.10) 0, rgba(217,164,65,.10) 44%, transparent 44%); border-radius: 2px; }
.lw-word:focus { outline: 2px solid rgba(53,94,75,.25); outline-offset: 2px; }

.lw-word-tooltip { display: none; position: fixed; z-index: 15000; width: min(310px, calc(100vw - 24px)); background: #23362d; color: #fff; border-radius: 12px; padding: 15px; box-shadow: 0 18px 45px rgba(0,0,0,.24); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
.lw-word-tooltip.show { display: block; }
.lw-tooltip-word { font-size: 16px; font-weight: 800; }
.lw-tooltip-translation { color: #f0c66f; font-size: 15px; font-weight: 700; margin-top: 2px; }
.lw-tooltip-explanation { color: rgba(255,255,255,.82); font-size: 13px; line-height: 1.45; margin-top: 6px; }
.lw-save-word { width: 100%; margin-top: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); color: #fff; border-radius: 7px; padding: 7px 9px; cursor: pointer; font-weight: 700; font-size: 12px; }
.lw-save-word:disabled { opacity: .65; }

.lw-selection-action { display: none; position: fixed; z-index: 14000; border: 0; background: var(--lw-green-dark); color: #fff; border-radius: 999px; padding: 9px 14px; box-shadow: 0 8px 25px rgba(0,0,0,.2); font-size: 12px; font-weight: 700; cursor: pointer; }
.lw-selection-action.show { display: block; }
.lw-explain-card { width: min(620px, 100%); max-height: 85vh; overflow: auto; }
.lw-selected-quote { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 19px; line-height: 1.55; background: #f1eadc; padding: 14px 16px; border-radius: 9px; margin: 12px 0 20px; }
.lw-explain-section { padding: 14px 0; border-top: 1px solid #ebe4d8; line-height: 1.55; }
.lw-explain-section label { display: block; margin-bottom: 4px; color: var(--lw-green); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; }

.lw-busy-overlay { display: none; position: fixed; inset: 0; z-index: 20000; background: rgba(27,39,33,.52); align-items: center; justify-content: center; padding: 20px; }
.lw-busy-overlay.show { display: flex; }
.lw-busy-card { background: var(--lw-paper); border-radius: 14px; min-width: 290px; padding: 28px 34px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.25); font-weight: 700; }
.lw-busy-card small { display: block; color: var(--lw-muted); font-weight: 400; margin-top: 5px; }
.lw-spinner { width: 42px; height: 42px; margin: 0 auto 14px; border: 4px solid #e1ddd3; border-top-color: var(--lw-green); border-radius: 50%; animation: lwSpin .8s linear infinite; }
@keyframes lwSpin { to { transform: rotate(360deg); } }

@media (max-width: 1280px) {
    .lw-form-row-options { grid-template-columns: repeat(3, minmax(145px, 1fr)); }
    .lw-generate-cell { grid-column: 1 / -1; display: flex; align-items: end; }
    .lw-generate-actions { width: 100%; max-width: 680px; }
    .lw-generate-btn, .lw-news-open-btn, .lw-bonus-open-btn { flex: 1 1 0; }
}
@media (max-width: 900px) {
    .lw-hero { grid-template-columns: 1fr; gap: 40px; padding-top: 55px; }
    .lw-feature-strip { grid-template-columns: 1fr; }
    .lw-app-shell { grid-template-columns: 1fr; }
    .lw-sidebar { position: static; top: auto; height: auto; max-height: none; overflow: visible; grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-auto-rows: 360px; order: 2; }
    .lw-side-card { height: 360px; }
    .lw-main { order: 1; }
    .lw-form-row-topic { grid-template-columns: 1fr 1fr; }
    .lw-topic-field { grid-column: 1 / -1; }
    .lw-create-head { align-items: start; flex-direction: column; }
    .lw-create-tip { text-align: left; }
}
@media (max-width: 650px) {
    .lw-public-inner, .lw-app-header-inner { padding: 15px 18px; }
    .lw-tagline, .lw-header-sub { display: none; }
    .lw-public-actions { gap: 8px; }
    .lw-language-select { max-width: 120px; }
    .lw-hero { padding: 45px 20px; }
    .lw-hero h1 { letter-spacing: -1px; }
    .lw-demo-card { padding: 24px 20px; }
    .lw-demo-tip { display: none; }
    .lw-app-shell { padding: 14px; }
    .lw-form-row-topic, .lw-form-row-options { grid-template-columns: 1fr 1fr; max-width: none; }
    .lw-topic-field, .lw-generate-cell { grid-column: 1 / -1; }
    .lw-generate-actions { flex-direction: column; max-width: none; }
    .lw-news-card { padding: 24px 18px; }
    .lw-news-headlines { max-height: 58vh; }
    .lw-reader-card { padding: 28px 20px 50px; }
    .lw-reader-header { flex-direction: column; align-items: start; }
    .lw-reader-help { text-align: left; }
    .lw-reader-side { align-items: flex-start; }
    .lw-news-controls { grid-template-columns: 1fr; }
    .lw-favorite-source-grid { grid-template-columns: 1fr; }
    .lw-favorite-add-cell .lw-btn { width: 100%; }
    .lw-story-text { font-size: 19px; line-height: 1.78; }
    .lw-sidebar { grid-template-columns: 1fr; grid-auto-rows: 320px; }
    .lw-side-card { height: 320px; }
    .lw-user-area span { display: none; }
}

.lw-explain-save { padding-top: 18px; text-align: right; }
.lw-explain-save .lw-save-word {
    width: auto;
    min-width: 130px;
    margin-top: 0;
    background: var(--lw-green);
    border: 1px solid var(--lw-green);
    color: #fff;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(40,74,58,.14);
}
.lw-explain-save .lw-save-word:hover {
    background: var(--lw-green-dark);
    border-color: var(--lw-green-dark);
}
.lw-explain-save .lw-save-word:disabled {
    opacity: .65;
    cursor: default;
}

/* V2 account, plan and admin */
.lw-account-button { border: 0; background: transparent; color: var(--lw-ink); padding: 5px 2px; cursor: pointer; font-weight: 600; }
.lw-account-button:hover, .lw-account-button:focus { color: var(--lw-green); outline: none; text-decoration: underline; text-underline-offset: 3px; }
.lw-plan-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.lw-plan-badge.free { background: #ece8df; color: #687068; }
.lw-plan-badge.premium { background: #efe1b9; color: #76591d; }
.lw-plan-badge-icon { min-width: 34px; justify-content: center; font-size: 16px; line-height: 1; padding: 3px 8px; }
.lw-plan-badge.admin { background: #dfeae4; color: var(--lw-green-dark); }
.lw-admin-link { color: var(--lw-green); font-weight: 700; text-decoration: none; }
.lw-admin-link:hover { color: var(--lw-green-dark); text-decoration: underline; }

.lw-register-card { width: min(720px, 100%); max-height: 90vh; overflow: auto; }
.lw-account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.lw-account-grid-wide { grid-column: 1 / -1; }
.lw-account-grid label { display: block; font-size: 12px; font-weight: 700; margin: 0 0 5px; color: #5e6862; }
.lw-register-card .lw-account-grid { margin-top: 18px; }
.lw-plan-note { margin-top: 16px; padding: 11px 13px; background: #f3efe5; border: 1px solid #e2dbcf; border-radius: 9px; color: #626962; font-size: 12px; line-height: 1.45; }

.lw-account-modal-card { width: min(760px, 100%); }
.lw-account-status { display: none; margin: 14px 0; padding: 10px 12px; border-radius: 8px; background: #eaf2ed; color: var(--lw-green-dark); font-size: 13px; font-weight: 600; }
.lw-account-status.error { background: #fff0ef; color: #9b3f3f; }
.lw-account-plan-card { background: #f4efe5; border: 1px solid #e3dccc; border-radius: 11px; padding: 14px 16px; margin: 18px 0; }
.lw-account-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lw-account-plan-head strong { font-size: 17px; }
.lw-account-plan-crown { font-size: 24px !important; line-height: 1; }
.lw-account-usage { color: #58635c; font-size: 12px; line-height: 1.55; margin-top: 7px; }
.lw-account-premium-dates { color: var(--lw-muted); font-size: 11px; margin-top: 4px; }
.lw-account-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.lw-account-password { border-top: 1px solid #e8e1d6; margin-top: 22px; padding-top: 18px; }
.lw-account-password h3 { font-family: Georgia, "Times New Roman", serif; font-size: 20px; margin: 0 0 12px; }
.lw-account-password .lw-btn { margin-top: 12px; }
.lw-limit-warning { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: #fff4d9; border: 1px solid #ecd8a2; color: #725916; font-size: 12px; font-weight: 700; line-height: 1.45; }

.lw-admin-shell { max-width: 1500px; margin: 0 auto; padding: 28px; }
.lw-admin-card { background: var(--lw-paper); border: 1px solid var(--lw-border); border-radius: 16px; padding: 24px; box-shadow: 0 8px 28px rgba(49,59,52,.055); }
.lw-admin-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 18px; }
.lw-admin-head h1 { font-family: Georgia, "Times New Roman", serif; margin: 0; font-size: 34px; }
.lw-admin-head p { color: var(--lw-muted); margin: 6px 0 0; }
.lw-admin-search { display: flex; gap: 8px; min-width: min(430px, 100%); }
.lw-admin-search .lw-input { flex: 1 1 auto; }
.lw-admin-count { color: var(--lw-muted); font-size: 12px; margin: 8px 0 12px; }
.lw-admin-table-wrap { overflow-x: auto; }
.lw-admin-table { width: 100%; border-collapse: collapse; min-width: 1120px; }
.lw-admin-table th { text-align: left; padding: 10px 9px; border-bottom: 1px solid #dcd5ca; color: #667069; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
.lw-admin-table td { padding: 11px 9px; border-bottom: 1px solid #eee8de; font-size: 12px; vertical-align: middle; }
.lw-admin-table tbody tr:hover { background: #faf8f2; }
.lw-admin-action-cell { text-align: right; }
.lw-admin-edit-card { width: min(760px, 100%); max-height: 90vh; overflow: auto; }
.lw-admin-checks { display: flex; gap: 24px; margin-top: 18px; padding: 12px 0; border-top: 1px solid #e8e1d6; border-bottom: 1px solid #e8e1d6; }
.lw-admin-checks label { display: flex; align-items: center; gap: 7px; margin: 0; cursor: pointer; }

@media (max-width: 900px) {
    .lw-admin-head { flex-direction: column; align-items: stretch; }
    .lw-admin-search { min-width: 0; }
    .lw-user-area { gap: 9px; }
}
@media (max-width: 650px) {
    .lw-account-grid { grid-template-columns: 1fr; }
    .lw-account-grid-wide { grid-column: auto; }
    .lw-account-modal-card, .lw-register-card, .lw-admin-edit-card { padding: 24px 18px; }
    .lw-admin-shell { padding: 14px; }
    .lw-admin-card { padding: 16px; }
    .lw-admin-search { flex-direction: column; }
    .lw-account-button span { display: inline !important; }
    .lw-plan-badge { display: none; }
}

/* V2.1 Bonus vocabulary */
.lw-bonus-open-btn { min-height: 44px; white-space: nowrap; }
.lw-bonus-card { width: min(980px, 100%); }
.lw-bonus-language-summary { display: inline-flex; margin-top: 14px; padding: 6px 10px; border-radius: 999px; background: #edf3ef; color: var(--lw-green-dark); font-size: 12px; font-weight: 800; }
.lw-bonus-categories { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0 10px; }
.lw-bonus-category { display: grid; grid-template-columns: 54px 1fr; grid-template-rows: auto auto; column-gap: 14px; text-align: left; width: 100%; border: 1px solid #ddd6ca; background: #faf7f0; border-radius: 13px; padding: 16px; cursor: pointer; color: var(--lw-ink); transition: border-color .15s ease, transform .15s ease, background .15s ease; }
.lw-bonus-category:hover, .lw-bonus-category:focus { border-color: #9bb3a8; background: #f4f8f5; outline: none; transform: translateY(-1px); }
.lw-bonus-category.active { border-color: var(--lw-green); background: #edf4ef; }
.lw-bonus-category-icon { grid-row: 1 / 3; align-self: center; justify-self: center; width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #eee4cf; color: #76591d; font-size: 14px; font-weight: 900; letter-spacing: -.02em; }
.lw-bonus-category-title { font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 700; }
.lw-bonus-category-text { margin-top: 3px; color: var(--lw-muted); font-size: 12px; line-height: 1.45; }
.lw-bonus-note { color: var(--lw-muted); font-size: 11px; margin: 8px 0 12px; }
.lw-bonus-items { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.lw-bonus-item { border: 1px solid #e2dbd0; border-radius: 12px; background: #fffdf9; padding: 15px; min-width: 0; }
.lw-bonus-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lw-bonus-term { font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.lw-bonus-translation { margin-top: 3px; color: var(--lw-green-dark); font-weight: 800; font-size: 13px; }
.lw-bonus-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; flex: 0 0 auto; max-width: 45%; }
.lw-bonus-register, .lw-bonus-region { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: #ece8df; color: #667067; }
.lw-bonus-register.rude, .lw-bonus-register.very_rude, .lw-bonus-register.extreme, .lw-bonus-register.strong { background: #f7e2de; color: #8a4138; }
.lw-bonus-register.extreme { background: #eed3cf; color: #762f28; }
.lw-bonus-region { background: #e8efeb; color: var(--lw-green-dark); text-transform: none; letter-spacing: 0; }
.lw-bonus-explanation { margin-top: 11px; font-size: 12px; line-height: 1.55; color: #4f5b54; }
.lw-bonus-example { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee8df; font-size: 12px; line-height: 1.5; }
.lw-bonus-example-label { font-weight: 800; color: #606a64; }
.lw-bonus-example-translation { margin-top: 3px; color: var(--lw-muted); font-style: italic; }
.lw-bonus-item-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.lw-bonus-save.saved { background: #e8f0eb; border-color: #b6cbbf; color: var(--lw-green-dark); }

@media (max-width: 1200px) {
    .lw-generate-btn, .lw-news-open-btn, .lw-bonus-open-btn { flex: 1 1 0; }
}
@media (max-width: 760px) {
    .lw-bonus-categories, .lw-bonus-items { grid-template-columns: 1fr; }
    .lw-bonus-category { grid-template-columns: 48px 1fr; padding: 13px; }
    .lw-bonus-item-head { flex-direction: column; }
    .lw-bonus-badges { max-width: none; justify-content: flex-start; }
    .lw-bonus-term { font-size: 20px; }
}


/* v2.1.2 credits */
.lw-plan-button { border: 0; background: transparent; padding: 0; margin: 0; cursor: pointer; border-radius: 999px; }
.lw-plan-button:hover .lw-plan-badge, .lw-plan-button:focus .lw-plan-badge { transform: translateY(-1px); box-shadow: 0 3px 9px rgba(40, 55, 46, .13); }
.lw-plan-button:focus { outline: none; }
.lw-plan-button .lw-plan-badge { transition: transform .15s ease, box-shadow .15s ease; }
.lw-account-credit-action { margin-top: 12px; display: flex; justify-content: flex-start; }

.lw-credits-modal-card { width: min(1120px, 96vw); max-height: 92vh; overflow-y: auto; }
.lw-credits-intro { max-width: 760px; }
.lw-credits-promise { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 2px 0 20px; padding: 8px 12px; background: #edf4ef; border: 1px solid #d7e5dc; border-radius: 999px; color: #416157; font-size: 12px; font-weight: 700; }
.lw-credits-promise > span:first-child { color: var(--lw-green); font-size: 14px; }
.lw-credits-dot { color: #8f968f; }
.lw-credit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.lw-credit-card { position: relative; display: flex; flex-direction: column; min-height: 330px; padding: 22px 19px 18px; border: 1px solid #ddd7cb; border-radius: 15px; background: #fff; box-shadow: 0 8px 24px rgba(62, 67, 59, .055); }
.lw-credit-card-free { background: #f8f6f1; box-shadow: none; }
.lw-credit-card-featured { border: 2px solid #b69a4c; padding: 21px 18px 17px; box-shadow: 0 12px 30px rgba(118, 89, 29, .13); }
.lw-credit-popular { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 5px 11px; border-radius: 999px; white-space: nowrap; background: #b69a4c; color: #fff; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.lw-credit-card-top { padding-bottom: 15px; border-bottom: 1px solid #eee9df; }
.lw-credit-name { color: var(--lw-green-dark); font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .075em; }
.lw-credit-price { margin-top: 9px; color: var(--lw-ink); font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 700; line-height: 1; }
.lw-credit-subtitle { margin-top: 7px; color: #68736c; font-size: 13px; font-weight: 700; }
.lw-credit-features { flex: 1; list-style: none; margin: 17px 0 20px; padding: 0; color: #56605a; font-size: 12px; line-height: 1.45; }
.lw-credit-features li { position: relative; padding: 7px 0 7px 19px; border-bottom: 1px solid #f0ece4; }
.lw-credit-features li:last-child { border-bottom: 0; }
.lw-credit-features li::before { content: "✓"; position: absolute; left: 0; top: 7px; color: var(--lw-green); font-weight: 900; }
.lw-credit-features .lw-credit-gold::before { content: ""; }
.lw-credit-features .lw-credit-gold { padding-left: 0; color: #76591d; font-weight: 800; }
.lw-credit-cta { width: 100%; margin-top: auto; }
.lw-credit-cta:disabled { opacity: .72; cursor: default; }
.lw-credit-footnote { margin-top: 17px; text-align: center; color: #727a74; font-size: 11px; }
.lw-credit-status { margin-top: 14px; margin-bottom: 0; }

@media (max-width: 980px) {
    .lw-credit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .lw-credits-modal-card { width: 96vw; max-height: 94vh; padding-left: 16px; padding-right: 16px; }
    .lw-credit-grid { grid-template-columns: 1fr; gap: 12px; }
    .lw-credit-card { min-height: 0; }
    .lw-credits-promise { border-radius: 12px; }
}

/* v2.1.3 credits header / Gold */
.lw-buy-credits-header {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #d9c991;
    border-radius: 999px;
    background: #f7edc8;
    color: #66501b;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.lw-buy-credits-header:hover,
.lw-buy-credits-header:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 11px rgba(73, 61, 24, .14);
    background: #fbf2d3;
    outline: none;
}
.lw-buy-credits-crown { font-size: 16px; line-height: 1; }
.lw-header-credit-balance {
    padding-left: 7px;
    border-left: 1px solid rgba(102, 80, 27, .22);
    font-size: 10px;
    font-weight: 700;
    opacity: .86;
}
.lw-account-credit-balance {
    margin-top: 6px;
    color: #66501b;
    font-size: 12px;
    font-weight: 700;
}
.lw-account-plan-gold { color: #76591d; }

@media (max-width: 720px) {
    .lw-buy-credits-header { padding: 6px 9px; }
    .lw-header-credit-balance { display: none; }
}


/* Public landing language flags */
.lw-language-flags {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px;
    border-radius: 999px;
}
.lw-flag-link {
    width: 34px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    font-size: 21px;
    line-height: 1;
    text-decoration: none;
    opacity: .68;
    transition: opacity .15s ease, transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.lw-flag-link:hover,
.lw-flag-link:focus {
    opacity: 1;
    transform: translateY(-1px);
    background: #f4efe5;
    border-color: #ddd4c4;
    outline: none;
    text-decoration: none;
}
.lw-language-flags[data-current="en"] .lw-flag-link[data-lang="en"],
.lw-language-flags[data-current="sv"] .lw-flag-link[data-lang="sv"],
.lw-language-flags[data-current="es"] .lw-flag-link[data-lang="es"] {
    opacity: 1;
    background: #f1ece2;
    border-color: #d8cebd;
    box-shadow: 0 1px 3px rgba(30, 55, 48, .08);
}
@media (max-width: 640px) {
    .lw-public-actions {
        gap: 8px;
    }
    .lw-language-flags {
        gap: 4px;
        padding: 1px;
    }
    .lw-flag-link {
        width: 31px;
        height: 28px;
        font-size: 19px;
    }
}

/* Saved-word practice */
.lw-word-head-actions { display: flex; align-items: center; gap: 7px; }
.lw-side-card-head .lw-word-head-actions { margin-bottom: 12px; }
.lw-practice-open { border: 1px solid #d8d0c1; background: #f6f1e8; color: var(--lw-green); border-radius: 999px; padding: 4px 9px; font-size: 10px; font-weight: 800; line-height: 1.2; cursor: pointer; text-transform: uppercase; letter-spacing: .04em; }
.lw-practice-open:hover, .lw-practice-open:focus { background: #ece6da; color: var(--lw-green-dark); outline: none; }
.lw-practice-card { width: min(780px, 100%); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.lw-practice-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.lw-practice-title-row > div:first-child { min-width: 0; }
.lw-practice-toggle { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #ded6c9; background: #f6f1e8; border-radius: 999px; color: #55625b; font-size: 12px; font-weight: 800; cursor: pointer; user-select: none; }
.lw-practice-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.lw-practice-switch { width: 30px; height: 17px; border-radius: 999px; background: #c9c6bd; position: relative; transition: .16s ease; }
.lw-practice-switch:after { content: ""; position: absolute; width: 13px; height: 13px; left: 2px; top: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: .16s ease; }
.lw-practice-toggle input:checked + .lw-practice-switch { background: var(--lw-green); }
.lw-practice-toggle input:checked + .lw-practice-switch:after { transform: translateX(13px); }
.lw-practice-score { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 17px 0 7px; padding: 10px 12px; border-radius: 10px; background: #f4efe5; border: 1px solid #e4ddd1; color: #5b655f; font-size: 12px; }
.lw-practice-score-good { color: #2f6d52; }
.lw-practice-score-bad { color: #9b4b48; }
.lw-practice-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; border-top: 1px solid #e7dfd3; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; }
.lw-practice-list::-webkit-scrollbar { width: 0; height: 0; display: none; }
.lw-practice-row { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(260px, 1.3fr); gap: 18px; align-items: center; padding: 13px 4px; border-bottom: 1px solid #e7dfd3; }
.lw-practice-word-wrap { display: flex; align-items: center; gap: 7px; min-width: 0; }
.lw-practice-word { font-family: Georgia, "Times New Roman", serif; font-size: 18px; color: var(--lw-ink); overflow-wrap: anywhere; }
.lw-practice-word-wrap .lw-pronounce-button { flex: 0 0 auto; }
.lw-practice-answer-cell { min-width: 0; }
.lw-practice-translation { color: #6d756f; font-size: 15px; }
.lw-practice-input-wrap { display: grid; grid-template-columns: minmax(0,1fr) 42px; gap: 7px; }
.lw-practice-input { min-width: 0; min-height: 40px; border-radius: 8px; border: 1px solid #d8d2c7; background: #fff; padding: 8px 10px; font-size: 14px; }
.lw-practice-input:focus { border-color: #809b8c; box-shadow: 0 0 0 2px rgba(47,94,75,.09); outline: none; }
.lw-practice-check { width: 42px; min-height: 40px; border: 0; border-radius: 8px; background: var(--lw-green); color: #fff; font-size: 19px; font-weight: 800; cursor: pointer; }
.lw-practice-check:hover, .lw-practice-check:focus { background: var(--lw-green-dark); outline: none; }
.lw-practice-check:disabled { opacity: .55; cursor: default; }
.lw-practice-row.is-correct { background: rgba(68,129,91,.055); }
.lw-practice-row.is-wrong { background: rgba(165,73,68,.055); }
.lw-practice-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lw-practice-result-answer { color: var(--lw-ink); font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.lw-practice-result-mark { flex: 0 0 auto; width: 29px; height: 29px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; }
.lw-practice-row.is-correct .lw-practice-result-mark { background: #e3efe7; color: #2f6d52; }
.lw-practice-row.is-wrong .lw-practice-result-mark { background: #f6e5e3; color: #9b4b48; }
.lw-practice-your-answer { margin-top: 4px; color: #9a7a76; font-size: 11px; }
.lw-practice-empty { padding: 28px 8px; color: var(--lw-muted); text-align: center; font-size: 13px; }

@media (max-width: 650px) {
    .lw-word-head-actions { gap: 5px; }
    .lw-practice-open { padding: 4px 7px; font-size: 9px; }
    .lw-practice-card { max-height: calc(100vh - 20px); padding: 24px 16px; }
    .lw-practice-title-row { flex-direction: column; gap: 12px; }
    .lw-practice-toggle { align-self: flex-start; }
    .lw-practice-score { gap: 8px 13px; }
    .lw-practice-row { grid-template-columns: 1fr; gap: 7px; padding: 12px 2px; }
    .lw-practice-word { font-size: 17px; }
    .lw-practice-input-wrap { grid-template-columns: minmax(0,1fr) 44px; }
}

/* v2.2.2 - unobtrusive practice answer review */
.lw-practice-review-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 7px; }
.lw-practice-review-btn { border: 0; background: transparent; padding: 2px 5px; color: #6f7871; font-size: 10px; font-weight: 750; cursor: pointer; border-radius: 6px; line-height: 1.35; }
.lw-practice-review-btn:hover, .lw-practice-review-btn:focus { background: #eee9df; color: var(--lw-green-dark); outline: none; }
.lw-practice-review-btn:disabled { opacity: .55; cursor: default; background: transparent; }
.lw-practice-accept-btn { color: #4f725f; }
.lw-practice-ai-btn { color: #7b6a45; }
.lw-practice-review-note { margin-top: 6px; color: #6e7771; font-size: 10.5px; line-height: 1.35; }
.lw-practice-review-note.is-good { color: #3f7559; }
.lw-practice-review-note.is-almost { color: #8a6c2e; }
.lw-practice-review-note.is-bad { color: #9a5b56; }

@media (max-width: 575.98px) {
    .lw-practice-review-actions { gap: 4px; }
    .lw-practice-review-btn { padding: 3px 4px; font-size: 10px; }
}
.lw-practice-row.is-almost { background: rgba(183,139,54,.055); }
.lw-practice-row.is-almost .lw-practice-result-mark { background: #f5ecd7; color: #8a6c2e; }

/* v2.2.3 practice direction, peek tooltip and login spinner */
.lw-practice-controls { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.lw-practice-direction { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: #68736c; padding: 2px 5px; border-radius: 6px; font-size: 10.5px; font-weight: 750; cursor: pointer; line-height: 1.35; }
.lw-practice-direction:hover, .lw-practice-direction:focus { background: #eee9df; color: var(--lw-green-dark); outline: none; }
.lw-practice-direction.is-reverse { color: var(--lw-green); }
.lw-practice-word.is-cheatable { position: relative; display: inline-block; width: fit-content; max-width: 100%; cursor: help; text-decoration-line: underline; text-decoration-style: dotted; text-decoration-color: #c69b4d; text-underline-offset: 4px; }
.lw-practice-word.is-cheatable:after { content: attr(data-cheat); position: absolute; left: 0; top: calc(100% + 7px); z-index: 40; min-width: 110px; max-width: 280px; width: max-content; padding: 7px 9px; border-radius: 7px; background: #33483f; color: #fff; font-family: Arial, Helvetica, sans-serif; font-size: 11.5px; font-weight: 500; line-height: 1.35; box-shadow: 0 5px 16px rgba(0,0,0,.16); opacity: 0; visibility: hidden; transform: translateY(-2px); transition: opacity .12s ease, transform .12s ease, visibility .12s ease; pointer-events: none; white-space: normal; }
.lw-practice-word.is-cheatable:hover:after,
.lw-practice-word.is-cheatable:focus:after,
.lw-practice-word.is-cheatable.is-cheat-open:after { opacity: 1; visibility: visible; transform: translateY(0); }

.lw-login-submit { position: relative; margin-top: 20px; }
.lw-login-submit .lw-btn { margin-top: 0; }
.lw-login-loading-overlay { display: none; position: absolute; inset: 0; z-index: 20; border-radius: 16px; background: rgba(250,248,243,.76); align-items: center; justify-content: center; pointer-events: all; }
.lw-login-loading-overlay.show { display: flex; }
.lw-login-spinner { width: 48px; height: 48px; border: 5px solid rgba(53,94,75,.18); border-top-color: var(--lw-green); border-radius: 50%; opacity: 0; visibility: hidden; pointer-events: none; box-shadow: 0 8px 28px rgba(31,58,47,.10); }
.lw-login-spinner.show { opacity: 1; visibility: visible; animation: lw-login-spin .7s linear infinite; }
.lw-login-modal-loading > :not(.lw-login-loading-overlay) { opacity: .42; transition: opacity .15s ease; }
.lw-login-loading { cursor: wait; }
@keyframes lw-login-spin { to { transform: rotate(360deg); } }

@media (max-width: 700px) {
    .lw-practice-controls { align-items: flex-start; width: 100%; }
    .lw-practice-direction { padding-left: 1px; }
    .lw-practice-word.is-cheatable:after { max-width: min(250px, 74vw); }
}

@media (min-width: 701px) {
    .lw-practice-row.is-reverse-direction .lw-practice-answer-cell { order: 1; }
    .lw-practice-row.is-reverse-direction .lw-practice-word-wrap { order: 2; }
}

/* v2.3 footer and feedback */
.lw-site-footer {
    margin-top: 30px;
    padding: 0 28px 30px;
}
.lw-site-footer-inner {
    max-width: 1700px;
    margin: 0 auto;
    border-top: 1px solid #ded6ca;
    padding: 22px 4px 0;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto auto;
    gap: 24px;
    align-items: center;
    color: #68716c;
}
.lw-site-footer-about { max-width: 650px; }
.lw-footer-brand {
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -.03em;
    color: var(--lw-green-dark);
    margin-bottom: 5px;
}
.lw-footer-brand span { color: #a48732; }
.lw-site-footer-about p {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: #77807a;
}
.lw-site-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.lw-footer-link {
    border: 0;
    background: transparent;
    color: var(--lw-green-dark);
    font-size: 12px;
    font-weight: 700;
    padding: 7px 9px;
    cursor: pointer;
    border-radius: 7px;
}
.lw-footer-link:hover, .lw-footer-link:focus {
    background: #eee8dd;
    outline: none;
}
.lw-site-footer-copy {
    font-size: 11px;
    white-space: nowrap;
    color: #8b918d;
}

.lw-feedback-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(27, 39, 34, .58);
    z-index: 10080;
}
.lw-feedback-backdrop.show { display: flex; }
.lw-feedback-card {
    position: relative;
    width: min(720px, 100%);
    max-height: min(90vh, 820px);
    overflow-y: auto;
    background: #fffdf9;
    border: 1px solid #ddd4c7;
    border-radius: 22px;
    box-shadow: 0 28px 80px rgba(18, 32, 27, .28);
    padding: 34px 38px 30px;
}
.lw-feedback-card h2 {
    margin: 4px 46px 7px 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
    line-height: 1.15;
    color: var(--lw-ink);
}
.lw-feedback-intro, .lw-feedback-mode-intro {
    color: #7d837f;
    line-height: 1.55;
    margin: 0;
}
.lw-feedback-intro { font-size: 13px; }
.lw-feedback-mode-intro { font-size: 12px; margin: 14px 0 18px; }
.lw-feedback-tabs {
    margin-top: 22px;
    display: inline-flex;
    padding: 4px;
    border: 1px solid #ddd5c9;
    background: #f3eee5;
    border-radius: 12px;
    gap: 3px;
}
.lw-feedback-tab {
    border: 0;
    background: transparent;
    color: #66716a;
    padding: 9px 13px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.lw-feedback-tab.active {
    background: #fffdf9;
    color: var(--lw-green-dark);
    box-shadow: 0 1px 4px rgba(21, 46, 38, .08);
}
.lw-feedback-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.lw-feedback-grid label, .lw-feedback-field label {
    display: block;
    margin: 0 0 6px;
    color: #57645d;
    font-size: 12px;
    font-weight: 700;
}
.lw-feedback-field { margin-top: 14px; }
.lw-feedback-message {
    resize: vertical;
    min-height: 135px;
    line-height: 1.5;
}
.lw-feedback-honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    left: -10000px !important;
}
.lw-feedback-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}
.lw-feedback-status {
    margin-top: 15px;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
}
.lw-feedback-status.success { background: #eaf2ed; color: var(--lw-green-dark); }
.lw-feedback-status.error { background: #fff0ef; color: #9b3f3f; }

.lw-admin-feedback-message {
    max-width: 560px;
    white-space: pre-wrap;
    line-height: 1.45;
    color: #58635c;
}
.lw-feedback-status-badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.lw-feedback-status-badge.new { background: #fff1d7; color: #8a6614; }
.lw-feedback-status-badge.handled { background: #e5eee8; color: #356650; }

@media (max-width: 800px) {
    .lw-site-footer { padding: 0 18px 24px; margin-top: 22px; }
    .lw-site-footer-inner {
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: start;
    }
    .lw-site-footer-actions { justify-content: flex-start; margin-left: -9px; }
    .lw-feedback-backdrop { padding: 12px; align-items: flex-end; }
    .lw-feedback-card {
        width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 12px 12px;
        padding: 28px 20px 22px;
    }
    .lw-feedback-card h2 { font-size: 28px; }
    .lw-feedback-grid { grid-template-columns: 1fr; gap: 12px; }
    .lw-feedback-tabs { display: flex; width: 100%; }
    .lw-feedback-tab { flex: 1; }
}
.lw-admin-feedback-card { margin-top: 24px; }

/* v2.3.1 Messages */
.lw-messages-header {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 0;
    background: transparent;
    color: var(--lw-ink);
    font: inherit;
    font-weight: 700;
    padding: 6px 5px;
    cursor: pointer;
}
.lw-messages-header:hover,
.lw-messages-header:focus { color: var(--lw-green); outline: none; }
.lw-unread-badge,
.lw-admin-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #d83b37;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 0 2px #fff;
}
.lw-messages-modal-card { width: min(980px, calc(100vw - 28px)); max-height: 88vh; }
.lw-messages-layout {
    display: grid;
    grid-template-columns: 300px minmax(0,1fr);
    min-height: 460px;
    max-height: 62vh;
    border: 1px solid #e4ddd1;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    margin-top: 16px;
}
.lw-message-thread-list {
    overflow-y: auto;
    background: #faf8f3;
    border-right: 1px solid #e6dfd4;
    scrollbar-width: none;
}
.lw-message-thread-list::-webkit-scrollbar,
.lw-message-conversation::-webkit-scrollbar { width: 0; height: 0; }
.lw-message-thread {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #ece6dd;
    background: transparent;
    text-align: left;
    padding: 13px 14px;
    cursor: pointer;
    color: var(--lw-ink);
}
.lw-message-thread:hover { background: #f2eee5; }
.lw-message-thread.active { background: #eaf1ed; }
.lw-message-thread.unread { background: #f8f2df; }
.lw-message-thread-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.lw-message-thread-top strong { font-size: 13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lw-message-thread-badge {
    flex: 0 0 auto;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:18px;
    height:18px;
    padding:0 5px;
    border-radius:999px;
    background:#d83b37;
    color:#fff;
    font-size:10px;
    font-weight:800;
}
.lw-message-thread-preview { margin-top:5px; font-size:11px; color:#667069; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lw-message-thread-date { display:block; margin-top:5px; font-size:10px; color:#9a9a91; }
.lw-message-conversation-panel { min-width:0; display:flex; flex-direction:column; background:#fff; }
.lw-message-conversation-panel h3 { margin:0; padding:14px 16px 11px; border-bottom:1px solid #eee8de; font-size:17px; font-family:Georgia,"Times New Roman",serif; }
.lw-message-conversation { flex:1 1 auto; overflow-y:auto; padding:16px; scrollbar-width:none; scroll-behavior:smooth; }
.lw-message-row { display:flex; margin:0 0 12px; }
.lw-message-row.admin { justify-content:flex-start; }
.lw-message-row.user { justify-content:flex-end; }
.lw-message-bubble { max-width:78%; padding:10px 12px; border-radius:12px; line-height:1.48; font-size:13px; }
.lw-message-row.admin .lw-message-bubble { background:#f2eee6; border-bottom-left-radius:4px; }
.lw-message-row.user .lw-message-bubble { background:#e5efe9; border-bottom-right-radius:4px; }
.lw-message-meta { display:flex; gap:9px; align-items:baseline; margin-bottom:4px; color:#667069; font-size:10px; }
.lw-message-meta strong { color:#3d4842; font-size:10px; }
.lw-message-text { white-space:pre-wrap; word-break:break-word; }
.lw-message-reply { flex:0 0 auto; display:flex; align-items:flex-end; gap:9px; border-top:1px solid #eee8de; padding:10px 12px; background:#fbfaf7; }
.lw-message-reply-input { min-height:54px !important; max-height:130px; resize:vertical; }
.lw-message-reply .lw-btn { flex:0 0 auto; min-width:84px; }
.lw-message-status { margin-top:10px; padding:8px 10px; border-radius:7px; background:#eaf2ed; color:var(--lw-green-dark); font-size:12px; font-weight:600; }
.lw-message-status.error { background:#fff0ef; color:#9b3f3f; }
.lw-message-empty { padding:18px 14px; color:#8b918d; font-size:12px; text-align:center; }
.lw-message-empty-large { padding-top:80px; }

/* Admin messages */
.lw-admin-message-head-actions { display:flex; gap:10px; align-items:center; }
.lw-admin-message-row-unread td { background:#fffaf0; }
.lw-admin-message-preview { max-width:440px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lw-admin-message-person small { display:block; color:var(--lw-muted); margin-top:2px; }
.lw-admin-thread-card { width:min(760px, calc(100vw - 30px)); max-height:90vh; overflow:auto; }
.lw-admin-thread-meta { display:flex; flex-wrap:wrap; gap:8px 14px; color:var(--lw-muted); font-size:11px; margin:-4px 0 14px; }
.lw-admin-thread-conversation { max-height:46vh; overflow-y:auto; padding:12px; border:1px solid #e7e0d5; border-radius:10px; background:#fbfaf7; scrollbar-width:none; }
.lw-admin-thread-conversation::-webkit-scrollbar { width:0; }
.lw-admin-thread-reply { margin-top:14px; }
.lw-admin-thread-reply textarea { min-height:90px; }
.lw-admin-thread-reply .lw-btn { margin-top:9px; }
.lw-broadcast-card { width:min(620px, calc(100vw - 30px)); }
.lw-broadcast-card textarea { min-height:150px; resize:vertical; }
.lw-broadcast-note { margin:10px 0 0; color:var(--lw-muted); font-size:11px; line-height:1.45; }

@media (max-width: 820px) {
    .lw-messages-modal-card { width:calc(100vw - 18px); padding:18px 14px; }
    .lw-messages-layout { grid-template-columns:1fr; max-height:none; min-height:0; overflow:visible; }
    .lw-message-thread-list { max-height:230px; border-right:0; border-bottom:1px solid #e6dfd4; }
    .lw-message-conversation-panel { min-height:360px; }
    .lw-message-conversation { max-height:44vh; }
    .lw-message-bubble { max-width:90%; }
}

@media (max-width: 560px) {
    .lw-messages-header span:first-child { display:none; }
    .lw-messages-header::before { content:'\2709'; font-size:18px; }
    .lw-message-reply { align-items:stretch; flex-direction:column; }
    .lw-message-reply .lw-btn { width:100%; }
    .lw-admin-message-head-actions { width:100%; justify-content:flex-start; }
}

.lw-header-message-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    color: var(--lw-green);
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.lw-header-message-icon:hover,
.lw-header-message-icon:focus {
    color: var(--lw-green-dark);
    background: #edf2ee;
    text-decoration: none;
    outline: none;
    transform: translateY(-1px);
}
.lw-header-message-svg {
    width: 21px;
    height: 21px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.lw-header-message-icon .lw-admin-unread-badge {
    position: absolute;
    top: -3px;
    right: -5px;
    z-index: 2;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 9px;
    box-shadow: 0 0 0 2px var(--lw-paper, #fff);
}
.lw-admin-link-wrap { display:inline-flex; align-items:center; gap:5px; }
@media (max-width:650px) {
    .lw-user-area .lw-unread-badge,
    .lw-user-area .lw-admin-unread-badge { display:inline-flex; }
}


/* v2.3.1.2 User message icon */
button.lw-header-message-icon {
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    cursor: pointer;
}
.lw-header-message-icon .lw-unread-badge,
.lw-header-message-icon .lw-admin-unread-badge {
    position: absolute;
    top: -3px;
    right: -5px;
    z-index: 2;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 9px;
    box-shadow: 0 0 0 2px var(--lw-paper, #fff);
}
.lw-user-message-icon { margin: 0 1px; }
.lw-user-message-icon::before {
    content: '';
    position: absolute;
    left: 50%;
    top: calc(100% + 4px);
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #263a31;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease, top .12s ease;
    z-index: 40;
}
.lw-user-message-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: calc(100% + 14px);
    transform: translateX(-50%);
    padding: 6px 9px;
    border-radius: 7px;
    background: #263a31;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(24, 42, 34, .18);
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease, top .12s ease;
    z-index: 40;
}
.lw-user-message-icon:hover::before,
.lw-user-message-icon:focus-visible::before,
.lw-user-message-icon:hover::after,
.lw-user-message-icon:focus-visible::after { opacity: 1; }
.lw-user-message-icon:hover::after,
.lw-user-message-icon:focus-visible::after { top: calc(100% + 12px); }
.lw-messages-modal-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding-right: 38px;
}
.lw-messages-modal-heading .lw-news-intro { margin-bottom: 0; }
.lw-message-new-button {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 40px;
    padding: 9px 15px;
}
@media (max-width: 650px) {
    .lw-user-message-icon::before,
    .lw-user-message-icon::after { display: none; }
    .lw-messages-modal-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding-right: 34px;
    }
    .lw-message-new-button {
        min-height: 36px;
        padding: 7px 12px;
    }
}
/* V2.4.1 full-text browser speech */
.lw-story-audio { display: flex; align-items: center; justify-content: flex-end; gap: 7px; margin-bottom: 9px; }
.lw-story-audio button { border: 0; cursor: pointer; font: inherit; white-space: nowrap; transition: background-color .15s ease, transform .15s ease, border-color .15s ease; }
.lw-story-audio button:active { transform: translateY(1px); }
.lw-story-audio-primary { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 7px 12px; border-radius: 999px; background: var(--lw-green); color: #fff; font-size: 12px; font-weight: 800; }
.lw-story-audio-primary:hover, .lw-story-audio-primary:focus { background: var(--lw-green-dark); outline: none; }
.lw-story-audio-secondary { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 7px 10px; border-radius: 999px; background: #f3efe6; border: 1px solid #e0d8ca !important; color: #495850; font-size: 11px; font-weight: 800; }
.lw-story-audio-secondary:hover, .lw-story-audio-secondary:focus { background: #ebe5da; outline: none; }
.lw-story-audio-icon { display: inline-flex; min-width: 12px; justify-content: center; font-size: 11px; line-height: 1; }

@media (max-width: 767px) {
    .lw-reader-header { align-items: flex-start; }
    .lw-reader-side { width: 100%; }
    .lw-story-audio { justify-content: flex-start; margin-top: 4px; }
    .lw-story-audio-primary, .lw-story-audio-secondary { min-height: 38px; }
}

