:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #121a20;
  color: #f1eee6;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 50% -10%, #31434a 0, #182229 39%, #121a20 72%); }
button, input, select { font: inherit; }
button, .file-button, .drop-target { cursor: pointer; }

.shell { width: min(880px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; padding: clamp(30px, 7vw, 88px) 0 22px; }
.masthead { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.eyebrow { margin: 0 0 7px; color: #9ab8aa; font-size: .72rem; font-weight: 800; letter-spacing: .17em; }
h1 { margin: 0; font-family: Georgia, "Songti SC", "STSong", serif; font-size: clamp(2rem, 6vw, 3.65rem); font-weight: 500; letter-spacing: -.045em; }
.file-button { color: #12201c; background: #b4d0ba; border-radius: 999px; padding: 11px 16px; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.file-button input { display: none; }

.empty-state { margin: auto 0; text-align: center; color: #bcc5bf; }
.empty-state h2 { margin: 0; color: #f1eee6; font-family: Georgia, "Songti SC", "STSong", serif; font-size: clamp(1.75rem, 5vw, 2.7rem); font-weight: 500; }
.empty-state p:not(.big-mark) { margin: 12px auto 28px; max-width: 410px; line-height: 1.55; }
.big-mark { margin: 0; color: #b4d0ba; font-family: "Songti SC", "STSong", serif; font-size: 8rem; line-height: 1; }
.drop-target { display: inline-block; padding: 14px 20px; border: 1px dashed #70857b; border-radius: 8px; color: #dbe9dd; }
.drop-target.dragging { background: #23362f; }

.reader { margin: auto 0; }
.book-meta { display: flex; justify-content: space-between; gap: 18px; color: #9faea6; font-size: .84rem; }
.book-meta p { margin: 0 0 12px; }
#book-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#position { white-space: nowrap; }
.subtitle-panel { display: grid; place-items: center; min-height: min(42vh, 390px); padding: 24px clamp(10px, 7vw, 72px); background: rgba(10, 16, 19, .6); border: 1px solid rgba(180, 208, 186, .16); border-radius: 12px; box-shadow: 0 24px 64px rgba(0, 0, 0, .21); }
#subtitle { margin: 0; color: #f6f1e5; font-family: "Songti SC", "STSong", Georgia, serif; font-size: clamp(1.85rem, 5.1vw, 3.75rem); line-height: 1.58; letter-spacing: .035em; text-align: center; word-break: break-word; }
#subtitle .spoken { color: #17231e; background: #c9e4b5; border-radius: .14em; box-shadow: 0 0 0 .05em #c9e4b5; }
.transport { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 10px; width: min(390px, 100%); margin: 23px auto 18px; }
.transport button { min-height: 50px; color: #edf0e6; background: transparent; border: 1px solid #4e635c; border-radius: 7px; font-weight: 700; }
.transport .play { color: #112019; background: #b4d0ba; border-color: #b4d0ba; }
.transport button:hover, .transport button:focus-visible { border-color: #c9e4b5; outline: none; }
.settings { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 13px 18px; color: #b9c3bc; font-size: .82rem; }
.settings > label:not(.checkbox-label) { display: flex; align-items: center; gap: 7px; }
select { max-width: 205px; color: #e9eee8; background: #233029; border: 1px solid #52665d; border-radius: 4px; padding: 5px; }
input[type="range"] { width: 104px; accent-color: #b4d0ba; }
output { min-width: 3.3em; }
.checkbox-label { white-space: nowrap; }
.checkbox-label input { vertical-align: -.1em; accent-color: #b4d0ba; }
footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 22px; margin-top: auto; padding-top: 30px; color: #809087; font-size: .78rem; }
kbd { padding: 2px 5px; border: 1px solid #53635b; border-bottom-width: 2px; border-radius: 4px; color: #d5dfd7; font-family: inherit; }

@media (max-width: 520px) { .masthead { align-items: center; } .file-button { padding: 9px 12px; } .settings { align-items: flex-start; flex-direction: column; margin-left: 6px; } }
