/* Outloud Reader web prototype, design B24. Tokens, sizes and structure come from mockups/b24-*.html. */
:root {
  --page: #eef1f5; --card: #fff; --fill: #eef1f5; --fill-2: #e3e7ed; --chip: #e7ebf0; --panel: #f3f5f8; --pop: #fff; --bal: #f3f5f8;
  --ink: #0d0f13; --text-2: #5d6572; --text-3: #96a0ae; --unread: #bfc6d1; --line: #e3e7ec;
  --btn: #0d0f13; --btn-ink: #fff;
  --wave: #f6c400; --red: #d9443a;
  --wavebg: #d3d9e2; --wavebg-card: #cbd2dc; --markcard: #dfe4eb; --track: #dfe4eb; --track-side: #d9dee6; --ex: #b3bbc7;
  --shadow: 0 0 0 1px rgba(16, 24, 40, .05), 0 1px 2px rgba(16, 24, 40, .03), 0 10px 28px -14px rgba(16, 24, 40, .08);
  --pop-shadow: 0 0 0 1px rgba(16, 24, 40, .06), 0 16px 36px -10px rgba(16, 24, 40, .22);
  --seg-on: 0 1px 2px rgba(14, 14, 16, .12); --row-on: 0 1px 2px rgba(14, 14, 16, .06);
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --page: #0f1114; --card: #17191d; --fill: #24272d; --fill-2: #2c3037; --chip: #2c3037; --panel: #1e2126; --pop: #1e2126; --bal: #262a31;
  --ink: #f2f4f7; --text-2: #a0a8b4; --text-3: #6f7783; --unread: #555c67; --line: #2a2e35;
  --btn: #f2f4f7; --btn-ink: #0d0f13;
  --wavebg: #343941; --wavebg-card: #3a3f47; --markcard: #2f343b; --track: #2c3037; --track-side: #2c3037; --ex: #555c67;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .04); --pop-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 16px 36px -10px rgba(0, 0, 0, .6);
  --seg-on: none; --row-on: none;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font: 400 14px/20px var(--sans); color: var(--ink); background: var(--page); -webkit-font-smoothing: antialiased; font-feature-settings: "ss01", "cv11"; overflow: hidden; }
svg { display: block; flex: none; }
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; background: none; border: 0; outline: 0; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Text fields show focus on their rounded holder, not as a square outline around the bare input. */
input[type="text"]:focus-visible, input[type="url"]:focus-visible, textarea:focus-visible { outline: 0; }
.search:focus-within, .rowc:focus-within, .pgc:focus-within { box-shadow: inset 0 0 0 1.5px var(--unread); }

