@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Literata:opsz,wght@7..72,400;7..72,500;7..72,600;7..72,700&display=swap');

:root {
  color-scheme: light;
  --ink: #18313a;
  --muted: #718186;
  --paper: #f5f3ed;
  --card: #fffefa;
  --line: #e8e7df;
  --teal: #1a5960;
  --teal-deep: #16464d;
  --mint: #dcebe4;
  --gold: #d99a4c;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button { color: inherit; font: inherit; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.app-shell { max-width: 760px; margin: 0 auto; min-height: 100dvh; padding: 0 18px calc(94px + var(--safe-bottom)); }
.topbar { height: 68px; display: flex; align-items: center; gap: 11px; }
.brand-mark { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 14px 14px 13px 5px; color: #fbf8ed; background: var(--teal); font: 700 24px 'Literata', Georgia, serif; box-shadow: 0 5px 10px #173e421f; }
.brand-mark i { position: absolute; width: 20px; height: 2px; bottom: 7px; left: 9px; background: var(--gold); border-radius: 8px; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.brand-copy strong { font: 700 17px 'Literata', Georgia, serif; letter-spacing: -.25px; }
.brand-copy span { color: var(--muted); font-size: 11px; letter-spacing: .15px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--teal); background: var(--mint); font-size: 14px; font-weight: 700; }
.hero { position: relative; overflow: hidden; min-height: 190px; padding: 22px 23px; border-radius: 22px; color: #fff9ec; background: radial-gradient(circle at 88% 13%, #6d9890 0, #2e6668 25%, transparent 50%), linear-gradient(130deg, #193d45, #1b555a 75%, #23676a); box-shadow: 0 12px 24px #173e421a; }
.hero:after { content: '❧'; position: absolute; right: 14px; bottom: -43px; color: #ffffff13; font: 170px 'Literata', Georgia, serif; transform: rotate(-18deg); }
.eyebrow { position: relative; z-index: 1; margin: 0 0 10px; color: #c4d8cf; text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: 1.7px; }
.hero h1 { position: relative; z-index: 1; max-width: 380px; margin: 0; font: 500 27px/1.16 'Literata', Georgia, serif; letter-spacing: -.55px; }
.hero p { position: relative; z-index: 1; max-width: 360px; margin: 9px 0 0; color: #d8e5df; font-size: 12px; line-height: 1.5; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 25px 2px 12px; }
.section-head h2 { margin: 0; font: 600 19px 'Literata', Georgia, serif; letter-spacing: -.25px; }
.section-head button, .text-link { padding: 0; color: var(--teal); background: none; font-size: 12px; font-weight: 700; }
.reading-card { display: grid; grid-template-columns: 62px minmax(0,1fr); gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 4px 12px #173e4208; }
.book-cover { position: relative; display: grid; place-items: center; overflow: hidden; width: 62px; height: 84px; border-radius: 7px 11px 11px 7px; color: #fff9e9; background: linear-gradient(145deg,#b8754d,#7c453a); box-shadow: inset 5px 0 #ffffff20, 2px 4px 7px #223a3522; font: 600 24px 'Literata', Georgia,serif; }
.book-cover:after { content: ''; position:absolute; left:10px; right:8px; bottom:12px; height:1px; background:#fff8df90; }
.cover-1 { background: linear-gradient(145deg,#80957d,#36574e); }
.cover-2 { background: linear-gradient(145deg,#6f8799,#33475c); }
.cover-3 { background: linear-gradient(145deg,#ba9160,#695235); }
.reading-main { min-width: 0; display: flex; flex-direction: column; align-items: start; }
.book-author { margin: 1px 0 4px; color: var(--muted); font-size: 10px; }
.book-title { margin: 0; font: 600 16px/1.25 'Literata', Georgia,serif; }
.progress-meta { display: flex; justify-content: space-between; gap: 8px; width: 100%; margin: auto 0 6px; color: var(--muted); font-size: 10px; }
.progress-track { overflow: hidden; width: 100%; height: 5px; border-radius: 5px; background: #ecece4; }
.progress-fill { height: 100%; border-radius: inherit; background: #70a18d; }
.button-row { display: flex; gap: 9px; margin-top: 12px; }
.primary-button, .secondary-button { min-height: 43px; padding: 0 16px; border-radius: 13px; font-size: 13px; font-weight: 700; transition: transform .15s, opacity .15s; }
.primary-button { color: #fffdf5; background: var(--teal); box-shadow: 0 5px 11px #174d5425; }
.primary-button:active, .secondary-button:active { transform: scale(.98); }
.primary-button:disabled { opacity: .5; }
.secondary-button { color: var(--teal); background: #e5efea; }
.wide { width: 100%; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 16px; }
.stat-card { padding: 13px 11px; border-radius: 15px; background: #ebece4; }
.stat-card strong { display: block; font: 600 18px 'Literata', Georgia,serif; }
.stat-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.category-pills { display: flex; gap: 7px; overflow-x: auto; margin: 15px -18px 12px; padding: 0 18px 3px; scrollbar-width: none; }
.category-pills::-webkit-scrollbar { display:none; }
.pill { white-space: nowrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: 20px; color: #607177; background: #fffefa; font-size: 11px; font-weight: 600; }
.pill.selected { border-color: var(--teal); color: #fff; background: var(--teal); }
.book-list { display: flex; flex-direction: column; gap: 9px; }
.book-row { display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.book-row .book-cover { width: 50px; height: 67px; font-size: 20px; }
.book-copy { min-width:0; }
.book-copy .book-title { font-size: 14px; }
.book-copy .book-author { margin-top: 4px; font-size: 10px; }
.page-count { margin-top: 7px; color: var(--muted); font-size: 10px; }
.add-button { display: grid; place-items:center; width: 35px; height: 35px; border-radius: 12px; color: var(--teal); background: #e7f0eb; font-size: 20px; font-weight: 500; }
.empty-state { padding: 28px 20px; border: 1px dashed #c9d1ca; border-radius: 18px; color: var(--muted); text-align: center; background: #faf9f4; }
.empty-icon { display:block; margin-bottom: 10px; color: #8da69a; font: 36px 'Literata',Georgia,serif; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); font: 600 17px 'Literata',Georgia,serif; }
.empty-state p { margin: 0 auto 15px; max-width: 250px; font-size: 12px; line-height:1.5; }
.profile-card { margin-top: 8px; padding: 22px; border-radius: 20px; color: #fff9ed; background: linear-gradient(135deg,#1b444c,#2e6967); }
.profile-top { display:flex; align-items:center; gap:14px; }
.large-avatar { display:grid; place-items:center; width:54px; height:54px; border:1px solid #ffffff36; border-radius:18px 18px 18px 6px; background:#ffffff18; font:600 25px 'Literata',Georgia,serif; }
.profile-card h1 { margin:0 0 4px; font:600 21px 'Literata',Georgia,serif; }
.profile-card p { margin:0; color:#c8d9d1; font-size:12px; }
.profile-stats { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin-top:21px; padding-top:17px; border-top:1px solid #ffffff24; }
.profile-stats strong { display:block; font:600 22px 'Literata',Georgia,serif; }
.profile-stats span { color:#c8d9d1; font-size:10px; }
.profile-section { margin-top:22px; }
.profile-section h2 { margin:0 0 10px; font:600 17px 'Literata',Georgia,serif; }
.info-row { display:flex; justify-content:space-between; gap:12px; padding:13px 1px; border-bottom:1px solid var(--line); font-size:12px; }
.info-row span:last-child { color:var(--muted); }
.tabbar { position:fixed; z-index:5; left:50%; bottom:0; display:grid; grid-template-columns:repeat(3,1fr); width:min(760px,100%); padding:9px 18px calc(10px + var(--safe-bottom)); border-top:1px solid #e7e6de; background:#f8f7f1ee; backdrop-filter:blur(16px); transform:translateX(-50%); }
.tab { display:flex; flex-direction:column; align-items:center; gap:3px; padding:4px 0; color:#829095; background:none; font-size:10px; font-weight:600; }
.tab-icon { display:grid; place-items:center; width:27px; height:24px; border-radius:9px; font-size:20px; line-height:1; }
.tab.active { color:var(--teal); }
.tab.active .tab-icon { background:#deebe4; }
.loading-card { display:flex; align-items:center; justify-content:center; gap:10px; min-height:180px; color:var(--muted); font-size:13px; }
.loader { width:17px; height:17px; border:2px solid #b8ccc2; border-top-color:var(--teal); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.toast { position:fixed; z-index:10; left:50%; bottom:calc(82px + var(--safe-bottom)); max-width:calc(100vw - 36px); padding:11px 15px; border-radius:12px; color:#fff; background:#183840; box-shadow:0 8px 24px #102c3244; opacity:0; pointer-events:none; transform:translate(-50%,8px); transition:all .2s; font-size:12px; text-align:center; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.modal-backdrop { position:fixed; z-index:8; inset:0; display:grid; align-items:end; padding:0; background:#10282c70; }
.sheet { width:min(760px,100%); max-height:85dvh; overflow:auto; margin:0 auto; padding:11px 19px calc(22px + var(--safe-bottom)); border-radius:24px 24px 0 0; background:var(--paper); animation:rise .23s ease-out; }
@keyframes rise { from { transform:translateY(20px); opacity:.6; } to { transform:translateY(0); opacity:1; } }
.sheet-handle { width:35px; height:4px; margin:0 auto 18px; border-radius:4px; background:#cbd0ca; }
.sheet h2 { margin:0 0 4px; font:600 22px 'Literata',Georgia,serif; }
.sheet-subtitle { margin:0 0 17px; color:var(--muted); font-size:12px; }
.form-label { display:flex; justify-content:space-between; margin:17px 0 9px; color:#4e6268; font-size:12px; font-weight:600; }
input[type=range] { width:100%; accent-color:var(--teal); }
.range-ends { display:flex; justify-content:space-between; color:#879398; font-size:10px; }
.reader-head { display:flex; align-items:center; gap:10px; margin:7px 0 15px; }
.reader-head button { width:35px; height:35px; border-radius:11px; color:var(--teal); background:#e4eee8; font-size:19px; }
.reader-head div { min-width:0; }
.reader-head strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:600 15px 'Literata',Georgia,serif; }
.reader-head span { color:var(--muted); font-size:10px; }
.reader-pages { display:flex; flex-direction:column; gap:12px; }
.page-paper { padding:19px 18px; border:1px solid #ebe7d9; border-radius:15px; background:#fffef8; box-shadow:0 5px 14px #403a2608; }
.page-label { margin-bottom:11px; color:#a57a4b; font-size:9px; font-weight:700; letter-spacing:1.4px; text-transform:uppercase; }
.page-text { margin:0; color:#35494d; font:15px/1.78 'Literata',Georgia,serif; white-space:pre-wrap; overflow-wrap:anywhere; }
.reader-footer { position:sticky; bottom:-1px; margin:13px -19px -1px; padding:12px 19px calc(10px + var(--safe-bottom)); background:linear-gradient(0deg,var(--paper) 82%,transparent); }
.next-date { margin:0 0 9px; color:var(--muted); font-size:10px; text-align:center; }
@media (min-width:600px) { .app-shell { padding-left:25px; padding-right:25px; } .hero { min-height:208px; padding:29px; } .hero h1 { font-size:32px; } .category-pills { margin-left:-25px; margin-right:-25px; padding-left:25px; padding-right:25px; } .reading-card { grid-template-columns:70px minmax(0,1fr); padding:18px; } .book-cover { width:70px; height:94px; } }
