:root{color-scheme:light;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",sans-serif;--ink:#1D1D1F;--muted:#6E6E73;--line:#E6E6E2;--paper:#F7F7F5;--card:#FFF;--focus:#596875;--button:#46545F;--money:#A38652;--learning:#596875;--network:#9A6B68;--fun:#98798B;--rest:#6F7392}
*{box-sizing:border-box}html{background:var(--paper)}body{min-width:0;margin:0;background:var(--paper);color:var(--ink);font-size:16px;line-height:1.7}button,input,textarea,select{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--focus);outline-offset:2px}h1,h2,h3,h4,p{margin:0}h2{font-size:27px;font-weight:650;letter-spacing:-.025em;line-height:1.3}h3{font-size:20px;line-height:1.4}.brand-logo{display:flex;align-items:center;width:34px;height:34px;margin:0}.brand-logo img{display:block;width:100%;height:100%;object-fit:contain}
.app-shell{width:min(100%,760px);min-height:100vh;margin:0 auto;padding:24px 22px 52px}.topbar{position:sticky;top:0;z-index:8;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:20px;padding:14px 0 18px;background:rgba(247,247,245,.94);backdrop-filter:blur(12px);border-bottom:1px solid var(--line)}.sync-bar{justify-self:end;display:flex;align-items:center;gap:8px;color:var(--muted);font-size:13px;line-height:1;white-space:nowrap}.sync-bar>div{display:flex;align-items:center;gap:5px}.sync-icon{display:inline-grid;place-items:center;width:16px;height:16px;color:var(--focus);font-size:13px;font-weight:800}.sync-icon:not(.is-online){color:var(--muted)}.logout-button,.icon-button{min-height:32px;border:1px solid var(--line);border-radius:5px;padding:6px 9px;background:var(--card);color:var(--focus);font-size:12px;font-weight:650}.logout-button:hover,.icon-button:hover{border-color:var(--focus)}.icon-button{display:grid;place-items:center;width:32px;padding:0;font-size:19px}
.date-navigator{display:flex;align-items:center;justify-content:center;gap:6px;min-width:320px;color:var(--focus)}.date-icon-button,.text-button{min-width:32px;min-height:32px;border:0;padding:4px 6px;background:transparent;color:var(--focus);font-weight:650}.date-icon-button{font-size:22px;line-height:1}.date-icon-button:disabled{opacity:.35;cursor:default}.selected-date-button,.date-today-button{min-height:34px;border:1px solid var(--line);border-radius:5px;background:var(--card);color:var(--ink);font-size:14px;font-weight:600}.selected-date-button{display:inline-flex;align-items:center;gap:7px;padding:5px 10px}.date-today-button{border-color:transparent;background:transparent;color:var(--focus);padding:4px}
.tabs{display:flex;align-items:flex-end;gap:26px;margin:24px 0 32px;border-bottom:1px solid var(--line)}.tab{min-height:44px;border:0;border-bottom:2px solid transparent;padding:0 0 12px;background:transparent;color:var(--muted);font-size:12px;font-weight:700;letter-spacing:.08em;white-space:nowrap}.tab.is-active{border-bottom-color:var(--focus);color:var(--ink)}.app-shell.is-thoughts-open .tabs{display:none}.view{display:none}.view.is-visible{display:block}.section-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:24px}.date-label{margin-bottom:6px;color:var(--muted);font-size:13px;line-height:1.4}.progress,.time-total{color:var(--ink);font-size:14px;font-weight:650;white-space:nowrap}
.entry-form{display:flex;gap:8px;margin-bottom:24px}input,textarea{min-width:0;border:1px solid var(--line);border-radius:5px;background:var(--card);color:var(--ink);padding:11px 12px;line-height:1.5}input:focus,textarea:focus{border-color:var(--focus);box-shadow:0 0 0 3px rgba(89,104,117,.12);outline:0}input::placeholder,textarea::placeholder{color:#929296}.entry-form>input:first-of-type{flex:1}.entry-form input[type=time]{width:116px}.primary-button{min-height:44px;border:1px solid var(--button);border-radius:5px;padding:0 16px;background:var(--button);color:#fff;font-size:14px;font-weight:650}.primary-button:hover{background:#37444e}.list,.timeline,.thought-list{display:grid;gap:8px}.task-item,.record-item{display:flex;align-items:center;gap:12px;padding:14px 2px;border-bottom:1px solid var(--line);background:transparent}.task-item:first-child,.record-item:first-child{border-top:1px solid var(--line)}.check{width:20px;height:20px;flex:0 0 20px;accent-color:var(--focus)}.item-main{min-width:0;flex:1}.item-title{overflow-wrap:anywhere;font-size:16px}.item-title.done{color:var(--muted);text-decoration:line-through}.item-meta,.char-count{color:var(--muted);font-size:12px}.delete-button,.edit-button{display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:4px;padding:0;background:transparent;color:var(--muted);font-size:19px}.delete-button:hover,.edit-button:hover{background:#f0f0ed;color:var(--focus)}.empty-state{padding:42px 10px;color:var(--muted);text-align:center;font-size:14px}
.timeline-form{align-items:stretch}.time-fields{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:13px}.time-fields input{width:103px}.record-title-field{position:relative;min-width:180px;flex:1}.record-title-field textarea{width:100%;min-height:44px;max-height:110px;padding-right:62px;resize:vertical}.record-title-field .char-count{position:absolute;right:9px;bottom:8px}.category-picker{display:flex;align-items:center;gap:8px;min-width:100px;border:1px solid var(--line);border-radius:5px;background:var(--card);padding:0 9px}.category-picker:focus-within{border-color:var(--focus);box-shadow:0 0 0 3px rgba(89,104,117,.12)}.category-picker select{width:100%;min-width:0;border:0;background:transparent;color:var(--ink);padding:11px 0;outline:none}.category-picker--wide{width:100%}.category-swatch,.legend-dot{width:10px;height:10px;flex:0 0 10px;border-radius:50%;background:var(--category-color,var(--focus))}.record-item{align-items:flex-start;border-left:3px solid var(--category,var(--focus));padding-left:11px}.record-item[data-record-card]{cursor:pointer}.record-time{width:112px;flex:0 0 112px;color:var(--ink);font-size:13px;font-weight:650}.record-actions{display:flex;align-items:center;gap:1px}
.daily-summary{margin-top:42px;padding-top:28px;border-top:1px solid var(--line)}.daily-summary-heading{margin-bottom:15px}.daily-summary h3,.record-edit-form h3{font-size:20px;font-weight:650}.summary-list{display:grid;gap:8px}.summary-card{display:grid;gap:10px;padding:16px;border:1px solid var(--line);border-radius:5px;background:var(--card)}.summary-card label{font-size:15px;font-weight:650}.summary-card textarea,.record-edit-form textarea{width:100%;min-height:82px;resize:vertical}.summary-footer,.form-footer,.summary-card-header,.summary-card-footer,.summary-actions{display:flex;align-items:center}.summary-footer,.form-footer,.summary-card-header,.summary-card-footer{justify-content:space-between;gap:10px}.summary-card-footer,.summary-status{color:var(--muted);font-size:12px}.summary-actions{gap:3px}.summary-copy{white-space:pre-wrap;line-height:1.75}.summary-status.is-synced{color:var(--focus)}.summary-status.is-failed{color:#9A6B68}.summary-status.is-local{color:#A38652}.summary-card--failed{border-color:#cda7a4}
.calendar-dialog,.record-dialog{width:min(92vw,420px);border:1px solid var(--line);border-radius:7px;padding:20px;background:var(--card);color:var(--ink);box-shadow:0 18px 50px rgba(29,29,31,.16)}.calendar-dialog::backdrop,.record-dialog::backdrop{background:rgba(29,29,31,.18)}.calendar-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.calendar-weekdays,.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);text-align:center}.calendar-weekdays{margin-bottom:6px;color:var(--muted);font-size:11px}.calendar-grid{gap:3px}.calendar-day{position:relative;height:38px;border:0;border-radius:50%;background:transparent;color:var(--ink);font-size:13px}.calendar-day:hover{background:rgba(89,104,117,.1)}.calendar-day.is-selected{background:var(--focus);color:#fff}.calendar-day.is-today{outline:1px solid var(--focus)}.calendar-dot{position:absolute;bottom:3px;left:50%;width:4px;height:4px;border-radius:50%;background:var(--focus);transform:translateX(-50%)}.calendar-day.is-selected .calendar-dot{background:#fff}.calendar-dialog .text-button{display:block;margin:14px auto 0}.record-edit-form{display:grid;gap:13px}.dialog-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.stats-grid{display:grid;grid-template-columns:1fr;gap:28px}.chart-panel{padding:0 0 28px;border-bottom:1px solid var(--line);background:transparent}.chart-panel:last-child{border-bottom:0}.chart-title{display:flex;align-items:baseline;justify-content:space-between;font-size:17px;font-weight:650}.chart-title small{color:var(--muted);font-size:13px;font-weight:400}.donut-wrap{display:grid;place-items:center;padding:22px 0 18px}.donut{position:relative;display:grid;place-items:center;width:174px;height:174px;border-radius:50%;background:conic-gradient(var(--line) 0 100%)}.donut::after{position:absolute;inset:29px;border-radius:50%;background:var(--paper);content:""}.donut-center{z-index:1;font-size:21px;font-weight:700}.legend{display:grid;gap:9px;max-width:400px;margin:auto}.legend-row{display:grid;grid-template-columns:12px 1fr auto;align-items:center;gap:8px;color:var(--muted);font-size:14px}.legend-row strong{color:var(--ink);font-size:14px;font-weight:600}
.book-layout{display:grid;grid-template-columns:210px minmax(0,1fr);gap:26px;align-items:start}.book-layout.is-empty{display:block}.book-list{display:grid;gap:8px}.book-layout.is-empty .book-list{min-height:330px;place-items:center}.book-card{display:flex;width:100%;overflow:hidden;border:1px solid var(--line);border-radius:5px;padding:0;background:var(--card);color:var(--ink);text-align:left}.book-card.is-selected{border-color:var(--focus);box-shadow:0 0 0 2px rgba(89,104,117,.1)}.book-spine{width:5px;background:var(--learning)}.book-card:nth-child(2n) .book-spine{background:var(--money)}.book-card:nth-child(3n) .book-spine{background:var(--fun)}.book-card-copy{display:grid;gap:3px;min-width:0;padding:11px}.book-card strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.book-card small,.book-stars,.note-empty,.book-empty{color:var(--muted);font-size:12px}.book-stars{letter-spacing:1px}.book-detail{min-height:330px;padding:24px;border:1px solid var(--line);border-radius:7px;background:var(--card)}.book-create-form{display:grid;max-width:420px;gap:10px}.book-create-form h3,.book-head h3{font-size:23px;font-weight:650}.compact-button{min-width:auto}.book-head{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;padding-bottom:18px;border-bottom:1px solid var(--line)}.rating{display:flex;gap:2px}.star-button{border:0;padding:2px;background:transparent;color:#d1d1ce;font-size:22px;line-height:1}.star-button.is-on{color:var(--focus)}.note-section{padding-top:28px}.note-section+.note-section{margin-top:38px;border-top:1px solid var(--line)}.note-section-title{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:12px}.note-section-title h4{font-size:18px}.note-section-title span{color:var(--muted);font-size:12px}.note-form{display:grid;grid-template-columns:1fr auto;gap:8px}.note-form textarea{grid-column:1/-1;width:100%;min-height:86px;resize:vertical}.upload-button{display:inline-flex;align-items:center;width:max-content;min-height:44px;border:1px solid var(--line);border-radius:5px;padding:8px 12px;color:var(--muted);font-size:13px}.upload-button input{display:none}.note-list{display:grid;gap:16px;margin-top:18px}.note-item{position:relative;display:grid;gap:10px;padding:16px;border:1px solid var(--line);border-radius:7px;background:#fbfbfa;box-shadow:0 2px 7px rgba(29,29,31,.035)}.note-copy{min-width:0}.note-text{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px;line-height:1.85}.note-item--excerpt .note-text{max-width:48rem;margin-inline:auto;font-family:ui-serif,Georgia,"Songti SC",serif;font-size:16px;line-height:1.9}.excerpt-media{position:relative;max-width:100%;overflow:hidden;border:1px solid #ecece8;border-radius:4px;background:#f2f2f0}.excerpt-media img{display:block;width:100%;height:auto;max-height:none;object-fit:contain}.note-item--excerpt .excerpt-media{margin-inline:auto}.note-footer{display:flex;justify-content:flex-end}.note-expand-button{min-height:30px;padding-inline:4px}.note-action-wrap{position:absolute;top:10px;right:10px;z-index:2}.note-action-button{display:grid;place-items:center;width:34px;height:34px;border:0;border-radius:5px;padding:0;background:rgba(255,255,255,.82);color:var(--focus);font-size:22px;font-weight:700;letter-spacing:1px;line-height:1}.note-action-button:hover{background:#f0f0ed}.note-action-menu{position:absolute;top:calc(100% + 3px);right:0;z-index:3;display:grid;min-width:84px;padding:4px;border:1px solid var(--line);border-radius:5px;background:var(--card);box-shadow:0 8px 18px rgba(29,29,31,.12)}.note-action-menu button{border:0;border-radius:3px;padding:7px 9px;background:transparent;color:var(--ink);font-size:13px;text-align:left}.note-action-menu button:hover{background:#f3f3f1}.note-action-menu .is-danger{color:#9A6B68}.note-item--reflection{border-left:3px solid #9caab5;background:#f8fafb}.note-item--reflection .note-copy:not(.is-expanded) .note-text{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:9}.note-item--reflection .excerpt-media{max-width:42rem}.note-item--excerpt .note-copy:not(.is-expanded) .excerpt-media{max-height:720px}.note-item--excerpt .note-copy:not(.is-expanded) .excerpt-media::after{position:absolute;right:0;bottom:0;left:0;height:72px;background:linear-gradient(transparent,#fbfbfa);content:"";pointer-events:none}
.thought-entry{display:block;width:max-content;margin:46px 0 0 auto;border:0;padding:10px 0;background:transparent;color:var(--ink);font-size:13px;font-weight:700;letter-spacing:.1em}.thought-entry:hover,.thought-entry.is-active{color:var(--focus)}.app-shell.is-thoughts-open>.thought-entry{display:none}.thoughts-heading{margin-bottom:22px}.thoughts-heading .date-label{margin:16px 0 7px}.thought-back-button{padding-left:0}.thought-compose{display:grid;gap:10px;padding:18px;border:1px solid var(--line);border-radius:5px;background:var(--card)}.thought-compose textarea,.thought-dialog textarea{width:100%;min-height:180px;resize:vertical;line-height:1.75}.thought-compose .thought-title-input,.thought-dialog .thought-title-input{min-height:48px;font-weight:650;line-height:1.5}.thought-save-status{color:var(--muted);font-size:12px}.thought-archive{margin-top:34px;padding-top:24px;border-top:1px solid var(--line)}.thought-archive h3{margin-bottom:13px;font-size:19px}.thought-card{width:100%;padding:15px 0;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--ink);text-align:left}.thought-card:first-child{border-top:1px solid var(--line)}.thought-card-header,.thought-card-footer,.thought-card-actions,.thought-card-ident,.thought-card-status{display:flex;align-items:center}.thought-card-header,.thought-card-footer{justify-content:space-between;gap:12px}.thought-card-ident{min-width:0;flex-wrap:wrap;align-items:baseline;gap:8px}.thought-card-status{flex:none;gap:6px;white-space:nowrap}.thought-card-date,.thought-card-footer{color:var(--muted);font-size:12px}.thought-card-title{color:var(--ink);font-size:16px;font-weight:650;overflow-wrap:anywhere}.thought-card-copy{display:-webkit-box;margin:10px 0;overflow:hidden;color:var(--ink);line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:5}.thought-card-copy.is-expanded{display:block;overflow:visible}.thought-card-actions{gap:3px}.thought-card .text-button{min-height:28px;padding:3px 6px;font-size:12px}.thought-action-wrap{position:relative;display:grid;place-items:center}.thought-action-button{display:grid;place-items:center;width:30px;height:30px;border:0;padding:0;background:transparent}.thought-action-button::before{width:9px;height:9px;border-radius:50%;background:var(--focus);content:""}.thought-action-menu{position:absolute;top:calc(100% + 3px);right:0;z-index:5;display:grid;min-width:80px;padding:4px;border:1px solid var(--line);border-radius:5px;background:var(--card);box-shadow:0 8px 18px rgba(29,29,31,.12)}.thought-action-menu button{border:0;border-radius:3px;padding:7px 9px;background:transparent;color:var(--ink);font-size:13px;text-align:left}.thought-action-menu button:hover{background:#f3f3f1}.thought-action-menu .is-danger{color:#9A6B68}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.thought-dialog-copy{margin:18px 0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.75}.thought-dialog-meta{color:var(--muted);font-size:12px}.thought-dialog-footer{display:flex;align-items:center;justify-content:space-between;gap:10px}.footer-note{margin-top:46px;color:var(--muted);font-size:12px;text-align:center}
@media(max-width:700px){.app-shell{width:100%;padding:14px 16px 88px}.topbar{position:relative;display:grid;grid-template-columns:1fr auto;gap:14px 8px;padding:8px 0 14px}.date-navigator{grid-column:1/-1;grid-row:2;justify-content:flex-start;min-width:0}.sync-bar{font-size:12px}.tabs{position:fixed;right:0;bottom:0;left:0;z-index:10;display:grid;grid-template-columns:repeat(4,1fr);gap:0;margin:0;padding:6px 8px calc(6px + env(safe-area-inset-bottom));background:rgba(255,255,255,.96);border-top:1px solid var(--line);backdrop-filter:blur(12px)}.tab{min-height:48px;border-bottom:0;padding:10px 3px;font-size:10px;letter-spacing:.035em}.tab.is-active{border-bottom:0;color:var(--focus)}.section-heading{margin-top:10px}.entry-form{flex-wrap:wrap}.entry-form>input:first-of-type,.timeline-form .record-title-field{flex-basis:calc(100% - 66px)}.entry-form input[type=time]{flex:1;width:auto}.timeline-form .time-fields{order:2;flex:1 1 100%}.timeline-form .record-title-field{order:1}.timeline-form .category-picker{order:3;flex:1}.timeline-form .primary-button{order:4;width:100%}.record-time{width:90px;flex-basis:90px}.stats-grid,.book-layout{grid-template-columns:1fr}.book-list{grid-template-columns:repeat(2,minmax(0,1fr))}.book-detail{padding:16px}.book-head{flex-direction:column}.thought-entry{margin-top:32px;margin-right:0}.thought-compose{padding:14px}.thought-compose textarea{min-height:150px}.footer-note{margin-top:28px}}
@media(prefers-reduced-motion:no-preference){button,input,textarea,.task-item,.record-item{transition:border-color .16s ease,background-color .16s ease,box-shadow .16s ease,transform .16s ease}.primary-button:active{transform:translateY(1px)}}
.book-card-copy{border:0;background:transparent;color:inherit;text-align:left}
@media(max-width:700px){#exportDataButton{display:inline-block}}
.book-card-copy{flex:1}.book-card-actions{display:flex;align-items:flex-start;gap:2px;padding:8px 6px 0 0;opacity:0;transition:opacity .15s}.book-card:hover .book-card-actions,.book-card:focus-within .book-card-actions{opacity:1}.book-card-action{border:0;padding:4px;background:transparent;color:var(--muted);font-size:14px}.book-card-action:hover{color:var(--ink)}.book-card-action.is-danger{color:#9a6b68}.toast{position:fixed;right:20px;bottom:20px;z-index:30;max-width:min(90vw,360px);padding:10px 14px;border:1px solid var(--line);border-radius:5px;background:var(--ink);color:#fff;font-size:13px;opacity:0;pointer-events:none;transform:translateY(8px);transition:opacity .2s,transform .2s}.toast.is-visible{opacity:1;transform:translateY(0)}
.sync-bar[data-auth-state="restoring"]{color:var(--focus)}.sync-bar[data-auth-state="offline"],.sync-bar[data-auth-state="expired"]{color:#9A6B68}.sync-bar[data-auth-state="signing-out"]{color:var(--muted)}.sync-bar[data-auth-state="offline"] .logout-button,.sync-bar[data-auth-state="expired"] .logout-button{border-color:#cda7a4;color:#9A6B68}
@media(max-width:700px){.sync-bar{flex-wrap:wrap;justify-content:flex-end;gap:6px}.sync-bar>div{flex:1 1 100%;justify-content:flex-end}.sync-bar #retrySyncButton,.sync-bar #signOutButton{display:inline-flex}}
.app-shell.is-thoughts-open .tabs{display:flex}.thoughts-heading .date-label{margin:0 0 7px}.thought-back-button{display:none}
@media(max-width:700px){.tabs{grid-template-columns:repeat(5,1fr)}.app-shell.is-thoughts-open .tabs{display:grid}}

/* Timeline composer: a single quiet action card with one clear input sequence. */
.timeline-form{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,.95fr) minmax(0,1.3fr);grid-template-areas:"title title title" "time category submit";gap:16px;align-items:center;margin-bottom:30px;padding:34px 36px;border:1px solid #dce1e3;border-radius:14px;background:#fff;box-shadow:0 10px 28px rgba(55,68,78,.045)}
.timeline-form .time-fields,.timeline-form .category-picker,.timeline-form .record-title-field textarea{min-width:0;min-height:52px;border:1px solid #d6dde1;border-radius:8px;background:#fff}
.timeline-form .record-time-fields{grid-area:time}.timeline-form .record-category-picker{grid-area:category}.timeline-form .record-title-field{grid-area:title}.record-submit-button{grid-area:submit}
.timeline-form .time-fields{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:10px;padding:0 16px;color:var(--focus);font-size:18px}
.timeline-form .time-fields:focus-within{border-color:var(--focus);box-shadow:0 0 0 3px rgba(89,104,117,.12)}
.timeline-form .time-fields input{width:100%;min-width:0;border:0;border-radius:0;padding:0;background:transparent;box-shadow:none;color:var(--ink);font-size:18px;line-height:1.2;text-align:center}
.timeline-form .time-fields input:focus{box-shadow:none}.timeline-form .time-fields input::-webkit-calendar-picker-indicator{display:none}
.timeline-form .record-title-field{min-width:0}.timeline-form .record-title-field textarea{display:block;width:100%;height:52px;max-height:none;padding:13px 16px;color:var(--ink);font-size:18px;line-height:1.4;resize:vertical}.timeline-form .record-title-field textarea::placeholder{color:#929296}
.timeline-form .category-picker{min-width:0;padding:0 16px}.timeline-form .category-picker select{padding:0;color:var(--ink);font-size:18px}.timeline-form .category-swatch{width:12px;height:12px;flex-basis:12px}
.record-submit-button{min-height:52px;border-radius:8px;font-size:17px}
@media(max-width:700px){.timeline-form{grid-template-columns:minmax(0,1.28fr) minmax(0,.8fr);grid-template-areas:"time category" "title title" "submit submit";gap:12px;padding:28px 16px;margin-bottom:26px}.timeline-form .record-submit-button{width:100%;min-height:52px}.timeline-form .time-fields{gap:7px;padding:0 10px;font-size:16px}.timeline-form .time-fields input,.timeline-form .category-picker select,.timeline-form .record-title-field textarea{font-size:16px}.timeline-form .category-picker{padding:0 12px}.timeline-form .record-title-field textarea{min-height:52px;padding:14px 15px}}

/* Reading notes: searchable shelf grid with an intentional, lightweight selection state. */
.book-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.45fr);gap:28px;align-items:start}
.book-library{min-width:0}.book-library-toolbar{display:flex;align-items:center;gap:10px;margin-bottom:14px}.book-library-toolbar input{width:100%;min-height:42px;padding:9px 12px}.book-count{flex:none;color:var(--muted);font-size:12px;white-space:nowrap}
.book-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.book-card{position:relative;display:flex;min-width:0;min-height:166px;overflow:hidden;border:1px solid var(--line);border-radius:10px;background:var(--card);box-shadow:0 2px 8px rgba(29,29,31,.025);transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease}.book-card:hover{border-color:#b6c0c6;box-shadow:0 6px 16px rgba(29,29,31,.07);transform:translateY(-1px)}.book-card.is-selected{border-color:var(--focus);box-shadow:0 0 0 2px rgba(89,104,117,.12)}
.book-card-copy{display:grid;align-content:space-between;gap:5px;width:100%;min-width:0;border:0;padding:16px;background:transparent;color:var(--ink);text-align:left}.book-card-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px;line-height:1.45}.book-card-copy small{overflow:hidden;color:var(--muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.book-card-kicker{color:var(--focus);font-size:11px;font-weight:700;letter-spacing:.04em}.book-stars{color:var(--focus);font-size:13px;letter-spacing:1px}.book-card-actions{position:absolute;right:7px;bottom:7px;display:flex;gap:2px;padding:0;opacity:0;transition:opacity .16s ease}.book-card:hover .book-card-actions,.book-card:focus-within .book-card-actions{opacity:1}.book-card-action{min-height:28px;border:0;border-radius:4px;padding:4px 6px;background:rgba(255,255,255,.9);color:var(--focus);font-size:11px;font-weight:650}.book-card-action:hover{background:#eef1f2}.book-card-action.is-danger{color:#9a6b68}.book-empty{grid-column:1/-1;padding:38px 14px;border:1px dashed var(--line);border-radius:10px;color:var(--muted);text-align:center;font-size:13px}
.book-detail{min-height:460px;padding:30px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:0 8px 24px rgba(55,68,78,.06)}
.book-detail[hidden]{display:none}
.book-head{padding-bottom:25px}
.book-head h3{font-size:26px}
.note-section{padding-top:27px}
.note-section-title{margin-bottom:12px}
.note-section-title h4{font-size:21px}
.note-section-title span{font-size:13px;color:#9aa8b2}
.note-form{grid-template-columns:auto 1fr auto;align-items:center;gap:10px}
.note-form textarea{grid-column:1/-1;min-height:140px;padding:16px;border-color:#dfe5e8;border-radius:9px}
.note-form .text-button{grid-column:1/-1;justify-self:center;min-height:32px;color:var(--focus);font-size:14px}
.note-form .text-button:disabled{visibility:hidden}
.upload-button{border-color:#dfe5e8;border-radius:9px;padding:9px 16px;background:#fff;color:var(--focus)}
.note-form .primary-button{justify-self:end;border-radius:9px}
.note-list{margin-top:12px}
.note-empty{font-size:14px}

@media(max-width:700px){
  .book-carousel{--book-card-width:min(76vw,300px);margin-right:-16px;margin-left:-16px}
  .book-list{gap:12px;min-height:210px}
  .book-card{min-height:196px}
  .book-detail{min-height:0;padding:24px 18px;border-radius:12px}
  .book-head h3{font-size:22px}
  .note-form{grid-template-columns:1fr auto}
  .note-form .upload-button{justify-self:start}
  .note-form .primary-button{justify-self:end}
}

@media(prefers-reduced-motion:reduce){.book-card{transition:none}}

/* Email OTP stays in normal document flow so it remains reachable above a mobile keyboard. */
.auth-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(250px,340px);gap:20px;align-items:end;margin:20px 0 0;padding:18px;border:1px solid var(--line);border-radius:8px;background:var(--card)}.auth-panel[hidden]{display:none}.auth-message{margin-top:5px;color:var(--muted);font-size:13px;line-height:1.55}.auth-message.is-failed{color:#9A6B68}.auth-form{display:grid;gap:7px}.auth-form label{font-size:13px;font-weight:650}.auth-form input{width:100%;letter-spacing:.24em;text-align:center}.auth-actions{display:grid;grid-template-columns:1fr 1.25fr;gap:8px}.auth-actions .logout-button,.auth-actions .primary-button{width:100%;min-height:44px}.auth-actions .logout-button{font-size:14px}
.migration-dialog{width:min(92vw,440px);border:1px solid var(--line);border-radius:8px;padding:22px;background:var(--card);color:var(--ink);box-shadow:0 18px 50px rgba(29,29,31,.16)}.migration-dialog::backdrop{background:rgba(29,29,31,.22)}.migration-counts{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:20px 0;padding:0;list-style:none}.migration-counts li{display:flex;justify-content:space-between;padding:9px 10px;border:1px solid var(--line);border-radius:5px;color:var(--muted);font-size:13px}.migration-counts strong{color:var(--ink)}.migration-meta,.migration-backup-status{color:var(--muted);font-size:13px}.migration-backup-status{margin-top:8px}.migration-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}
.migration-progress{height:5px;margin-top:14px;overflow:hidden;border-radius:99px;background:var(--line)}.migration-progress span{display:block;width:0;height:100%;border-radius:inherit;background:var(--focus);transition:width .2s ease,background-color .2s ease}.migration-dialog[data-migration-state="preparing"] .migration-progress span{width:55%;background:var(--focus)}.migration-dialog[data-migration-state="completed"] .migration-progress span{width:100%;background:#718b78}.migration-dialog[data-migration-state="failed"]{border-color:#cda7a4}.migration-dialog[data-migration-state="failed"] .migration-progress span{width:100%;background:#9A6B68}.migration-dialog[data-migration-state="aborted"] .migration-progress span{width:0;background:#A38652}.migration-dialog[data-migration-state="failed"] .migration-backup-status{color:#9A6B68}.migration-dialog[data-migration-state="aborted"] .migration-backup-status{color:#A38652}.migration-dialog[data-migration-state="completed"] .migration-backup-status{color:#718b78}
@media(max-width:700px){.auth-panel{grid-template-columns:1fr;gap:14px;margin-top:14px;padding:16px}.auth-form{gap:8px}.auth-form input{min-height:48px;font-size:18px}.auth-actions{grid-template-columns:1fr}.auth-actions .logout-button,.auth-actions .primary-button{min-height:48px}.auth-panel{scroll-margin-top:14px}}

@media(min-width:1000px){.app-shell{width:min(100%,1120px)}.note-item--excerpt .excerpt-media{width:96%}}
@media(max-width:700px){.book-detail{padding:16px}.note-section{padding-top:24px}.note-section+.note-section{margin-top:30px}.note-section-title{align-items:flex-start}.note-section-title span{text-align:right}.note-form{grid-template-columns:1fr 1fr}.note-form .upload-button,.note-form .primary-button{width:100%;justify-content:center}.note-form .text-button{grid-column:1/-1}.note-list{gap:12px;margin-top:14px}.note-item{padding:14px}.note-item--excerpt .note-copy:not(.is-expanded) .excerpt-media{max-height:560px}.note-item--excerpt .excerpt-media{width:100%}.note-item--reflection .note-copy:not(.is-expanded) .note-text{-webkit-line-clamp:8}.note-action-wrap{top:8px;right:8px}.note-footer{padding-right:38px}}

/* Match each card to the P2 panel width while keeping neighboring cards visible. */
.book-carousel{--book-card-width:326px;width:100vw;margin-left:calc((100% - 100vw)/2);margin-right:calc((100% - 100vw)/2)}
.book-list{min-height:0}
.book-card{width:var(--book-card-width);height:auto;min-height:0;aspect-ratio:2 / 1}
.book-card-copy strong{display:block;width:10em;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:700px){.book-carousel{--book-card-width:min(326px,calc(100vw - 32px))}}

/* Compact sync and account utility group. */
.sync-bar{position:relative;gap:12px}
.sync-status-button,.account-menu-button{border:0;padding:0;background:transparent;color:var(--focus)}
.sync-status-button{display:inline-flex;align-items:center;gap:6px;min-height:36px;color:var(--muted);font-size:13px;line-height:1;white-space:nowrap}.sync-status-button #syncStatus{display:none}
.sync-status-button:hover,.sync-status-button:focus-visible{color:var(--focus)}
.sync-icon{width:24px;height:24px}.sync-icon svg{display:block;width:100%;height:100%}
.sync-icon.is-online{color:var(--focus)}
.account-menu-wrap{position:relative}
.account-menu-button{display:flex;align-items:center;gap:7px;min-height:40px}
.account-avatar{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#eef0f1;color:var(--focus)}
.account-avatar svg{width:22px;height:22px}.account-chevron{font-size:18px;line-height:1;transform:translateY(-2px)}
.account-menu{position:absolute;top:calc(100% + 7px);right:0;z-index:12;display:grid;min-width:148px;padding:5px;border:1px solid var(--line);border-radius:8px;background:var(--card);box-shadow:0 12px 26px rgba(29,29,31,.12)}.account-menu[hidden]{display:none}
.account-menu button{min-height:34px;border:0;border-radius:5px;padding:7px 9px;background:transparent;color:var(--ink);font-size:13px;text-align:left}.account-menu button:hover,.account-menu button:focus-visible{background:#f0f0ed}.account-menu #signOutButton{color:#9a6b68}
@media(max-width:700px){.sync-bar{flex-wrap:nowrap;gap:16px}.sync-status-button{width:40px;min-height:40px;justify-content:center}.sync-status-button #syncStatus{display:none}.sync-icon{width:28px;height:28px}.account-menu-button{min-height:40px}.account-avatar{width:40px;height:40px}.account-chevron{display:none}.account-menu{top:calc(100% + 8px);right:0}.sync-bar #retrySyncButton,.sync-bar #signOutButton{display:block}}

/* Keep the card content centered; the detail panel below starts directly with notes. */
.book-card{position:relative}
.book-card-top{position:absolute;top:12px;right:14px;left:14px;z-index:1;min-height:0;padding:0}
.book-card-copy{display:grid;align-content:center;justify-items:center;height:100%;padding:28px 20px 16px;text-align:center;cursor:pointer}
.book-card-copy strong{width:10em;max-width:100%;text-align:center}
.book-card-copy small{max-width:100%;text-align:center}
.book-card-copy .book-stars{display:flex;justify-content:center;gap:0}
.book-card-copy .star-button{font-size:20px}
.book-detail>.note-section:first-child{padding-top:0}

.conflict-dialog{width:min(94vw,860px)}.conflict-note{margin:16px 0;color:var(--muted);line-height:1.6}.conflict-versions{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:14px 0}.conflict-versions section{min-width:0;border:1px solid var(--line);border-radius:5px;padding:12px;background:#f7f7f5}.conflict-versions h4,.conflict-merge-label{font-size:13px}.conflict-versions pre{max-height:220px;margin:8px 0 0;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.6 inherit}.conflict-dialog textarea{width:100%;min-height:130px;margin-top:7px;resize:vertical}.conflict-dialog .migration-actions{flex-wrap:wrap}@media(max-width:700px){.conflict-versions{grid-template-columns:1fr}.conflict-versions pre{max-height:160px}.conflict-dialog .migration-actions{justify-content:stretch}.conflict-dialog .migration-actions button{flex:1 1 100%}}

/* Final shelf overrides: these deliberately supersede the retired carousel rules above. */
.book-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.45fr);gap:28px;align-items:start}.book-layout.is-empty{display:block}.book-library{min-width:0}.book-library-toolbar{display:flex;align-items:center;gap:10px;margin-bottom:14px}.book-library-toolbar input{width:100%;min-height:42px;padding:9px 12px}.book-count{flex:none;color:var(--muted);font-size:12px;white-space:nowrap}.book-list{display:grid;width:auto;min-height:0;padding:0;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.book-layout.is-empty .book-list{display:grid;width:auto;min-height:0;place-items:normal;padding:0}.book-card{position:relative;display:flex;width:auto;height:auto;min-width:0;min-height:166px;aspect-ratio:auto;overflow:hidden;border:1px solid var(--line);border-radius:10px;background:var(--card);box-shadow:0 2px 8px rgba(29,29,31,.025);opacity:1;transform:none;transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease}.book-card:hover{border-color:#b6c0c6;box-shadow:0 6px 16px rgba(29,29,31,.07);transform:translateY(-1px)}.book-card.is-selected{border-color:var(--focus);box-shadow:0 0 0 2px rgba(89,104,117,.12)}.book-card-copy{display:grid;align-content:space-between;justify-items:stretch;width:100%;height:auto;padding:16px;background:transparent;color:var(--ink);text-align:left;cursor:pointer}.book-card-copy strong,.book-card-copy small{width:auto;max-width:100%;text-align:left}.book-card-copy strong{font-size:16px;line-height:1.45}.book-card-copy .book-stars{display:block;justify-content:normal;color:var(--focus);font-size:13px;letter-spacing:1px}.book-card-actions{position:absolute;right:7px;bottom:7px;display:flex;align-items:center;gap:2px;padding:0;opacity:0;transition:opacity .16s ease}.book-card:hover .book-card-actions,.book-card:focus-within .book-card-actions{opacity:1}.book-card-action{width:auto;min-height:28px;border:0;border-radius:4px;padding:4px 6px;background:rgba(255,255,255,.9);color:var(--focus);font-size:11px;font-weight:650;line-height:1}.book-card-action.is-danger{color:#9a6b68}.book-empty{grid-column:1/-1;padding:38px 14px;border:1px dashed var(--line);border-radius:10px;color:var(--muted);text-align:center;font-size:13px}.book-detail{min-height:460px;padding:30px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:0 8px 24px rgba(55,68,78,.06)}
@media(max-width:700px){.book-layout{grid-template-columns:1fr;gap:18px}.book-list{gap:10px}.book-card{min-height:154px}.book-detail{min-height:0;padding:18px}.book-library-toolbar{margin-bottom:12px}}

/* A single reading composer makes the choice between source material and reflection explicit. */
.reading-notebook-head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;max-width:760px;margin:0 auto 26px;padding-bottom:22px;border-bottom:1px solid var(--line)}.reading-notebook-head h3{font-size:28px}.reading-notebook-head p:not(.date-label){margin-top:4px;color:var(--muted);font-size:14px}.reading-rating{display:grid;justify-items:end;gap:4px;color:var(--muted);font-size:12px}.reading-rating-copy{display:flex;align-items:baseline;gap:7px}.reading-rating-copy strong{color:var(--ink);font-size:13px}.rating{display:flex;gap:1px}.star-button{font-size:20px}.reading-capture{max-width:760px;margin:0 auto;padding:22px;border:1px solid #dfe5e8;border-radius:12px;background:#fbfcfc}.reading-capture-copy{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-bottom:16px}.reading-capture-copy h4{font-size:18px}.reading-capture-copy p{color:var(--muted);font-size:13px}.note-type-switch{display:inline-flex;gap:2px;margin-bottom:12px;padding:3px;border:1px solid var(--line);border-radius:8px;background:#fff}.note-type-switch button{min-height:32px;border:0;border-radius:5px;padding:5px 13px;background:transparent;color:var(--muted);font-size:13px;font-weight:650}.note-type-switch button.is-active{background:var(--focus);color:#fff}.reading-capture .note-form{display:grid;grid-template-columns:1fr;gap:10px}.reading-capture .note-form textarea{min-height:128px;max-height:260px;padding:14px;border-radius:8px;background:#fff}.note-form-actions{display:flex;align-items:center;justify-content:space-between;gap:10px}.reading-capture .upload-button{min-height:38px;padding:7px 11px;border-radius:7px;font-size:13px}.reading-capture .primary-button{min-height:40px;border-radius:7px}.reading-capture .text-button{justify-self:start}.book-detail .note-section{padding-top:30px}.book-detail .note-section+.note-section{margin-top:30px}.note-section-title h4{font-size:18px}.note-section-title span{color:var(--muted);font-size:12px}@media(max-width:700px){.reading-notebook-head{display:grid;gap:14px;margin-bottom:18px;padding-bottom:16px}.reading-notebook-head h3{font-size:23px}.reading-rating{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid #dfe5e8;border-radius:10px;background:#fbfcfc}.reading-rating-copy{display:grid;gap:1px}.reading-rating-copy strong{font-size:12px}.rating{gap:0}.star-button{display:grid;place-items:center;width:44px;height:44px;padding:0;font-size:25px}.reading-capture{padding:16px}.reading-capture-copy{display:block}.reading-capture-copy p{margin-top:4px}.note-form-actions{align-items:stretch}.reading-capture .upload-button,.reading-capture .primary-button{justify-content:center}.book-detail .note-section{padding-top:24px}}

/* Preview an uploaded image before it becomes part of the saved note. */
.note-image-preview{position:relative;overflow:hidden;border:1px solid var(--line);border-radius:8px;background:#fff}.note-image-preview img{display:block;width:100%;max-height:340px;object-fit:contain}.note-image-remove{position:absolute;top:8px;right:8px;min-height:30px;border:0;border-radius:5px;padding:5px 8px;background:rgba(29,29,31,.76);color:#fff;font-size:12px}.note-image-remove:hover{background:var(--ink)}

@media(min-width:701px){.tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:end;gap:0}.tab{width:100%;text-align:center;letter-spacing:.065em}.tab.is-active{border-bottom-width:3px}}

/* Library first, editor second: keep the shelf readable instead of splitting attention. */
.book-layout{display:block}.book-library{margin-bottom:30px}.book-library-toolbar{max-width:680px}.book-list{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.book-card{min-height:142px}.book-card-copy{padding:14px}.book-detail{width:100%;min-height:0;max-width:none;padding:32px;border-radius:12px}.book-detail .note-section{max-width:760px;margin-inline:auto}.book-detail .note-section+.note-section{margin-top:34px}.book-card-actions{opacity:0}.book-card:hover .book-card-actions,.book-card:focus-within .book-card-actions{opacity:1}@media(max-width:900px){.book-list{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:700px){.book-library{margin-bottom:22px}.book-library-toolbar{max-width:none}.book-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.book-card{min-height:138px}.book-detail{padding:20px 16px}.book-detail .note-section{max-width:none}}
