/* Katiopa v4.0: fixed-height shelves; readable on touch screens and keyboard. */
.k40-shelf{margin:34px 0 44px;padding:clamp(18px,3vw,36px);background:linear-gradient(145deg,#112e26,#204b3c);color:#fff9ed;border-radius:26px;overflow:hidden}
.k40-shelf-head{display:flex;justify-content:space-between;align-items:end;gap:20px;flex-wrap:wrap;margin-bottom:18px}.k40-shelf-head h2{font:500 clamp(28px,4vw,48px)/1.1 Georgia,serif;margin:4px 0 10px}.k40-shelf-head p{max-width:650px;color:#dfebe3}.k40-shelf-head a{border:1px solid #c4d7c2;padding:11px 17px;border-radius:100px;color:#fff;white-space:nowrap}
.k40-rail{display:flex;align-items:stretch;gap:16px;overflow-x:auto;scroll-snap-type:x mandatory;padding:7px 2px 19px;scrollbar-color:#a6b8ac transparent}.k40-shelf-item{flex:0 0 clamp(172px,19vw,217px);min-width:0;display:flex;flex-direction:column;scroll-snap-align:start;background:#fffdf8;color:#20392f;border-radius:14px;overflow:hidden;box-shadow:0 14px 28px #02170f33;transition:transform .2s ease}.k40-shelf-item:hover{transform:translateY(-4px)}
.k40-shelf-cover{height:244px;flex:none;background:radial-gradient(circle at 22% 18%,#688977,#1c4436 75%);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:18px;color:#fff9e8;text-decoration:none;overflow:hidden}.k40-shelf-cover img{height:100%;width:100%;object-fit:cover}.k40-shelf-cover strong{font:500 22px/1.2 Georgia,serif;max-height:4.8em;overflow:hidden}.k40-shelf-cover>span{font-size:30px;color:#d2b586}.k40-free-cover{background:linear-gradient(130deg,#1e503d,#71907d)}
.k40-shelf-info{padding:14px;display:flex;flex-direction:column;flex:1;gap:7px}.k40-shelf-info>small{font-size:10px;letter-spacing:.11em;color:#547263}.k40-shelf-info h3{font:500 17px/1.22 Georgia,serif;min-height:2.44em;max-height:2.44em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0}.k40-shelf-info p{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}.k40-shelf-info a{font-size:12px;font-weight:700;margin-top:auto;padding-top:12px;color:#236249}.k40-empty-shelf{min-width:min(360px,90%);padding:22px;border:1px dashed #9db9a8;border-radius:13px}.k40-empty-shelf p{color:#dce7df}.k40-empty-shelf a{color:#fff;text-decoration:underline}
.k40-rec-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:12px;margin:20px 0}.k40-rec-card{padding:16px;background:#fff;border:1px solid #dae4d9;border-radius:14px;display:flex;flex-direction:column;gap:8px;min-height:165px;text-decoration:none}.k40-rec-title{font:500 19px/1.2 Georgia,serif;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:46px}.k40-rec-card>span:nth-child(2){font-size:12px;color:#657465}.k40-rec-card small{margin-top:auto;font-weight:700;color:#2c694c}
.content-section .books-grid>.book-card,.content-section .books-grid>.nk-library-tile{min-width:0}.book-card-data h3,.nk-library-tile .book-card h3{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.44em;max-height:2.44em}.book-card-data>p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:1.5em}.book-card-data>b{margin-top:auto}
@media(max-width:680px){.k40-shelf{margin:22px -12px;padding:19px 12px;border-radius:18px}.k40-shelf-item{flex-basis:173px}.k40-shelf-cover{height:205px}}@media(prefers-reduced-motion:reduce){.k40-shelf-item{transition:none}}

.k40-import-device{display:inline-flex;align-items:center;min-height:42px;margin:10px 0 0 5%;padding:8px 18px;border:1px solid #397359;background:#e6f0e9;color:#1c4632;border-radius:26px;font-weight:700}.k40-import-device[hidden]{display:none}

.k40-history{margin-top:30px;padding:20px;background:#f4f6f1;border-radius:16px}.k40-history details{padding:12px;border-bottom:1px solid #dce6db}.k40-history summary{cursor:pointer;font-weight:700}

#k40-import-free{border:1px solid #bcd1c1;background:#edf5e6;color:#17392e;font-weight:700;border-radius:24px;padding:10px 16px;cursor:pointer;margin-bottom:14px}#k40-import-free[hidden]{display:none}#k40-import-status{font-size:12px;color:#dce8dd}
