.library-panel,
.updates-panel {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 42px 28px 64px;
}

.library-page-heading { margin-bottom: 28px; }
.library-page-heading h2 { display: block; color: #203a31; font-size: clamp(26px, 3.4vw, 34px); font-weight: 720; letter-spacing: -.035em; }
.library-page-heading p:not(.section-kicker) { margin: 12px 0 0; color: #718078; font-size: 14px; line-height: 1.7; }
.library-page-heading .section-kicker,
.library-picker-heading .section-kicker { margin: 0 0 10px; color: #6e8878; font-size: 11px; font-weight: 650; letter-spacing: .1em; }
.library-feedback { padding: 13px 16px; margin: 0 0 18px; border: 1px solid #dce5d8; border-radius: 12px; background: #f1f5eb; color: #52673a; line-height: 1.7; }

.library-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 430px;
  padding: 48px 24px;
  border: 1px solid #e2e8dd;
  border-radius: 24px;
  background: #fffefb;
  text-align: center;
}
.library-empty h3 { margin: 30px 0 12px; color: #263e32; font-size: 23px; font-weight: 680; text-transform: none; }
.library-empty p { max-width: 360px; margin: 0 0 26px; color: #7c877f; line-height: 1.85; }
.library-empty .button { min-height: 44px; padding-inline: 28px; border-radius: 12px; }
.library-empty-art { position: relative; width: 110px; height: 112px; }
.library-empty-art > span { position: absolute; display: grid; place-items: center; width: 76px; height: 102px; left: 17px; top: 5px; border-radius: 4px 9px 9px 4px; border-left: 5px solid #0000000a; }
.library-empty-art > span:first-child { transform: rotate(-15deg) translateX(-13px); background: #e6d7bd; }
.library-empty-art > span:nth-child(2) { transform: rotate(12deg) translateX(13px); background: #c4d5c1; }
.library-empty-art > span:last-child { background: #376552; color: #eaf0dc; box-shadow: 0 10px 20px #284b3714; }
.library-empty-art svg { width: 44px; height: 44px; }

.library-workspace {
  position: static;
  min-width: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}
.library-current { display: flex; align-items: center; gap: 32px; padding: 30px 34px; border: 1px solid #e1e7dc; border-radius: 22px; background: #fffefb; }
.library-current-copy { min-width: 0; }
.library-current-label { display: inline-block; margin-bottom: 12px; padding: 5px 10px; border-radius: 6px; background: #edf3e7; color: #628052; font-size: 11px; font-weight: 650; letter-spacing: .04em; }
.library-current-copy h3 { margin: 0 0 12px; color: #223b2f; font-size: clamp(22px, 3vw, 29px); line-height: 1.4; font-weight: 690; text-transform: none; overflow-wrap: anywhere; }
.library-current-copy p { margin-bottom: 0; color: #7a877e; font-size: 13px; line-height: 1.65; }
.library-current-copy .library-reading-position { margin-top: 15px; color: #47654e; }
.library-current-copy .button { min-height: 38px; margin-top: 20px; padding: 0 18px; border-radius: 9px; }
.library-cover { --cover-bg: #386351; --cover-ink: #f3f1d9; position: relative; display: flex; flex: 0 0 auto; flex-direction: column; overflow: hidden; border-radius: 4px 10px 10px 4px; border-left: 7px solid #00000012; background: var(--cover-bg); color: var(--cover-ink); box-shadow: 1px 2px 0 #ffffffaa inset, 0 7px 16px #31453413; }
.library-cover::after { position: absolute; content: ""; width: 120px; height: 120px; right: -52px; bottom: -56px; border: 1px solid #ffffff24; border-radius: 50%; box-shadow: 0 0 0 15px #ffffff0b, 0 0 0 30px #ffffff08; }
.library-cover-large { width: 146px; min-height: 198px; padding: 18px 16px 15px; }
.library-cover-label { margin-bottom: 15px; font-size: 8px; font-weight: 700; letter-spacing: .18em; opacity: .75; }
.library-cover-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font-size: 16px; font-weight: 650; line-height: 1.45; }
.library-cover-large svg { width: 32px; height: 32px; margin: 12px 0 20px; opacity: .85; }
.library-cover-footer { margin-top: auto; font-size: 7px; letter-spacing: .06em; opacity: .7; }
.library-cover-blue { --cover-bg: #4b6574; --cover-ink: #f1efdd; }
.library-cover-sand { --cover-bg: #c7ae7d; --cover-ink: #453e30; }
.library-cover-rose { --cover-bg: #a97d70; --cover-ink: #fff0dc; }

.library-lessons { margin-top: 32px; padding: 28px 30px; border: 1px solid #e1e7dc; border-radius: 22px; background: #fffefb; }
.library-lessons-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.library-lessons-heading h3 { color: #2a4034; font-size: 17px; font-weight: 680; text-transform: none; }
.library-lessons-heading p { margin: 0; color: #8b948c; font-size: 12px; line-height: 1.6; }
.library-lessons .book-word-filter-grid { grid-template-columns: minmax(160px, .8fr) minmax(190px, 1.2fr) auto; gap: 12px; margin-bottom: 26px; }
.library-lessons .field > span,
.library-picker-content .field > span { color: #7a887c; font-size: 11px; font-weight: 550; text-transform: none; }
.library-lessons input,
.library-lessons select,
.library-picker-content input,
.library-picker-content select { min-height: 44px; height: 44px; border: 1px solid #dfe6d9; border-radius: 10px; background: #fafbf7; color: #2e4335; font-size: 13px; }
.library-lessons input::placeholder,
.library-picker-content input::placeholder { color: #99a295; }
.library-lessons input:focus,
.library-lessons select:focus,
.library-picker-content input:focus,
.library-picker-content select:focus { border-color: #759781; box-shadow: 0 0 0 3px #77968115; }
.library-lessons .book-word-filter-grid .button,
.library-picker-content .library-book-search-grid .button { min-height: 44px; padding-inline: 21px; border-radius: 10px; }
.library-unit-navigation { display: flex; align-items: center; gap: 8px; margin: -10px 0 24px; padding: 9px 0; border-bottom: 1px solid #edf0e5; }
.library-unit-position { margin-right: auto; color: #899680; font-size: 11px; }
.library-unit-navigation .button { min-height: 32px; padding: 0 11px; border-radius: 8px; color: #6c855b; font-size: 11px; font-weight: 550; }
.library-unit-navigation .button:hover:not(:disabled) { background: #f0f5e8; }
.library-unit-navigation .button:disabled { opacity: .35; }
.library-lessons-heading { scroll-margin-top: 24px; }
.library-lessons .book-word-results { display: block; max-height: none; margin-top: 0; padding-right: 0; overflow: visible; }
.library-word-list-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 0 6px; color: #8a958a; font-size: 11px; line-height: 1.6; }
.library-word-list { display: grid; }
.library-word-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 140px) 20px; align-items: center; gap: 14px; width: 100%; min-height: 77px; margin: 0; padding: 16px 9px; border: 0; border-top: 1px solid #edf0e8; background: transparent; color: #263c2f; text-align: left; cursor: pointer; }
.library-word-row:hover { border-radius: 10px; background: #f4f7ee; }
.library-word-row:focus-visible { position: relative; outline: 2px solid #789783; outline-offset: 1px; border-radius: 8px; }
.library-word-row .library-word-number { color: #a4ada0; font-size: 11px; font-variant-numeric: tabular-nums; }
.library-word-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.library-word-row .library-word-main strong { color: #304b37; font-size: 17px; font-weight: 630; line-height: 1.4; overflow-wrap: anywhere; }
.library-word-row .library-word-main > span { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: #7d887d; font-size: 12px; line-height: 1.65; }
.library-word-row .library-word-unit { color: #969f92; font-size: 11px; text-align: right; line-height: 1.6; }
.library-word-row .library-word-arrow { color: #8a9b86; font-size: 17px; text-align: right; }
.library-load-more { display: block; min-height: 40px; margin: 24px auto 0; border-radius: 9px; padding-inline: 24px; font-size: 12px; }
.library-inline-state { display: flex; align-items: center; flex-direction: column; gap: 10px; padding: 38px 20px; color: #778573; text-align: center; }
.library-inline-state p { margin: 0; color: #5c6f55; font-size: 14px; }
.library-inline-state span { font-size: 12px; line-height: 1.7; }
.library-inline-state .button { margin-top: 7px; border-radius: 9px; }
.library-loading { margin: 0; padding: 35px 16px; color: #7d8d77; font-size: 13px; text-align: center; }
.library-loading::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 9px; border: 2px solid #dfe8d6; border-top-color: #607b53; border-radius: 50%; vertical-align: -2px; animation: library-spin .8s linear infinite; }
@keyframes library-spin { to { transform: rotate(360deg); } }

body.library-picker-open { overflow: hidden; }
.book-picker { width: min(930px, calc(100vw - 40px)); max-width: none; max-height: min(88vh, 900px); margin: auto; padding: 0; overflow: auto; border: 1px solid #dfe5d8; border-radius: 24px; background: #fcfdf8; color: #2b4033; box-shadow: 0 30px 90px #21382833; }
.book-picker::backdrop { background: #1c332652; backdrop-filter: blur(4px); }
.library-picker-heading { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 27px 30px 23px; border-bottom: 1px solid #e7ebdf; background: #fcfdf8f5; backdrop-filter: blur(12px); }
.library-picker-heading h2 { display: block; color: #2b4233; font-size: 24px; letter-spacing: -.02em; font-weight: 690; }
.library-picker-heading p:not(.section-kicker) { margin: 9px 0 0; color: #8a9483; font-size: 12px; }
.library-picker-close { display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; padding: 7px; border: 1px solid #e1e7d9; border-radius: 50%; background: #f4f7ed; color: #778871; cursor: pointer; }
.library-picker-close svg { width: 19px; height: 19px; }
.library-picker-close:hover { background: #eaf0e1; color: #3a5d3e; }
.library-picker-content { padding: 24px 30px 30px; }
.library-book-search-grid { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-bottom: 22px; }
.library-picker-content .book-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; }
.library-picker-content .book-tab { min-height: 32px; padding: 0 13px; border: 1px solid #e3e8db; border-radius: 8px; background: #f7f9f1; color: #809075; font-size: 12px; }
.library-picker-content .book-tab:hover { color: #36573c; background: #eef3e5; border-color: #bdcdb1; }
.library-picker-content .book-tab.active { border-color: #b6c9a9; background: #e7efdf; color: #45643b; font-weight: 650; }
.library-more-filters { margin: 0 0 23px; padding-bottom: 13px; border-bottom: 1px solid #e8ecdf; }
.library-more-filters summary { width: fit-content; padding: 4px 0; color: #8b9980; font-size: 11px; cursor: pointer; }
.library-more-filters .book-filter-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 14px; margin: 14px 0 0; }
.library-more-filters .inline-check { align-self: end; min-height: 44px; color: #7e8c73; font-size: 11px; }
.library-more-filters .inline-check input { width: 14px; height: 14px; min-height: 0; accent-color: #567d48; }
.library-picker-content .book-results { display: block; max-height: none; margin: 0; padding: 0; overflow: visible; }
.library-picker-content .book-result-count { margin: 0 0 14px; color: #929d88; font-size: 11px; }
.library-book-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.library-book-option { display: flex; align-items: center; gap: 17px; min-width: 0; padding: 17px; border: 1px solid #e5e9df; border-radius: 15px; background: #fffefb; color: #32472f; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.library-book-option:hover { border-color: #b1c1a4; background: #f8faf2; }
.library-book-option:focus-visible { outline: 2px solid #7f9c6c; outline-offset: 2px; }
.library-book-option.selected { border-color: #acc69b; background: #f4f8ec; }
.library-cover-small { width: 66px; min-height: 94px; padding: 10px 9px 10px 7px; border-left-width: 4px; border-radius: 3px 6px 6px 3px; }
.library-cover-small > span { margin-bottom: 8px; font-size: 5px; letter-spacing: .12em; opacity: .75; }
.library-cover-small > strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font-size: 10px; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.library-cover-small > i { width: 16px; height: 1px; margin-top: auto; padding-top: 7px; border-bottom: 1px solid currentColor; opacity: .5; }
.library-book-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.library-book-info > strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: #3b5135; font-size: 14px; font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; }
.library-book-info > span:not(.library-book-action) { color: #8a987e; font-size: 11px; line-height: 1.5; }
.library-book-info > small { color: #9aa48f; font-size: 10px; line-height: 1.5; }
.library-book-info > .library-book-action { margin-top: 3px; color: #688157; font-size: 11px; font-weight: 600; }
.library-book-info > .library-book-action > span { font-size: 13px; }

.library-panel .button.secondary,
.book-picker .button.secondary { border: 1px solid #dce4d4; background: #f7faf1; color: #5c7651; }
.library-panel .button.primary,
.book-picker .button.primary { border: 1px solid #245746; background: #245746; color: #fffef7; }
.updates-panel .vocab-update-card { margin: 0; }

@media (max-width: 720px) {
  .library-panel, .updates-panel { padding: 30px 18px 44px; }
  .library-page-heading { margin-bottom: 22px; }
  .library-current { gap: 22px; padding: 25px; }
  .library-cover-large { width: 116px; min-height: 166px; padding: 15px 12px; }
  .library-cover-title { font-size: 13px; }
  .library-cover-large svg { width: 27px; height: 27px; margin: 10px 0 13px; }
  .library-current-copy h3 { font-size: 21px; }
  .library-lessons { padding: 23px 20px; }
  .library-lessons-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .library-lessons .book-word-filter-grid { grid-template-columns: minmax(0, 1fr) auto; gap: 12px 8px; }
  .library-lessons .book-word-filter-grid > label:first-child { grid-column: 1 / -1; }
  .library-word-row { grid-template-columns: 24px minmax(0, 1fr) 18px; gap: 10px; padding: 15px 3px; }
  .library-word-row .library-word-unit { display: none; }
  .library-word-row .library-word-main strong { font-size: 16px; }
  .library-word-list-heading { font-size: 10px; }
  .book-picker { width: calc(100vw - 24px); max-height: 91vh; border-radius: 20px; }
  .library-picker-heading { padding: 23px 22px 20px; }
  .library-picker-content { padding: 20px 22px 25px; }
  .library-book-grid { grid-template-columns: 1fr; gap: 10px; }
  .library-book-option { gap: 17px; padding: 15px; }
  .library-cover-small { width: 62px; min-height: 84px; }
  .library-more-filters .book-filter-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .library-more-filters .inline-check { grid-column: 1 / -1; min-height: 24px; }
}

@media (max-width: 440px) {
  .library-current { align-items: flex-start; gap: 18px; padding: 21px 18px; }
  .library-cover-large { width: 92px; min-height: 138px; padding: 12px 9px; border-left-width: 5px; }
  .library-cover-large .library-cover-label { margin-bottom: 10px; font-size: 6px; }
  .library-cover-title { font-size: 11px; }
  .library-cover-large svg { width: 22px; height: 22px; margin: 8px 0 0; }
  .library-cover-footer { display: none; }
  .library-current-copy h3 { margin-bottom: 8px; font-size: 18px; }
  .library-current-label { margin-bottom: 8px; font-size: 10px; }
  .library-current-copy p { font-size: 11px; }
  .library-current-copy .library-reading-position { margin-top: 10px; }
  .library-current-copy .button { margin-top: 13px; min-height: 33px; padding-inline: 13px; font-size: 11px; }
  .library-lessons { padding: 22px 16px; }
  .library-empty { min-height: 390px; padding: 35px 22px; }
  .library-empty h3 { font-size: 20px; }
  .library-empty p { font-size: 12px; }
  .library-picker-heading { padding: 22px 18px 18px; }
  .library-picker-content { padding: 18px; }
  .library-picker-content .book-tab { min-height: 30px; padding-inline: 10px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .library-loading::before { animation: none; }
  .library-book-option { transition: none; }
}
