
.l3 { background: #f4ecdc; }
.l3 .a3-bar { background: linear-gradient(180deg, rgba(48, 34, 20, .55), rgba(48, 34, 20, 0)); }
.l3 .l3-door { border-color: rgba(127, 174, 60, .8); }
.l3-fade { position: absolute; inset: 0; z-index: 6; background: #f4ecdc; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.l3-fade.on { opacity: 1; }
.l3-layer { display: none; } 
.lib {
  position: fixed; inset: 0; z-index: 95; display: flex; justify-content: center; align-items: stretch;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: rgba(30, 24, 16, .32); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  word-break: keep-all; overflow-wrap: anywhere;
}
.lib-rd { z-index: 100; background: rgba(30, 24, 16, .42); }
.lib-box {
  width: min(880px, 100%); max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch;
  border-radius: 18px; border: 1px solid rgba(201, 162, 74, .7);
  background: linear-gradient(180deg, #fffdf6 0%, #f8f2e2 100%); color: #2a2418;
  box-shadow: 0 14px 44px rgba(30, 20, 10, .32); font-family: var(--hn-sans, sans-serif);
}
.lib-paper { width: min(760px, 100%); }
.lib-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: linear-gradient(180deg, #2f2416, #241b10); border-bottom: 1px solid rgba(201, 162, 74, .7); border-radius: 18px 18px 0 0;
}
.lib-title { flex: 1; min-width: 0; margin: 0; text-align: center; font: 700 17px/1.25 var(--hn-serif, serif); letter-spacing: .08em; color: #f6e7b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-place { min-width: 0; color: #d8c79a; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-head .lib-place:empty { display: none; }
.lib-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 14px 4px; }
.lib-tab {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px; white-space: nowrap;
  border: 1px solid #d9c9a0; background: linear-gradient(180deg, #fffaf0, #f3ead4); color: #4a3d26; font: 700 14.5px/1 var(--hn-sans, sans-serif);
}
.lib-tab small { font: 600 12px/1 var(--hn-sans, sans-serif); color: #8a7650; }
.lib-tab.on { border-color: var(--accent, #7fae3c); background: linear-gradient(180deg, #f3f9e8, #e3efcd); color: #2f4a17; box-shadow: inset 0 0 0 1px var(--accent, #7fae3c); }
.lib-tools { display: flex; gap: 8px; padding: 8px 14px 4px; }
.lib-tools input, .lib-tools select {
  min-height: 42px; border-radius: 12px; border: 1px solid #d9c9a0; background: #fffdf8; color: #2a2418; font: 500 15px var(--hn-sans, sans-serif); padding: 0 12px;
}
.lib-tools input { flex: 1; min-width: 0; }
.lib-tools input:focus, .lib-tools select:focus { outline: 2px solid rgba(127, 174, 60, .55); outline-offset: 1px; }
.lib-groups { display: flex; gap: 6px; overflow-x: auto; padding: 6px 14px 2px; scrollbar-width: thin; }
.lib-groups:empty { display: none; }
.lib-chip { flex: none; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid #e2d6b8; background: #fffaf0; color: #5a4a2c; font: 600 13px/1 var(--hn-sans, sans-serif); white-space: nowrap; }
.lib-chip small { color: #9a8760; font-weight: 500; }
.lib-chip.on { border-color: #b89545; background: #f6ebcc; color: #3e3018; }
.lib-desc { margin: 6px 14px 4px; color: #7a6a4a; font-size: 13px; line-height: 1.5; }
.lib-list { display: grid; gap: 0; padding: 4px 8px 6px; }
.lib-row { display: grid; gap: 3px; padding: 12px 10px; border-bottom: 1px solid #eee3c8; color: inherit; text-decoration: none; border-radius: 10px; }
.lib-row:hover, .lib-row:focus-visible { background: linear-gradient(90deg, rgba(201, 162, 74, .12), rgba(201, 162, 74, 0)); outline: none; }
.lib-row b { font: 600 15.5px/1.45 var(--hn-sans, sans-serif); color: #2a2418; }
.lib-row small { font-size: 12.5px; color: #8a7a58; }
.lib-row.dim b { color: #5a5040; font-weight: 500; }
.lib-list.grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 8px 14px; }
.lib-tile { position: relative; display: grid; gap: 4px; color: inherit; text-decoration: none; }
.lib-tile img, .lib-tile video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #e8dfc8; display: block; }
.lib-tile small { font-size: 12px; line-height: 1.35; color: #6a5a3a; }
.lib-vid { position: absolute; left: 6px; top: 6px; z-index: 1; padding: 2px 8px; border-radius: 999px; background: rgba(30, 24, 16, .7); color: #fff3d0; font-size: 11px; }
.lib-wait { padding: 26px 10px; text-align: center; color: #8a7a58; }
.lib-more { display: block; margin: 8px auto 4px; background: linear-gradient(180deg, #3a2c1a, #241b10); }
.lib-foot { margin: 6px 14px 14px; text-align: center; color: #9a8a68; font-size: 12px; }

.lib-doc { padding: 18px 22px 26px; font-size: 16px; line-height: 1.75; }
.lib-doc h1 { margin: 0 0 6px; font: 700 21px/1.4 var(--hn-serif, serif); color: #2a2010; letter-spacing: .01em; }
.lib-doc h2 { margin: 22px 0 8px; padding-left: 10px; border-left: 3px solid #c9a24a; font: 700 17.5px/1.45 var(--hn-serif, serif); color: #3a2c14; }
.lib-doc h3, .lib-doc h4 { margin: 16px 0 6px; font: 700 16px/1.45 var(--hn-sans, sans-serif); color: #4a3a1c; }
.lib-doc p { margin: 8px 0; }
.lib-doc ul, .lib-doc ol { margin: 8px 0; padding-left: 22px; }
.lib-doc li { margin: 4px 0; }
.lib-doc blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid #d9c9a0; background: #fbf5e4; color: #5a4a2c; border-radius: 0 10px 10px 0; }
.lib-doc a { color: #4f7a1f; }
.lib-meta { margin: 0 0 14px !important; color: #8a7a58; font-size: 13.5px; }
.lib-sum { padding: 12px 14px; border-radius: 12px; background: #fbf5e4; border: 1px solid #eee3c8; }
.lib-soft { color: #8a7a58; }
.lib-src { margin-top: 18px !important; color: #9a8a68; font-size: 12.5px; }
.lib-out { display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; margin-top: 6px; text-decoration: none; }
.lib-media { display: block; width: 100%; max-height: 72vh; object-fit: contain; border-radius: 12px; background: #1e1810; }

.lib-cn { z-index: 96; }

.lib-lk { z-index: 97; align-items: center; }
.lib-lkbox { width: min(420px, 100%); }
.lib-lkin { display: grid; gap: 12px; justify-items: center; padding: 18px 20px 22px; text-align: center; }
.lib-lkin .lib-desc { margin: 0; }
.lib-padlock { position: relative; width: 54px; height: 44px; margin-top: 18px; border-radius: 10px; background: linear-gradient(180deg, #e2c27a, #b88c32); box-shadow: 0 3px 10px rgba(80, 60, 20, .3); }
.lib-padlock::before { content: ''; position: absolute; left: 11px; top: -22px; width: 32px; height: 30px; border: 6px solid #9a7a3a; border-bottom: 0; border-radius: 18px 18px 0 0; box-sizing: border-box; }
.lib-padlock::after { content: ''; position: absolute; left: 50%; top: 14px; width: 8px; height: 14px; margin-left: -4px; border-radius: 4px; background: #5a4220; }
.lib-pw { display: grid; gap: 6px; width: 100%; text-align: left; font-size: 13px; color: #6a5a3a; }
.lib-pw input { min-height: 46px; border-radius: 12px; border: 1px solid #d9c9a0; background: #fffdf8; font: 500 16px var(--hn-sans, sans-serif); padding: 0 12px; color: #2a2418; }
.lib-pw input:focus { outline: 2px solid rgba(127, 174, 60, .55); outline-offset: 1px; }
.lib-lkgo { min-height: 46px; padding: 0 30px; }
.lib-lkgo:disabled, .lib-pw input:disabled { opacity: .5; }
.lib-lkmsg { min-height: 1.3em; margin: 0; font-size: 13.5px; color: #4f7a1f; }
.lib-lkmsg.bad { color: #a8452f; }
.lib-chip.lock, .lib-tab.lock { border-color: #b89545; background: linear-gradient(180deg, #3a2c1a, #241b10); color: #f2dc9e; }
.lib-tab.lock small { color: #d8c79a; }
.lib-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 6px 14px 4px; }
.lib-card {
  position: relative; display: grid; gap: 4px; text-align: left; padding: 16px 16px 14px 56px; min-height: 92px; border-radius: 14px; cursor: pointer;
  border: 1px solid #e2d6b8; background: linear-gradient(180deg, #fffdf6, #f6efdc); color: #2a2418; font-family: var(--hn-sans, sans-serif);
}
.lib-card:hover, .lib-card:focus-visible { border-color: #c9a24a; outline: none; }
.lib-card .n { position: absolute; left: 14px; top: 16px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #2f5a3a; color: #fff3d0; font: 700 15px/1 var(--hn-serif, serif); }
.lib-card b { font: 700 16.5px/1.3 var(--hn-serif, serif); }
.lib-card small { color: #7a6a4a; font-size: 13px; line-height: 1.45; }
.lib-card i { justify-self: start; margin-top: 4px; padding: 2px 10px; border-radius: 999px; background: #f1e6c4; color: #6a5420; font: 600 11.5px/1.5 var(--hn-sans, sans-serif); font-style: normal; }
@media (max-width: 560px) {
  .lib { padding: 0; }
  .lib-box { border-radius: 0; border-left: 0; border-right: 0; }
  .lib-head { border-radius: 0; padding: 8px 10px; }
  .lib-tabs { gap: 6px; padding: 10px 10px 2px; }
  .lib-tab { min-height: 38px; padding: 0 12px; font-size: 13.5px; }
  .lib-tools { padding: 8px 10px 2px; }
  .lib-doc { padding: 14px 16px 22px; font-size: 15.5px; }
  .lib-list.grid { grid-template-columns: repeat(2, 1fr); padding: 8px 10px; }
}

.lib-row.cmrow { grid-template-columns: 64px 1fr; gap: 14px; align-items: center; }
.lib-row.cmrow > span { display: grid; gap: 3px; min-width: 0; }
.cm-cover { width: 64px; height: auto; border-radius: 6px; border: 1px solid #e2d6b8; background: #e8dfc8; display: block; }
.lib-rd.cm-mode .lib-box { height: 100%; display: flex; flex-direction: column; overflow: hidden; width: min(980px, 100%); }
.lib-rd.cm-mode .lib-doc { flex: 1; min-height: 0; padding: 8px 12px 10px; display: flex; }
.cm { display: flex; flex-direction: column; gap: 8px; width: 100%; min-height: 0; }
.cm-top { display: flex; align-items: baseline; gap: 10px; flex: none; }
.lib-doc .cm-title { margin: 0; font-size: 19px; }
.cm-ep { color: #7a6a4a; font-size: 14px; }
.cm-chips { display: flex; gap: 6px; overflow-x: auto; flex: none; padding-bottom: 2px; scrollbar-width: thin; }
.cm-chips .lib-chip { min-height: 38px; font-size: 14px; padding: 0 14px; }
.cm-stage { position: relative; flex: 1; min-height: 0; display: flex; }
.cm-track { flex: 1; min-width: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; border-radius: 12px; background: #1e1810; outline: none; overscroll-behavior-x: contain; }
.cm-track::-webkit-scrollbar { display: none; }
.cm-track:focus-visible { box-shadow: 0 0 0 3px rgba(127, 174, 60, .6); }
.cm-pg { flex: 0 0 100%; min-width: 0; margin: 0; display: flex; overflow: hidden; scroll-snap-align: center; scroll-snap-stop: always; }
.cm-pg img { margin: auto; display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.cm.zoom .cm-pg { overflow: auto; }
.cm.zoom .cm-pg img { max-width: none; max-height: none; width: 190%; flex: none; }
.cm-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 72px; border: 0; border-radius: 12px; background: rgba(30, 24, 16, .58); color: #fff3d0; font: 400 36px/1 var(--hn-sans, sans-serif); cursor: pointer; }
.cm-nav.prev { left: 6px; }
.cm-nav.next { right: 6px; }
.cm-nav:disabled { opacity: .22; cursor: default; }
.cm-nav:focus-visible { outline: 3px solid rgba(127, 174, 60, .8); }
.cm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; flex: none; }
.cm-count { flex: 1 1 100%; text-align: center; font: 700 17px/1.3 var(--hn-sans, sans-serif); color: #3a2c14; }
.cm-bar .hn-btn { min-height: 48px; padding: 0 20px; font-size: 16px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.cm-src { margin: 0 !important; text-align: center; flex: none; }
@media (max-width: 560px) {
  .lib-rd.cm-mode .lib-doc { padding: 6px 8px 8px; }
  .cm-nav { width: 40px; height: 64px; font-size: 30px; }
  .cm-bar .hn-btn { flex: 1 1 140px; padding: 0 12px; }
}
@media (max-height: 560px) {
  .cm-chips, .cm-src { display: none; }
  .cm-top { display: none; }
  .cm-bar { flex-wrap: nowrap; gap: 8px; }
  .cm-count { flex: 1 1 auto; text-align: left; font-size: 15px; }
  .cm-bar .hn-btn { flex: none; min-height: 40px; padding: 0 14px; font-size: 14.5px; }
  .lib-rd.cm-mode .lib-doc { padding: 4px 8px 6px; }
  
  .cm-pg { display: block; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .cm-pg img { width: 100%; max-width: 100%; max-height: none; margin: 0 auto; }
}

.lib-rd.np-mode .lib-box { width: min(920px, 100%); background: #efe6cf; }
.lib-rd.np-mode .lib-doc { padding: 16px 18px 22px; }
.np {
  position: relative; padding: 18px 22px 16px; color: #1e1a12;
  background: repeating-linear-gradient(0deg, rgba(120, 100, 60, .035) 0 1px, transparent 1px 3px), linear-gradient(180deg, #fbf6e6, #f3ead2);
  border: 1px solid #cdbf98; box-shadow: 0 2px 0 #e4d8b6, 0 10px 26px rgba(60, 44, 20, .18);
}
.np::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: linear-gradient(180deg, transparent, rgba(110, 90, 50, .16) 12%, rgba(110, 90, 50, .16) 88%, transparent); } 
.np-mast { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; padding-bottom: 8px; border-bottom: 3px double #2a2214; }
.np-ear { font-size: 11.5px; color: #6a5a3a; letter-spacing: .04em; }
.np-paper { font: 900 30px/1.1 var(--hn-serif, serif); letter-spacing: .12em; color: #17130b; text-align: center; white-space: nowrap; }
.np-dateline { justify-self: end; font-size: 12.5px; color: #4a3e26; white-space: nowrap; }
.np-head { position: relative; margin: 16px 0 12px !important; font: 900 27px/1.32 var(--hn-serif, serif) !important; color: #120f08 !important; letter-spacing: -.01em; }
.np-cols { position: relative; column-count: 2; column-gap: 28px; column-rule: 1px solid rgba(90, 72, 40, .28); font: 400 16px/1.8 var(--hn-serif, serif); text-align: justify; }
.np-cols p { margin: 0 0 10px; }
.np-cols.one { column-count: 1; max-width: 640px; } 
.np-lead.soft { color: #7a6a48; font-size: 14px; }
.np-sum { break-inside: avoid; }
.np-tag { display: inline-block; margin-bottom: 4px; padding: 1px 8px; border: 1px solid #2a2214; font: 700 11.5px/1.6 var(--hn-sans, sans-serif); }
.np-go { position: relative; margin: 14px 0 0 !important; }
.np-src { position: relative; }
.np-nav { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(90, 72, 40, .3); }
.np-nav .hn-btn { min-height: 44px; padding: 0 16px; }
.np-nav .hn-btn[disabled] { opacity: .35; cursor: default; }
.np-count { color: #5a4a2c; font-size: 13.5px; }
@media (max-width: 560px) {
  .lib-rd.np-mode .lib-doc { padding: 10px 8px 16px; }
  .np { padding: 14px 14px 12px; }
  .np::before { display: none; }
  .np-mast { grid-template-columns: 1fr; justify-items: center; gap: 2px; }
  .np-ear { order: 3; } .np-dateline { justify-self: center; }
  .np-paper { font-size: 25px; }
  .np-head { font-size: 22px !important; }
  .np-cols { column-count: 1; font-size: 16px; }
}

.lt-tabs { position: sticky; top: 60px; z-index: 1; display: flex; align-items: center; gap: 8px; margin: 0 -4px 12px; padding: 8px 4px; background: #fdf9ee; border-bottom: 1px solid #eee3c8; }
.lt-tab { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid #d9c9a0; background: #fffaf0; color: #4a3a1c; font: 700 14.5px/1 var(--hn-sans, sans-serif); cursor: pointer; }
.lt-tab small { font-weight: 500; color: #8a7a58; }
.lt-tab.on { background: #2f5a3a; border-color: #2f5a3a; color: #fff3d0; }
.lt-tab.on small { color: #d8ecc0; }
.lt-tab[disabled] { opacity: .4; cursor: default; }
.lt-big { margin-left: auto; min-width: 46px; min-height: 40px; border-radius: 10px; border: 1px solid #d9c9a0; background: #fffaf0; color: #4a3a1c; font: 700 15px/1 var(--hn-serif, serif); cursor: pointer; }
.lt-big[aria-pressed="true"] { background: #f1e6c4; border-color: #c9a24a; }
.lib-body.lt-full p { margin: 0 0 14px; }
.lib-body.big { font-size: 19px; line-height: 1.85; }
.lt-ts { display: inline-block; margin-right: 8px; padding: 0 6px; border-radius: 6px; background: #efe6cc; color: #7a6a48; font: 600 12px/1.6 var(--hn-sans, sans-serif); vertical-align: 1px; }
@media (max-width: 560px) { .lt-tabs { top: 52px; gap: 6px; } .lt-tab { padding: 0 12px; font-size: 14px; } }