/* ---------- Sidebar ---------- */
.side { z-index: 5; position: fixed; left: 0; top: 0; bottom: 0; width: 232px; padding: 36px 14px 12px; display: flex; flex-direction: column; }
.brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; }
.brand b { font: 700 18px/22px var(--sans); letter-spacing: -.04em; }
.brand span { font: 600 8.5px/11px var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--text-2); margin-top: 3px; padding-left: .18em; }
.new { height: 40px; border-radius: 20px; background: var(--btn); color: var(--btn-ink); font: 600 14px/1 var(--sans); display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { height: 36px; border-radius: 10px; display: flex; align-items: center; gap: 10px; padding: 0 10px; font: 500 14px/20px var(--sans); color: var(--text-2); }
.nav a.on { background: var(--fill-2); color: var(--ink); font-weight: 600; }
.nav .npc { margin: 0 -4px 0 auto; width: 26px; height: 26px; border-radius: 13px; display: none; place-items: center; color: var(--ink); cursor: pointer; }
body.sounding .nav .npc { display: grid; }
.nav .npc > * { grid-area: 1 / 1; }
.nav .npc .npi { display: none; place-items: center; }
.nav .eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
@media (hover: hover) {
  .nav a:hover .npc { background: var(--fill-2); } .nav a.on:hover .npc { background: var(--card); }
  .nav a:hover .npc .eq { display: none; } .nav a:hover .npc .pa { display: grid; }
}
.nav .npc:focus-visible .eq { display: none; } .nav .npc:focus-visible .pa { display: grid; }
.nav .eq i { width: 3px; height: 100%; border-radius: 1.5px; background: var(--ink); transform-origin: 50% 100%; animation: eq .9s ease-in-out infinite; }
.nav .eq i:nth-child(1) { animation-delay: -.2s; } .nav .eq i:nth-child(2) { animation-delay: -.6s; } .nav .eq i:nth-child(3) { animation-delay: -.35s; } .nav .eq i:nth-child(4) { animation-delay: -.75s; }
@keyframes eq { 0%, 100% { transform: scaleY(.28); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .nav .eq i { animation: none; transform: scaleY(.6); } .nav .eq i:nth-child(2n) { transform: scaleY(1); } }
.side .sp { flex: 1; }
.acct { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; width: 100%; text-align: left; }
.acct .ch { margin-left: auto; color: var(--text-3); }
body.mopen .acct { background: var(--fill-2); }
.acct .t { font: 600 13px/18px var(--sans); }
.acct .s { font-size: 12px; line-height: 16px; color: var(--text-2); }
.acct .av { width: 32px; height: 32px; border-radius: 50%; background: var(--fill-2); display: grid; place-items: center; color: var(--text-2); }
.acct .rg { position: relative; width: 36px; height: 36px; flex: none; display: grid; place-items: center; margin: -2px; }
.acct .rg svg.rs { position: absolute; inset: 0; }
.acct .rg .av { width: 26px; height: 26px; }
.rs .trk { stroke: var(--track-side); } .rs .arc, .rg2 .arc { stroke: var(--btn); }
.menu { display: none; position: absolute; left: 14px; width: 272px; bottom: 70px; background: var(--pop); border-radius: 16px; overflow: hidden; box-shadow: var(--pop-shadow); }
body.mopen .menu { display: block; }
.menu a { height: 36px; border-radius: 8px; display: flex; align-items: center; gap: 10px; padding: 0 10px; font: 500 14px/20px var(--sans); }
.menu a:hover, .pop a:hover { background: var(--fill); }
.menu a i, .pop a i { margin-left: auto; color: var(--text-3); display: grid; place-items: center; }
.pop a i { color: var(--ink); }
body.topen .menu a.thm, body.terms .menu a.trm { background: var(--fill); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .zone { padding: 6px 6px 0; }
.menu .lst { padding: 6px; }
.menu a.out2 { height: 50px; }
.menu a.out2 div { min-width: 0; }
.menu a.out2 b { display: block; font: 500 14px/19px var(--sans); }
.menu a.out2 small { display: block; font: 400 12px/16px var(--sans); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bal { background: var(--bal); border-radius: 10px; padding: 12px 10px 8px; }
.bal .bh { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bal .bh b { font: 600 14px/20px var(--sans); letter-spacing: -.01em; }
.bal .bh button { margin-left: auto; height: 28px; border-radius: 14px; padding: 0 12px; background: var(--btn); color: var(--btn-ink); font: 600 12px/28px var(--sans); }
.bal .rg2 .trk { stroke: var(--wavebg); }
.bal .br { display: flex; align-items: baseline; height: 28px; font: 400 13px/28px var(--sans); color: var(--text-2); }
.bal .br b { margin-left: auto; font: 500 13px/28px var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.pop { position: fixed; z-index: 30; background: var(--pop); border-radius: 14px; padding: 6px; box-shadow: var(--pop-shadow); max-height: min(420px, 70vh); overflow: auto; }
.pop a { height: 36px; border-radius: 8px; display: flex; align-items: center; gap: 10px; padding: 0 10px; font: 500 14px/20px var(--sans); white-space: nowrap; }
.pop.sub { z-index: 31; }
.pop.aa { padding: 14px 16px 12px; width: 232px; }
.pop.aa .lab { padding: 0; margin-bottom: 10px; display: flex; align-items: baseline; }
.pop.aa .lab b { margin-left: auto; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pop.aa input[type=range] { width: 100%; accent-color: var(--ink); }
.pop.aa .prev { margin-top: 8px; color: var(--ink); letter-spacing: -.018em; white-space: nowrap; overflow: hidden; }
.pop.res { padding: 6px; }
.pop.res a { height: 44px; }
.pop.res a small { margin-left: auto; font: 400 12px/16px var(--sans); color: var(--text-2); }
.pop.res .none { padding: 12px 10px; color: var(--text-2); font-size: 13px; }
.pop.ren { padding: 8px; width: 240px; }
.pop.ren input { width: 100%; height: 36px; border-radius: 10px; background: var(--fill); padding: 0 12px; font: 500 14px/20px var(--sans); }

/* ---------- Container ---------- */
.app { position: fixed; left: 232px; top: 12px; right: 12px; bottom: 12px; background: var(--card); border-radius: 24px; box-shadow: var(--shadow);
  padding: 26px 32px 0; display: flex; flex-direction: column; overflow: hidden; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -32px; padding: 0 32px 28px; scrollbar-width: thin; }
.top { display: flex; align-items: center; margin-bottom: 22px; flex: none; }
.top h1, .sheet h1 { font: 700 26px/32px var(--sans); letter-spacing: -.035em; }
.top .psub { font-size: 14px; line-height: 20px; color: var(--text-2); margin-top: 2px; }
.search { margin-left: auto; width: 264px; height: 36px; border-radius: 18px; background: var(--chip); display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--text-3); font-size: 14px; cursor: text; }
.search input { flex: 1; min-width: 0; height: 100%; font-size: 14px; color: var(--ink); }
.search input::placeholder { color: var(--text-3); }
.search kbd { margin-left: auto; font: 500 11px/18px var(--sans); color: var(--text-2); background: var(--card); border-radius: 6px; padding: 0 6px; box-shadow: 0 0 0 1px var(--line); }
.card { background: var(--panel); border-radius: 20px; }
.card .wave i { background: var(--wavebg-card); } .card .wave i.p { background: var(--wave); }
.h { font: 600 15px/22px var(--sans); letter-spacing: -.01em; }
.lbl { font: 500 13px/18px var(--sans); color: var(--text-2); }
.link { font: 500 13px/18px var(--sans); color: var(--text-2); display: inline-flex; align-items: center; gap: 2px; }
.link.s { color: var(--ink); font-weight: 600; }
.ib { min-width: 36px; height: 36px; border-radius: 18px; background: var(--fill); display: grid; place-items: center; font: 600 13px/1 var(--sans); padding: 0 10px; }
.ib.sm { min-width: 28px; height: 28px; padding: 0; }
.ib.on { background: var(--btn); color: var(--btn-ink); }
.play { width: 44px; height: 44px; border-radius: 50%; background: var(--btn); display: grid; place-items: center; color: var(--btn-ink); flex: none; }
.play.lg { width: 56px; height: 56px; }
.wave { flex: 1; display: flex; align-items: center; gap: 2px; overflow: hidden; height: 32px; cursor: pointer; }
.wave i { flex: 1; max-width: 3px; min-width: 2px; border-radius: 2px; background: var(--wavebg); }
.wave i.p { background: var(--wave); }
.time { font: 500 13px/18px var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.time span { color: var(--text-3); }
.ph.cur { white-space: nowrap; background: var(--chip); color: inherit; border-radius: 7px; padding: 3px 6px; margin: 0 -6px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.card .ph.cur { background: var(--markcard); }
.mono-note { color: var(--text-2); }

/* Covers */
.cover { aspect-ratio: 3 / 4; border-radius: 6px; padding: 12px 12px 0 14px; position: relative; overflow: hidden; box-shadow: inset 3px 0 0 rgba(0, 0, 0, .08), 0 1px 2px rgba(14, 14, 16, .1), 0 12px 20px -12px rgba(14, 14, 16, .28); }
.cover::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 13%), linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(0, 0, 0, .06)); }
.cover b { display: block; font: 500 15px/18px var(--serif); letter-spacing: -.005em; }
.cover small { display: block; font: 600 8.5px/12px var(--sans); letter-spacing: .14em; text-transform: uppercase; opacity: .6; margin-bottom: 6px; }
.cover .art { position: absolute; inset: auto 0 0 0; height: 46%; }
.c1 { background: #e6eaef; color: #1c2230; } .c1 .art { background: radial-gradient(circle at 50% 118%, #e5532d 0 46%, transparent 47%); }
.c2 { background: #1d2740; color: #eef0f6; } .c2 .art { background: radial-gradient(circle, #f6c400 0 2.2px, transparent 2.8px) 0 0 / 16px 14px; opacity: .9; }
.c3 { background: #f6c400; color: #221c06; } .c3 .art { background: radial-gradient(circle at 30% 70%, transparent 0 17px, #221c06 17.5px 19px, transparent 19.5px), radial-gradient(circle at 72% 70%, transparent 0 17px, #221c06 17.5px 19px, transparent 19.5px); }
.c4 { background: #cdd9e8; color: #1c2738; } .c4 .art { background: linear-gradient(#1c2738, #1c2738) 0 62% / 100% 1.5px no-repeat, radial-gradient(circle at 70% 30%, #fff 0 12px, transparent 12.5px); }
.c5 { background: #c9573b; color: #fdf1ea; } .c5 .art { background: repeating-linear-gradient(90deg, rgba(253, 241, 234, .85) 0 2px, transparent 2px 9px); height: 30%; clip-path: polygon(0 60%, 12% 30%, 26% 70%, 40% 10%, 54% 62%, 68% 24%, 82% 66%, 100% 34%, 100% 100%, 0 100%); }
.c6 { background: #2d5a4c; color: #eef3ee; } .c6 .art { background: radial-gradient(circle at 50% 100%, transparent 0 26px, rgba(238, 243, 238, .7) 26.5px 28px, transparent 28.5px 40px, rgba(238, 243, 238, .45) 40.5px 42px, transparent 42.5px); }

/* ---------- Dashboard ---------- */
.row1 { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 20px; }
.cont { padding: 24px; display: flex; gap: 28px; }
.cont .cover { width: 196px; flex: none; align-self: flex-start; cursor: pointer; }
.cont .body { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-top: 2px; }
.cont .hd { display: flex; align-items: center; }
.cont .go { margin-left: auto; height: 30px; border-radius: 15px; padding: 0 6px 0 12px; background: var(--card); display: inline-flex; align-items: center; gap: 2px; font: 600 13px/1 var(--sans); box-shadow: var(--row-on); }
.cont .t { font: 700 22px/28px var(--sans); letter-spacing: -.03em; margin-top: 6px; }
.cont .m { font-size: 13px; line-height: 18px; color: var(--text-2); margin-top: 2px; }
.cont .ex { font: 400 20px/33px var(--sans); letter-spacing: -.014em; color: var(--ex); margin: 16px 0 18px; flex: 1; max-width: 660px; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.now { color: var(--ink); }
.strip { display: flex; align-items: center; gap: 14px; }
.week { padding: 20px 24px; display: flex; flex-direction: column; }
.ring { display: flex; align-items: center; gap: 16px; margin: 4px 0 14px; }
.ring .g { position: relative; width: 92px; height: 92px; flex: none; }
.ring .g b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 28px/1 var(--sans); letter-spacing: -.04em; }
.rg2 .trk { stroke: var(--track); }
.ring .t1 { font: 600 16px/22px var(--sans); letter-spacing: -.01em; }
.ring .t2 { font-size: 13px; line-height: 18px; color: var(--text-2); }
.kv { display: flex; align-items: center; height: 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.kv:first-of-type { border-top: 0; }
.kv b { margin-left: auto; font: 500 13px/18px var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.week .link { margin-top: auto; padding-top: 10px; }
.sect { display: flex; align-items: baseline; margin: 30px 0 16px; }
.sect .link { margin-left: auto; }
.books { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 28px; }
.bk { position: relative; cursor: pointer; min-width: 0; }
.books .d { margin-top: 12px; font-size: 13px; line-height: 18px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.books .n { margin-top: 12px; font: 600 13px/18px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.books .n + .d { margin-top: 0; }
.bk .bf { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.bk .bt { flex: 1; min-width: 0; }
.bk .bf .n { margin-top: 0; }
.bk .bf .d { white-space: normal; } /* next to the download button: a long "3 pages · today" takes two lines */
.bk .dl { flex: none; width: 32px; height: 32px; border-radius: 16px; background: var(--fill); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.bk .dl:hover { background: var(--fill-2); }
.bk .more { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 14px; background: var(--card); color: var(--ink); display: grid; place-items: center; opacity: 0; z-index: 2; box-shadow: 0 1px 2px rgba(14, 14, 16, .16); }
.bk:hover .more, .bk .more:focus-visible { opacity: 1; }
.bk .rn { width: 100%; height: 22px; margin-top: 10px; border-radius: 6px; background: var(--fill); padding: 0 6px; font: 600 13px/18px var(--sans); }

/* ---------- Now playing ---------- */
.np { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 32px; padding-bottom: 28px; }
.reader { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.rh { display: flex; align-items: center; gap: 6px; }
.rh .pg { font: 500 13px/18px var(--sans); color: var(--text-2); margin: 0 4px; }
.seg { height: 36px; border-radius: 18px; background: var(--fill); display: flex; padding: 3px; gap: 2px; }
.seg a { height: 30px; border-radius: 15px; padding: 0 12px; display: flex; align-items: center; gap: 6px; font: 500 13px/1 var(--sans); color: var(--text-2); }
.seg a.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--seg-on); }
.rtext { --ts: 26px; flex: 1; min-height: 0; overflow: auto; padding: 18px 0 0; font: 400 var(--ts)/calc(var(--ts) * 1.692) var(--sans); letter-spacing: -.018em; color: var(--unread); scrollbar-width: none; }
.rtext p { max-width: 780px; cursor: default; } .rtext p + p { margin-top: 18px; }
.rtext .s { cursor: pointer; }
.rtext.plainm { color: var(--ink); } .rtext.plainm .ph.cur { background: none; padding: 0; margin: 0; }
.rtext .hid { color: var(--text-3); font-size: 15px; line-height: 24px; letter-spacing: 0; padding-top: 6px; }
.rplayer { border-top: 1px solid var(--line); padding: 14px 0 0; }
.rplayer .wave { height: 36px; flex: none; margin-bottom: 10px; }
.ctl { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.ctl .l, .ctl .r { display: flex; align-items: center; gap: 8px; }
.ctl .l .time { margin-left: 6px; }
.ctl .r { justify-content: flex-end; }
.ctl .mid { display: flex; align-items: center; gap: 22px; }
.ctl .mid > a { display: grid; place-items: center; }
.ni { display: grid; }
.rcol { display: flex; flex-direction: column; gap: 20px; min-height: 0; overflow: auto; }
.list { padding: 16px 8px 8px; }
.list .hd { padding: 0 12px 6px; display: flex; align-items: baseline; }
.list .hd span + span { margin-left: auto; font-size: 13px; color: var(--text-2); }
.list a { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border-radius: 12px; font: 500 14px/20px var(--sans); }
.list a .n { width: 24px; height: 24px; border-radius: 8px; background: var(--card); display: grid; place-items: center; font: 600 12px/1 var(--sans); color: var(--text-2); }
.list a.on { background: var(--card); font-weight: 600; box-shadow: var(--row-on); }
.list a.on .n { background: var(--btn); color: var(--btn-ink); }
.list a .v { margin-left: auto; font-weight: 400; color: var(--text-2); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 2px; }
.list a.addp { color: var(--text-2); }
.list a:not(.on):hover { background: var(--fill); }

/* ---------- New import ---------- */
.sheet { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sheet .hd { display: flex; align-items: flex-start; flex: none; }
.sheet .sub { font-size: 14px; line-height: 20px; color: var(--text-2); margin-top: 2px; }
.x { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; flex: none; }
.tiles { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; margin: 22px 0 26px; flex: none; }
.tile { min-height: 120px; border-radius: 20px; background: var(--fill); padding: 14px 14px 12px; text-align: left; display: block; } /* grows when a subtitle takes more lines */
.tile .i { height: 26px; display: flex; align-items: center; }
.tile b { display: block; font: 600 14px/20px var(--sans); letter-spacing: -.01em; margin-top: 10px; white-space: nowrap; }
.tile span { display: block; font-size: 12px; line-height: 16px; color: var(--text-2); margin-top: 1px; }
.tile.on { background: var(--red); color: #fff; }
.tile.on span { color: rgba(255, 255, 255, .86); }
.form { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 32px; padding-bottom: 28px; }
.form > div { min-height: 0; }
.form .left { overflow: auto; scrollbar-width: thin; }
.lab { display: flex; font: 500 13px/18px var(--sans); color: var(--text-2); padding: 0 4px; margin-bottom: 8px; }
.lab a, .lab button { margin-left: auto; color: var(--ink); font-weight: 600; }
.rowc { min-height: 48px; border-radius: 14px; background: var(--fill); display: flex; align-items: center; gap: 10px; padding: 0 16px; font: 500 14px/20px var(--sans); margin-bottom: 8px; width: 100%; text-align: left; }
.rowc .v { margin-left: auto; color: var(--text-2); font-weight: 400; display: flex; align-items: center; gap: 4px; }
.rowc.addp { font-weight: 600; }
.rowc input { flex: 1; min-width: 0; height: 48px; }
.rowc input::placeholder { color: var(--text-3); }
.pgc { border-radius: 14px; background: var(--fill); padding: 12px 16px 14px; margin-bottom: 8px; position: relative; }
.pgc b { display: block; font: 600 13px/18px var(--sans); color: var(--text-2); margin-bottom: 2px; }
.pgc p, .pgc textarea { font-size: 14px; line-height: 21px; display: block; width: 100%; resize: none; }
.pgc p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pgc textarea { height: 42px; overflow: auto; }
.pgc textarea::placeholder { color: var(--text-3); }
.pgc .rm { position: absolute; top: 8px; right: 10px; width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; color: var(--text-3); }
.pgc .rm:hover { background: var(--fill-2); color: var(--ink); }
.pgc.conn { padding: 22px 20px; display: flex; align-items: center; gap: 16px; }
.pgc.conn .cl { width: 44px; height: 44px; border-radius: 12px; background: var(--card); display: grid; place-items: center; flex: none; }
.pgc.conn b { font: 600 15px/22px var(--sans); color: var(--ink); margin: 0; }
.pgc.conn span { display: block; font-size: 13px; line-height: 18px; color: var(--text-2); }
.pgc.conn .cb { margin-left: auto; height: 36px; border-radius: 18px; padding: 0 18px; background: var(--btn); color: var(--btn-ink); font: 600 13px/36px var(--sans); }
.right { display: flex; flex-direction: column; }
.sum { margin-top: auto; }
.sum .n { font: 600 14px/20px var(--sans); text-align: center; }
.sum .m { font-size: 13px; line-height: 18px; color: var(--text-2); text-align: center; margin: 2px 0 12px; }
.create { height: 48px; border-radius: 24px; background: var(--btn); color: var(--btn-ink); font: 600 15px/1 var(--sans); display: flex; align-items: center; justify-content: center; width: 100%; }
.create[disabled] { background: var(--fill-2); color: var(--text-3); cursor: default; }
.sum .create.stop { background: var(--fill-2); color: var(--ink); cursor: pointer; } /* "Stop import" while an import runs: the grey secondary capsule */
.gap { height: 12px; }
.empty-hint { color: var(--text-2); font-size: 13px; line-height: 18px; padding: 4px; }

/* ---------- Library / Settings ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filters .ib { cursor: pointer; font-weight: 500; }
.filters .ib.on { font-weight: 600; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 80px 0; }
.empty .h { margin-bottom: 4px; } .empty p { color: var(--text-2); margin-bottom: 16px; }
.empty a { height: 40px; border-radius: 20px; background: var(--btn); color: var(--btn-ink); padding: 0 20px; display: inline-flex; align-items: center; font: 600 14px/1 var(--sans); }
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin: -4px 0 26px; flex: none; }
.tabs a { position: relative; padding: 0 2px 12px; font: 500 14px/20px var(--sans); color: var(--text-2); }
.tabs a.on { color: var(--ink); font-weight: 600; }
.tabs a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 1px; background: var(--ink); }
.set { max-width: 860px; display: flex; flex-direction: column; gap: 30px; }
.set .h { padding: 0 4px 10px; }
.set .card { padding: 2px 20px; }
.srow { display: flex; align-items: center; gap: 24px; min-height: 68px; padding: 13px 0; border-top: 1px solid var(--line); }
.srow:first-child { border-top: 0; }
.srow .t { font: 500 14px/20px var(--sans); }
.srow .d { font-size: 13px; line-height: 18px; color: var(--text-2); margin-top: 2px; }
.srow .c { margin-left: auto; flex: none; display: flex; align-items: center; }
.sel { height: 34px; border-radius: 17px; background: var(--card); padding: 0 10px 0 14px; display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1 var(--sans); cursor: pointer; }
.sel svg { transform: rotate(90deg); color: var(--text-3); }
.sbtn { height: 34px; border-radius: 17px; background: var(--card); padding: 0 16px; display: inline-flex; align-items: center; font: 600 13px/1 var(--sans); cursor: pointer; }
.sbtn.danger { color: var(--red); background: color-mix(in srgb, var(--red) 13%, var(--card)); }
.sedit { width: 30px; height: 30px; margin: 0 -6px 0 8px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); cursor: pointer; }
.sedit:hover { background: var(--fill-2); color: var(--ink); }
.sval { font-size: 14px; color: var(--text-2); }
.sbtn.primary { background: var(--btn); color: var(--btn-ink); }
.srow .si { width: 36px; height: 36px; border-radius: 10px; background: var(--card); display: grid; place-items: center; flex: none; margin-right: -8px; }
.srow .si svg { max-width: 22px; max-height: 22px; }
.stat { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font: 500 13px/18px var(--sans); color: var(--text-2); white-space: nowrap; }
.stat i { width: 7px; height: 7px; border-radius: 50%; background: #2f9e62; }
.stat.bad { color: var(--red); } .stat.bad i { background: var(--red); }

/* Storage: the first-run dialog, the switch confirmation, the bar shown while the storage cannot be reached */
.dlg-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(13, 15, 19, .42); overflow: auto; }
.dlg { width: 100%; max-width: 560px; background: var(--pop); border-radius: 24px; padding: 32px; box-shadow: var(--pop-shadow); }
.dlg.sm { max-width: 460px; }
.dlg .steps { font: 600 12px/16px var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.dlg .link { display: flex; gap: 24px; align-items: center; margin: 22px 0 4px; }
.dlg .phone { flex: none; width: 150px; height: 236px; border-radius: 26px; background: var(--ink); padding: 7px; }
.dlg .phone .ps { height: 100%; border-radius: 20px; background: var(--card); padding: 18px 10px 0; display: flex; flex-direction: column; gap: 6px; }
.dlg .phone b { font: 700 13px/16px var(--sans); letter-spacing: -.02em; margin: 0 4px 6px; }
.dlg .phone i { font: 500 9.5px/12px var(--sans); font-style: normal; color: var(--text-2); background: var(--panel); border-radius: 7px; padding: 6px 8px; } /* a long app label takes two lines */
.dlg .phone i.hl { color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--ink); }
.dlg .phone span { margin-top: 8px; text-align: center; font: 700 20px/26px var(--sans); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.dlg .how { flex: 1; min-width: 0; }
.dlg .how ol { margin: 0 0 16px 18px; font-size: 14px; line-height: 21px; color: var(--text-2); display: grid; gap: 6px; }
.dlg .how ol b { color: var(--ink); font-weight: 600; }
.dlg .code { width: 100%; height: 56px; border-radius: 16px; background: var(--panel); text-align: center; font: 700 26px/1 var(--sans); letter-spacing: .12em; font-variant-numeric: tabular-nums; color: var(--ink); }
.dlg .code::placeholder { color: var(--unread); }
.dlg .code:focus { box-shadow: inset 0 0 0 1.5px var(--ink); }
.dlg button.create { border: 0; cursor: pointer; } .dlg button.create[disabled] { cursor: default; }
.dlg h2 { font: 700 24px/30px var(--sans); letter-spacing: -.03em; }
.dlg p { font-size: 14px; line-height: 21px; color: var(--text-2); margin-top: 8px; }
.dlg p b { color: var(--ink); font-weight: 600; }
.dlg .opts { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 8px; margin: 22px 0 16px; }
.dlg .opt { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--panel); cursor: pointer; box-shadow: inset 0 0 0 1.5px transparent; min-width: 0; }
.dlg .opt.on { box-shadow: inset 0 0 0 1.5px var(--ink); }
.dlg .opt .oi { width: 40px; height: 40px; border-radius: 12px; background: var(--card); display: grid; place-items: center; flex: none; }
.dlg .opt .oi svg { max-width: 24px; max-height: 24px; }
.dlg .opt .ot { flex: 1; min-width: 0; }
.dlg .opt b { display: block; font: 600 14px/20px var(--sans); }
.dlg .opt .ot span { display: block; font-size: 12px; line-height: 16px; color: var(--text-2); }
.dlg .opt .rd { align-self: flex-start; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--unread); flex: none; }
.dlg .opt.on .rd { box-shadow: inset 0 0 0 5.5px var(--ink); }
.dlg .note { font-size: 12.5px; line-height: 18px; margin: 0 0 20px; }
.dlg .create { cursor: pointer; }
.dlg .row2 { display: flex; gap: 8px; margin-top: 24px; }
.dlg .row2 .create { flex: 1; height: 44px; font-size: 14px; padding: 0 16px; white-space: nowrap; }
.dlg .sbtn2 { height: 44px; border-radius: 22px; background: var(--fill-2); padding: 0 20px; display: inline-flex; align-items: center; font: 600 14px/1 var(--sans); cursor: pointer; }
.dbar { position: fixed; z-index: 4; left: 232px; right: 12px; top: 12px; min-height: 44px; border-radius: 14px; background: color-mix(in srgb, var(--wave) 26%, var(--card)); display: none; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; font: 400 13.5px/18px var(--sans); }
.dbar b { font-weight: 600; }
.dbar a { margin-left: auto; flex: none; height: 32px; border-radius: 16px; background: var(--btn); color: var(--btn-ink); padding: 0 14px; display: inline-flex; align-items: center; font: 600 13px/1 var(--sans); }
body.dlost .dbar { display: flex; }
body.dlost .app { top: 64px; }
body[data-route="full"] .dbar { display: none; }
.tog { width: 40px; height: 24px; border-radius: 12px; background: var(--unread); position: relative; cursor: pointer; transition: background .15s; }
.tog::after { content: ""; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.tog.on { background: var(--ink); }
.tog.on::after { transform: translateX(16px); background: var(--card); }

/* ---------- Full screen reader ---------- */
.full { position: fixed; inset: 0; z-index: 20; background: var(--card); display: flex; flex-direction: column; }
.full .text { flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; padding: 72px 32px 0; scrollbar-width: none; }
.full .col { --ts: 30px; max-width: 820px; width: 100%; font: 400 var(--ts)/calc(var(--ts) * 1.667) var(--sans); letter-spacing: -.02em; color: var(--unread); }
.full .col p + p { margin-top: 26px; }
.full .col .ph.cur { border-radius: 10px; padding: 6px 8px; margin: 0 -8px; }
.full .col.plainm { color: var(--ink); } .full .col.plainm .ph.cur { background: none; padding: 0; margin: 0; }
.full .col .s { cursor: pointer; }
.full .bar { flex: none; padding: 36px 32px 28px; display: flex; justify-content: center; background: linear-gradient(transparent, var(--card) 36px); margin-top: -36px; position: relative; }
.full .player { width: 100%; max-width: 820px; }
.full .wave { height: 44px; gap: 4px; margin-bottom: 14px; flex: none; }
.full .wave i { max-width: 5px; border-radius: 3px; background: var(--wavebg); } .full .wave i.p { background: var(--wave); }
.full .ctl .l, .full .ctl .r { gap: 10px; }
.full .mid { gap: 28px; }
.full .rb { min-width: 44px; height: 44px; border-radius: 22px; background: var(--panel); display: grid; place-items: center; font: 600 14px/1 var(--sans); padding: 0 12px; }
.full .rb.on { background: var(--btn); color: var(--btn-ink); }
.full .time { font: 500 14px/20px var(--sans); margin-left: 6px; }
.full .play { width: 64px; height: 64px; }

/* ---------- Toast ---------- */
#toasts { position: fixed; left: 0; right: 0; bottom: 28px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--btn); color: var(--btn-ink); padding: 11px 18px; border-radius: 22px; font: 500 14px/20px var(--sans); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.toast.in { opacity: 1; transform: none; }

/* ---------- 768-1199 ---------- */
@media (max-width: 1199px) {
  .books { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
  .row1 { grid-template-columns: minmax(0, 1fr); }
  .week { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 28px; }
  .week .ring { margin: 0; }
  .week .kv { border-top: 0; height: 32px; width: auto; gap: 12px; }
  .week .link { margin-top: 0; padding: 0; margin-left: auto; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .np { grid-template-columns: minmax(0, 1fr); overflow-y: auto; gap: 20px; }
  .reader { overflow: visible; }
  .rtext { flex: none; overflow: visible; min-height: 200px; padding-bottom: 20px; }
  .rcol { overflow: visible; }
  .sheet { overflow-y: auto; padding-bottom: 20px; scrollbar-width: thin; }
  .form { grid-template-columns: minmax(0, 1fr); overflow: visible; flex: none; gap: 20px; align-content: start; padding-bottom: 0; }
  .form > div { min-height: auto; }
  .reader, .rcol { min-height: auto; }
}

/* ---------- Under 768: edge-to-edge container, bottom bar ---------- */
@media (max-width: 767px) {
  .dbar { left: 8px; right: 8px; top: 8px; } body.dlost .app { top: 72px; }
  .dlg { padding: 24px 20px; } .dlg .opts { grid-template-columns: 1fr; } .dlg .row2 { flex-direction: column-reverse; } .dlg .link { flex-direction: column; } .dlg .phone { height: 200px; }
  .side { top: auto; width: auto; right: 0; height: 64px; padding: 0 8px env(safe-area-inset-bottom); flex-direction: row; align-items: center; background: var(--card); border-top: 1px solid var(--line); z-index: 10; }
  .brand, .side .sp, .acct .t, .acct .s, .acct .ch { display: none; }
  .nav { display: contents; }
  .nav a { flex: 1; height: 52px; flex-direction: column; justify-content: center; gap: 2px; padding: 0; font-size: 10.5px; line-height: 14px; border-radius: 12px; min-width: 0; }
  .nav a.on { background: none; color: var(--ink); }
  .nav a { position: relative; } .nav .npc { position: absolute; top: 2px; left: calc(50% + 8px); width: 22px; height: 22px; margin: 0; } .nav .eq { height: 10px; } .nav .eq i { width: 2px; }
  .nav a:nth-child(1) { order: 1; } .nav a:nth-child(2) { order: 2; } .nav a:nth-child(3) { order: 4; }
  .new { order: 3; flex: none; width: 44px; height: 44px; border-radius: 50%; margin: 0 4px; font-size: 0; gap: 0; }
  .new svg { width: 22px; height: 22px; }
  .acct { order: 5; flex: none; width: 52px; height: 52px; padding: 0; justify-content: center; }
  .acct .rg { margin: 0; }
  .menu { left: auto; right: 10px; bottom: 74px; width: min(272px, calc(100vw - 20px)); }
  .app { left: 0; right: 0; top: 0; bottom: 64px; border-radius: 0; box-shadow: none; padding: 18px 16px 0; }
  .scroll { margin: 0 -16px; padding: 0 16px 20px; }
  .top { margin-bottom: 16px; }
  .top h1, .sheet h1 { font-size: 22px; line-height: 28px; }
  .search { width: 150px; } .search kbd { display: none; }
  .books { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .cont { flex-direction: column; padding: 18px; gap: 16px; }
  .cont .cover { width: 132px; }
  .cont .ex { font-size: 17px; line-height: 28px; -webkit-line-clamp: 4; }
  .rtext { --ts: 20px !important; }
  .np { padding-bottom: 20px; }
  .rh { flex-wrap: wrap; row-gap: 10px; }
  .seg a { padding: 0 9px; }
  .ctl .mid { gap: 10px; } .ctl .l .time { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px 0; }
  .tile { min-height: 96px; padding: 12px 12px 10px; } .tile b { margin-top: 6px; }
  .week .kv { width: 100%; } .week { gap: 0; }
  .full .text { padding: 40px 20px 0; } .full .col { --ts: 22px !important; }
  .full .ctl .l .time { display: none; } .full .mid { gap: 14px; }
  .full .bar { padding: 36px 16px 20px; }
  .sheet .sub { display: none; }
}

/* ---------- New import › Link with our server: a failed read ---------- */
.empty-hint.lkx { color: var(--red); }
.empty-hint .lkr { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Sign-in gate (mockups/b25-signin.html; js/views/signin.js) ---------- */
.sgn { position: fixed; inset: 0; z-index: 1000; overflow: auto; background: var(--page); display: grid; place-items: center; padding: 16px; }
.sgn-card { width: 100%; max-width: 440px; background: var(--card); border-radius: 24px; box-shadow: var(--shadow); padding: 44px 40px 32px; text-align: center; }
.sgn .brand { display: flex; margin-bottom: 36px; }
.sgn h1 { font: 700 26px/32px var(--sans); letter-spacing: -.03em; text-wrap: balance; }
.sgn-lead { font-size: 15px; line-height: 22px; color: var(--text-2); margin: 10px auto 0; max-width: 320px; }
.sgn-g { margin: 28px auto 0; width: 100%; max-width: 320px; min-height: 40px; display: flex; justify-content: center; }
.sgn-check { display: flex; justify-content: center; }
.sgn-check:not(:empty) { margin-top: 12px; }
.sgn-line { margin: 10px auto 0; max-width: 320px; font-size: 13px; line-height: 18px; color: var(--text-2); }
.sgn-line.bad { color: var(--red); }
.sgn-line:empty { display: none; }
.sgn-msg { margin: 28px auto 0; max-width: 320px; font-size: 14px; line-height: 20px; color: var(--text-2); }
.sgn-note { margin: 20px auto 0; max-width: 320px; padding: 12px 14px; border-radius: 14px; background: var(--panel); font-size: 13px; line-height: 19px; color: var(--text-2); text-align: left; display: flex; gap: 10px; align-items: flex-start; }
.sgn-note svg { flex: none; margin-top: 1px; }
.sgn-note b { color: var(--ink); font-weight: 600; }
.sgn-fine { margin-top: 28px; font-size: 12px; line-height: 18px; color: var(--text-3); }
.sgn-fine a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
/* `?gate=1` only (no API_BASE, no Google script): a stand-in drawn like Google's filled_black pill button */
.sgn-demo { position: relative; width: 100%; height: 40px; border-radius: 20px; background: #131314; color: #e3e3e3; display: flex; align-items: center; justify-content: center; font: 500 14px/20px Roboto, Arial, sans-serif; letter-spacing: .25px; }
.sgn-demo i { position: absolute; left: 2px; top: 2px; width: 36px; height: 36px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
@media (max-width: 480px) { .sgn-card { padding: 36px 20px 24px; border-radius: 20px; } }
