.library-view-row{display:flex;align-items:stretch;gap:8px;flex-shrink:0;min-width:0}
.library-view-row .library-view-switch{flex:1;min-width:0}
.vocabulary-entry{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:44px;padding:7px 10px;border:1px solid #cde6f4;border-radius:22px;background:#fff;color:#236a99;font-size:12px;white-space:nowrap}
.vocabulary-entry span{display:inline-grid;place-items:center;min-width:20px;min-height:20px;padding:1px 4px;border-radius:12px;background:#edf8fe;font-size:11px}
.vocabulary-gallery .gallery-instruction{align-items:center;gap:8px;flex-wrap:wrap}
.word-settings-trigger{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-width:72px;min-height:44px;padding:7px 11px;border:1px solid #d6e8f4;border-radius:13px;background:#fff;color:#337fae;font-size:13px}
.word-settings-trigger>span{font-size:18px}
.vocabulary-gallery .gallery-card{display:flex;flex-direction:column}
.vocabulary-gallery .gallery-word-audio{display:block;min-width:0;max-width:100%}
.vocabulary-gallery .gallery-word-audio strong{font-size:clamp(18px,1.8vw,22px);line-height:1.55;margin:10px 0 7px;overflow-wrap:anywhere}
.vocabulary-gallery .ph-demo{display:block;max-width:100%}
.vocabulary-gallery .ph-demo-lexeme{min-width:0;max-width:100%;flex-wrap:wrap;column-gap:10px;row-gap:8px}
.vocabulary-gallery .ph-demo[data-ph-display=phonics] .ph-demo-chunk,.vocabulary-gallery .ph-demo[data-ph-display=phonics] .ph-demo-split{gap:3px}
.vocabulary-gallery .gallery-word-translation{margin:2px 0 8px;font-size:13px;line-height:1.6;overflow-wrap:anywhere}
.vocabulary-gallery.is-simple .gallery-card{position:relative;display:grid;grid-template-columns:minmax(0,1fr);align-content:start}
.vocabulary-gallery.is-simple .gallery-word-row{display:flex;align-items:center;justify-content:center;min-width:0;min-height:44px;margin-top:6px;text-align:center;font-size:clamp(17px,1.5vw,20px);line-height:1.3;color:var(--ink);overflow-wrap:anywhere}
.vocabulary-gallery.is-simple .gallery-word-audio{display:block;min-width:0;max-width:100%;padding:0;border:0;background:transparent;color:var(--ink);text-align:center}
.vocabulary-gallery.is-simple .gallery-word-audio:after{content:"";position:absolute;inset:0}
.vocabulary-gallery.is-simple .gallery-word-row strong{display:block;flex:0 1 auto;min-width:0;max-width:calc(100% - 44px);margin:0;padding:0;font-size:inherit;line-height:inherit}
.vocabulary-gallery.is-simple .gallery-word-row>.vocabulary-add{position:relative;z-index:1;flex:0 0 44px;width:44px;min-height:44px;margin:0;padding:0;border:0;background:transparent;color:#2885c8}
.vocabulary-gallery.is-simple .vocabulary-add-symbol{font-size:20px}
.vocabulary-gallery.is-simple .vocabulary-add.is-added .vocabulary-add-symbol{font-size:17px;color:#2d8269}
.vocabulary-gallery.is-simple .gallery-word-translation{display:flex;align-items:center;justify-content:center;min-height:44px;margin:0;padding:0 3px;font-size:13px;line-height:1.5;box-sizing:border-box}
.vocabulary-gallery .gallery-card-footer{display:flex;align-items:center;justify-content:space-between;gap:4px 6px;flex-wrap:wrap;min-height:44px;margin-top:auto;padding-top:4px}
.vocabulary-gallery .gallery-card-actions{display:flex;align-items:center;justify-content:flex-end;gap:3px;flex-wrap:wrap;margin-left:auto;min-width:0}
.vocabulary-gallery .gallery-card-actions>button{min-height:44px;min-width:44px;padding:6px;font-size:12px}
.vocabulary-add{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-width:44px;min-height:44px;padding:7px 10px;border:1px solid #d8eaf5;border-radius:12px;background:#f2f9ff;color:#2c7cae;font-size:13px;line-height:1.3}
.vocabulary-gallery .gallery-card-actions>.vocabulary-add{padding:6px;border:1px solid #d8eaf5;background:#f2f9ff}
.vocabulary-add-symbol{font-size:24px;line-height:1;flex-shrink:0}
.vocabulary-add.is-added{background:#edf8f5;border-color:#cee9df;color:#2d8269}
.vocabulary-gallery .gallery-card-actions>.vocabulary-add.is-added{background:#edf8f5;border-color:#cee9df;color:#2d8269}
.vocabulary-add.is-added .vocabulary-add-symbol{font-size:17px}
.gallery-example{display:flex!important;align-items:flex-start!important;justify-content:flex-start!important;width:100%;min-height:44px;padding-top:10px;margin-top:7px;border-top:1px solid #e8f1f6;border-radius:0;min-width:0;text-align:left}
.gallery-example-content{min-width:0;flex:1}
.vocabulary-gallery .gallery-example-english,.vocabulary-gallery .gallery-example-chinese{display:block;margin:0 0 5px;text-align:left;font-size:12px;line-height:1.65;overflow-wrap:anywhere}
.gallery-example-english{color:#285a7c}
.gallery-example-chinese{color:#7791a4}
.vocabulary-detail-tools{align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.vocabulary-detail-tools .vocabulary-add,.vocabulary-detail-tools .word-settings-trigger{min-height:44px}
.ph-ipa{white-space:normal;overflow-wrap:anywhere}
.ph-ipa-speaking{background:#fff0cf;border-radius:3px;color:inherit}
.word-display-settings{width:min(460px,calc(100% - 24px));max-height:calc(100dvh - 32px);padding:20px;margin:auto;border:1px solid #d6eaf5;border-radius:24px;background:#f5fcff;color:#215678;overflow-y:auto;box-sizing:border-box}
.word-display-settings::backdrop{background:#153d6680}
.word-settings-heading{display:flex;justify-content:space-between;align-items:center;gap:10px}
.word-settings-heading h2{font-size:19px;margin:0}
.word-settings-heading>button{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:white;font-size:25px;color:#387ca5}
.word-settings-scope{margin:3px 0 13px;color:#6a8ba0;font-size:12px}
.word-setting-row{display:flex;justify-content:space-between;align-items:center;gap:14px;min-height:76px;padding:12px 3px;border-top:1px solid #dcecf6;cursor:pointer}
.word-setting-row>span{display:grid;gap:6px;min-width:0}
.word-setting-row b{font-size:15px;font-weight:650}
.word-setting-row small{font-size:11px;line-height:1.6;color:#7292a5}
.word-setting-row input{appearance:none;-webkit-appearance:none;position:relative;flex:0 0 42px;width:42px;height:24px;padding:0;margin:0;border:0;border-radius:20px;background:#d5e5ee;cursor:pointer}
.word-setting-row input:after{content:"";position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;background:white;box-shadow:0 1px 3px #264f7126}
.word-setting-row input:checked{background:#2689e8}
.word-setting-row input:checked:after{transform:translateX(18px)}
.word-settings-note{margin:8px 0 18px;font-size:11px;line-height:1.7;color:#6d8ca1}
.word-settings-done{width:100%;min-height:44px}
body[data-page=vocabulary] .shell{height:auto;min-height:100dvh;overflow:visible;padding-bottom:calc(90px + env(safe-area-inset-bottom))}
.vocabulary-screen{max-width:760px;margin:0 auto}
.vocabulary-screen .vocabulary-gallery{margin-top:12px}
.vocabulary-screen .vocabulary-page-note{margin:7px 0 12px;font-size:12px;color:#7190a5}
.vocabulary-source{flex:1 0 100%;font-size:10px;line-height:1.5;overflow-wrap:anywhere}
.vocabulary-empty{text-align:center;padding:28px 18px}
.vocabulary-empty>span{display:inline-grid;place-items:center;width:58px;height:58px;margin-bottom:10px;border-radius:18px;background:#eaf6ff;color:#318ad0;font-size:35px}
.vocabulary-empty h2{margin:5px 0 10px;font-size:19px}
.vocabulary-empty p{font-size:13px;line-height:1.8;color:#7290a4}
.vocabulary-empty .primary{min-height:44px}
@media(max-width:360px){.library-view-row{gap:5px}.library-view-row .library-view-switch>button{padding-inline:7px;font-size:12px}.vocabulary-entry{padding-inline:8px;font-size:11px}.vocabulary-gallery .gallery-word-audio strong{font-size:17px}.vocabulary-gallery .ph-demo-lexeme{column-gap:8px}.vocabulary-gallery .gallery-card-actions>button{font-size:11px}.word-display-settings{padding:16px}}

.vocabulary-entry-icon{width:22px;height:22px;flex-shrink:0}
.vocabulary-entry{min-width:44px}

/* Unit overview reuses the learning playback settings. */
.library-workspace.gallery-mode > .gallery-instruction{flex-wrap:wrap;align-items:center;gap:8px}
.library-workspace.gallery-mode > .gallery-instruction > span{flex:1 1 240px}
#galleryPlaybackStatus{flex:1 0 100%;margin:0;min-height:18px;overflow-wrap:anywhere}
.gallery-word-audio{touch-action:manipulation}

.gallery-settings-actions > button{min-height:44px}

/* Keep unit navigation and the two overview controls on one row. */
.library-unit-row{display:flex;align-items:center;gap:8px;flex:1 1 0;min-width:0}
.with-gallery-controls .library-unit-tabs{display:flex;gap:4px;max-width:none;min-width:44px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;touch-action:pan-x}
.with-gallery-controls .library-unit-tabs button{flex:0 0 auto;min-width:44px;min-height:44px;padding-inline:8px}
.gallery-inline-controls{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.gallery-inline-controls .playback-settings-trigger{white-space:nowrap;min-height:44px;font-size:12px;gap:5px;padding-inline:8px}
.gallery-inline-controls .playback-settings-trigger svg{width:18px;height:18px}
.gallery-play-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;padding:10px;border:1px solid #d6e8f4;border-radius:13px;background:white;color:#337fae}
.gallery-play-toggle svg{width:22px;height:22px}
.gallery-play-toggle[data-playing="true"] .gallery-play-icon,.gallery-play-toggle[data-playing="false"] .gallery-pause-icon{display:none}
@media(max-width:600px){
 .library-course-selectors.with-gallery-controls{flex-wrap:wrap}
 .with-gallery-controls .library-textbook-selector{flex-basis:100%}
 .with-gallery-controls .library-unit-row{flex-basis:100%;gap:6px}
}

.with-gallery-controls .library-unit-tabs::-webkit-scrollbar{display:none}

/* The library starts directly with its map/overview switch, without a brand strip. */
body[data-page="library"] #oceanHeader,
body[data-page="library"] #qaStorageNotice{display:none}
