/* One phone interface, including when opened in a wider browser. */
:root{
  font-family:var(--body-font);
  background:var(--paper);
  color:var(--ink);
  font-synthesis:style}
html{
  min-width:320px;
  scroll-padding-bottom:100px}
body{
  max-width:520px;
  margin:0 auto;
  background:var(--paper);
  color:var(--ink);
  min-height:100dvh;
  position:relative;
  isolation:isolate}
body:before{
  content:'';
  position:fixed;
  inset:0;
  max-width:520px;
  margin:auto;
  background-image:var(--art);
  background-size:auto 780px;
  background-position:center top;
  background-repeat:no-repeat;
  opacity:.10;
  z-index:-1;
  pointer-events:none}
body:after{
  content:'';
  position:fixed;
  inset:0;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23887963' filter='url(%23n)' opacity='.13' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
  opacity:.17;
  z-index:-1;
  pointer-events:none}
button,input,select,textarea{
  font-family:var(--body-font);
  font-size:16px}
button,a,input,select,textarea{
  touch-action:manipulation}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:3px solid var(--accent);
  outline-offset:3px}
button:disabled{
  opacity:.55}
button,a{
  color:inherit}
a{
  text-underline-offset:3px}
h1,h2,h3{
  font-family:var(--heading-font);
  color:var(--ink);
  font-weight:600;
  letter-spacing:-.5px}
h1{
  font-size:36px;
  line-height:1.12}
h2{
  font-size:26px;
  line-height:1.14}
h3{
  font-size:22px}
p{
  line-height:1.55}
.workspace{
  margin:0;
  max-width:none;
  min-height:100dvh}
.sidebar,.topbar{
  display:none!important}
.ui-icon{
  width:24px;
  height:24px;
  display:inline-block;
  flex-shrink:0;
  vertical-align:middle}
.visually-hidden{
  position:absolute!important;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0}
.mobile-header{
  height:83px;
  padding:12px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  position:relative;
  z-index:5}
.mobile-brand{
  display:flex;
  align-items:center;
  gap:9px;
  text-decoration:none;
  line-height:1;
  color:var(--ink);
  min-width:0}
.mobile-brand>span:last-child{
  font:600 34px/1 var(--heading-font);
  letter-spacing:-1px}
.mobile-brand small{
  display:block;
  font:700 7px/1.6 var(--body-font);
  letter-spacing:1.5px;
  margin-top:5px}
.mobile-brand .ui-icon{
  width:33px;
  height:33px;
  color:var(--brand);
  stroke-width:1}
.header-actions{
  display:flex;
  align-items:center;
  gap:8px}
