.transcript-lookup-help{margin:.4rem 0;color:#4d6356;font-size:.83rem}.transcript-term{display:inline;margin:0;padding:0 .07em;background:#e6f1e8;border:0;border-radius:.2em;color:#124835;font:inherit;font-weight:660;line-height:inherit;text-decoration:underline dotted;text-underline-offset:.17em;cursor:pointer;user-select:text;-webkit-user-select:text}.transcript-term:hover,.transcript-term[aria-expanded=true]{background:#c8e1d0}.transcript-term:focus-visible,.transcript-lookup-close:focus-visible{outline:2px solid #8b5719;outline-offset:2px}.transcript-lookup{position:fixed;z-index:30;bottom:max(16px,env(safe-area-inset-bottom));right:16px;width:min(420px,calc(100vw - 32px));max-height:min(55vh,410px);overflow:auto;padding:14px 16px;background:#fffef9;color:#203228;border:1px solid #92b1a0;border-radius:15px;box-shadow:0 10px 36px #102e2733}.transcript-lookup-head{display:flex;gap:8px;justify-content:space-between;align-items:start}.transcript-lookup-word{font-size:1.16rem;overflow-wrap:anywhere}.transcript-lookup p{margin:.3rem 0;line-height:1.5;overflow-wrap:anywhere}.transcript-lookup-close{flex:none;min-height:38px;padding:5px 10px;border-radius:8px;border:1px solid #bdcdc3;background:#fffef9;color:#284639;font:inherit;font-size:.81rem}.transcript-lookup-pinyin,.transcript-lookup-canonical{color:#4d6356;font-size:.85rem}.transcript-lookup-en{font-weight:660}.transcript-lookup-cn{font-size:.9rem;color:#425a50}@media(max-width:650px){.transcript-lookup{left:10px;right:10px;width:auto;bottom:max(10px,env(safe-area-inset-bottom));max-height:48vh}}

.transcript-lookup-badge{display:inline-block;background:#e5efe8;color:#244c39;border-radius:5px;padding:.1rem .4rem;font-size:.76rem;font-weight:720}.transcript-lookup-example,.transcript-lookup-missing,.transcript-dictionary-credit{color:#4b6356;font-size:.82rem}.transcript-dictionary-list{margin:.35rem 0;padding-left:1.3rem}.transcript-dictionary-sense{padding:.18rem 0;line-height:1.46}.transcript-dictionary-sense strong{margin-right:.45rem;color:#17463b;font-size:.83rem}.transcript-dictionary-more summary{cursor:pointer;color:#13503b;font-size:.86rem;font-weight:690}.transcript-dictionary-credit a{color:#17463b;text-underline-offset:.17em}

.saved-vocab-action{display:inline-flex;align-items:center;justify-content:center;gap:6px;margin-top:8px;border:1px solid #153c30;border-radius:999px;background:#153c30;color:#fff;padding:.45rem .95rem;font:inherit;font-size:.84rem;font-weight:600;cursor:pointer;transition:background .16s ease}
.saved-vocab-action:hover:not(:disabled){background:#0e2b22}
button.saved-vocab-action[hidden]{display:none}.saved-vocab-action:disabled{opacity:.6;cursor:default}
.saved-vocab-status{font-size:.82rem;color:#255543;margin:.35rem 0 0}
.saved-vocab-status:empty{display:none}

/* Home Vocabulary Workbench */
.vocab-head{padding-bottom:22px;border-bottom:1px solid rgba(20,36,30,.085)}
.vocab-title-row{display:flex;align-items:baseline;flex-wrap:wrap;gap:12px}
.vocab-head h1{margin:0;font-family:"Songti SC","STSong","Noto Serif SC","Source Han Serif SC",Georgia,serif;font-size:clamp(1.95rem,3.4vw,2.55rem);font-weight:600;line-height:1.18;color:#12231c}
.vocab-count-pill{display:inline-flex;align-items:center;padding:3px 11px;border-radius:999px;background:#e6f0e9;color:#153c30;font-size:.78rem;font-weight:680;font-variant-numeric:tabular-nums}
.vocab-subtitle{margin:10px 0 0;color:#66786f;font-size:.9rem;line-height:1.65;max-width:60ch}
.vocab-toolbar{margin:22px 0 14px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}
.vocab-filters{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.vocab-select{min-height:38px;max-width:290px;padding:6px 12px;border:1px solid rgba(20,36,30,.12);border-radius:999px;background:#fff;color:#12231c;font:inherit;font-size:.83rem;font-weight:560;cursor:pointer}
.vocab-pills,.vocab-mode-switch{display:inline-flex;align-items:center;padding:3px;border-radius:999px;background:rgba(20,36,30,.055);border:1px solid rgba(20,36,30,.065)}
.vocab-pill,.vocab-mode-btn{border:0;background:transparent;color:#4f6258;font:inherit;font-size:.8rem;font-weight:560;padding:5px 12px;border-radius:999px;min-height:30px;white-space:nowrap;transition:background .15s ease,color .15s ease,box-shadow .15s ease}
.vocab-pill:hover,.vocab-mode-btn:hover{color:#12231c}
.vocab-pill[aria-pressed=true],.vocab-mode-btn[aria-pressed=true]{background:#fff;color:#12231c;font-weight:640;box-shadow:0 1px 3px rgba(16,46,39,.12)}
.vocab-status{margin:0 0 16px;min-height:1.4em;font-size:.82rem;color:#5a6e64}
.vocab-status:empty{display:none}
.vocab-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,310px),1fr));gap:14px}
.vocab-card{display:flex;flex-direction:column;background:#fff;border:1px solid rgba(20,36,30,.085);border-radius:16px;padding:18px 20px 16px;box-shadow:0 1px 2px rgba(16,46,39,.03),0 10px 26px -18px rgba(16,46,39,.12);transition:transform .2s cubic-bezier(.22,1,.36,1),border-color .2s ease,box-shadow .2s ease}
.vocab-card:hover{transform:translateY(-2px);border-color:rgba(21,60,48,.18);box-shadow:0 14px 28px -18px rgba(16,46,39,.2)}
.vocab-card.is-masked{cursor:pointer}
.vocab-card.is-masked[data-revealed=true]{border-color:rgba(21,60,48,.26)}
.vocab-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.vocab-card-title{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px;min-width:0}
.vocab-word{margin:0;font-family:"Songti SC","STSong","Noto Serif SC",Georgia,serif;font-size:1.42rem;font-weight:650;line-height:1.25;color:#12231c}
.vocab-tag{display:inline-block;padding:1px 8px;border-radius:999px;background:#f2f3ee;color:#5b6d63;font-size:.69rem;font-weight:620}
.vocab-tag.is-lesson{background:#e6f0e9;color:#153c30}
.vocab-remove{flex:none;border:1px solid transparent;background:transparent;color:#788980;font:inherit;font-size:.75rem;font-weight:560;padding:3px 9px;border-radius:999px;transition:background .15s ease,color .15s ease,border-color .15s ease}
.vocab-remove:hover:not(:disabled){background:#faece8;color:#8e3927;border-color:#ebc7be}
.vocab-pinyin{margin:8px 0 0;color:#2e5a49;font-size:.86rem;font-weight:560}
.vocab-def{margin:6px 0 0;color:#394c42;font-size:.87rem;line-height:1.58;flex:1}
.vocab-pinyin.is-hidden,.vocab-def.is-hidden,.vocab-drawer-def.is-hidden{display:inline-block;padding:2px 10px;border-radius:8px;background:#f4f5f0;border:1px dashed rgba(20,36,30,.18);color:#6e8076;font-size:.77rem;font-weight:520;flex:0 0 auto;align-self:flex-start}
.vocab-card-foot{margin-top:16px;padding-top:11px;border-top:1px solid rgba(20,36,30,.07)}
.vocab-source-link{display:inline-flex;align-items:center;gap:4px;color:#355c4e;font-size:.77rem;font-weight:580;text-decoration:none}
.vocab-source-link:hover{color:#12231c;text-decoration:underline;text-underline-offset:3px}
.vocab-empty{grid-column:1/-1;max-width:520px;margin:24px auto;padding:34px 26px;text-align:center;border:1px dashed rgba(20,36,30,.18);border-radius:18px;background:rgba(255,255,255,.65)}
.vocab-empty h2{margin:0;font-family:"Songti SC","STSong","Noto Serif SC",Georgia,serif;font-size:1.3rem;color:#12231c}
.vocab-empty p{margin:8px 0 18px;color:#66786f;font-size:.87rem;line-height:1.65}
.vocab-empty-cta{border:1px solid #153c30;border-radius:999px;background:#153c30;color:#fff;padding:8px 20px;min-height:40px;font:inherit;font-size:.84rem;font-weight:580}
.vocab-empty-cta:hover{background:#0e2b22}
.vocab-more{display:inline-flex;align-items:center;justify-content:center;margin-top:20px;border:1px solid rgba(20,36,30,.16);border-radius:999px;background:#fff;color:#153c30;padding:8px 20px;min-height:40px;font:inherit;font-size:.84rem;font-weight:600}
.vocab-more:hover:not(:disabled){background:#f1f6f2;border-color:#153c30}
.vocab-credit{margin-top:20px;font-size:.78rem;color:#66786f}
.vocab-credit summary{cursor:pointer;font-weight:580;color:#355c4e}
.vocab-credit p{margin:6px 0 0}
.vocab-credit a{color:#153c30;text-underline-offset:3px}

/* Lesson Page Topbar Integration & Right Slide-Over Drawer */
body[data-page="lesson"] .school-tools:has(#school-signout[hidden]),body[data-page="lesson"] .school-tools:empty{display:none;margin:0;padding:0}
body[data-page="lesson"] header.top{flex-wrap:wrap;gap:10px 14px}
body[data-page="lesson"] header.top .library-link{margin-left:auto}
.lesson-top-tools{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}
.lesson-vocab-trigger{display:inline-flex;align-items:center;gap:7px;border:1px solid rgba(21,60,48,.22);border-radius:999px;background:#fffef9;color:#153c30;padding:6px 14px;min-height:36px;font:inherit;font-size:.82rem;font-weight:620;transition:background .15s ease,border-color .15s ease}
.lesson-vocab-trigger:hover{background:#edf4ef;border-color:#153c30}
.lesson-vocab-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#153c30;color:#fff;font-size:.69rem;font-weight:700;font-variant-numeric:tabular-nums}
.lesson-top-tools #school-signout{border:1px solid rgba(20,36,30,.15);border-radius:999px;background:transparent;color:#4f6258;padding:6px 13px;min-height:36px;font-size:.8rem;font-weight:560}
.lesson-top-tools #school-signout:hover{background:rgba(20,36,30,.05);color:#12231c}

dialog.saved-vocab-dialog.is-drawer{position:fixed;inset:0 0 0 auto;margin:0 0 0 auto;width:min(440px,95vw);max-width:95vw;height:100dvh;max-height:100dvh;padding:0;border:0;border-left:1px solid rgba(20,36,30,.1);border-radius:0;background:#f9f8f4;color:#12231c;box-shadow:-12px 0 40px rgba(14,34,27,.16);display:none;flex-direction:column}
dialog.saved-vocab-dialog.is-drawer[open]{display:flex}
dialog.saved-vocab-dialog.is-drawer::backdrop{background:rgba(14,34,27,.42);backdrop-filter:blur(2px)}
.vocab-drawer-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 22px;background:#fff;border-bottom:1px solid rgba(20,36,30,.085)}
.vocab-drawer-titlewrap{display:flex;align-items:baseline;gap:10px}
.vocab-drawer-head h2{margin:0;font-family:"Songti SC","STSong","Noto Serif SC",Georgia,serif;font-size:1.25rem;font-weight:650;color:#12231c}
.vocab-drawer-count{font-size:.76rem;color:#66786f;font-variant-numeric:tabular-nums}
.vocab-drawer-close{border:1px solid rgba(20,36,30,.14);border-radius:999px;background:#fff;color:#4f6258;padding:5px 13px;min-height:34px;font:inherit;font-size:.8rem;font-weight:580}
.vocab-drawer-close:hover{background:#f4f5f0;color:#12231c}
.vocab-drawer-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 22px;background:#f5f4ef;border-bottom:1px solid rgba(20,36,30,.075)}
.vocab-drawer-mask{display:inline-flex;padding:2px;border-radius:999px;background:rgba(20,36,30,.06)}
.vocab-mini-pill{border:0;border-radius:999px;background:transparent;color:#4f6258;padding:4px 10px;font:inherit;font-size:.75rem;font-weight:580}
.vocab-mini-pill[aria-pressed=true]{background:#fff;color:#12231c;font-weight:640;box-shadow:0 1px 2px rgba(16,46,39,.12)}
.vocab-drawer-hub{font-size:.76rem;font-weight:600;color:#153c30;text-decoration:none}
.vocab-drawer-hub:hover{text-decoration:underline;text-underline-offset:3px}
.vocab-drawer-body{flex:1;overflow-y:auto;padding:16px 22px 28px}
.vocab-drawer-list{margin:0;padding:0;list-style:none;display:grid;gap:10px}
.vocab-drawer-item{background:#fff;border:1px solid rgba(20,36,30,.085);border-radius:13px;padding:14px 16px;box-shadow:0 1px 3px rgba(16,46,39,.04)}
.vocab-drawer-item.is-masked{cursor:pointer}
.vocab-drawer-item-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.vocab-drawer-wordwrap{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px}
.vocab-drawer-word{font-family:"Songti SC","STSong","Noto Serif SC",Georgia,serif;font-size:1.18rem;color:#12231c}
.vocab-drawer-pinyin{font-size:.82rem;color:#2e5a49}
.vocab-drawer-def{margin:6px 0 0;font-size:.86rem;color:#394c42;line-height:1.52}
.vocab-drawer-meta{margin:8px 0 0;font-size:.74rem;color:#687a71}

@media(max-width:600px){.vocab-toolbar{flex-direction:column;align-items:stretch}.vocab-select{max-width:none;width:100%}}