:root {
  color-scheme: light;
  --paper: #f7f5ed;
  --white: #fffef9;
  --ink: #1b3027;
  --muted: #5e675d;
  --green: #183f32;
  --orange: #bf583d;
  --line: #d8d9ca;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", "Segoe UI", Arial, sans-serif;
  font: 16px/1.5 var(--sans);
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button, summary, select, input[type="range"] { cursor: pointer; }
button { border: 0; }
button:disabled, input:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 3px solid #bd6746; outline-offset: 4px; }
.skip { position: fixed; top: -8em; left: 1em; background: white; color: var(--ink); padding: .75em 1em; z-index: 5; }
.skip:focus { top: .5em; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.mast { border-bottom: 1px solid var(--line); background: #faf9f2; }
.mast-inner, main { max-width: 1200px; width: calc(100% - clamp(36px, 10vw, 160px)); margin: 0 auto; }
.mast-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font: 700 1.8rem/1 var(--serif); letter-spacing: -.065em; color: var(--ink); text-decoration: none; }
.brand-light { font-weight: 400; }
.brand-mark, .onair { display: flex; align-items: center; justify-content: center; gap: 3px; }
.brand-mark { width: 36px; height: 36px; background: var(--green); border-radius: 9px; }
.brand-mark i, .onair i { width: 3px; height: 9px; border-radius: 3px; background: #ece8cc; }
.brand-mark i:nth-child(2), .onair i:nth-child(2) { height: 17px; }
.brand-mark i:nth-child(3), .onair i:nth-child(3) { height: 23px; }
.brand-mark i:nth-child(4), .onair i:nth-child(4) { height: 14px; }
.voice-state { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 25px; background: var(--white); padding: 6px 12px; font: 500 .77rem/1.35 var(--sans); color: var(--muted); }
.voice-state b { font-weight: 550; }
.voice-state>span { background: #a28a63; width: 7px; height: 7px; border-radius: 50%; }
.voice-state.verified>span { background: #438759; }
.mast-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.account-menu { position: relative; z-index: 3; }
.account-menu > summary {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 12px;
  list-style: none; border: 1px solid var(--line); border-radius: 8px; background: var(--white);
  font-weight: 650; font-size: .875rem; white-space: nowrap;
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary::after {
  content: ""; width: 7px; height: 7px; margin-top: -4px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.account-menu[open] > summary::after { transform: rotate(225deg); margin-top: 3px; }
.account-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: min(284px, calc(100vw - 36px));
  padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--white);
  box-shadow: 0 12px 30px #183f3220;
}
.account-profile { padding: 9px 12px 11px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.account-profile p { margin-top: 2px; color: var(--muted); font-size: .875rem; }
.account-panel a, .account-panel button {
  display: flex; align-items: center; min-height: 42px; padding: 8px 12px; margin-top: 3px;
  border-radius: 7px; color: var(--green); font-weight: 600; font-size: .875rem; text-decoration: none;
}
.account-panel button { width: 100%; background: transparent; }
.account-panel :is(a, button):hover { background: #ebeede; }
.account-gate { max-width: 560px; padding: clamp(24px, 4vw, 44px); background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.account-gate h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
.account-gate p { color: var(--muted); margin: 12px 0 16px; }
.account-gate a { text-decoration: none; }
.account-form { display: grid; gap: 9px; max-width: 360px; margin-top: 16px; }
.account-form label { font-weight: 600; }
.account-form input {
  width: 100%; min-height: 46px; padding: 10px 12px;
  background: var(--white); border: 1px solid #91a093; border-radius: 8px;
}
.account-form .btn { justify-self: start; white-space: normal; }
@media (max-width: 520px) {
  .mast-actions { gap: 5px; padding-block: 7px; }
}
main { padding: clamp(32px, 5.6vw, 80px) 0 48px; }
.library-heading, .reading-head, .page-toolbar, .player-title, .times, .speed-row, .total-progress>div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; }
h1 { font-size: clamp(2.8rem, 5.5vw, 5.1rem); letter-spacing: -.07em; line-height: 1.05; }
.title-dot { color: var(--orange); }
.library-heading p { color: var(--muted); margin-top: 12px; font-size: clamp(.91rem, 1.5vw, 1.02rem); }
.library-heading { margin-bottom: clamp(24px, 3vw, 39px); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 8px; min-height: 44px; padding: 10px 19px; font-size: .92rem; line-height: 1.25; font-weight: 650; white-space: nowrap; }
.btn:not(:disabled):hover { filter: brightness(.95); }
.primary { background: var(--green); color: #fffef9; }
.plus { font-weight: 400; line-height: 1; font-size: 1.45em; }
.empty { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; min-height: clamp(320px, 33vw, 422px); border-radius: 18px; background: #1c4033; color: var(--white); }
.empty::after { content: ""; position: absolute; inset: 9px; pointer-events: none; border: 1px solid #a9b99c40; border-radius: 11px; z-index: 1; }
.empty-copy { padding: clamp(26px, 4.6vw, 69px); position: relative; z-index: 1; }
.paper-symbol { width: 33px; height: 40px; border: 1.5px solid #dbdab9; color: #e6e6c7; border-radius: 4px 9px 4px 4px; display: grid; place-items: end center; margin-bottom: clamp(19px, 2.4vw, 29px); padding-bottom: 5px; }
.paper-symbol span { font: 650 .52rem/1 var(--sans); letter-spacing: .1em; }
.empty h2 { font-size: clamp(2rem, 3.7vw, 3.7rem); line-height: 1.02; letter-spacing: -.065em; }
.empty-copy p { margin: 13px 0 23px; color: #dcdfcf; max-width: 34ch; }
.paper-btn { background: #f6efd9; color: var(--green); }
.cover-art { align-self: stretch; min-height: 300px; position: relative; pointer-events: none; overflow: hidden; }
.art-halo { position: absolute; inset: -28% -18% -5% -22%; background: repeating-radial-gradient(ellipse at 60% 49%, transparent 0 19px, #bed4b21a 19.5px 20px, transparent 20.5px 30px); mask-image: linear-gradient(90deg, transparent, #000 33%); }
.cover { height: 64%; aspect-ratio: .71; position: absolute; left: 48%; top: 49%; border-radius: 3px 7px 7px 3px; box-shadow: 3px 7px 0 -2px #d5c8a7, 5px 10px 1px -3px #66735c, 8px 16px 15px #0e2c2336; }
.cover::before { content: ""; position: absolute; inset: 0 auto 0 5%; border-left: 1px solid #0002; border-right: 1px solid #fff2; }
.back { transform: translate(-63%, -46%) rotate(-22deg); background: #d1b56c; }
.middle { transform: translate(-49%, -47%) rotate(-9deg); background: #d9d9be; }
.front { transform: translate(-36%, -51%) rotate(9deg); background: #c46a4d; box-shadow: inset 14px 0 #ae5a42, inset 17px 0 #c7795c, 2px 4px 0 #cdbf9e, 4px 7px 0 #a2503b, 5px 11px 11px #102e242b; display: grid; place-items: center; padding-left: 7%; }
.cover-rule { position: absolute; left: 18%; right: 10%; top: 11%; height: 1px; background: #f6d7aa90; }
.cover-rule.bottom { top: auto; bottom: 11%; }
.cover-wave { display: flex; align-items: center; justify-content: center; gap: 3px; width: 82%; height: 60%; transform: translateX(-8%); }
.cover-wave i { background: #f0d1a5; flex: 1; max-width: 5px; border-radius: 3px; height: 18%; }
.cover-wave i:nth-child(2n) { height: 32%; }.cover-wave i:nth-child(3n) { height: 48%; }.cover-wave i:nth-child(4n) { height: 67%; }.cover-wave i:nth-child(5n) { height: 51%; }.cover-wave i:nth-child(7) { height: 90%; }
main.dropping .empty, main.dropping #shelf { outline: 3px dashed var(--orange); outline-offset: 4px; }
.notice { margin: 14px 0; padding: 10px 14px; border-left: 3px solid #82987b; background: #ebeee2; font-size: .92rem; }
.notice.problem { background: #f6e8de; border-color: var(--orange); color: #763925; }
.privacy { border-top: 1px solid var(--line); padding: 18px 0 0; margin-top: 24px; color: var(--muted); font-size: .86rem; }
.privacy summary { display: flex; width: fit-content; align-items: center; gap: 9px; color: #405546; font-weight: 550; list-style: none; }
.privacy summary::-webkit-details-marker { display: none; }
.privacy summary::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin-left: 3px; }
.privacy[open] summary::after { transform: rotate(225deg); }
.privacy p { max-width: 84ch; margin: 10px 0 0 24px; }
.info { border: 1px solid; border-radius: 50%; width: 15px; height: 15px; text-align: center; font: italic 600 11px/14px Georgia, serif; }
.books { display: flex; gap: 10px; overflow-x: auto; padding: 4px 4px 10px; margin: -4px -4px 18px; scrollbar-width: thin; }
.book-card { text-align: left; display: flex; align-items: center; gap: 11px; width: clamp(185px, 23vw, 270px); flex: none; padding: 11px; background: var(--white); border: 1px solid var(--line); border-radius: 9px; }
.book-card[aria-pressed="true"] { border-color: #59715b; background: #ebeede; box-shadow: 0 0 0 1px #59715b; }
.mini-book { flex: none; width: 25px; height: 34px; border-radius: 1px 4px 4px 1px; background: repeating-linear-gradient(0deg,transparent 0 8px,#fdf7dd80 8px 9px,transparent 9px 16px) center/55% 62% no-repeat, linear-gradient(90deg,#0002 0 10%,transparent 10%) var(--cover-color,#a65b43); box-shadow: 1px 2px #cabd9e; }
.book-meta { min-width: 0; }
.book-meta strong, .book-meta small { display: block; }
.book-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .91rem; }
.book-meta small { color: var(--muted); font-size: .75rem; margin-top: 2px; }
#workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(245px, .46fr); gap: clamp(14px, 2vw, 27px); align-items: start; }
.reading-panel, .player-panel { border-radius: 14px; }
.reading-panel { background: var(--white); border: 1px solid var(--line); overflow: hidden; min-width: 0; }
.reading-head { padding: 23px clamp(17px, 2.5vw, 32px) 18px; align-items: flex-start; }
.reading-head>div { min-width: 0; }
.kicker { display: block; text-transform: uppercase; font: 650 .64rem/1.6 var(--sans); letter-spacing: .13em; }
.reading-head .kicker { color: #8b4a35; margin-bottom: 3px; }
.reading-head h2 { font-size: clamp(1.8rem, 3.1vw, 3rem); line-height: 1.1; letter-spacing: -.045em; overflow-wrap: anywhere; }
.icon-btn, .transport-skip, .transport-play { display: inline-grid; place-items: center; }
.remove-btn { width: 42px; height: 42px; border-radius: 50%; color: var(--muted); background: transparent; flex: none; }
.remove-btn:hover { background: #f2eee4; }
.ico { position: relative; display: inline-block; }
.ico-bin { width: 13px; height: 15px; border: 1.6px solid; border-top: 0; border-radius: 0 0 3px 3px; }
.ico-bin::before, .ico-bin::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); }
.ico-bin::before { width: 18px; top: -3px; border-top: 1.6px solid; }
.ico-bin::after { width: 6px; height: 2px; border: 1.5px solid; border-bottom: 0; top: -6px; }
.page-toolbar { padding: 9px clamp(17px,2.5vw,32px); flex-wrap: wrap; border-block: 1px solid var(--line); background: #f7f7ef; color: var(--muted); font-size: .83rem; }
.page-toolbar form { display: inline-flex; align-items: center; gap: 6px; }
.page-toolbar input { background: var(--white); border: 1px solid var(--line); border-radius: 4px; width: 4.3em; min-height: 32px; text-align: center; padding: 0 3px; }
.text-btn { background: transparent; color: var(--green); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; min-height: 34px; padding-inline: 6px; }
.part-label { font-size: .76rem; }
.passage { min-height: 190px; max-height: max(380px, 56vh); overflow: auto; padding: 18px clamp(15px,2.5vw,35px) 28px; scrollbar-width: thin; scroll-padding: 12px; }
.passage p { margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid transparent; border-radius: 1px 5px 5px 1px; font: 400 clamp(1.08rem,1.65vw,1.32rem)/1.7 var(--serif); color: #374335; overflow-wrap: anywhere; white-space: pre-line; }
.passage p.current { background: #f4ecd7; border-color: var(--orange); color: #242e23; }
.player-panel { padding: clamp(20px,2.25vw,32px); color: #f9f7e8; background: var(--green); }
.player-title .kicker, .voice-credit, .times, .speed-row label, .total-progress span { color: #ced7c4; }
.onair { height: 25px; gap: 2px; }.onair i { background: #c99b75; width: 2.5px; }
.player-panel h2 { font-size: 3.8rem; line-height: 1; letter-spacing: -.075em; margin: 13px 0 5px; }
.voice-credit, .speed-row, .total-progress>div { font-size: .82rem; }
.engine-settings { margin-top: 15px; font-size: .82rem; }
.engine-settings, .engine-settings>div { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 7px; }
.engine-settings>div { grid-column: 1/-1; }
.engine-settings label { color: #ced7c4; }
.engine-settings select { width: 100%; min-height: 34px; border: 1px solid #a5b39a; border-radius: 5px; padding: 4px; color: var(--ink); background: #edf0e1; }
.play-state { margin: 19px 0 3px; font-size: .82rem; font-weight: 600; }
.seek { display: block; width: 100%; margin: 0; height: 24px; accent-color: #e0ae87; }
.times { font-size: .72rem; font-variant-numeric: tabular-nums; }
.transport { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0 21px; }
.transport-play, .transport-skip { border-radius: 50%; }
.transport-play { width: 55px; height: 55px; background: #f7efd8; color: var(--green); }
.transport-skip { width: 39px; height: 39px; background: transparent; color: #ecf0df; }
.transport-skip:hover:not(:disabled) { background: #ffffff19; }
.ico-play, .ico-next, .ico-prev { width: 0; height: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 12px solid currentColor; }
.ico-play { margin-left: 4px; }
.ico-next, .ico-prev { border-width: 6px 0 6px 9px; }
.ico-prev { transform: rotate(180deg); }
.ico-next::after, .ico-prev::after { content:""; position:absolute; left:1px; top:-6px; width:2px; height:12px; background:currentColor; }
.ico-pause { width: 13px; height: 17px; border-inline: 4px solid; }
.speed-row { border-top: 1px solid #ffffff30; padding-top: 15px; }
.speed-row select { background: #e9ecdb; color: var(--green); border: 0; border-radius: 5px; padding: 4px 5px; min-height: 33px; }
.total-progress { margin-top: 17px; }
.total-progress strong { font-weight: 550; }
progress { width: 100%; height: 4px; appearance: none; border: none; background: #677d6d; border-radius: 5px; overflow: hidden; }
progress::-webkit-progress-bar { background: #677d6d; } progress::-webkit-progress-value { background: #d5d5ad; } progress::-moz-progress-bar { background: #d5d5ad; }
.player-error { font-size: .84rem; color: #ffdbcc; margin-top: 14px; }
dialog { width: min(92vw, 415px); padding: 27px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--white); }
dialog::backdrop { background: #182e237d; }
dialog h2 { font-size: 2rem; letter-spacing: -.055em; }
dialog p { margin: 10px 0 22px; font-size: .92rem; color: var(--muted); }
dialog form>div { display: flex; justify-content: flex-end; gap: 8px; }
.subtle { background: #eaeadd; } .danger { background: #99472f; color: white; }
@media(max-width: 760px) {
  .mast-inner { min-height: 63px; }
  .brand { font-size: 1.53rem; gap: 9px; } .brand-mark { width: 32px; height: 32px; }
  #workspace { grid-template-columns: minmax(0,1fr); }
  .player-panel { grid-row: 1; display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .player-title,.player-panel h2,.voice-credit { grid-column: 1; }
  .player-title { grid-row: 1; } .onair { display: none; }
  .player-panel h2 { grid-row: 2; font-size: 2.7rem; margin: 4px 0 0; } .voice-credit { grid-row: 3; }
  .transport { grid-column: 2; grid-row: 1/4; justify-content: end; align-self: center; gap: 2px; margin: 0; }
  .play-state,.seek,.times,.player-error,.engine-settings { grid-column: 1/-1; }
  .speed-row,.total-progress { margin-top: 14px; padding-top: 10px; border-top: 1px solid #ffffff30; }
  .total-progress { align-self: stretch; }
  .player-panel { padding: 20px; }
  .cover-art { min-height: 245px; }
}
@media(max-width: 570px) {
  .mast-inner, main { width: calc(100% - 32px); }
  .library-heading { align-items: flex-start; flex-wrap: wrap; }
  .library-heading .btn { min-height: 38px; padding: 8px 12px; }
  .empty { grid-template-columns: 1fr; }
  .empty-copy { padding: 26px 26px 33px; }
  .empty-copy p { max-width: 26ch; }
  .cover-art { grid-row: 1; width: 100%; min-height: 175px; height: 38vw; max-height: 210px; }
  .cover { height: 68%; }
  .art-halo { inset: -65% -16% -43%; mask-image: linear-gradient(0deg,transparent,#000 40%); }
  .paper-symbol { display: none; }
  .empty h2 { font-size: 2.5rem; }
  .empty-copy p { margin: 10px 0 18px; }
  .privacy { margin-top: 18px; }
  .book-card { width: min(72vw, 215px); }
  .voice-state { font-size: .69rem; padding: 5px 8px; }
  .transport-play { width: 45px; height: 45px; }
  .transport-skip { width: 34px; height: 39px; }
}
@media(prefers-reduced-motion:no-preference) { .btn,.book-card,.transport-play { transition: background .15s, filter .15s; } }