.header-icon,.profile-shortcut{
  display:grid;
  place-items:center;
  width:41px;
  height:41px;
  min-height:41px;
  border:1px solid var(--line);
  border-radius:50%;
  text-decoration:none;
  background:var(--surface);
  box-shadow:0 2px 6px #45381d0b}
.header-icon .ui-icon{
  width:20px;
  height:20px}
.profile-shortcut{
  background:var(--green);
  color:var(--on-primary);
  font-size:18px;
  font-weight:700;
  border:3px solid var(--surface-strong)}
main{
  padding:12px 20px 105px;
  max-width:none;
  margin:0}
.page-heading{
  display:flex;
  align-items:flex-start;
  flex-direction:row;
  gap:12px;
  margin:12px 0 22px}
.page-heading>div{
  min-width:0;
  flex:1}
.page-heading h1{
  font-size:34px;
  margin:0;
  overflow-wrap:anywhere}
.page-heading h1>span{
  display:none}
.page-heading p:last-child{
  font-size:14px;
  line-height:1.5;
  margin:8px 0 0;
  color:var(--muted)}
.page-heading .eyebrow{
  display:none}
.page-heading>.primary{
  width:auto;
  min-height:43px;
  padding:10px 12px;
  max-width:135px;
  white-space:normal;
  font-size:13px;
  flex-shrink:0}
.primary{
  background:var(--green);
  color:var(--on-primary);
  border:1px solid var(--green);
  border-radius:25px;
  padding:12px 17px;
  min-height:46px;
  box-shadow:0 3px 8px #25382314;
  font-size:14px;
  gap:8px;
  white-space:normal}
.primary:hover{
  background:var(--green);
  filter:brightness(1.07)}
.primary .ui-icon{
  width:17px;
  height:17px}
.secondary{
  background:var(--surface-strong);
  color:var(--ink);
  border:1px solid var(--line);
  border-radius:22px;
  padding:11px 15px;
  min-height:44px;
  font-size:14px}
.danger{
  background:transparent;
  color:var(--ink);
  border:1px solid var(--accent);
  border-radius:22px;
  padding:10px 14px;
  min-height:44px}
.icon-button{
  background:var(--surface);
  color:var(--ink);
  border:1px solid var(--line);
  border-radius:50%;
  width:40px;
  height:40px;
  min-height:40px;
  font-size:28px;
  display:grid;
  place-items:center}
.bottom-nav{
  position:fixed;
  bottom:0;
  left:50%;
  transform:translateX(-50%);
  width:100%;
  max-width:520px;
  z-index:30;
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:0;
  margin:0;
  padding:6px 8px calc(8px + env(safe-area-inset-bottom));
  overflow:visible;
  background:var(--surface-strong);
  border-top:1px solid var(--line);
  box-shadow:0 -4px 22px #25291812;
  backdrop-filter:blur(15px)}
.bottom-nav a{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  min-height:57px;
  padding:6px 0;
  width:100%;
  min-width:0;
  border-radius:15px;
  color:var(--muted);
  font:600 10px/1.2 var(--body-font);
  text-decoration:none;
  white-space:normal;
  text-align:center}
.bottom-nav a>span{
  font-size:inherit;
  width:auto;
  color:inherit}
.bottom-nav a .ui-icon{
  width:24px;
  height:24px;
  stroke-width:1.4}
.bottom-nav a[aria-current=page]{
  color:var(--ink);
  background:var(--surface-soft);
  font-weight:800}
.bottom-nav a[aria-current=page] .ui-icon{
  color:var(--brand);
  stroke-width:2}
.floating-add{
  position:fixed;
  bottom:calc(90px + env(safe-area-inset-bottom));
  right:max(18px,calc((100vw - 520px)/2 + 18px));
  width:54px;
  height:54px;
  min-height:54px;
  display:grid;
  place-items:center;
  border:2px solid var(--surface-strong);
  border-radius:50%;
  background:var(--green);
  color:var(--on-primary);
  z-index:20;
  box-shadow:0 4px 16px #28372835}
.floating-add .ui-icon{
  width:26px;
  height:26px}
.page-footer{
  padding:20px 0 4px;
  margin-top:18px;
  border:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-size:11px}
.page-footer a{
  min-height:34px;
  display:flex;
  align-items:center}
.update-banner,.offline-banner{
  margin:0 14px 8px;
  border-radius:12px;
  padding:12px;
  background:var(--surface-soft);
  color:var(--ink);
  border:1px solid var(--line);
  font-size:14px}
.update-banner button{
  color:var(--ink);
  border:1px solid var(--line);
  background:var(--surface-strong);
  border-radius:18px;
  padding:8px 12px;
  min-height:42px}
.toast{
  max-width:calc(100vw - 32px);
  width:max-content;
  left:50%;
  right:auto;
  transform:translateX(-50%);
  bottom:calc(90px + env(safe-area-inset-bottom));
  background:var(--green);
  color:var(--on-primary);
  border:1px solid var(--line);
  border-radius:14px;
  padding:13px 18px;
  font-size:14px;
  line-height:1.4;
  z-index:100}
/* The home screen follows the reference: greeting, reading card, shortcuts, summaries. */
body[data-view=home] main{
  padding-top:0}
.home-welcome{
  position:relative;
  isolation:isolate;
  padding:20px 3px 34px;
  min-height:140px}
.home-welcome:before{
  content:'';
  position:absolute;
  inset:-82px -20px -100px;
  background-image:var(--art);
  background-size:cover;
  background-position:64% 28%;
  opacity:var(--art-opacity);
  z-index:-1;
  mask-image:linear-gradient(#000 10%,#000 50%,transparent)}
.home-kicker{
  font-size:8px;
  letter-spacing:2px;
  font-weight:800;
  color:var(--muted);
  margin:0 0 8px}
.home-welcome h1{
  font:600 35px/1.12 var(--heading-font);
  margin:0 0 6px;
  overflow-wrap:anywhere;
  max-width:100%;
  text-shadow:0 1px var(--paper)}
.home-welcome>p:last-child{
  font-size:13px;
  color:var(--ink);
  margin:0}
.welcome-leaf .ui-icon{
  width:22px;
  height:22px;
  color:var(--brand);
  margin-left:10px}
.continue-card,.welcome-card{
  position:relative;
  border:1px solid var(--line);
  border-radius:19px;
  background:var(--surface-strong);
  box-shadow:var(--shadow);
  margin:0 0 15px;
  min-height:212px}
.continue-card:before,.welcome-card:before{
  content:'';
  position:absolute;
  inset:0;
  background-image:var(--art);
  background-size:cover;
  background-position:70% center;
  opacity:.24;
  pointer-events:none;
  border-radius:inherit;
  mask-image:linear-gradient(90deg,transparent 40%,#000)}
.continue-card{
  display:grid;
  grid-template-columns:110px minmax(0,1fr);
  gap:15px;
  padding:16px 15px;
  align-items:center}
.featured-cover{
  display:block;
  border:0;
  padding:0;
  background:transparent;
  min-width:0;
  position:relative;
  z-index:1;
  align-self:center}
.featured-cover-image{
  width:110px;
  height:165px;
  display:block;
  object-fit:cover;
  border-radius:3px 7px 7px 3px;
  box-shadow:3px 5px 12px #1e271b40}
.cover-placeholder{
  width:110px;
  height:165px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  border-radius:3px 7px 7px 3px;
  background:var(--green);
  color:var(--on-primary);
  padding:12px;
  text-align:center;
  box-shadow:3px 5px 12px #1e271b35}
.cover-placeholder strong{
  font:500 18px/1.15 var(--heading-font);
  overflow-wrap:anywhere}
.continue-content{
  position:relative;
  min-width:0;
  z-index:1}
.reading-label{
  display:inline-block;
  color:var(--on-primary);
  background:var(--green);
  border-radius:16px;
  padding:4px 10px;
  font-size:10px;
  line-height:1.3;
  font-weight:700}
.continue-content h2{
  font-size:24px;
  line-height:1.1;
  margin:10px 0 5px;
  overflow-wrap:anywhere;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden}
.continue-content>p{
  font-size:12px;
  margin:0 0 10px;
  line-height:1.3}
.continue-content>small{
  display:block;
  color:var(--muted);
  font-size:10px;
  margin-top:5px}
.continue-content .primary{
  width:100%;
  padding:9px 10px;
  font-size:12px;
  min-height:38px;
  margin-top:11px}
.home-progress{
  display:flex;
  align-items:center;
  gap:8px}
.home-progress progress{
  width:100%;
  min-width:0;
  flex:1;
  height:8px;
  border:0;
  appearance:none;
  background:var(--line);
  border-radius:8px;
  overflow:hidden}
.home-progress span{
  font-size:11px;
  white-space:nowrap}
.home-progress progress::-webkit-progress-bar{
  background:var(--line);
  border-radius:8px}
.home-progress progress::-webkit-progress-value{
  background:var(--accent);
  border-radius:8px}
.home-progress progress::-moz-progress-bar{
  background:var(--accent);
  border-radius:8px}
.welcome-card{
  padding:24px;
  min-height:210px;
  overflow:hidden}
.welcome-card>div{
  position:relative;
  z-index:1;
  max-width:270px}
.welcome-card h2{
  font-size:30px;
  line-height:1.05;
  margin:13px 0 8px;
  max-width:230px}
.welcome-card p{
  font-size:13px;
  margin:0 0 18px;
  max-width:225px}
.welcome-card .primary{
  font-size:12px;
  padding:10px 14px;
  min-height:40px}
.home-shortcuts{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--surface-strong);
  padding:14px 4px;
  margin:0 0 14px;
  box-shadow:var(--shadow);
  gap:0;
  overflow:visible}
.home-shortcuts a{
  display:flex;
  flex-direction:column;
  gap:4px;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  min-height:70px;
  padding:0 3px;
  font-size:12px;
  color:var(--ink);
  border-radius:0;
  text-align:center}
.home-shortcuts a+a{
  border-left:1px solid var(--line)}
.home-shortcuts a .ui-icon{
  width:27px;
  height:27px;
  color:var(--brand);
  margin-bottom:2px}
.home-shortcuts a:last-child .ui-icon{
  color:var(--accent)}
.home-shortcuts strong{
  font-size:12px;
  line-height:1.3}
.home-shortcuts small{
  font-size:10px;
  color:var(--muted)}
.home-duo{
  display:grid;
  grid-template-columns:1.13fr 1fr;
  gap:12px;
  margin:0 0 23px}
.home-stat-card,.home-saga-card{
  display:flex;
  flex-direction:column;
  min-width:0;
  text-decoration:none;
  color:var(--ink);
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:17px;
  padding:14px 12px;
  box-shadow:var(--shadow);
  gap:12px}
.home-tile-label{
  display:flex;
  align-items:center;
  gap:6px;
  font:600 17px/1.1 var(--heading-font)}
.home-tile-label .ui-icon{
  width:18px;
  height:18px;
  color:var(--brand)}
.home-numbers{
  display:flex;
  gap:10px;
  justify-content:space-between}
.home-numbers strong{
  font:600 27px/1.1 var(--heading-font);
  min-width:0;
  overflow-wrap:anywhere}
.home-numbers small{
  display:block;
  font:11px/1.4 var(--body-font);
  color:var(--muted);
  margin-top:4px}
.home-tile-link{
  display:flex;
  align-items:center;
  gap:3px;
  justify-content:space-between;
  font-size:10px;
  color:var(--muted);
  margin-top:auto}
.home-tile-link .ui-icon{
  width:13px;
  height:13px}
.home-saga-card>strong{
  font:600 31px/1 var(--heading-font)}
.home-saga-card>span:nth-last-child(2){
  font-size:11px;
  margin-top:-7px;
  color:var(--muted)}
.section-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px}
.section-heading h2{
  font-size:23px;
  margin:0}
.section-heading>a{
  display:flex;
  align-items:center;
  font-size:11px;
  text-decoration:none;
  color:var(--muted);
  white-space:nowrap}
.section-heading>a .ui-icon{
  width:15px;
  height:15px}
.home-book-shelf{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px}
.home-book-shelf button{
  border:0;
  background:none;
  padding:0;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  text-align:left;
  color:var(--ink);
  min-width:0}
.shelf-cover{
  display:block;
  width:100%;
  aspect-ratio:2/3;
  object-fit:cover;
  border-radius:3px 6px 6px 3px;
  box-shadow:2px 3px 9px #2028142b}
.shelf-placeholder{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  aspect-ratio:2/3;
  gap:10px;
  background:var(--green);
  color:var(--on-primary);
  border-radius:3px 6px 6px 3px;
  padding:8px;
  text-align:center;
  font:15px/1.1 var(--heading-font);
  overflow:hidden}
.shelf-placeholder .ui-icon{
  width:22px;
  height:22px}
.shelf-placeholder span{
  max-height:64px;
  overflow:hidden;
  overflow-wrap:anywhere}
.shelf-title{
  font-size:10px;
  line-height:1.3;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  margin-top:7px}
.home-social-card{
  display:flex;
  align-items:center;
  gap:12px;
  margin:22px 0 0;
  padding:17px 14px;
  text-decoration:none;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:17px;
  color:var(--ink)}
.home-social-card>span{
  flex:1;
  min-width:0}
.home-social-card strong,.home-social-card small{
  display:block}
.home-social-card strong{
  font:600 21px/1.1 var(--heading-font)}
.home-social-card small{
  font-size:11px;
  color:var(--muted);
  margin-top:5px}
.home-social-card>.ui-icon{
  color:var(--brand)}
/* Book lists, reading controls and forms use the same theme and touch sizes. */
.collection-tabs{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  margin:0 0 20px;
  padding:4px;
  background:var(--surface-soft);
  border:1px solid var(--line);
  border-radius:24px;
  gap:3px;
  overflow:visible}
.collection-tabs.reading-tabs{
  grid-template-columns:1fr 1fr}
.collection-tabs a{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  white-space:normal;
  text-align:center;
  text-decoration:none;
  font-size:12px;
  font-weight:700;
  padding:7px 4px;
  border-radius:20px;
  margin:0;
  color:var(--muted)}
.collection-tabs a[aria-current=page]{
  background:var(--surface-strong);
  color:var(--ink);
  box-shadow:0 2px 5px #3a382014}
.toolbar{
  gap:10px;
  flex-wrap:wrap;
  align-items:stretch}
.search{
  min-width:100%;
  width:100%;
  border:1px solid var(--line);
  border-radius:25px;
  padding:0 14px;
  background:var(--surface-strong);
  max-width:none;
  box-shadow:0 3px 8px #3a38200a}
.search>span{
  color:var(--brand)}
.search input{
  font-size:15px;
  min-height:46px;
  color:var(--ink)}
.sort-label{
  margin-left:auto;
  color:var(--muted);
  font-size:12px}
select{
  color:var(--ink);
  background-color:var(--surface-strong);
  border:1px solid var(--line);
  font-size:14px;
  min-height:44px;
  border-radius:15px}
.filter-row{
  flex-wrap:wrap;
  gap:8px;
  margin:14px 0}
.filter-row>select{
  margin-left:auto;
  border:1px solid var(--line);
  border-radius:18px;
  font-size:12px}
.chips{
  display:flex;
  flex-wrap:wrap;
  gap:5px}
.chips button{
  color:var(--muted);
  border:1px solid var(--line);
  background:var(--surface);
  font-size:11px;
  min-height:35px;
  padding:7px 11px}
.chips button[aria-pressed=true]{
  background:var(--green);
  border-color:var(--green);
  color:var(--on-primary)}
.collection-caption{
  color:var(--muted);
  font-size:12px;
  margin:12px 0 16px;
  padding-top:12px;
  border-color:var(--line)}
.collection-caption>span:last-child{
  display:none}
.book-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:20px 16px}
.book-cover{
  border-radius:4px 8px 8px 4px;
  aspect-ratio:2/3;
  box-shadow:2px 4px 10px #28322026;
  padding:17px 13px}
.cover-title{
  font-size:24px;
  font-family:var(--heading-font)}
.cover-author{
  font-size:9px;
  letter-spacing:1px}
.cover-kicker{
  font-size:8px;
  letter-spacing:1px}
.book-info{
  padding:10px 0;
  min-width:0}
.book-info h2{
  font:600 19px/1.15 var(--heading-font);
  color:var(--ink);
  margin-top:7px}
.book-info>p{
  font-size:12px;
  color:var(--muted);
  margin-top:4px}
.book-topline,.book-foot{
  gap:5px;
  flex-wrap:wrap}
.book-foot{
  font-size:11px;
  color:var(--muted)}
.book-topline .format-text{
  font-size:10px;
  color:var(--muted)}
.status{
  font-size:10px;
  border-radius:14px;
  padding:4px 8px;
  color:var(--ink);
  background:var(--surface-soft)}
.status.reading{
  color:var(--on-primary);
  background:var(--green)}
.status.read{
  color:var(--ink);
  background:var(--surface-soft);
  border:1px solid var(--brand)}
.status.abandoned{
  color:var(--muted);
  background:var(--surface)}
.book-remove{
  font-size:11px;
  color:var(--muted);
  margin-top:8px}
.progress{
  accent-color:var(--brand)}
.summary{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-bottom:20px}
.metric,.metric:last-child{
  background:var(--surface);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  border-radius:16px;
  padding:15px;
  min-height:105px;
  color:var(--ink)}
.metric strong{
  font-family:var(--heading-font);
  font-size:31px}
.metric>span,.metric small{
  color:var(--muted);
  font-size:11px}
.panel{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:18px;
  padding:20px 17px;
  box-shadow:var(--shadow);
  margin-bottom:16px;
  color:var(--ink)}
.panel h2{
  font-size:27px;
  margin-top:0}
.panel h3{
  font-size:23px}
.panel p,.panel li{
  font-size:14px;
  line-height:1.6;
  color:var(--muted)}
.panel a{
  color:var(--ink)}
.social-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px}
.social-navigation{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  padding:10px;
  background:var(--surface-soft);
  box-shadow:none}
.social-navigation button{
  white-space:normal;
  border-radius:14px;
  background:var(--surface-strong);
  font-size:14px}
.social-form label{
  font-size:14px;
  color:var(--ink)}
.social-form input,.social-form textarea,.social-form select,.reading-progress-form input,.series-total-form input{
  font-size:16px;
  background:var(--surface-strong);
  color:var(--ink);
  border:1px solid var(--line);
  border-radius:12px;
  min-height:46px;
  padding:12px}
.social-row,.social-comment{
  border-color:var(--line);
  color:var(--ink)}
.social-row small,.social-comment small{
  color:var(--muted)}
.social-row button{
  font-size:12px}
.social .inline-check{
  font-size:13px}
.social details>summary,.password-reset summary{
  color:var(--ink)}
.social details{
  margin:15px 0}
.notice{
  background:var(--surface-soft);
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px;
  color:var(--ink);
  font-size:14px}
.notice p,.notice li{
  color:var(--ink);
  font-size:13px}
.empty{
  padding:25px 15px;
  border:1px dashed var(--line);
  border-radius:18px;
  background:var(--surface)}
.empty h2{
  font-size:29px;
  color:var(--ink)}
.empty p{
  font-size:14px;
  color:var(--muted)}
.empty-icon{
  color:var(--brand)}
dialog{
  width:calc(100vw - 20px);
  max-width:500px;
  max-height:calc(100dvh - 24px);
  margin:auto;
  border:1px solid var(--line);
  border-radius:22px;
  background:var(--paper);
  color:var(--ink);
  padding:22px 18px 26px;
  box-shadow:0 15px 80px #0005;
  overflow-y:auto;
  overscroll-behavior:contain}
dialog::backdrop{
  background:#17241c8a;
  backdrop-filter:blur(4px)}
.dialog-heading h2{
  font-size:29px}
.dialog-heading .eyebrow{
  font-size:8px;
  color:var(--muted)}
.form-intro{
  font-size:14px;
  color:var(--muted)}
.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px 12px}
.form-grid>label{
  font-size:13px;
  color:var(--ink)}
.form-grid input,.form-grid textarea,.form-grid select,.catalogue-search input{
  background:var(--surface-strong);
  color:var(--ink);
  font-size:16px;
  border:1px solid var(--line);
  border-radius:11px;
  min-height:46px}
.form-grid .wide{
  grid-column:1/-1}
.form-grid small{
  font-size:11px;
  color:var(--muted);
  line-height:1.5}
.dialog-actions{
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end}
.dialog-actions button{
  font-size:13px}
.dialog-actions .primary{
  flex:1;
  min-width:130px}
.panel-actions{
  display:flex;
  flex-wrap:wrap;
  gap:9px}
.panel-actions button{
  white-space:normal;
  font-size:13px}
.personal-cover-options{
  border-color:var(--line);
  border-radius:15px;
  background:var(--surface);
  padding:14px}
.personal-cover-options p{
  font-size:13px;
  color:var(--muted)}
.personal-cover-options legend{
  font-size:15px}
.personal-cover-options .panel-actions button{
  flex:1;
  min-width:100px}
.catalogue-search label{
  font-size:14px;
  color:var(--ink)}
.catalogue-search>div{
  display:flex;
  flex-wrap:wrap;
  gap:8px}
.catalogue-search input{
  min-width:0;
  flex-basis:100%}
.catalogue-search button{
  width:100%}
.catalogue-choice{
  display:flex;
  gap:12px;
  width:100%;
  border-radius:14px;
  background:var(--surface-strong);
  padding:12px;
  color:var(--ink);
  line-height:1.4}
.catalogue-choice strong{
  font:600 20px/1.1 var(--heading-font);
  color:var(--ink)}
.catalogue-choice span span{
  font-size:12px;
  margin-top:5px}
.catalogue-choice small{
  font-size:10px;
  color:var(--muted)}
.catalogue-thumb{
  width:52px;
  min-width:52px}
.catalogue-cover{
  width:52px;
  height:78px}
.catalogue-preview{
  gap:12px}
.catalogue-preview-image,.catalogue-preview-cover{
  width:95px}
.catalogue-preview a{
  color:var(--ink)}
.form-error{
  color:var(--ink);
  background:var(--surface-soft);
  border-left:3px solid var(--accent);
  padding:13px;
  border-radius:9px;
  font-size:14px}
.reading-heading{
  gap:15px;
  margin:18px 0}
.reading-heading h2{
  font:600 28px/1.1 var(--heading-font);
  color:var(--ink)}
.reading-heading p{
  font-size:14px}
.reading-cover,.reading-cover-image{
  width:90px}
.reading-cover{
  min-height:130px}
.reading-actions{
  grid-template-columns:1fr 1fr;
  gap:8px}
.reading-actions button{
  font-size:13px}
.reading-progress-form{
  grid-template-columns:1fr 1fr;
  gap:12px}
.reading-progress-form label{
  font-size:13px}
.reading-note{
  font-size:13px;
  color:var(--muted)}
.book-description{
  font-size:14px}
.saga-heading h2{
  font:600 27px/1.1 var(--heading-font)}
.saga-ratio{
  font:600 34px var(--heading-font);
  color:var(--ink)}
.saga-card progress{
  accent-color:var(--brand)}
.series-intro{
  font-size:14px;
  color:var(--muted)}
.series-book{
  grid-template-columns:25px minmax(0,1fr);
  border-color:var(--line);
  gap:9px}
.series-book button{
  color:var(--ink);
  font-size:14px}
.series-book>.status{
  grid-column:2;
  justify-self:start}
.series-total-form label{
  font-size:13px}
.saga-card details>summary{
  font-size:14px}
.destination-field{
  font-size:14px}
.destination-options{
  gap:12px}
.destination-options button{
  font-size:16px}
.destination-options span{
  font-size:12px}
/* Theme selection uses real, isolated previews of each palette. */
.theme-intro{
  font-size:14px;
  color:var(--muted);
  margin:0 0 20px}
.theme-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px 12px}
.theme-option{
  min-width:0;
  padding:0 0 13px;
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  background:var(--surface);
  color:var(--ink);
  text-align:left;
  box-shadow:var(--shadow)}
.theme-option[aria-pressed=true]{
  outline:2px solid var(--brand);
  outline-offset:2px}
.theme-preview{
  display:flex;
  flex-direction:column;
  position:relative;
  isolation:isolate;
  background:var(--paper);
  color:var(--ink);
  height:183px;
  padding:10px 10px 0;
  overflow:hidden;
  border-bottom:1px solid var(--line);
  font-family:var(--body-font)}
.theme-preview:before{
  content:'';
  position:absolute;
  inset:0;
  background-image:var(--art);
  background-size:cover;
  background-position:center;
  opacity:var(--art-opacity);
  z-index:-1}
.theme-preview-brand{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  font:600 20px/1 var(--heading-font);
  color:var(--ink)}
.theme-preview-brand .ui-icon{
  width:16px;
  height:16px}
.theme-preview-greeting{
  font:600 15px/1 var(--heading-font);
  margin:17px 0 9px;
  color:var(--ink)}
.theme-preview-card{
  font-size:8px;
  line-height:1.3;
  display:block;
  background:var(--surface-strong);
  border:1px solid var(--line);
  border-radius:9px;
  padding:12px 8px;
  box-shadow:0 2px 7px #0001}
.theme-preview-card .ui-icon{
  width:14px;
  height:14px;
  margin-right:3px;
  color:var(--brand)}
.theme-preview-bar{
  display:block;
  position:relative;
  height:5px;
  background:var(--line);
  border-radius:6px;
  margin-top:14px;
  overflow:hidden}
.theme-preview-bar:after{
  content:'';
  position:absolute;
  inset:0 40% 0 0;
  background:var(--accent);
  border-radius:6px}
.theme-preview-nav{
  margin:auto -10px 0;
  padding:9px 8px 7px;
  background:var(--surface-strong);
  display:flex;
  justify-content:space-around;
  color:var(--brand);
  border-top:1px solid var(--line)}
.theme-preview-nav .ui-icon{
  width:15px;
  height:15px}
.theme-option-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:5px;
  font:600 20px/1.1 var(--heading-font);
  padding:12px 10px 0;
  overflow-wrap:anywhere}
.theme-option-title .ui-icon{
  width:17px;
  height:17px;
  color:var(--brand)}
.theme-option>small{
  display:block;
  color:var(--muted);
  font-size:9px;
  margin:6px 10px}
.theme-option-description{
  display:block;
  font-size:11px;
  color:var(--muted);
  line-height:1.4;
  margin:8px 10px 0}
.theme-settings-link{
  display:flex;
  align-items:center;
  gap:12px;
  padding:15px 12px;
  margin:20px 0;
  text-decoration:none!important;
  background:var(--surface-soft);
  border:1px solid var(--line);
  border-radius:15px}
.theme-settings-link>span{
  flex:1;
  min-width:0}
.theme-settings-link strong,.theme-settings-link small{
  display:block}
.theme-settings-link strong{
  font:600 21px var(--heading-font)}
.theme-settings-link small{
  font-size:11px;
  color:var(--muted);
  line-height:1.5;
  margin-top:4px}
.theme-settings-link .ui-icon{
  width:21px;
  height:21px;
  color:var(--brand)}
@media(max-width:360px){main{
  padding-left:15px;
  padding-right:15px}
.mobile-header{
  padding-left:15px;
  padding-right:15px}
.mobile-brand>span:last-child{
  font-size:30px}
.continue-card{
  grid-template-columns:94px minmax(0,1fr);
  padding:14px 12px;
  gap:12px}
.featured-cover-image,.cover-placeholder{
  width:94px;
  height:145px}
.continue-content h2{
  font-size:22px}
.continue-content>p{
  font-size:11px}
.home-tile-label{
  font-size:16px}
.home-numbers strong{
  font-size:24px}
.home-welcome h1{
  font-size:32px}
.theme-option-title{
  font-size:18px}
.page-heading h1{
  font-size:31px}
.page-heading>.primary{
  max-width:116px;
  font-size:12px}
.theme-grid{
  gap:14px 10px}
}
@media(prefers-reduced-motion:reduce){*{
  scroll-behavior:auto!important;
  transition:none!important;
  animation:none!important}
.cover-button:hover{
  transform:none}
}
.featured-cover-image{
  position:absolute;
  inset:0}
.cover-placeholder small{
  font:8px/1.3 var(--body-font);
  opacity:.8}
.home-book-shelf button{
  position:relative}
.shelf-cover{
  position:absolute;
  top:0;
  left:0}
.home-welcome h1{
  position:relative;
  padding-right:24px}
.welcome-leaf{
  position:absolute;
  top:6px;
  right:0}
.welcome-leaf .ui-icon{
  margin:0}
.home-welcome:after{
  content:"";
  position:absolute;
  inset:0 -20px 0;
  z-index:-1;
  background:linear-gradient(90deg,var(--paper),transparent 95%);
  opacity:.58;
  pointer-events:none}
.continue-content .primary{
  min-height:44px;
  font-size:13px}
.header-icon,.profile-shortcut{
  width:44px;
  height:44px;
  min-height:44px}
[data-theme="fantasy-nuit"] .home-welcome h1{
  font-size:30px}
.cover-placeholder strong{
  font:600 14px/1.35 var(--body-font);
  hyphens:auto}
.reading-cover{
  position:relative;
  background:var(--surface-soft);
  color:var(--brand)}
.reading-cover-placeholder{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center}
.reading-cover-placeholder .ui-icon{
  width:30px;
  height:30px}
.reading-cover-image{
  position:relative;
  z-index:1;
  background:var(--surface-soft);
  min-height:130px}
.eyebrow{
  color:var(--muted)}
/* Eight visual identities: materials and navigation follow the selected universe. */
body:after{opacity:var(--grain-opacity,.17)}
.continue-card,.welcome-card,.home-shortcuts,.home-stat-card,.home-saga-card,.home-social-card,.panel,.metric,.saga-card,dialog,.theme-option,.theme-preview-card,.collection-tabs,.search,.chips,.notice,.update-banner,.offline-banner,input,textarea,select,.status:not(.reading){
  --ink:var(--panel-ink);--muted:var(--panel-muted);--brand:var(--panel-brand,var(--green));
  color:var(--ink)
}
.continue-card,.welcome-card,.home-shortcuts,.home-stat-card,.home-saga-card,.home-social-card,.panel,.metric,.saga-card,dialog,.theme-preview-card{
  border-radius:var(--card-radius);border-color:var(--card-border)
}
dialog{background:var(--surface-strong)}
.header-icon{color:var(--panel-ink)}
.bottom-nav,.theme-preview-nav{background:var(--nav-bg);--ink:var(--nav-ink);--muted:var(--nav-ink);color:var(--nav-ink)}
.bottom-nav a[aria-current=page]{background:var(--nav-active);color:var(--nav-ink)}
.bottom-nav a[aria-current=page] .ui-icon{color:var(--nav-accent)}
.theme-preview-nav .ui-icon{color:var(--nav-accent)}
.theme-preview-card{color:var(--ink);border-color:var(--card-border)}
.theme-preview-brand .ui-icon{color:var(--brand)}
.theme-preview{height:192px}
[data-theme="romance"] .home-welcome h1{font-style:italic}
[data-theme="romance"] .continue-card{box-shadow:0 7px 22px #ac315026;border:1px solid #e5a9bb}
[data-theme="romance"] .home-progress progress::-webkit-progress-value{background:linear-gradient(90deg,#b30e4d,#dc7595)}
[data-theme="romance"] .home-shortcuts a:last-child .ui-icon{fill:#eab3c377}
[data-theme="thriller-noir"] body:before{opacity:.38;filter:grayscale(1)}
[data-theme="thriller-noir"] .continue-card{border-left:3px solid var(--accent)}
[data-theme="thriller-noir"] .primary,[data-theme="thriller-noir"] .secondary,[data-theme="thriller-noir"] .collection-tabs,[data-theme="thriller-noir"] .collection-tabs a,[data-theme="thriller-noir"] .bottom-nav a{border-radius:4px}
[data-theme="thriller-noir"] .home-kicker{letter-spacing:3px}
[data-theme="fantasy-nuit"] .continue-card,[data-theme="fantasy-nuit"] .home-shortcuts{box-shadow:0 0 0 2px #08172b,0 0 0 3px #97824b,0 8px 22px #0004}
[data-theme="fantasy-nuit"] .home-progress progress::-webkit-progress-value{background:linear-gradient(90deg,#00c6b8,#64e7e0)}
[data-theme="fantasy-nuit"] .home-welcome>p:last-child:after,[data-theme="velaris"] .home-welcome>p:last-child:after{content:'✧ ─── ✧';display:block;margin-top:13px;color:var(--gold);letter-spacing:3px}
[data-theme="club-thriller"] .continue-card,[data-theme="club-thriller"] .home-shortcuts{outline:1px solid #b28e5866;outline-offset:-5px}
[data-theme="club-thriller"] .reading-label{background:#813e4d;border-radius:2px}
[data-theme="club-thriller"] .home-kicker{color:#813e4d}
[data-theme="club-thriller"] .primary{border-radius:7px}
[data-theme="jardin-fantasy"] .continue-card{background:linear-gradient(125deg,#fcfff3,#e9f1d7)}
[data-theme="jardin-fantasy"] .home-shortcuts{border-bottom:3px solid #afc89a}
[data-theme="jardin-fantasy"] .home-progress progress::-webkit-progress-value{background:linear-gradient(90deg,#4f7358,#86a86d)}
:is([data-theme="enquete"],[data-theme="velaris"]) body:before{opacity:.32;background-size:auto 1000px}
:is([data-theme="enquete"],[data-theme="velaris"]) :is(dialog,.panel,.continue-card,.welcome-card,.theme-option,input,textarea,select){color-scheme:light}
[data-theme="enquete"] .continue-card,[data-theme="enquete"] .home-shortcuts,[data-theme="enquete"] .home-stat-card,[data-theme="enquete"] .home-saga-card{outline:1px solid #95703999;outline-offset:-5px;box-shadow:0 3px 0 #6b4528,0 7px 18px #0005}
[data-theme="enquete"] .primary{background:linear-gradient(#913228,#641b16);border:1px solid #c6a35e;border-radius:8px}
[data-theme="enquete"] .reading-label{background:#355b44}
[data-theme="enquete"] .home-welcome h1{color:#fff0d0}
[data-theme="enquete"] .home-kicker{color:#e2c58b}
[data-theme="enquete"] .bottom-nav{border-top:2px solid #c6a35e}
[data-theme="velaris"] .continue-card,[data-theme="velaris"] .home-shortcuts,[data-theme="velaris"] .home-stat-card,[data-theme="velaris"] .home-saga-card{background:linear-gradient(130deg,#f4e6ed,#ddc7e6);box-shadow:0 0 0 1px #b9914d,0 7px 20px #0004}
[data-theme="velaris"] .primary{background:linear-gradient(#754390,#48245e);border:1px solid #d8b56a}
[data-theme="velaris"] .home-progress progress::-webkit-progress-value{background:linear-gradient(90deg,#6f4ba7,#af6ac2)}
[data-theme="velaris"] .home-welcome h1{font-style:italic}
[data-theme="velaris"] .bottom-nav{border-top:2px solid #c19c5a}
[data-theme="velaris"] .bottom-nav a[aria-current=page]{border:1px solid #c8a65f}
.secondary{color:var(--panel-ink)}
.social-navigation{--ink:var(--panel-ink);--muted:var(--panel-muted);color:var(--ink)}
.bottom-nav a[aria-current=page]>span{color:var(--nav-ink)}

/* Search is an edition grid. Cover dimensions remain stable while images load. */
.catalogue-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px 12px;margin:20px 0}
.catalogue-tile{border:0;background:none;padding:0;min-width:0;text-align:left;color:var(--panel-ink);display:flex;flex-direction:column;gap:5px}
.catalogue-grid-cover{display:flex;width:100%;aspect-ratio:2/3;align-items:center;justify-content:center;background:var(--surface-soft);border-radius:8px;overflow:hidden;box-shadow:0 5px 12px #0002;font-size:12px;text-align:center}
.catalogue-grid-image{width:100%;height:100%;object-fit:cover;display:block}
.catalogue-tile strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:13px;line-height:1.35}.catalogue-tile small{font-size:10px;color:var(--panel-muted);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#catalogue-browser,#catalogue-detail,#batch-dialog{width:min(520px,100%);max-width:100%;box-sizing:border-box;padding:26px 18px;max-height:calc(100dvh - 20px);color:var(--panel-ink)}
#catalogue-browser-form,#batch-isbn-form{display:grid;gap:10px;margin-top:18px}#catalogue-browser-form label,#batch-isbn-form label{display:grid;gap:6px}
.catalogue-detail-heading{display:grid;grid-template-columns:34% minmax(0,1fr);gap:18px;margin-top:28px}.catalogue-detail-heading h2{font-size:26px;line-height:1.15}.catalogue-detail-heading p{overflow-wrap:anywhere}
.catalogue-facts{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:24px 0}.catalogue-facts div{min-width:0}.catalogue-facts dt{font-size:11px;text-transform:uppercase;letter-spacing:1px;color:var(--panel-muted)}.catalogue-facts dd{margin:4px 0;overflow-wrap:anywhere}
.catalogue-detail-actions{position:sticky;bottom:-26px;display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:14px 0 max(14px,env(safe-area-inset-bottom));background:var(--surface);margin-top:24px;border-top:1px solid var(--line)}.catalogue-detail-actions button{font-size:13px;padding:12px 8px;min-height:54px}
.batch-row{display:grid;grid-template-columns:65px minmax(0,1fr);gap:14px;padding:18px 0;border-bottom:1px solid var(--line)}.batch-cover{aspect-ratio:2/3;max-height:98px;overflow:hidden;border-radius:5px}.batch-row label{display:block;margin:10px 0}#batch-video{width:100%;max-height:230px;object-fit:cover}#batch-save{margin-top:20px;width:100%}
#reading-session-panel{padding:18px 0;margin:12px 0;border-block:1px solid var(--line)}#reading-session-panel label,#session-finish-form label{display:block;margin:10px 0}#session-finish-form{padding-top:16px}#reading-session-panel [data-session-clock]{font-variant-numeric:tabular-nums;font-size:28px}
.timer-dock{position:fixed;bottom:calc(82px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(480px,calc(100% - 24px));z-index:30;border:1px solid var(--line);border-radius:14px;background:var(--nav-bg);color:var(--nav-ink);box-shadow:0 4px 20px #0003;padding:12px 16px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:13px;font-variant-numeric:tabular-nums}.timer-dock:not([hidden])~.toast{bottom:150px}body:has(.timer-dock:not([hidden])) main{padding-bottom:160px}
select[multiple]{min-height:170px}select[multiple] option{padding:7px}#publisher-filter{max-width:100%}
