*{box-sizing:border-box}body{margin:0;background:#f4f3ed;color:#292e24;font-family:system-ui,-apple-system,"PingFang SC",sans-serif;font-size:14px}header{max-width:1040px;margin:0 auto;padding:30px 28px;display:flex;align-items:center;justify-content:space-between}.brand{font-size:21px;font-weight:750;text-decoration:none;color:inherit;letter-spacing:2px}.brand span{font-size:11px;letter-spacing:3px;margin-left:10px;font-weight:500;color:#747c65}.header-note{font-size:12px;color:#7d836f}main{max-width:984px;margin:8px auto 50px;padding:42px 44px 28px;background:#fffefb;border:1px solid #e2e3d8;border-radius:8px;min-height:450px;box-shadow:0 7px 25px #252e1c05}h1{font-size:31px;font-weight:650;letter-spacing:-.8px;line-height:1.5;margin:5px 0 8px}h2{font-size:20px;font-weight:650;margin:0 0 7px}p{line-height:1.8}.eyebrow{font-size:11px;letter-spacing:2px;color:#7b8568;margin:0}.muted{font-size:12px;color:#7a816f;margin:6px 0 16px}.heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.heading .muted{margin-bottom:0}button,input{font:inherit}button{border:1px solid transparent;border-radius:5px;background:#4a583e;color:#fff;cursor:pointer;padding:11px 16px;font-weight:550;white-space:nowrap}button:hover{filter:brightness(.95)}button:disabled{opacity:.5;cursor:wait}.secondary{background:transparent;color:#526146;border:1px solid #d7ddcc}.icon{color:#7d846f;background:none;font-size:23px;padding:0 4px;line-height:1.1}.entry{display:flex;gap:10px}input{border:1px solid #d7ddcc;border-radius:5px;background:#fffefb;padding:12px 14px;width:100%;min-width:0;color:#303a27}input:focus{outline:2px solid #a8b59a;outline-offset:2px}label{display:block;font-size:13px;font-weight:600;margin:21px 0 9px}.entry input{flex:1}.entry button{flex-shrink:0}.stats{display:grid;grid-template-columns:repeat(3,1fr);margin:28px 0 24px;background:#f7f8f1;border:1px solid #e5e9dc;border-radius:6px}.stats div{padding:19px 24px;display:flex;justify-content:space-between;align-items:center;gap:10px}.stats div+div{border-left:1px solid #e5e9dc}.stats span{font-size:12px;color:#7b846d}.stats strong{font-size:29px;font-weight:550}nav{display:flex;gap:23px;border-bottom:1px solid #e0e3d7}.tab{background:transparent;color:#7e8572;border:0;border-bottom:2px solid transparent;border-radius:0;padding:14px 0}.tab.active{color:#34472a;border-bottom-color:#4a583e}.view{padding:28px 0 14px;min-height:345px}.section-head{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:18px}.section-head .muted{margin-bottom:0}.filters{display:flex;gap:8px;margin:23px 0 8px}.chip{padding:6px 13px;background:transparent;font-size:12px;color:#838b75;border:1px solid transparent;border-radius:20px}.chip.active{color:#4d603e;background:#eef2e7;border-color:#e1e8d7}.list{list-style:none;padding:0;margin:0}.list>li{padding:17px 0;border-bottom:1px solid #ebeee4;display:flex;align-items:center;gap:13px}.list .empty{padding:45px 0;color:#8c937e;justify-content:center;font-size:13px}.todo-title{flex:1;overflow-wrap:anywhere;font-size:15px;line-height:1.7}.done .todo-title{text-decoration:line-through;color:#8b9480}.toggle{width:24px;height:24px;min-width:24px;padding:0;border:1px solid #abb79d;background:transparent;border-radius:4px;color:#fff}.done .toggle{background:#6a7e56;border-color:#6a7e56}.row-actions{display:flex;gap:8px;align-items:center}.text-button{padding:5px 8px;background:none;color:#718360;font-size:12px;font-weight:500}.danger{color:#a77b67}.source-body{flex:1;min-width:0}.source-title{font-size:15px;font-weight:600;display:flex;gap:12px;align-items:center}.badge{font-size:10px;font-weight:500;border-radius:20px;background:#eef3e7;color:#65804a;padding:3px 8px}.badge.off{background:#f0f1ed;color:#969b8d}.source-url{color:#858e78;font-size:12px;margin:7px 0 0;overflow-wrap:anywhere;line-height:1.6}.note{font-size:12px;color:#7f886f;background:#f8f9f3;border-radius:5px;padding:13px 16px;margin:22px 0 0}footer{border-top:1px solid #e7eadf;padding-top:20px;margin-top:10px;display:flex;gap:12px;justify-content:space-between;color:#8b927e;font-size:11px}#status,.error{font-size:13px;color:#a46950;min-height:0}#status:empty{display:none}.login{max-width:570px;padding:27px 0 35px}.login h1{font-size:43px;line-height:1.5;margin-top:14px}.intro{color:#768168;font-size:14px;margin:17px 0 26px}.login .muted{margin-top:15px}dialog{padding:28px;width:min(480px,calc(100% - 32px));border:1px solid #dce2d0;border-radius:9px;color:inherit;background:#fffefb;box-shadow:0 18px 80px #1c291c24}dialog::backdrop{background:#26301f55}.dialog-head{display:flex;justify-content:space-between;align-items:baseline;gap:15px}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;border-top:1px solid #e5e9dd;margin-top:25px;padding-top:20px}.checkbox-label{display:flex;gap:9px;align-items:center;font-weight:400}.checkbox-label input{width:16px;height:16px;accent-color:#60764d}button:focus-visible,a:focus-visible{outline:2px solid #99ae86;outline-offset:3px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}[hidden]{display:none!important}@media(max-width:650px){header{padding:24px 20px}.header-note{display:none}main{margin:0 10px 24px;padding:25px 21px 20px}.heading{align-items:flex-start}.heading h1{font-size:23px}.heading>.secondary{font-size:11px;padding:8px}.stats{margin-top:23px}.stats div{flex-direction:column;align-items:flex-start;padding:15px 14px;gap:8px}.stats strong{font-size:25px}.stats span{font-size:11px}.section-head{align-items:flex-start;gap:12px}.section-head h2{font-size:18px}.section-head>button{font-size:12px;padding:10px}.entry button{padding:10px;font-size:12px}.todo-title{font-size:14px}.row-actions{gap:2px}.text-button{padding:5px;font-size:11px}.sources>li{align-items:flex-start;flex-wrap:wrap;gap:8px}.sources .source-body{flex-basis:100%}.sources .row-actions{margin-left:auto}.view{padding-top:24px}.login h1{font-size:34px}footer{flex-direction:column;gap:7px}}
:root {
  color-scheme:light;
  --paper:#f7f5ef;
  --surface:#fffdf8;
  --ink:#262b24;
  --muted:#5d665a;
  --pine:#254237;
  --pine-dark:#192f27;
  --leaf:#e8eee6;
  --line:#e1e0d5;
  --line-strong:#cdcec1;
  --serif:"Songti SC","Noto Serif CJK SC","Noto Serif SC",Georgia,serif;
  --radius:16px;
}
body { background:var(--paper); color:var(--ink); font-size:14px }
button { background:var(--pine); transition:background-color .15s,color .15s,border-color .15s; border-radius:9px }
button:hover { filter:none; background:var(--pine-dark) }
button.secondary { color:var(--pine); background:var(--surface); border-color:var(--line-strong) }
button.secondary:hover,button.text-button:hover { background:var(--leaf) }
button.text-button,button.icon { color:var(--pine); background:none }
button.danger { color:#8b4540 }
button:focus-visible,a:focus-visible,summary:focus-visible { outline:2px solid #50705b; outline-offset:3px }
input,select,textarea { border:1px solid var(--line-strong); border-radius:9px; background:var(--surface); color:var(--ink); font:inherit }
input:focus,select:focus,textarea:focus { outline:2px solid #779080; outline-offset:2px }
.muted { color:var(--muted) }
#global-header,#admin-shell { max-width:1480px; margin:0 auto }
#global-header { height:78px; padding:0 32px; gap:14px }
#global-header .brand { display:inline-flex; align-items:center; min-height:44px; gap:11px; flex-shrink:0; white-space:nowrap; letter-spacing:.08em; line-height:1; font-family:var(--serif); font-size:26px; font-weight:750 }
#global-header .brand img { display:block; width:36px; height:36px; border-radius:9px }
#global-header .secondary { min-height:40px; padding:7px 13px }
.header-actions,.view-actions { display:flex; gap:8px; align-items:center }
#admin-shell { padding:4px 32px 40px; min-height:0; border:0; border-radius:0; background:none; box-shadow:none }
#app-startup { margin:clamp(44px,12vh,120px) auto 0; text-align:center }
#startup-message { margin:0 0 14px; font-size:14px }
#dashboard { display:grid; grid-template-columns:166px minmax(0,1fr); gap:32px; align-items:start }
#management-menu { display:block; position:sticky; top:22px; margin:0; padding:4px 0; border:0 }
#reading-nav,#utility-nav { display:grid; gap:4px }
#utility-nav { border-top:1px solid var(--line); margin-top:12px; padding-top:12px }
#management-menu .tab { display:flex; align-items:center; gap:12px; min-height:46px; text-align:left; padding:9px 12px; border:0; border-radius:10px; color:var(--muted); width:100%; background:transparent }
#management-menu .tab:hover { background:#eeeee5 }
#management-menu .tab.active { color:var(--pine-dark); background:var(--leaf); font-weight:720 }
#management-menu #menu-more { display:none }
.nav-mark { width:16px; height:16px; display:inline-block; position:relative; flex-shrink:0; color:inherit }
.nav-home { border:1.5px solid currentColor; border-radius:4px 4px 3px 3px }
.nav-home::after { position:absolute; content:""; inset:3px; border-top:1.5px solid currentColor; border-radius:2px }
.nav-books { border:1.5px solid currentColor; border-radius:3px }
.nav-books::after { content:""; position:absolute; left:45%; height:100%; border-left:1.5px solid currentColor }
.nav-magazines::before,.nav-magazines::after { content:""; position:absolute; box-sizing:border-box; top:2px; width:8px; height:12px; border:1.5px solid currentColor }
.nav-magazines::before { left:0; border-right:0; border-radius:2px 1px 0 2px; transform:skewY(10deg) }
.nav-magazines::after { right:0; border-radius:1px 2px 2px 0; transform:skewY(-10deg) }
.nav-clips::before { content:""; position:absolute; inset:1px 3px; background:currentColor; clip-path:polygon(evenodd,0 0,100% 0,100% 100%,50% 70%,0 100%,0 0,15% 11%,15% 78%,50% 57%,85% 78%,85% 11%,15% 11%) }
.nav-sources { background:radial-gradient(circle at 3px 13px,currentColor 1.35px,transparent 1.6px) }
.nav-sources::before,.nav-sources::after { content:""; position:absolute; box-sizing:border-box; left:2px; bottom:2px; border:1.5px solid currentColor; border-width:1.5px 1.5px 0 0 }
.nav-sources::before { width:12px; height:12px; border-top-right-radius:100% }
.nav-sources::after { width:8px; height:8px; border-top-right-radius:100% }
.nav-preview { border:1.5px solid currentColor; border-radius:4px; height:17px; width:13px; margin-inline:1.5px; border-bottom-width:3px }
.nav-todos { border:1.5px solid currentColor; border-radius:4px }
.nav-todos::after { content:""; position:absolute; width:6px; height:3px; left:3px; top:4px; border-bottom:1.5px solid currentColor; border-left:1.5px solid currentColor; transform:rotate(-45deg) }
.nav-more::after { content:""; position:absolute; top:7px; left:7px; width:3px; height:3px; border-radius:50%; background:currentColor; box-shadow:-5px 0,5px 0 }
#work-area { min-width:0; padding:0 }
#dashboard .view { padding:0; margin:0; min-height:0 }
#dashboard .view:not(#view-home):not(#view-books):not(#view-magazines) { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:clamp(16px,3vw,30px) }
#dashboard .section-head { margin:0 0 20px; gap:12px; min-height:38px; flex-wrap:wrap }
#dashboard .section-head h2 { margin:0; font-family:var(--serif); font-size:clamp(25px,3vw,34px); font-weight:700; line-height:1.26 }
#dashboard .section-head button { min-height:38px; padding:7px 12px }
#dashboard .view-actions { justify-content:flex-start; flex-wrap:wrap }
#dashboard .filters { margin:14px 0 4px }
#dashboard .list>li { padding-block:12px }
#dashboard .note { margin:10px 0 }
#upload-progress:empty,#status:empty { display:none }
#status { padding:10px 12px; margin:0 0 12px; border:1px solid #e1cec0; border-radius:10px; background:#fbf2e8; color:#75432c }
#admin-shell .login { width:min(100%,910px); max-width:none; padding:0; display:grid; grid-template-columns:1.05fr 1fr; overflow:hidden; margin:clamp(28px,8vh,92px) auto 0; border:1px solid var(--line); border-radius:22px; background:var(--surface) }
.login-main { padding:clamp(28px,6vw,68px); align-self:center }
#admin-shell .login h1 { margin:0; font:700 clamp(29px,4.5vw,49px)/1.16 var(--serif); letter-spacing:.02em }
.login-intro { margin:13px 0 25px; color:var(--muted) }
.login .entry { align-items:stretch; gap:8px }
.login-art { background:#d5cbb5; position:relative; min-height:405px }
.login-art img { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:cover; object-position:66% 50% }
.login #remember-login { flex:0 0 16px }
#login-form .checkbox-label { min-height:42px; margin-block:8px 0 }
dialog { border-color:var(--line); border-radius:var(--radius); background:var(--surface); box-shadow:0 18px 60px #18291d29; max-height:calc(100dvh - 30px); overscroll-behavior:contain }
dialog::backdrop { background:#16241e70 }
dialog .dialog-head .icon { min-width:40px; min-height:40px }
#status p { margin:0 }
@media(max-width:790px) {
  #global-header { height:auto; min-height:58px; padding:8px max(16px,env(safe-area-inset-right)) 8px max(16px,env(safe-area-inset-left)); padding-top:max(8px,env(safe-area-inset-top)); position:sticky; top:0; z-index:3; background:var(--paper); border-bottom:1px solid var(--line) }
  #global-header .brand { font-size:23px }
  #global-header .brand img { width:32px; height:32px; border-radius:8px }
  #global-header .secondary { min-height:44px; font-size:13px }
  #admin-shell { padding:14px max(14px,env(safe-area-inset-right)) 24px max(14px,env(safe-area-inset-left)) }
  #dashboard { display:block; padding-bottom:calc(70px + env(safe-area-inset-bottom)) }
  #management-menu { position:fixed; z-index:4; inset:auto 0 0; display:grid; grid-template-columns:4fr 1fr; padding:4px max(9px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(9px,env(safe-area-inset-left)); background:var(--surface); border-top:1px solid var(--line); box-shadow:0 -5px 18px #192f2708 }
  #reading-nav { grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; padding-right:4px }
  #management-menu .tab { flex-direction:column; justify-content:center; gap:4px; text-align:center; font-size:12px; padding:4px 2px; min-height:51px }
  #management-menu #menu-more { display:flex }
  #utility-nav { display:none }
  #management-menu.menu-expanded #utility-nav { display:grid; position:absolute; right:max(10px,env(safe-area-inset-right)); bottom:100%; width:min(220px,calc(100vw - 20px)); margin:0 0 8px; padding:5px; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 8px 28px #18291d24 }
  #utility-nav .tab { flex-direction:row; justify-content:flex-start; padding-inline:12px; gap:10px; min-height:44px; font-size:14px }
  #dashboard .section-head { margin-bottom:15px }
  #dashboard .section-head button,#dashboard .source-read,dialog button { min-height:44px }
  dialog :is(input:not([type="checkbox"]),select,textarea),#dashboard :is(input:not([type="checkbox"]),select,textarea) { font-size:16px }
}
@media(max-width:570px) {
  #admin-shell .login { grid-template-columns:1fr; width:min(100%,455px); margin-top:16px }
  .login-main { padding:23px 19px 14px; grid-row:2 }
  .login-art { min-height:138px; height:min(38vw,185px) }
  .login-art img { object-position:65% 63% }
  #login-form .entry input { font-size:16px; padding-inline:10px }
  .login-intro { margin-bottom:13px }
  dialog:not(.reading-fullscreen) { padding-inline:16px }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { transition-duration:0s!important; scroll-behavior:auto!important }
}

#account-login #google-login { display:flex; align-items:center; justify-content:center; gap:11px; width:100%; min-height:44px; border-color:#747775; background:#fff; color:#1f1f1f; font:500 14px/1.4 "Google Sans",Roboto,system-ui,sans-serif }
#account-login #google-login:hover { border-color:#747775; background:#f5f8ff }
#google-login svg { flex:none }
.login-divider { border-top:1px solid var(--line); margin:16px 0 14px }
#password-login label { margin:10px 0 5px }
#password-login input { min-height:44px; padding-block:8px }
#password-login button { width:100%; margin-top:14px; min-height:44px }
@media(max-width:790px){#password-login input{font-size:16px}}
#profile-dialog label { margin:14px 0 5px }
#profile-dialog select { width:100%; padding:9px 12px }
#profile-dialog .dialog-actions { margin-top:14px; padding-top:12px }
.profile-coords { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px }
.account-devices { border-top:1px solid var(--line); margin-top:19px; padding-top:12px }
.account-devices h3 { margin:0; font-family:var(--serif); font-size:17px }
#device-value { display:inline-block; padding:7px 10px; margin-top:8px; border-radius:8px; background:var(--leaf); color:var(--pine); letter-spacing:.1em; font:700 17px/1.5 ui-monospace,monospace }
#device-list li { justify-content:space-between; overflow-wrap:anywhere }
#profile-status:empty { display:none }
@media(max-width:790px) {
  #profile-open { min-height:44px }
}

.book-tools{flex-wrap:wrap}.book-tools select{width:auto;max-width:min(45vw,240px)}.book-tools button{white-space:nowrap}
.book-icon.has-cover{width:44px;height:62px;padding:0;overflow:hidden}
.book-icon img,#catalog-cover-preview img{display:block;width:100%;height:100%;object-fit:contain}
.book-info .book-byline{margin:3px 0;color:#426047;font-size:13px;overflow-wrap:anywhere}
.book-groups{margin:4px 0;color:#617055;font-size:12px}
.catalog-dialog{max-height:calc(100dvh - 36px);overflow:auto;width:min(94vw,592px)}
.catalog-dialog fieldset{padding:0;border:0;margin:0;min-width:0}.catalog-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 14px}
.catalog-fields label,.catalog-cover-controls label{min-width:0}.catalog-cover-controls{display:flex;align-items:center;gap:12px;margin:10px 0 16px}
.catalog-cover-controls button{padding:6px 10px;margin-top:7px}
#catalog-cover-preview:empty{display:none}#catalog-cover-preview{width:55px;height:75px;flex-shrink:0}
#catalog-group-options{display:flex;flex-wrap:wrap;gap:6px 14px}.catalog-members legend{padding:0;margin-bottom:4px}
#catalog-group-options label{display:flex;gap:5px;align-items:center;min-width:0}#catalog-group-options input[type=checkbox]{width:auto;margin:0}
#book-groups-dialog{width:min(94vw,480px);padding:12px 14px}
#book-groups-dialog .dialog-head{align-items:center;margin-bottom:10px}
#book-groups-title{margin:0}
#groups-close,#book-group-form button,#book-group-list button{min-height:44px}
#groups-close{min-width:44px}
#book-groups-dialog input{min-height:44px;padding:7px 10px;border-color:var(--line-strong)}
#book-group-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}
#book-group-list{margin:6px 0 0}
#book-group-list>li{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:4px;align-items:center;padding:3px 0;border:0}
#book-group-form button,#book-group-list button{min-width:44px;padding:5px 7px;font-size:13px}
#book-group-list .secondary{border-color:transparent}
#book-group-list button:hover{background:var(--leaf)}
#book-group-list:empty,#book-group-status:empty{display:none}
#book-lookup-results:empty{display:none}#book-lookup-results li{display:flex;gap:10px;align-items:center;justify-content:space-between}
#book-lookup-results small{display:block;color:#52624b}#book-lookup-results button{padding:6px 10px;white-space:nowrap}
#book-details-filename{margin:0 0 8px;overflow-wrap:anywhere;line-height:1.4}
#book-details-dialog .dialog-head{align-items:center}
#book-details-dialog label{margin:0 0 5px}
#book-details-dialog input:not([type=checkbox]),#book-details-dialog textarea{padding:8px 10px}
#book-details-dialog .catalog-fields{gap:8px 10px;align-items:end;margin-bottom:10px}
.catalog-title-field{grid-column:1/-1}
#book-details-dialog .catalog-fields label{margin:0}
.catalog-fields input{display:block;margin-top:3px}
.catalog-find{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:4px 6px}
.catalog-find button{min-height:44px;padding:5px 9px}
#catalog-description{display:block;width:100%;resize:vertical}
.catalog-cover-controls{margin:10px 0}
.catalog-cover-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.catalog-cover-controls button{margin-top:0}
#catalog-cover-status{flex-basis:100%;margin:0}
#catalog-cover-status:empty,#book-details-status:empty{display:none}
#catalog-group-options{gap:5px 12px}
#catalog-group-options label{margin:0;min-height:31px}
#book-details-form .dialog-actions{margin-top:12px;padding-top:10px}
@media(max-width:560px){.catalog-dialog{padding:14px 16px}.catalog-cover-controls{gap:8px}}
@media(max-width:360px){#book-details-dialog .catalog-fields{gap:7px}#book-details-dialog .catalog-cover-actions{gap:4px}}

.shelf-heading { align-items:center }
.shelf-heading #book-capacity { display:block; margin:5px 0 0; font-size:12px }
.shelf-heading .view-actions { gap:6px }
#view-books .book-tools { margin:0 0 16px; display:flex; align-items:stretch; gap:8px; padding:10px; background:var(--surface); border:1px solid var(--line); border-radius:13px }
.book-search-wrap { position:relative; flex:1 1 225px; min-width:0 }
.book-search-wrap::before { content:""; pointer-events:none; position:absolute; width:10px; height:10px; border:1.5px solid #586b5c; border-radius:50%; top:13px; left:13px }
.book-search-wrap::after { content:""; pointer-events:none; position:absolute; width:6px; border-top:1.5px solid #586b5c; top:24px; left:23px; transform:rotate(43deg) }
#book-search { height:41px; padding:8px 12px 8px 36px; width:100%; max-width:none; scroll-margin-top:75px }
#book-group-filter { height:41px; min-width:0; max-width:165px; padding-inline:9px; color:var(--pine) }
#manage-book-groups { padding:6px 10px }
.shelf-modes { display:flex; align-items:center; gap:2px; padding:3px; border:1px solid var(--line); border-radius:9px; color:var(--pine) }
.shelf-modes button { position:relative; padding:0; width:35px; min-height:34px; border:0; color:inherit; background:transparent; border-radius:6px }
.shelf-modes button[aria-pressed="true"],.shelf-modes button:hover { background:var(--leaf) }
.shelf-modes button::before { content:""; display:block; width:15px; height:15px; margin:auto; background:currentColor }
#books-grid::before { width:6px; height:6px; margin:0; position:absolute; top:calc(50% - 7.5px); left:calc(50% - 7.5px); box-shadow:9px 0,0 9px,9px 9px }
#books-list::before { background:repeating-linear-gradient(0deg,currentColor 0 2px,transparent 2px 5px) }
#shelf-status { margin:0 0 10px }
#shelf-status:empty { display:none }
#books[data-mode="grid"] { --shelf-row-gap:19px; display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,171px),1fr)); align-items:start; gap:var(--shelf-row-gap) 13px }
#books[data-mode="grid"][data-masonry] { grid-auto-rows:4px; row-gap:0 }
#books[data-mode="grid"]>li[data-book-id] { position:relative; min-width:0; padding:0; display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:4px; align-items:start; border:0 }
.book-jacket { --cover-bg:#dce4d9; --cover-ink:#2f493c; display:flex; flex-direction:column; justify-content:space-between; align-items:flex-start; position:relative; isolation:isolate; width:100%; aspect-ratio:4/5; border:0; border-radius:10px 13px 13px 10px; color:var(--cover-ink); background:var(--cover-bg); overflow:hidden; padding:14% 12%; white-space:normal; text-align:left; box-shadow:inset 4px 0 #24392a27 }
#books[data-mode="grid"] .book-jacket { grid-column:1/-1 }
button.book-jacket:hover { background:var(--cover-bg) }
.book-jacket:focus-visible { outline-offset:4px }
.book-jacket::before { content:""; position:absolute; left:5%; top:0; bottom:0; border-left:1px solid #33423525 }
.book-jacket[data-palette="1"] { --cover-bg:#e9dec7; --cover-ink:#4e3b2b }
.book-jacket[data-palette="2"] { --cover-bg:#e4dcdb; --cover-ink:#4d414f }
.book-jacket[data-palette="3"] { --cover-bg:#d7e1e3; --cover-ink:#27434c }
.book-jacket-title { font:700 clamp(17px,2vw,27px)/1.31 var(--serif); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere }
.book-jacket-format { font-size:11px; font-weight:680; letter-spacing:.08em; border-top:1px solid currentColor; padding-top:4px }
.book-jacket img { position:absolute; z-index:1; inset:0; width:100%; height:100%; object-fit:contain; background:#e7e5dc }
#books[data-mode="grid"] .book-jacket:has(img) { display:block; aspect-ratio:auto; padding:0 }
#books[data-mode="grid"] .book-jacket img { position:relative; display:block; height:auto }
.book-jacket:has(img):hover img { filter:brightness(.97) }
.book-info { min-width:0; flex:1 }
#books[data-mode="grid"] .book-info { padding:9px 0 0 1px }
#books .book-title { color:var(--pine-dark); font-size:15px; font-weight:700; line-height:1.45; overflow-wrap:anywhere; text-align:left; white-space:normal; background:transparent; border:0; padding:0 }
#books .book-title:hover { text-decoration:underline; text-underline-offset:3px }
#books[data-mode="grid"] .book-title { display:block; max-width:100% }
#books .book-byline,#books .book-identifiers,#books .book-meta,#books .book-groups { margin:4px 0 0; color:var(--muted); font-size:12px; line-height:1.45; overflow-wrap:anywhere }
#books[data-mode="grid"] :is(.book-meta,.book-identifiers) { display:none }
#books[data-mode="grid"] :is(.book-byline,.book-groups) { overflow:hidden; display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical }
.book-menu { position:relative; flex-shrink:0; text-align:left }
#books[data-mode="grid"] .book-menu { margin-top:6px }
#books li:has(.book-menu[open]) { z-index:2 }
.book-menu summary { display:grid; place-items:center; width:38px; height:38px; border:1px solid var(--line); border-radius:10px; color:var(--pine); background:var(--surface); cursor:pointer; list-style:none; font-size:21px; line-height:1 }
.book-menu summary::-webkit-details-marker { display:none }
.book-menu[open] summary,.book-menu summary:hover { background:var(--leaf) }
.book-menu .row-actions { position:absolute; z-index:2; top:calc(100% + 5px); right:0; display:grid; min-width:128px; padding:5px; border:1px solid var(--line); background:var(--surface); box-shadow:0 7px 22px #192f2726; border-radius:12px }
.book-menu .row-actions button { text-align:left; min-height:36px; padding:6px 9px; font-size:13px; border-radius:6px }
#books[data-mode="list"] { background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:0 14px }
#books[data-mode="list"]>li[data-book-id] { align-items:center; flex-wrap:nowrap; gap:12px; padding-block:9px }
#books[data-mode="list"]>li:last-child { border-bottom:0 }
#books[data-mode="list"] .book-jacket { aspect-ratio:3/4; width:45px; flex:0 0 45px; padding:6px; border-radius:4px; justify-content:center; align-items:center }
#books[data-mode="list"] .book-jacket-title { display:none }
#books[data-mode="list"] .book-jacket-format { border:0; padding:0; font-size:9px }
#books[data-mode="list"] .book-info { width:auto; flex:1 }
#books .shelf-empty { grid-column:1/-1; display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:155px; gap:9px; border:1px dashed var(--line-strong); border-radius:14px; padding:19px; background:var(--surface); color:var(--muted) }
#books[data-mode="list"]:has(.shelf-empty) { padding:0; border:0; background:none }
.book-pages { display:flex; justify-content:center; align-items:center; gap:12px; padding:21px 0 4px; border:0 }
.book-pages button { min-height:41px; padding:7px 10px }
.book-pages span { font-size:13px; color:var(--muted) }
#dav-dialog { overflow:auto }
#dav-dialog .dialog-actions { flex-wrap:wrap }
#dav-feedback { margin-bottom:0 }
#dav-feedback:empty { display:none }
.catalog-dialog #book-details-form .dialog-actions { position:sticky; z-index:1; bottom:0; margin-top:16px; padding:12px 0 0; background:var(--surface) }
@media(max-width:790px) {
  #view-books .book-tools { gap:6px; margin-bottom:12px }
  #book-search,#book-group-filter { height:44px }
  .shelf-modes button { width:40px; min-height:39px }
  .book-menu summary { width:44px; height:44px }
  .book-menu .row-actions button { min-height:44px }
  #books[data-mode="grid"] { --shelf-row-gap:17px; grid-template-columns:repeat(auto-fill,minmax(min(100%,132px),1fr)); column-gap:10px }
}
@media(max-width:560px) {
  .book-search-wrap { flex-basis:100% }
  #view-books .book-tools { flex-wrap:wrap; padding:8px }
  #book-group-filter { max-width:45%; flex:1; font-size:14px }
  #manage-book-groups { font-size:12px; min-height:44px; padding-inline:7px }
  .shelf-modes { margin-left:auto }
  .shelf-modes button { width:35px }
  #books[data-mode="grid"] { grid-template-columns:repeat(2,minmax(0,1fr)) }
  #books .book-title { font-size:14px }
  .shelf-heading .view-actions button { padding-inline:8px; font-size:13px }
}

#book-batch-toggle[aria-pressed="true"] { background:var(--leaf) }
#book-batch-bar { position:sticky; top:0; z-index:2; display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; margin:0 0 10px; padding:4px 8px; background:var(--surface); border:1px solid var(--line); border-radius:12px }
@media(max-width:790px) { #book-batch-bar { top:calc(58px + env(safe-area-inset-top)) } }
#book-batch-bar button,#book-batch-dialog button { min-height:44px; padding:6px 9px; font-size:13px }
.book-batch-page,.book-select-item { display:flex; align-items:center; gap:6px; margin:0; min-height:44px; cursor:pointer }
.book-select-item { justify-content:center; min-width:44px; flex:none }
.book-batch-page input,.book-select-item input { margin:0; width:18px; height:18px; accent-color:var(--pine) }
.book-batch-actions { display:flex; gap:4px; margin-left:auto }
#book-selection-count { color:var(--muted); font-size:12px }
#books[data-selecting] .book-jacket { cursor:pointer }
#books[data-selecting] li[data-selected] .book-jacket { outline:2px solid var(--pine); outline-offset:2px }
#books[data-mode="grid"] .book-select-item { position:absolute; z-index:1; top:3px; right:3px; background:var(--surface); border-radius:8px }
#books[data-mode="list"][data-selecting]>li[data-book-id] { gap:7px }
#book-batch-dialog { width:min(94vw,420px) }
#book-batch-summary { margin:5px 0; overflow-wrap:anywhere }
#book-batch-note { margin:0 }
#book-batch-target { width:100% }
#book-batch-status:empty { display:none }
#book-batch-dialog .dialog-actions { margin-top:14px; padding-top:10px }
#book-batch-confirm[data-delete] { background:#8b4540; color:white }
#notes-dialog{width:min(760px,calc(100% - 28px));max-height:calc(100vh - 36px);overflow:auto}#notes-dialog .dialog-head{align-items:flex-start}#notes-title{overflow-wrap:anywhere}.notes-tools{display:flex;gap:10px;margin:12px 0 20px}.notes-tools input{flex:1;min-width:0}.annotation-card{padding:20px 0;border-bottom:1px solid #e5e9dd}.annotation-location{font-size:12px;color:#7b886f;line-height:1.7;margin-bottom:10px}.annotation-quote{border-left:3px solid #98ac84;padding:2px 0 2px 15px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.9;color:#33482b}.annotation-note{margin-top:13px;padding:13px 15px;background:#f6f8ef;border-radius:4px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.9}.annotation-date{font-size:11px;color:#96a18b;margin-top:12px}.notes-book{width:100%;display:block;text-align:left;background:transparent;color:#34472b;padding:16px 0;border-bottom:1px solid #e5e9dd;border-radius:0;white-space:normal;line-height:1.8}.notes-book small{display:block;font-size:12px;color:#8a967d;font-weight:400;margin-top:4px}#notes-content .empty{padding:35px 0;color:#88947d;text-align:center}.section-head:has(#show-all-notes){flex-wrap:wrap}.section-head:has(#show-all-notes)>div{flex:1;min-width:220px}@media(max-width:650px){.notes-tools{flex-wrap:wrap}.notes-tools input{flex-basis:100%}#notes-dialog{padding:21px}.annotation-quote{padding-left:12px}.section-head:has(#show-all-notes)>div{flex-basis:100%}.section-head:has(#show-all-notes){gap:10px}}
#epub-dialog { width:min(1000px,calc(100% - 24px)); height:min(825px,calc(100dvh - 30px)); max-height:none; padding:0; overflow:hidden; background:#fffefb }
#epub-dialog[open] { display:flex; flex-direction:column }
#epub-dialog .epub-header { display:flex; justify-content:space-between; gap:12px; padding:11px 16px; margin:0; border-bottom:1px solid #e4e5dc }
.epub-header h2 { margin:0; font-size:15px; line-height:1.5; overflow-wrap:anywhere }
.epub-header button { padding:6px 9px; font-size:13px }
.reading-actions { display:flex; align-items:center; gap:8px; flex-shrink:0 }
.reading-actions button[aria-pressed="true"] { background:#e9eee1; border-color:#aebda1 }
#epub-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0 }
#epub-loading { margin:12px 16px }
#epub-loading:empty { display:none }
#epub-host { flex:1; min-height:0 }
#epub-host iframe { display:block; width:100%; height:100%; border:0 }
#epub-host iframe.reader-pending { visibility:hidden }
.book-title.book-open { display:block; background:none; color:#344d2d; border:none; padding:0; white-space:normal; text-align:left }
.book-open:hover { text-decoration:underline; text-underline-offset:3px }
#epub-dialog.reading-fullscreen { width:100%; height:100dvh; max-width:none; margin:0; border:0; border-radius:0 }
#epub-dialog.reading-fullscreen .epub-header { padding:9px max(12px,env(safe-area-inset-right)) 9px max(12px,env(safe-area-inset-left)); padding-top:max(9px,env(safe-area-inset-top)) }

.quick-panel { border:1px solid var(--line); background:var(--surface); border-radius:14px; padding:clamp(14px,2.2vw,22px) }
.quick-panel h3 { margin:0; font-family:var(--serif); font-size:18px; line-height:1.35; color:var(--pine-dark) }
.quick-panel fieldset { border:0; padding:0; margin:0; min-width:0 }
.quick-panel :is(select,input:not([type=checkbox])) { width:100%; min-width:0; margin:0; height:44px; padding:7px 10px; border-radius:8px }
.quick-panel label:not(.checkbox-label) { margin:12px 0 5px; color:var(--muted) }
.quick-feed { display:grid; grid-template-columns:minmax(0,1fr) minmax(82px,108px); gap:9px }
.quick-feed>div { min-width:0 }
.quick-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:11px }
.quick-actions button { min-height:40px }
#quick-progress { display:block; width:100%; height:8px; accent-color:var(--pine); margin-top:12px }
#quick-status { margin:8px 0 0 }
#quick-skipped { margin-top:8px; overflow-wrap:anywhere; font-size:13px }
#quick-skipped-items { padding-left:18px }
#quick-open-books { min-height:40px; padding-inline:0 }
@media(max-width:790px) { .quick-actions button { min-height:44px } }

.daily-head { display:flex; align-items:center; justify-content:space-between; gap:10px }
.daily-head .checkbox-label { margin:0; min-height:24px; color:var(--pine) }
.daily-head input { margin:0; accent-color:var(--pine) }
.daily-controls { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:9px; align-items:center }
.daily-controls input[type=time] { appearance:none; display:block; text-align:left }
.daily-controls input[type=time]::-webkit-date-and-time-value { text-align:left; min-height:1.25em }
.daily-panel label span { font-size:11px; font-weight:400; margin-left:3px }
.daily-controls button { min-height:44px; padding:7px 11px }
.daily-panel .mag-status { margin:8px 0 0 }
.daily-run summary { cursor:pointer; color:var(--pine-dark); font-weight:650; min-height:32px }
.daily-run[open] summary { margin-bottom:8px }
.daily-run .muted { margin:8px 0 }
.daily-run li { overflow-wrap:anywhere }
.daily-log-tools { display:flex; flex-wrap:wrap; align-items:center; gap:8px }
.daily-log-tools select,.daily-log-tools button { min-height:40px; padding:7px 10px }
#daily-log-feedback:empty { display:none }
.daily-events { max-height:min(40vh,280px); overflow:auto; margin:10px 0 0; padding:0 12px; list-style:none; border:1px solid #e3e7db; border-radius:7px; background:#fafbf7 }
.daily-events>li { display:grid; grid-template-columns:3.2rem minmax(0,1fr); gap:6px; padding:8px 0; line-height:1.45 }
.daily-events>li+li { border-top:1px solid #e7e9e0 }
.daily-events time { color:#59654f; font-size:.92em; font-variant-numeric:tabular-nums }
.daily-events .daily-event-issue { color:#803e2c }

#dashboard #view-magazines { background:transparent; padding:0; border:0 }
#view-magazines .section-head { margin-bottom:14px }
.mag-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:12px }
.mag-grid>* { min-width:0 }
.mag-workflows { align-items:stretch }
.mag-results { margin-top:12px; grid-template-columns:minmax(0,1.45fr) minmax(0,1fr) }
.mag-published,.daily-run { background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:clamp(14px,2.2vw,22px) }
.mag-heading { display:flex; align-items:center; justify-content:space-between; gap:9px; margin:0 0 8px }
.mag-heading h3 { margin:0; font:700 18px/1.35 var(--serif); color:var(--pine-dark) }
.mag-list { margin:0; padding:0; list-style:none }
.mag-list>li { border-top:1px solid var(--line); padding:9px 0; overflow-wrap:anywhere }
.mag-list .muted { margin:0 }
.mag-status:empty,#mag-issues-status:empty,#mag-issues:empty { display:none }
.mag-status { font-size:13px; color:var(--pine); overflow-wrap:anywhere }
.mag-published .issue-open { width:100%; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:4px 0; white-space:normal; text-align:left; font-size:15px; font-weight:650 }
.issue-open span:first-child { min-width:0; overflow-wrap:anywhere }
.issue-open .issue-arrow { font-weight:400 }
#mag-more-issues { min-height:40px; padding:6px 10px; margin-top:6px }
@media(max-width:920px) { .mag-grid { grid-template-columns:minmax(0,1fr) } }

.source-title { align-items:center; gap:8px }
.source-title .source-read { padding:2px 0; min-width:0; text-align:left; font-size:15px; font-weight:650; white-space:normal; overflow-wrap:anywhere }
.source-read:hover,.feed-article-title:hover { text-decoration:underline; text-underline-offset:3px }
#feed-dialog { width:min(810px,calc(100% - 24px)); max-height:calc(100dvh - 30px); padding:0; overflow:hidden }
#feed-dialog[open] { display:flex; flex-direction:column }
#feed-dialog.reading-fullscreen { width:100%; height:100dvh; max-width:none; max-height:none; margin:0; border:0; border-radius:0 }
.feed-top { display:flex; align-items:center; gap:8px; padding:8px max(14px,env(safe-area-inset-right)) 8px max(14px,env(safe-area-inset-left)); padding-top:max(8px,env(safe-area-inset-top)); border-bottom:1px solid #e6e8de }
.feed-top .reading-actions { margin-left:auto }
#feed-fullscreen { padding:6px 9px; font-size:13px }
#feed-scroll { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:clamp(14px,4vw,30px) max(16px,calc((100% - 720px) / 2)) max(28px,env(safe-area-inset-bottom)) }
#feed-scroll:focus-visible { outline:2px solid #76896a; outline-offset:-3px }
#feed-to-top { position:absolute; bottom:max(14px,env(safe-area-inset-bottom)); right:max(14px,env(safe-area-inset-right)); width:44px; height:44px; padding:0; border-radius:50%; font-size:22px; opacity:.62; background:#fffefb; box-shadow:0 2px 9px #282e2420 }
#feed-to-top:hover,#feed-to-top:focus-visible { opacity:1 }
#feed-return { color:#415737; padding:4px 0 }
#feed-heading { font-size:clamp(21px,3vw,29px); line-height:1.4; overflow-wrap:anywhere }
#feed-meta { margin:6px 0 }
#feed-original { color:#415737; font-size:13px }
#feed-meta:empty,#feed-message:empty { display:none }
#feed-entries { list-style:none; margin:7px 0 0; padding:0 }
#feed-entries li { padding:10px 0; border-bottom:1px solid #e6e8de }
#feed-entries .feed-row { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:start; gap:9px }
#feed-entries input[type=checkbox] { width:17px; height:17px; margin:4px 0 0; accent-color:#566d46 }
.feed-send-tools { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:12px 0 4px }
.feed-send-tools p { margin:0 }
.feed-send-tools button { padding:6px 10px; font-size:13px }
#feed-entries .feed-article-title { display:block; padding:4px 0; color:var(--pine); font-size:15px; line-height:1.55; white-space:normal; text-align:left; overflow-wrap:anywhere }
#feed-entries .muted { margin:3px 0 0 }
#feed-body { margin-top:19px; font:17px/1.83 "Songti SC","Noto Serif CJK SC",Georgia,serif; overflow-wrap:anywhere }
#feed-body a { color:#415c3f }
#feed-body p { margin:.85em 0 }
#feed-body img { max-width:100%; height:auto; display:block; margin:12px auto }
#feed-body figure { margin:15px 0 }
#feed-body pre,#feed-body table { display:block; overflow:auto; font-size:.88em }
#feed-body pre { padding:11px; background:#f0f1e9 }

.overview-hero { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); min-height:330px; border-radius:21px; overflow:hidden; background:var(--pine); color:#fcf6e9 }
.overview-copy { align-self:center; min-width:0; padding:clamp(24px,4.1vw,58px) }
.overview-date { margin:0 0 15px; color:#e2eacb; font-size:13px; font-variant-numeric:tabular-nums }
.overview-hero h2 { margin:0; font:700 clamp(36px,4.5vw,66px)/1.13 var(--serif); letter-spacing:.045em; text-wrap:balance }
.overview-current { margin:14px 0 0; color:#ecf0e4; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.overview-art { position:relative; min-height:100%; background:#baab87 }
.overview-art img { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:cover; object-position:61% 57% }
.overview-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:26px }
.overview-actions button { min-height:44px; padding:8px 13px; color:var(--pine-dark); background:#f4efdd; border-color:#f4efdd }
.overview-actions button:hover { background:#fff9ec }
.overview-actions .secondary { color:#fcf6e9; background:transparent; border-color:#9cad97 }
.overview-actions .secondary:hover { color:var(--pine-dark); background:#e8eee2 }
.overview-lists { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); align-items:start; gap:18px; margin-top:20px }
.overview-list { min-width:0; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:clamp(14px,2.3vw,26px) }
.overview-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-bottom:9px; border-bottom:1px solid var(--line) }
.overview-heading h3 { margin:0; font:700 clamp(19px,2vw,24px)/1.26 var(--serif) }
.overview-heading>div { display:flex; align-items:baseline; gap:9px; flex-wrap:wrap }
.overview-heading .muted { margin:0 }
.overview-list ul { list-style:none; margin:0; padding:0 }
.overview-list li { min-width:0; padding:11px 0; border-bottom:1px solid var(--line); overflow-wrap:anywhere }
.overview-list li:last-child { border-bottom:0 }
.overview-list .text-button { min-height:40px }
.overview-book-row { display:flex; align-items:center; gap:11px }
.overview-format { display:grid; place-items:center; width:35px; height:44px; flex:0 0 35px; background:#e8e9dd; color:var(--pine); border-radius:3px 6px 6px 3px; border-left:3px solid #7c8b71; font-size:9px; font-weight:700 }
.overview-book { display:block; min-width:0; flex:1; white-space:normal; text-align:left; font-size:14px; padding:4px 6px }
.overview-list .overview-empty { color:var(--muted); font-size:13px }
.overview-schedule { display:flex; justify-content:space-between; align-items:center; gap:7px; padding:12px 0; border-bottom:1px solid var(--line); font-size:13px }
.overview-schedule div { display:grid; min-width:0; gap:4px }
.overview-schedule strong { color:var(--pine); font-size:16px }
.overview-schedule small { color:var(--muted); overflow-wrap:anywhere }
.overview-schedule small:empty { display:none }
.overview-todo::before { content:""; display:inline-block; margin-right:9px; width:7px; height:7px; border:1px solid #718476; border-radius:50%; vertical-align:2px }
@media(max-width:790px) {
  .overview-hero { min-height:240px }
  .overview-copy { padding:20px 18px }
  .overview-lists { gap:10px; margin-top:12px }
  .overview-list .text-button { min-height:44px }
}
@media(max-width:580px) {
  .overview-hero { grid-template-columns:1fr; border-radius:17px }
  .overview-art { grid-row:1; height:clamp(126px,35vw,215px); min-height:0 }
  .overview-art img { object-position:68% 64% }
  .overview-copy { padding:15px 17px 17px }
  .overview-date { margin-bottom:7px }
  .overview-hero h2 { font-size:clamp(32px,8.5vw,45px) }
  .overview-current { margin-top:7px; font-size:13px }
  .overview-actions { margin-top:13px }
  .overview-lists { grid-template-columns:minmax(0,1fr) }
}

#kindle-install-dialog { width:min(640px,calc(100% - 28px)) }
#kindle-install-status { margin:6px 0 12px }
#kindle-install-status:empty { display:none }
#kindle-install-text { display:block; resize:vertical; width:100%; min-height:9em; padding:9px 11px; line-height:1.65 }
#kindle-install-dialog label { margin:9px 0 6px }
#kindle-install-dialog .dialog-actions { align-items:center; margin-top:14px; padding-top:12px; flex-wrap:wrap }
.install-download { display:inline-grid; place-items:center; min-height:44px; padding:7px 10px; color:var(--pine); text-underline-offset:3px }

.kindle-layout { display:grid; grid-template-columns:minmax(0,640px) minmax(0,1fr); gap:22px; align-items:start }
.kindle-stage { min-width:0; padding:22px; overflow:auto; border:1px solid #dfdfd6; border-radius:11px; background:radial-gradient(ellipse at 43% 23%,#f5f3ec,#e3e2d9 80%) }
.kindle-device { position:relative; container-type:inline-size; width:min(100%,456px); aspect-ratio:117/169; margin:0 auto; border:1px solid #222321; border-radius:4.1% / 2.9%; background:linear-gradient(145deg,#30312e 0%,#222321 20%,#181917 76%,#20211f 100%); box-shadow:inset 0 1px 0 #ffffff29,inset 1px 0 0 #ffffff19,inset -3px -3px 8px #0007,0 2px 2px #2a2b2860,0 14px 29px -14px #25251e90 }
.kindle-device::after { content:""; position:absolute; top:9.1%; left:10.75%; width:78.5%; aspect-ratio:758/1024; border:1px solid #d5d5ce18; border-radius:2px; box-shadow:0 0 0 1px #090a09; pointer-events:none }
.kindle-screen { position:absolute; left:11.2%; top:9.4%; width:77.6%; aspect-ratio:758/1024; overflow:hidden; background:#eeeee6; box-shadow:0 0 0 1px #020202 }
.kindle-screen::after { content:""; position:absolute; inset:0; pointer-events:none; background:linear-gradient(164deg,#ffffff16 0%,transparent 30%,#4141360b 92%); box-shadow:inset 0 1px 3px #2222173b }
#kindle-panel { display:block; width:100%; height:auto }
#kindle-news-links { position:absolute; inset:49.9% 3.7% auto; height:26.86%; display:grid; grid-template-rows:repeat(5,1fr); pointer-events:none }
#kindle-news-links a { display:block; pointer-events:auto }
#kindle-news-links a:focus-visible { outline:2px solid #3e493b; outline-offset:-2px }
.kindle-logotype { position:absolute; left:0; right:0; bottom:4.7%; text-align:center; color:#c4c4bc; font-family:Georgia,serif; font-size:5.2cqw; font-weight:600; letter-spacing:-.035em; text-shadow:0 1px 1px #000 }
.kindle-stage.is-native { max-height:76vh }
.kindle-stage.is-native .kindle-device { width:979px }
.kindle-stage.is-native .kindle-screen { width:758px }
.kindle-caption { padding:5px 0; color:#4d5648 }
.kindle-caption h3 { margin:0; font-size:17px }
.kindle-caption p { margin:6px 0 }
.kindle-caption span { display:block }
@media(max-width:950px) {
  .kindle-layout { grid-template-columns:minmax(0,1fr); gap:10px }
  .kindle-caption { display:flex; flex-wrap:wrap; justify-content:space-between; gap:0 10px; align-items:baseline }
  .kindle-caption h3 { font-size:14px }
}
@media(max-width:680px) {
  .kindle-stage { padding:12px }
  .kindle-caption p { font-size:12px }
}

.clip-toolbar { display:flex; flex-wrap:wrap; gap:10px 16px; align-items:center; justify-content:space-between; margin-bottom:10px; }
.clip-toolbar input { flex:1 1 210px; max-width:360px; }
.clip-toolbar .filters { margin:0; }
#clip-list > li { gap:12px; padding:15px 0; }
.clip-row-copy { flex:1; min-width:0; }
.clip-row-title { display:block; max-width:100%; padding:0; color:var(--ink); text-align:left; white-space:normal; overflow-wrap:anywhere; font-weight:650; }
.clip-row-meta { margin:5px 0 0; }
.clip-row-actions { display:flex; flex-shrink:0; gap:8px; align-items:center; }
.clip-row-original { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:7px 12px; border-color:var(--line-strong); border-radius:8px; color:var(--pine); font-weight:550; text-decoration:none; white-space:nowrap; }
.clip-row-original:hover { background:var(--leaf); }
#clip-details-title { overflow-wrap:anywhere; }
#clip-details .dialog-actions { flex-wrap:wrap; }
#clip-original { color:var(--ink); align-self:center; }
#clip-secret { font:12px ui-monospace,monospace; }
#clip-devices > li { justify-content:space-between; }
@media(max-width:650px) {
  #clip-list > li { flex-wrap:wrap; }
  .clip-row-copy { flex-basis:100%; }
  .clip-row-actions { margin-left:auto; }
  .clip-row-details { min-height:44px; padding-inline:12px; }
}

.book-listen-button { background:transparent; color:var(--pine); font-size:13px; border:0; padding:3px 0; min-height:30px }
#books .book-listen-button:hover { background:transparent; text-decoration:underline; text-underline-offset:3px }
.listen-dock-space #dashboard { padding-bottom:85px }
#listen-dock { position:fixed; z-index:5; bottom:calc(env(safe-area-inset-bottom) + 15px); right:max(18px,env(safe-area-inset-right)); width:min(486px,calc(100vw - 36px)); border:1px solid var(--line-strong); background:var(--surface); border-radius:18px; box-shadow:0 9px 34px #192f2724 }
#listen-dock:not([data-active]):not([data-expanded]) { width:auto; border-radius:999px }
#listen-panel { max-height:calc(100dvh - 115px); overflow:auto; overscroll-behavior:contain; padding:14px 16px 15px; border-bottom:1px solid var(--line) }
.listen-panel-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px }
.listen-panel-head h2 { font:700 20px/1.25 var(--serif); color:var(--pine-dark); margin:0 }
#listen-settings-open,.listen-voice a,#listen-key-note a { color:var(--pine); font-size:13px }
#listen-settings-open { min-height:36px; padding:4px 8px }
.listen-mini { display:flex; align-items:center; gap:6px; padding:4px 8px 4px 5px; min-height:49px }
#listen-toggle { min-width:0; min-height:44px; flex:1; padding:5px 8px; display:flex; align-items:center; text-align:left; gap:9px; color:var(--pine-dark); background:transparent; border:0; border-radius:12px }
#listen-toggle:hover { background:var(--leaf) }
.listen-description { display:grid; gap:1px; min-width:0; flex:1 }
.listen-description :is(strong,span) { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.listen-description strong { font-size:14px; line-height:1.4 }
#listen-caption { color:var(--muted); font-size:12px; font-weight:500 }
.listen-caret { width:7px; height:7px; border-left:1.5px solid currentColor; border-top:1.5px solid currentColor; transform:rotate(45deg); margin:4px 2px 0 1px }
#listen-toggle[aria-expanded="true"] .listen-caret { transform:rotate(225deg); margin-top:-3px }
.listen-mark { display:inline-block; flex:none; width:34px; height:34px; border-radius:9px; background:var(--leaf); color:var(--pine); position:relative }
.listen-mark::before { content:""; position:absolute; width:16px; height:14px; left:9px; top:8px; border:1.7px solid currentColor; border-bottom:0; border-radius:13px 13px 0 0 }
.listen-mark::after { content:""; position:absolute; left:8px; top:18px; width:5px; height:8px; border-radius:2px; background:currentColor; box-shadow:13px 0 }
#listen-play { width:43px; height:43px; flex:none; display:grid; place-items:center; padding:0; border-radius:50%; border:0; background:var(--pine); color:#fffdf8 }
#listen-play span { width:0; height:0; margin-left:3px; border-left:10px solid currentColor; border-top:6px solid transparent; border-bottom:6px solid transparent }
#listen-play[data-playing] span { width:11px; height:13px; margin-left:0; border:0; border-left:3px solid currentColor; border-right:3px solid currentColor }
.listen-timeline { display:grid; grid-template-columns:3.2em minmax(0,1fr) 3.2em; align-items:center; gap:9px; margin:4px 0; font-size:12px; font-variant-numeric:tabular-nums; color:var(--muted) }
#listen-duration { text-align:right }
#listen-seek { width:100%; height:26px; padding:0; border:0; background:transparent; accent-color:var(--pine); cursor:pointer }
.listen-buttons,.listen-selectors { display:flex; align-items:center; gap:8px }
.listen-buttons { justify-content:center; margin:6px 0 13px }
.listen-buttons :is(button,select),.listen-selectors select,#listen-settings select { border:1px solid var(--line); border-radius:8px; padding:7px 10px; background:var(--surface); color:var(--pine); font:inherit; min-height:38px }
.listen-selectors label { flex:1 1 0; min-width:0; font-size:12px; margin:0; color:var(--muted) }
.listen-selectors select { width:100%; display:block; margin-top:4px; font-size:14px }
#listen-feedback { font-size:13px; margin:10px 0 0 }
#listen-feedback:empty,#listen-settings-feedback:empty { display:none }
#listen-action-row { margin-top:9px }
#listen-generation { display:grid; gap:6px; margin-top:13px; padding-top:10px; border-top:1px solid var(--line) }
.listen-generation-row { display:flex; align-items:center; justify-content:space-between; gap:12px }
.listen-generation-info { min-width:0; font-size:13px; color:var(--pine-dark) }
#listen-generation :is(#listen-generation-status,#listen-generation-note) { margin:2px 0 0; font-size:12px }
#listen-generation-action { min-height:36px; padding:6px 10px; font-size:13px; flex:none }
#listen-generation-progress { width:100%; height:5px; accent-color:var(--pine) }
#listen-generation-confirm-copy { margin:12px 0 0; font-size:14px; line-height:1.7; overflow-wrap:anywhere }
#listen-empty .muted { margin:7px 0 10px; font-size:13px }
.listen-voice { display:flex; align-items:center; gap:10px; margin-top:15px; border:1px solid var(--line); padding:9px 12px; border-radius:10px }
.listen-voice div { min-width:0; flex:1; display:grid; gap:3px }
.listen-voice div span { color:var(--muted); font-size:12px }
#listen-key-note { display:flex; flex-wrap:wrap; gap:4px 14px; margin:5px 0 0 }
#listen-settings select,#listen-sample { width:100% }
.listen-preview-row { display:flex; align-items:center; gap:8px 12px; flex-wrap:wrap; margin-top:10px }
.listen-preview-row .muted { font-size:12px }
#listen-sample { display:block; margin-top:8px }
#listen-settings .dialog-actions { align-items:center; margin-top:16px; padding-top:12px }
#listen-settings-save { min-width:66px }
#profile-listening { margin-top:14px }
@media(max-width:790px) {
  #management-menu.menu-expanded { z-index:6 }
  #listen-dock { right:max(10px,env(safe-area-inset-right)); width:min(486px,calc(100vw - 20px)); bottom:calc(63px + max(5px,env(safe-area-inset-bottom))) }
  #listen-dock[data-active],#listen-dock[data-expanded] { left:max(10px,env(safe-area-inset-left)); width:auto }
  #listen-panel { max-height:calc(100dvh - 135px - env(safe-area-inset-bottom)); padding:12px }
  #listen-settings-open,#listen-action,#listen-preview,#listen-generation-action,.listen-buttons :is(button,select),.listen-selectors select { min-height:44px }
  #listen-settings :is(input,select),.listen-selectors select { font-size:16px }
  .listen-dock-space #dashboard { padding-bottom:calc(139px + env(safe-area-inset-bottom)) }
  #books .book-listen-button { min-height:33px }
}
