@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500;1,600&display=swap');

:root{--ink:#26342f;--muted:#818a83;--green:#426b57;--green-dark:#345743;--paper:#f7f6f1;--white:#fff;--line:#e9e9e2;--peach:#f6e7dc;--shadow:0 16px 45px rgba(40,56,46,.08)}
*{box-sizing:border-box}
body{margin:0;background:var(--paper);color:var(--ink);font-family:'DM Sans',sans-serif;font-size:14px;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
[hidden]{display:none!important}
.login-page{min-height:100vh;display:grid;grid-template-columns:1.02fr .98fr;background:#fff}
.login-story{position:relative;min-height:100vh;overflow:hidden;padding:42px 8.5%;display:flex;flex-direction:column;justify-content:space-between;background:linear-gradient(145deg,rgba(31,52,43,.84),rgba(42,74,58,.88)),radial-gradient(ellipse at 20% 65%,#af9d77 0%,#415a4a 40%,#263e33 100%);color:#fff}
.login-story:after{content:"";position:absolute;width:470px;height:470px;border:1px solid rgba(255,255,255,.12);border-radius:50%;right:-190px;bottom:6%;box-shadow:0 0 0 60px rgba(255,255,255,.025),0 0 0 120px rgba(255,255,255,.02)}
.brand{display:inline-flex;align-items:center;gap:9px;width:max-content;color:var(--ink);font-family:'Playfair Display',serif;font-size:20px;font-weight:700;text-decoration:none;letter-spacing:-.7px}
.brand-mark{display:grid;place-items:center;width:31px;height:31px;border-radius:10px;background:var(--green);color:white;font-family:'Playfair Display',serif;font-size:20px}
.brand-accent{color:var(--green);font-weight:500}
.brand-light{color:#fff;position:relative;z-index:1}
.brand-light .brand-mark{background:#fff;color:var(--green)}
.brand-light .brand-accent{color:#d9c6a5}
.story-copy{position:relative;z-index:1;max-width:490px;margin-top:-40px}
.eyebrow{margin:0 0 12px;color:var(--green);font-size:10px;font-weight:700;letter-spacing:1.7px}
.login-story .eyebrow{color:#d6c7a9}
h1,h2,p{margin-top:0}
.story-copy h1,.welcome-row h1{margin:0 0 18px;font-family:'Playfair Display',serif;font-size:clamp(44px,5.2vw,70px);line-height:1.12;font-weight:500;letter-spacing:-1.6px}
.story-copy h1 em,.welcome-row h1 em,.hero-text h2 em,.collection-title-row h1 em{color:#d6c6a7;font-weight:500}
.story-copy>p:last-child{max-width:370px;color:rgba(255,255,255,.75);font-size:15px;line-height:1.8}
.story-bottom{position:relative;z-index:1;display:flex;align-items:center;gap:14px;color:rgba(255,255,255,.6);font-size:9px;letter-spacing:1.5px}
.story-line{height:1px;width:60px;background:rgba(255,255,255,.4)}
.login-panel{display:grid;place-items:center;padding:52px 7%}
.login-card{width:min(100%,390px)}
.login-card h2,.modal h2{margin:0 0 8px;font-family:'Playfair Display',serif;font-size:34px;font-weight:500;letter-spacing:-.7px}
.muted{color:var(--muted);line-height:1.7}
.login-intro{margin-bottom:35px}
label{display:block;margin:19px 0 8px;font-size:12px;font-weight:600;color:#45544c}
input,select,textarea{width:100%;border:1px solid #e4e7e1;border-radius:8px;background:#fff;color:var(--ink);outline:none;transition:border-color .2s,box-shadow .2s}
input,select{height:46px;padding:0 13px}
textarea{padding:12px 13px;resize:vertical}
input::placeholder,textarea::placeholder{color:#aab0aa}
input:focus,select:focus,textarea:focus{border-color:#7b9d87;box-shadow:0 0 0 3px rgba(66,107,87,.1)}
.button{display:inline-flex;align-items:center;justify-content:center;gap:10px;border:0;border-radius:7px;padding:12px 18px;font-weight:600;transition:background .18s,transform .18s}
.button:active{transform:translateY(1px)}
.button-primary{background:var(--green);color:#fff}
.button-primary:hover{background:var(--green-dark)}
.login-submit{width:100%;margin-top:22px;padding:14px}
.login-submit span{margin-left:auto;font-size:18px}
.login-switch{margin:18px 0 0;color:var(--muted);font-size:12px;text-align:center}
.login-switch .text-button{font-size:12px}
.form-error{min-height:0;margin:8px 0 0;color:#b0443f;font-size:12px}
.demo-note{display:flex;align-items:center;gap:11px;margin-top:26px;padding:14px;background:#f7f7f2;border:1px solid #edeee7;border-radius:8px;color:#6f7971;font-size:12px;line-height:1.6}
.demo-note strong{color:var(--ink)}
.note-dot{width:8px;height:8px;border-radius:50%;background:#83a68c}
.login-foot{margin:26px 0 0;color:#a2a8a2;font-size:10px;text-align:center}
.app-page{min-height:100vh}
.sidebar{position:fixed;inset:0 auto 0 0;width:248px;padding:30px 22px 19px;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;z-index:2}
.sidebar .brand{margin:0 0 58px 5px}
.side-label{margin:0 0 12px 10px;color:#a0a69e;font-size:9px;font-weight:700;letter-spacing:1.6px}
.nav-link{display:flex;align-items:center;gap:13px;width:100%;padding:12px 13px;margin:3px 0;border:0;border-radius:7px;background:transparent;color:#777f78;text-align:left;font-size:13px}
.nav-link:hover,.nav-link.active{background:#f0f4ef;color:var(--green);font-weight:600}
.nav-icon{width:18px;font-size:18px;text-align:center}
.sidebar-bottom{margin-top:auto}
.sidebar-quote{margin:0 3px 25px;padding:17px 15px;border-left:2px solid #b8c7b8;background:#f8f8f4;color:#7c847c;font-family:'Playfair Display',serif;font-size:13px;font-style:italic;line-height:1.6}
.profile{display:flex;align-items:center;gap:10px;padding-top:15px;border-top:1px solid var(--line)}
.avatar,.topbar-avatar{display:grid;place-items:center;width:35px;height:35px;border-radius:50%;background:#e4eee6;color:var(--green);font-family:'Playfair Display',serif;font-size:15px}
.profile-info{display:flex;flex:1;flex-direction:column;gap:3px}
.profile-info strong{font-size:12px}
.profile-info span{color:#9ba19b;font-size:10px}
.icon-button{display:grid;place-items:center;border:0;border-radius:50%;background:transparent;color:#89928a}
.icon-button:hover{background:#f0f2ed;color:var(--green)}
.logout-button{width:30px;height:30px;font-size:18px;transform:rotate(90deg)}
.main-area{min-height:100vh;margin-left:248px;padding:0 5.2%;display:flex;flex-direction:column}
.topbar{height:68px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}
.breadcrumb{color:#9aa19a;font-size:11px}
.breadcrumb span{padding:0 9px;color:#c0c5be}
.breadcrumb strong{color:#45544c;font-weight:600}
.topbar-right{display:flex;align-items:center;gap:14px}
.today-label{color:#9ca39b;font-size:9px;letter-spacing:1.1px}
.topbar-avatar{width:30px;height:30px;font-size:13px}
.content-view{width:100%;max-width:1100px;margin:0 auto;flex:1;padding:38px 0 56px}
.welcome-row{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:27px}
.welcome-row .eyebrow{margin-bottom:10px}
.welcome-row h1{font-size:35px;letter-spacing:-.6px;margin-bottom:6px}
.welcome-row h1 em{color:var(--green)}
.welcome-row .muted{margin-bottom:0;font-size:12px}
.welcome-row>.button{flex-shrink:0;font-size:12px}
.plus{font-size:17px;font-weight:400}
.hero-card{position:relative;min-height:240px;overflow:hidden;display:grid;grid-template-columns:1.1fr .9fr;border-radius:10px;background:#eaf0e9}
.hero-text{position:relative;z-index:1;padding:32px 37px}
.hero-text .eyebrow{font-size:9px}
.hero-text h2{margin:0 0 12px;font-family:'Playfair Display',serif;font-size:32px;font-weight:500;line-height:1.15}
.hero-text h2 em{color:var(--green)}
.hero-text>p:not(.eyebrow){max-width:370px;margin-bottom:15px;color:#77837a;font-size:11px;line-height:1.7}
.text-button{border:0;padding:0;background:transparent;color:var(--green);font-size:11px;font-weight:700}
.text-button span{padding-left:7px;font-size:15px}
.text-button:hover{color:var(--green-dark)}
.book-illustration{position:relative;min-height:240px;overflow:hidden;background:linear-gradient(120deg,rgba(234,240,233,0),rgba(210,225,211,.48))}
.illustration-sun{position:absolute;top:26px;right:55px;width:91px;height:91px;border-radius:50%;background:#e3d6b9;opacity:.65}
.book-stack{position:absolute;z-index:1;left:40%;bottom:38px;width:200px;height:150px;transform:rotate(-5deg)}
.book{position:absolute;display:flex;align-items:center;justify-content:center;box-shadow:4px 8px 15px rgba(56,67,56,.2);font-family:'Playfair Display',serif;font-size:9px;font-weight:600;letter-spacing:1px;line-height:1.5;text-align:center}
.book-back{left:96px;top:8px;width:83px;height:131px;transform:rotate(8deg);background:#bf8768;color:#f4e9dc}
.book-middle{left:48px;top:20px;width:89px;height:124px;transform:rotate(-5deg);background:#768c73;color:#f4eee0}
.book-front{left:0;top:34px;width:92px;height:108px;transform:rotate(-8deg);background:#d5bb8e;color:#fffdf5}
.book-front i{position:absolute;left:45px;bottom:15px;width:1px;height:16px;background:rgba(255,255,255,.55)}
.table-shape{position:absolute;bottom:23px;left:16%;width:290px;height:13px;border-radius:50%;background:#8d9d86;opacity:.42}
.plant{position:absolute;z-index:1;bottom:39px;width:3px;height:83px;background:#68866c;transform-origin:bottom}
.plant:before,.plant:after{content:"";position:absolute;width:21px;height:10px;border-radius:100% 0 100% 0;background:#7f9a7c}
.plant:before{top:14px;left:-17px;transform:rotate(20deg)}
.plant:after{top:34px;left:1px;transform:rotate(-30deg) scaleX(-1)}
.plant-one{left:23%;transform:rotate(-12deg)}.plant-two{left:28%;height:66px;transform:rotate(17deg)}
.section-heading{display:flex;align-items:end;justify-content:space-between;margin:32px 0 14px}
.section-heading .eyebrow{margin-bottom:5px;font-size:9px}
.section-heading h2{margin:0;font-family:'Playfair Display',serif;font-size:20px;font-weight:500}
.section-heading>.text-button{margin-bottom:3px}
.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:13px}
.stat-card{padding:16px 18px;border:1px solid var(--line);border-radius:8px;background:#fff}
.stat-top{display:flex;align-items:center;justify-content:space-between;color:#7f8880;font-size:11px}
.stat-icon{display:grid;place-items:center;width:27px;height:27px;border-radius:7px;background:#eaf0e9;color:var(--green);font-size:14px}
.stat-icon.peach{background:#fbefe7;color:#bd7956}.stat-icon.green{background:#e7f1e9;color:#638868}
.stat-card>strong{display:block;margin:13px 0 3px;font-family:'Playfair Display',serif;font-size:29px;font-weight:500}
.stat-caption{color:#a2a8a1;font-size:10px}
.recent-heading{margin-top:31px}
.book-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.book-card{min-width:0;padding:15px;border:1px solid var(--line);border-radius:8px;background:#fff;transition:transform .18s,box-shadow .18s}
.book-card:hover{transform:translateY(-2px);box-shadow:var(--shadow)}
.book-card[role="button"]{cursor:pointer}
.book-card[role="button"]:focus-visible{outline:3px solid rgba(66,107,87,.28);outline-offset:3px}
.book-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.book-open-button,.book-title-button{display:block;padding:0;border:0;background:none;text-align:left;cursor:pointer}
.book-cover{position:relative;display:grid;place-items:center;width:55px;height:74px;flex-shrink:0;margin-bottom:13px;padding:7px;border-radius:2px 5px 5px 2px;background:var(--cover,#87977e);box-shadow:2px 3px 5px rgba(30,40,33,.16);color:#fff;text-align:center}
.book-open-button .book-cover{margin-bottom:13px;transition:transform .18s,box-shadow .18s}
.book-open-button:hover .book-cover,.book-open-button:focus-visible .book-cover{transform:translateY(-2px);box-shadow:3px 6px 10px rgba(30,40,33,.24)}
.book-cover:before{content:"";position:absolute;left:5px;top:0;bottom:0;width:1px;background:rgba(255,255,255,.32)}
.book-cover span{font-family:'Playfair Display',serif;font-size:8px;line-height:1.35}
.book-cover small{position:absolute;bottom:5px;font-size:5px;letter-spacing:.5px;opacity:.8}
.status-pill{display:inline-block;max-width:100%;padding:5px 8px;border-radius:20px;background:#f1f3ed;color:#69776b;font-size:9px;white-space:nowrap}
.status-pill.reading{background:#fbefe7;color:#a86c4d}.status-pill.finished{background:#eaf2e9;color:#55775d}
.book-card h3{overflow:hidden;margin:0 0 4px;font-family:'Playfair Display',serif;font-size:15px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}
.book-title-button{overflow:hidden;max-width:100%;color:inherit;font:inherit;text-overflow:ellipsis;white-space:nowrap}
.book-title-button:hover,.book-title-button:focus-visible{color:var(--green);text-decoration:underline}
.book-author{overflow:hidden;margin:0 0 10px;color:#89918a;font-size:10px;text-overflow:ellipsis;white-space:nowrap}
.book-owner{margin:0 0 8px;color:var(--green);font-size:10px;font-weight:600}
.book-meta{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding-top:10px;border-top:1px solid #f0f0eb;color:#a1a79f;font-size:9px}
.card-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px}
.card-actions button{border:0;background:none;color:#78867b;font-size:10px;text-align:right}
.card-actions button:hover{color:#355d43;text-decoration:underline}
.no-story{color:#a1a79f;font-size:9px;text-align:right}
.collection-title-row{margin:38px 0 26px}
.collection-toolbar{display:flex;align-items:center;gap:10px;margin-bottom:18px}
.search-wrap{position:relative;flex:1;max-width:360px}
.search-wrap>span{position:absolute;top:8px;left:13px;color:#91a094;font-size:23px;line-height:1}
.search-wrap input{height:39px;padding-left:39px;font-size:11px}
.collection-toolbar select{width:155px;height:39px;color:#657168;font-size:11px}
.result-count{margin-left:auto;color:#959d95;font-size:10px}
.collection-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.empty-state{grid-column:1/-1;padding:50px 20px;border:1px dashed #dce1d9;border-radius:9px;color:#8a958c;text-align:center}
.empty-state strong{display:block;margin-bottom:6px;color:#45544c;font-family:'Playfair Display',serif;font-size:19px;font-weight:500}
.empty-state p{margin:0;font-size:11px}
.app-footer{max-width:1100px;width:100%;margin:0 auto;padding:17px 0 20px;border-top:1px solid var(--line);color:#a1a79f;font-size:8px;letter-spacing:1.3px;text-align:center}
.app-footer span{padding:0 7px;color:#8aa08c}
.modal-backdrop{position:fixed;z-index:5;inset:0;display:grid;place-items:center;padding:20px;background:rgba(29,42,34,.48);backdrop-filter:blur(3px)}
.modal{width:min(100%,480px);max-height:calc(100vh - 40px);overflow-y:auto;padding:27px 30px 25px;border-radius:12px;background:#fff;box-shadow:0 25px 90px rgba(20,33,24,.2)}
.modal-header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:20px}
.modal-header .eyebrow{margin-bottom:6px;font-size:9px}
.modal h2{font-size:27px}
.close-button{width:32px;height:32px;font-size:24px}
.modal form>label:first-of-type{margin-top:0}
.modal label{font-size:11px}
.modal label span{color:#bd7956}
.modal label .optional{color:#a4aaa3;font-weight:400}
.modal input,.modal select{height:41px;font-size:12px}
.modal textarea{font-size:12px}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.form-row label{margin-top:16px}
.modal-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:12px}
.modal-actions .button{font-size:11px}
.button-quiet{background:#f1f3ef;color:#667168}
.button-quiet:hover{background:#e8ebe5}
.chapters-editor{margin-top:22px;padding-top:18px;border-top:1px solid var(--line)}
.chapters-editor-heading,.chapter-field-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.chapters-editor-heading strong,.chapter-field-heading strong{color:var(--ink);font-size:12px}
.chapters-editor-heading p{margin:4px 0 0;color:var(--muted);font-size:10px}
.chapters-editor-heading .button{padding:8px 11px;font-size:10px}
.chapter-field{margin-top:14px;padding:14px;border:1px solid var(--line);border-radius:8px;background:#fcfcfa}
.chapter-field-heading .text-button{font-size:10px}
.chapter-field label{margin-top:14px}
.chapter-field label:first-of-type{margin-top:12px}
.chapter-field textarea{width:100%;min-height:140px;line-height:1.65}
.reader-modal{width:min(100%,760px);padding:30px 36px}
.reader-modal .modal-header{margin-bottom:12px}
.reader-modal .modal-header h2{margin-bottom:4px}
.reader-modal .modal-header .muted{margin:0;font-size:12px}
.reader-progress{display:flex;justify-content:space-between;padding:12px 0;border-top:1px solid var(--line);color:var(--muted);font-size:11px}
.reader-chapter-title{margin:18px 0;font-family:'Playfair Display',serif;font-size:23px;font-weight:500}
.reader-content{min-height:140px;max-height:55vh;overflow:auto;padding:4px 2px;color:#3f4c43;font-family:'Playfair Display',Georgia,serif;font-size:16px;line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere}
.reader-notice{margin:18px 0 0;padding:12px 14px;border-radius:7px;background:#f7f7f2;color:#78867b;font-size:12px;line-height:1.6}
.reader-actions{display:flex;justify-content:space-between;gap:10px;margin-top:24px;padding-top:16px;border-top:1px solid var(--line)}
.reader-actions .button{font-size:11px}
.reader-actions .button:disabled{opacity:.45;cursor:not-allowed}
.toast{position:fixed;right:25px;bottom:25px;z-index:10;max-width:calc(100% - 40px);padding:12px 17px;border-radius:7px;background:#2f4938;color:#fff;font-size:12px;box-shadow:var(--shadow);opacity:0;transform:translateY(8px);pointer-events:none;transition:opacity .2s,transform .2s}
.toast.visible{opacity:1;transform:translateY(0)}
.account-table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:9px;background:#fff}
.account-table{width:100%;border-collapse:collapse;text-align:left}
.account-table th,.account-table td{padding:14px 17px;border-bottom:1px solid #f0f0eb;font-size:11px}
.account-table th{background:#fafaf7;color:#8a948c;font-size:9px;letter-spacing:.8px;text-transform:uppercase}
.account-table tr:last-child td{border-bottom:0}
.account-table td:first-child{color:var(--ink);font-weight:600}
.role-badge{display:inline-block;padding:5px 9px;border-radius:20px;background:#f1f3ed;color:#69776b;font-size:9px}
.role-badge.admin{background:#eaf2e9;color:#55775d}
.account-actions{display:flex;gap:8px}
.account-actions button{border:0;background:none;color:#55775d;font-size:10px}
.account-actions button:hover{color:#294c36;text-decoration:underline}
.account-hint{margin:6px 0 0;color:#a0a69e;font-size:10px}
.account-empty-cell{text-align:center;color:#969e97}
@media(max-width:1050px){.sidebar{width:215px}.main-area{margin-left:215px;padding:0 4%}.collection-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.book-grid{gap:10px}}
@media(max-width:760px){.login-page{grid-template-columns:1fr}.login-story{min-height:290px;padding:25px 7%}.story-copy{margin:32px 0}.story-copy h1{font-size:43px}.story-copy>p:last-child{font-size:13px}.story-bottom{display:none}.login-panel{padding:42px 7%}.sidebar{position:relative;width:auto;height:auto;padding:12px 18px;border-right:0;border-bottom:1px solid var(--line);flex-direction:row;align-items:center;justify-content:space-between}.sidebar .brand{margin:0}.side-label,.sidebar-quote,.nav-link{display:none}.sidebar-bottom{margin:0}.profile{padding:0;border:0}.profile-info{display:none}.logout-button{margin-left:4px}.main-area{margin-left:0;padding:0 5%}.topbar{height:55px}.content-view{padding-top:27px}.book-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.collection-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.hero-card{grid-template-columns:1fr}.hero-text{padding:26px}.book-illustration{position:absolute;inset:0 0 0 auto;width:47%;opacity:.45}.hero-text{max-width:74%}.welcome-row h1{font-size:29px}.today-label{display:none}}
@media(max-width:480px){.main-area{padding:0 17px}.welcome-row{align-items:flex-start;flex-direction:column}.welcome-row>.button{align-self:flex-start}.welcome-row h1{font-size:28px}.hero-text{max-width:100%;padding:24px}.hero-card{min-height:245px}.hero-text>p:not(.eyebrow){max-width:245px}.book-illustration{width:50%;opacity:.25}.stats-grid{gap:7px}.stat-card{padding:12px 10px}.stat-top{font-size:9px}.stat-icon{width:22px;height:22px}.stat-card>strong{font-size:25px}.stat-caption{font-size:8px}.section-heading h2{font-size:18px}.book-grid,.collection-grid{gap:8px}.book-card{padding:11px}.book-card h3{font-size:13px}.collection-toolbar{flex-wrap:wrap}.search-wrap{max-width:none;flex-basis:100%}.collection-toolbar select{width:145px}.result-count{margin-left:auto}.collection-title-row{gap:14px}.modal{padding:23px 19px}.reader-modal{padding:23px 19px}.reader-chapter-title{font-size:20px}.reader-content{font-size:15px}.reader-actions .button{padding:10px;font-size:10px}.app-footer{font-size:7px;letter-spacing:.8px}}
