:root {
  color-scheme: dark;
  --bg: #101312;
  --bg-2: #141816;
  --panel: #1b211e;
  --panel-2: #232b27;
  --line: #303a35;
  --line-strong: #46534d;
  --text: #f3f0e8;
  --muted: #b7bfb3;
  --soft: #8d978f;
  --teal: #58c7b7;
  --teal-dark: #337d75;
  --amber: #e0ad4f;
  --red: #d66d5d;
  --blue: #7aa6d9;
  --green: #95bd6f;
  --reader-bg: #171b19;
  --reader-text: #f0eadc;
  --reader-muted: #aaa99f;
  --reader-line: #334039;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --sidebar-width: 238px;
  --control-h: 40px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

body {
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.noscript {
  margin: 16px;
  padding: 16px;
  border: 1px solid var(--red);
  background: #321f1c;
  color: var(--text);
  border-radius: var(--radius);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  padding: 18px 12px;
  background: #0c100e;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  align-self: start;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 22px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #e9e0ce;
  display: grid;
  place-items: center;
  color: var(--bg);
  font-weight: 800;
  flex: 0 0 auto;
}

.brand-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 750;
}

.brand-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-button {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  text-align: left;
  border-left: 3px solid transparent;
}

.nav-button:hover,
.nav-button.is-active {
  background: var(--panel);
  color: var(--text);
  border-left-color: var(--teal);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--teal);
  font-size: 15px;
  font-weight: 800;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.sidebar-note {
  margin: 24px 8px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  background: #121715;
}

.mobile-topbar {
  display: none;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topline {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.topline h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
}

.topline p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 860px;
  line-height: 1.5;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

.toolbar.is-spread {
  justify-content: space-between;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 12px;
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--control-h);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 10px;
  outline: none;
}

.textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.45;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(79, 183, 167, 0.16);
}

.search {
  min-width: 260px;
  flex: 1 1 260px;
}

.button {
  min-height: var(--control-h);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.button:hover {
  border-color: var(--line-strong);
  background: var(--panel-2);
}

.button.primary {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
  color: #f8fffb;
}

.button.primary:hover {
  background: #36877d;
}

.button.mark {
  border-color: var(--amber);
  background: #3c3020;
  color: #ffe8b8;
}

.button.mark:hover {
  background: #4b3a22;
}

.button.warn {
  border-color: #8a3f35;
  background: #3a211e;
  color: #ffd8d2;
}

.button.ghost {
  background: transparent;
}

.button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.button.square {
  width: 40px;
  padding: 0;
}

.segmented {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.segmented button {
  min-height: calc(var(--control-h) - 2px);
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.is-active {
  background: var(--teal-dark);
  color: #f8fffb;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.list {
  display: grid;
  gap: 10px;
}

.book-card,
.issue-card,
.panel,
.metric,
.empty-state {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.book-card {
  min-width: 0;
  overflow: hidden;
}

.book-card.list-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px;
}

.cover {
  aspect-ratio: 2 / 3;
  width: 100%;
  min-height: 0;
  background: #30312b;
  display: grid;
  place-items: center;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover.placeholder {
  padding: 18px;
  text-align: center;
}

.cover.placeholder::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(239, 238, 231, 0.28);
  border-radius: 4px;
}

.cover-title {
  position: relative;
  z-index: 1;
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.book-body {
  padding: 12px;
}

.book-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.book-meta,
.muted {
  color: var(--muted);
}

.book-meta {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.4;
}

.book-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.metadata-editor {
  margin-bottom: 14px;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.field > span {
  font-size: 12px;
  color: var(--muted);
}

.metadata-span {
  grid-column: span 3;
}

.metadata-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.metadata-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: #141a17;
}

.metadata-actions {
  margin: 14px 0 0;
}

.pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  background: #181915;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  padding: 14px;
  background: #18201d;
}

.metric-value {
  font-size: 24px;
  font-weight: 760;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.workspace-heading {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #141a17;
}

.tool-board {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.tool-panel {
  min-width: 0;
}

.tool-panel-wide {
  grid-column: span 1;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.panel-title-row p,
.tool-panel > p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.tool-kicker {
  color: var(--teal);
  font-size: 12px;
  line-height: 1.3;
  text-transform: uppercase;
}

.tool-empty {
  color: var(--muted);
  line-height: 1.5;
  padding: 10px 0;
}

.focus-list,
.chapter-health-list,
.dialogue-list,
.pulse-stack,
.signal-stack,
.dense-list {
  display: grid;
  gap: 10px;
}

.focus-item,
.chapter-health-row,
.dialogue-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.focus-item:first-child,
.chapter-health-row:first-child,
.dialogue-line:first-child {
  border-top: 0;
  padding-top: 0;
}

.focus-item h3,
.chapter-health-row h3 {
  margin: 4px 0 4px;
  font-size: 16px;
  line-height: 1.25;
}

.focus-item p,
.chapter-health-row p,
.dialogue-line p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.priority-high {
  border-left: 3px solid var(--red);
  padding-left: 10px;
}

.priority-medium {
  border-left: 3px solid var(--amber);
  padding-left: 10px;
}

.priority-low {
  border-left: 3px solid var(--green);
  padding-left: 10px;
}

.score-block {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.score-ring {
  --score: 50%;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel) 0 58%, transparent 59%),
    conic-gradient(var(--teal) var(--score), #343d38 0);
  color: var(--text);
  font-weight: 760;
}

.pulse-row {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.pulse-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.pulse-row div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.pulse-row strong {
  color: var(--text);
}

.mini-track {
  height: 8px;
  border-radius: 999px;
  background: #0f1412;
  overflow: hidden;
  border: 1px solid var(--line);
}

.mini-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.mini-bar.warn {
  background: var(--amber);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analysis-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #141a17;
  color: var(--text);
  font-size: 13px;
}

.analysis-tag b {
  color: var(--amber);
}

.tool-subhead {
  margin: 16px 0 8px;
  font-size: 14px;
}

.dense-line,
.signal-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.dense-line:first-child,
.signal-row:first-child {
  border-top: 0;
}

.dense-line span,
.signal-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dense-line strong,
.signal-row strong {
  color: var(--text);
  font-size: 18px;
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(282px, 308px);
  gap: 14px;
  align-items: start;
}

.reader-layout.listen-layout {
  grid-template-columns: minmax(0, 1fr);
}

.reader-layout.reading-only {
  grid-template-columns: minmax(0, 1fr);
}

.listen-screen {
  padding-bottom: 112px;
}

.reader-shell {
  min-width: 0;
}

.reader-mark-tools {
  display: grid;
  grid-template-columns: minmax(168px, 220px) minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(27, 33, 30, 0.84);
}

.field.compact {
  gap: 5px;
}

.selection-preview {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-mark-chips {
  grid-column: 1 / -1;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.mark-chip {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #141a17;
  color: var(--muted);
  padding: 0 9px;
  font-size: 12px;
  box-shadow: inset 0 -2px 0 var(--issue-color, var(--teal));
}

.mark-chip:hover,
.mark-chip.is-active {
  color: var(--text);
  border-color: var(--issue-color, var(--teal));
  background: rgba(88, 199, 183, 0.1);
}

.reader-mark-note {
  min-width: 0;
}

.reader-options-head {
  display: none;
}

.reader-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 10px;
  margin-bottom: 12px;
  align-items: end;
}

.reader-surface {
  --reader-font-size: 18px;
  --reader-line-height: 1.65;
  --reader-pad: 40px;
  min-height: 68vh;
  border: 1px solid var(--reader-line);
  border-radius: var(--radius);
  background: var(--reader-bg);
  color: var(--reader-text);
  padding: var(--reader-pad);
  box-shadow: var(--shadow);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
  width: 100%;
}

.reader-surface.theme-light {
  --reader-bg: #f4f2ed;
  --reader-text: #1e1f1d;
  --reader-muted: #696b62;
  --reader-line: #d5d0c4;
}

.reader-surface.theme-sepia {
  --reader-bg: #eee4d1;
  --reader-text: #252018;
  --reader-muted: #776d5d;
  --reader-line: #d6c8ac;
}

.reader-surface.theme-dark {
  --reader-bg: #181916;
  --reader-text: #ece8db;
  --reader-muted: #aaa799;
  --reader-line: #393a32;
}

.chapter-heading {
  margin: 0 0 28px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.reader-paragraph {
  margin: 0 0 1.15em;
  border-left: 3px solid transparent;
  padding-left: 10px;
}

.reader-paragraph.active-paragraph {
  border-left-color: var(--amber);
}

.sentence.active-sentence {
  background: rgba(217, 164, 65, 0.2);
  border-radius: 6px;
  box-shadow: 0 0 0 2px rgba(217, 164, 65, 0.08);
}

.word {
  border-radius: 4px;
  padding: 1px 0;
}

.word.issue-marked {
  background: var(--issue-bg, rgba(217, 164, 65, 0.24));
  box-shadow: inset 0 -0.2em 0 var(--issue-color, var(--amber));
}

.word.active-word {
  background: rgba(88, 199, 183, 0.16);
  color: inherit;
  box-shadow: inset 0 -0.22em 0 rgba(88, 199, 183, 0.72);
  transition: background 120ms linear, box-shadow 120ms linear;
}

.listen-rail,
.settings-rail {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  scrollbar-width: thin;
}

.listen-layout .listen-rail {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  max-height: none;
  overflow: visible;
}

.panel {
  padding: 14px;
}

.panel h2,
.panel h3 {
  margin: 0 0 12px;
  line-height: 1.2;
}

.panel h2 {
  font-size: 18px;
}

.panel h3 {
  font-size: 15px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.control-grid .button {
  width: 100%;
}

.range-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.range-row label,
.range-row span {
  color: var(--muted);
  font-size: 12px;
}

.range {
  width: 100%;
  accent-color: var(--teal);
}

.now-reading {
  border-left: 3px solid var(--teal);
  padding-left: 10px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.capture-grid {
  display: grid;
  gap: 10px;
}

.listen-dock {
  position: fixed;
  left: calc(var(--sidebar-width) + 24px);
  right: 24px;
  bottom: 16px;
  z-index: 35;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(17, 18, 16, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.listen-dock.is-choosing-mark {
  align-items: end;
}

.listen-dock-main {
  min-width: 0;
}

.listen-dock-kicker,
.listen-dock-word {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.listen-dock-line {
  margin-top: 3px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listen-dock-word {
  margin-top: 3px;
  color: var(--teal);
}

.listen-dock-status,
.playback-status {
  color: var(--soft);
  font-size: 12px;
  line-height: 1.25;
}

.listen-dock-status {
  margin-top: 3px;
}

.playback-status {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #141a17;
}

.listen-dock-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, auto));
  gap: 8px;
  align-items: center;
}

.mark-menu {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.mark-menu-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mark-menu-head strong,
.mark-menu-head span {
  display: block;
}

.mark-menu-head span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.mark-menu-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(174px, 1fr));
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.mark-option {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #151b18;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  text-align: left;
}

.mark-option:hover,
.mark-option.is-active {
  border-color: var(--teal);
  background: rgba(88, 199, 183, 0.12);
}

.mark-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.category-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #1a1b18;
  color: var(--muted);
  padding: 0 8px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-button.is-active {
  border-color: var(--teal);
  color: var(--text);
  background: rgba(79, 183, 167, 0.12);
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #111210;
  overflow: hidden;
  border: 1px solid var(--line);
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--teal);
}

.chapter-review-list,
.highlight-manager {
  display: grid;
  gap: 12px;
}

.chapter-review-card,
.highlight-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.chapter-review-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.chapter-review-card h2,
.highlight-row h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.chapter-mark-list {
  display: grid;
  gap: 8px;
}

.chapter-mark-row {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #141a17;
  color: var(--text);
  display: grid;
  grid-template-columns: minmax(104px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  text-align: left;
}

.chapter-mark-row:hover {
  border-color: var(--teal);
  background: rgba(88, 199, 183, 0.1);
}

.chapter-mark-row span {
  color: var(--teal);
  font-size: 12px;
}

.chapter-mark-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.highlight-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-left: 4px solid var(--issue-color, var(--teal));
  background:
    linear-gradient(90deg, var(--issue-bg, rgba(88, 199, 183, 0.12)), transparent 42%),
    var(--panel);
}

.highlight-row p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.highlight-actions {
  display: grid;
  gap: 8px;
  min-width: 116px;
}

.issue-list {
  display: grid;
  gap: 12px;
}

.issue-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
}

.issue-shot {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #111210;
  object-fit: cover;
}

.issue-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.issue-excerpt {
  margin: 8px 0 0;
  color: var(--text);
  line-height: 1.45;
}

.issue-note {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.issue-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.status-open {
  color: var(--amber);
}

.status-reviewed {
  color: var(--blue);
}

.status-fixed {
  color: var(--green);
}

.status-ignored {
  color: var(--soft);
}

.status-exported {
  color: var(--teal);
}

.empty-state {
  padding: 24px;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.empty-state p {
  max-width: 680px;
  margin: 0 auto 16px;
  color: var(--muted);
  line-height: 1.5;
}

.report-preview {
  white-space: pre-wrap;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #111210;
  color: var(--text);
  padding: 16px;
  overflow: auto;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.privacy-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.diagnostic-grid > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #141a17;
  padding: 8px 10px;
}

.diagnostic-grid span,
.diagnostic-grid strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.diagnostic-grid span {
  color: var(--muted);
  font-size: 11px;
}

.diagnostic-grid strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.diagnostic-actions {
  margin: 12px 0 0;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #10110f;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 40;
  max-width: min(520px, calc(100vw - 32px));
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hidden {
  display: none !important;
}

@media (max-width: 1120px) {
  .reader-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .tool-board {
    grid-template-columns: 1fr;
  }

  .listen-rail,
  .settings-rail {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 55;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(12, 16, 14, 0.96);
    backdrop-filter: blur(14px);
  }

  .mobile-menu-button {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    flex: 0 0 auto;
  }

  .mobile-menu-icon,
  .mobile-menu-icon::before,
  .mobile-menu-icon::after {
    display: block;
    width: 15px;
    height: 2px;
    border-radius: 2px;
    background: var(--teal);
  }

  .mobile-menu-icon {
    position: relative;
  }

  .mobile-menu-icon::before,
  .mobile-menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .mobile-menu-icon::before {
    top: -5px;
  }

  .mobile-menu-icon::after {
    top: 5px;
  }

  .mobile-topbar-title {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .mobile-topbar-title strong,
  .mobile-topbar-title span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-topbar-title strong {
    font-size: 14px;
    line-height: 1.15;
  }

  .mobile-topbar-title span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
  }

  .sidebar {
    display: none;
    min-height: auto;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .app-shell.mobile-menu-open .sidebar {
    position: fixed;
    top: 64px;
    left: 10px;
    right: 10px;
    z-index: 65;
    display: block;
    max-height: calc(100vh - 76px);
    overflow: auto;
    padding: 10px;
    background: #0c100e;
  }

  .app-shell.mobile-menu-open .brand {
    padding: 0 4px 10px;
  }

  .app-shell.mobile-menu-open .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .app-shell.mobile-menu-open .nav-button {
    justify-content: flex-start;
    min-height: 44px;
    padding: 0 10px;
  }

  .app-shell.mobile-menu-open .nav-button span:last-child,
  .app-shell.mobile-menu-open .brand-subtitle {
    display: inline;
  }

  .sidebar-note {
    display: none;
  }

  .main {
    padding: 12px;
  }

  .topline {
    display: block;
  }

  .reader-screen > .topline,
  .listen-screen > .topline {
    display: none;
  }

  .workspace-heading {
    padding: 14px;
  }

  .metadata-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metadata-span {
    grid-column: 1 / -1;
  }

  .focus-item,
  .chapter-health-row,
  .dialogue-line {
    grid-template-columns: 1fr;
  }

  .reader-options-head {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    margin-bottom: 8px;
    padding: 0 0 2px;
  }

  .reader-options-head div {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .reader-options-head span {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.15;
  }

  .reader-options-head strong {
    min-width: 0;
    max-width: 58vw;
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .reader-toolbar {
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(27, 33, 30, 0.78);
  }

  .reader-toolbar.is-open {
    display: grid;
  }

  .reader-mark-tools {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 7px;
    padding: 8px;
  }

  .reader-mark-tools .field {
    grid-column: 1 / -1;
  }

  .reader-mark-note {
    grid-column: 1 / -1;
  }

  .selection-preview {
    font-size: 11px;
  }

  .reader-mark-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .mark-chip {
    flex: 0 0 auto;
  }

  .reader-surface {
    min-height: calc(100vh - 178px);
    padding: min(var(--reader-pad), 22px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  }

  .listen-layout .listen-rail {
    grid-template-columns: 1fr;
  }

  .listen-screen {
    padding-bottom: 94px;
  }

  .listen-dock {
    left: 12px;
    right: 12px;
    bottom: 12px;
    min-height: 60px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
  }

  .listen-dock-actions {
    grid-template-columns: repeat(4, 52px);
    gap: 6px;
  }

  .listen-dock-actions .button {
    min-height: 36px;
    padding: 0 7px;
    font-size: 12px;
  }

  .listen-dock-kicker {
    display: none;
  }

  .listen-dock-line {
    font-size: 13px;
    white-space: nowrap;
  }

  .listen-dock-word {
    font-size: 12px;
  }

  .mark-menu {
    grid-column: 1 / -1;
  }

  .mark-menu-list {
    grid-template-columns: 1fr 1fr;
    max-height: 250px;
  }

  .chapter-heading {
    margin-bottom: 18px;
    font-size: 22px;
  }

  .book-card.list-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .book-card.list-row .book-actions {
    grid-column: 1 / -1;
  }

  .issue-card {
    grid-template-columns: 1fr;
  }

  .highlight-row {
    grid-template-columns: 1fr;
  }

  .highlight-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-width: 0;
  }

  .chapter-mark-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .mobile-topbar {
    min-height: 52px;
    padding: 7px 10px;
  }

  .mobile-menu-button {
    min-height: 36px;
    padding: 0 9px;
    font-size: 13px;
  }

  .mobile-topbar-title strong {
    font-size: 13px;
  }

  .mobile-topbar-title span {
    font-size: 11px;
  }

  .nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .brand {
    padding-bottom: 14px;
  }

  .brand-subtitle {
    display: none;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar > * {
    width: 100%;
  }

  .main {
    padding: 10px;
  }

  .search {
    min-width: 0;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metadata-grid,
  .diagnostic-grid {
    grid-template-columns: 1fr;
  }

  .control-grid,
  .category-grid {
    grid-template-columns: 1fr 1fr;
  }

  .reader-options-head {
    min-height: 38px;
    margin-bottom: 6px;
  }

  .reader-options-head strong {
    max-width: 50vw;
    font-size: 13px;
  }

  .reader-options-head .button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 12px;
  }

  .reader-mark-tools {
    grid-template-columns: 1fr 1fr;
  }

  .reader-mark-tools .field,
  .reader-mark-note,
  .selection-preview {
    grid-column: 1 / -1;
  }

  .reader-mark-tools .button {
    min-height: 34px;
    padding: 0 8px;
    font-size: 12px;
  }

  .reader-surface {
    min-height: calc(100vh - 178px);
    padding: min(var(--reader-pad), 18px);
  }

  .reader-paragraph {
    padding-left: 8px;
  }

  .chapter-heading {
    margin-bottom: 16px;
    font-size: 20px;
  }

  .listen-screen {
    padding-bottom: 84px;
  }

  .listen-dock-line {
    display: none;
  }

  .listen-dock-actions {
    grid-template-columns: repeat(4, 44px);
    gap: 5px;
  }

  .listen-dock {
    grid-template-columns: minmax(0, 1fr) auto;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    min-height: 54px;
    padding: 7px;
  }

  .listen-dock-main {
    min-width: 0;
  }

  .listen-dock-actions .button {
    min-height: 34px;
    padding: 0 5px;
    font-size: 11px;
  }

  .listen-dock-word {
    margin-top: 0;
    font-size: 11px;
    line-height: 1.2;
  }

  .listen-dock-status {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .highlight-actions {
    grid-template-columns: 1fr 1fr;
  }

  .mark-menu-list {
    grid-template-columns: 1fr;
    max-height: 226px;
  }
}

/* Modern interface refresh */
:root {
  --bg: #0d1110;
  --bg-2: #121715;
  --panel: #181d1b;
  --panel-2: #202725;
  --surface: #151917;
  --surface-raised: #1c2320;
  --line: #2b3431;
  --line-strong: #43504b;
  --text: #f5f1e8;
  --muted: #b8c0b5;
  --soft: #87938b;
  --teal: #62d2c0;
  --teal-dark: #2f8177;
  --amber: #e4b85c;
  --red: #dc7667;
  --blue: #86aee0;
  --green: #9cc878;
  --reader-bg: #181916;
  --reader-text: #f1eadc;
  --reader-muted: #aaa89b;
  --reader-line: #3b3c34;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 8px 26px rgba(0, 0, 0, 0.18);
  --control-h: 42px;
}

body {
  background: var(--bg);
}

.app-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0)),
    var(--bg);
}

.sidebar {
  background: rgba(10, 14, 13, 0.92);
  border-right-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.02);
}

.brand {
  padding: 4px 8px 22px;
}

.brand-mark {
  background: var(--teal);
  color: #08110f;
  box-shadow: 0 10px 24px rgba(98, 210, 192, 0.16);
}

.brand-title {
  font-size: 19px;
  letter-spacing: 0;
}

.nav {
  gap: 7px;
}

.nav-button {
  min-height: 46px;
  border: 1px solid transparent;
  border-left: 0;
  padding: 0 10px;
  color: var(--muted);
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.nav-button:hover,
.nav-button.is-active {
  border-color: rgba(98, 210, 192, 0.28);
  background: rgba(98, 210, 192, 0.09);
  color: var(--text);
}

.nav-icon {
  width: 38px;
  height: 28px;
  border-radius: 8px;
  border-color: rgba(98, 210, 192, 0.25);
  background: rgba(98, 210, 192, 0.08);
  font-size: 10px;
  letter-spacing: 0;
}

.sidebar-note {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.08);
}

.main {
  padding: 30px;
}

.topline {
  align-items: center;
  margin-bottom: 22px;
}

.topline h1 {
  font-size: 31px;
  font-weight: 780;
}

.topline p {
  color: var(--soft);
}

.toolbar {
  gap: 9px;
}

.input,
.select,
.textarea {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(98, 210, 192, 0.72);
  box-shadow: 0 0 0 3px rgba(98, 210, 192, 0.14);
}

.button {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: transform 120ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.button:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.085);
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button.primary {
  border-color: rgba(98, 210, 192, 0.38);
  background: #2f8177;
  color: #f8fffb;
  box-shadow: 0 10px 20px rgba(47, 129, 119, 0.22);
}

.button.primary:hover {
  background: #379489;
}

.button.mark {
  border-color: rgba(228, 184, 92, 0.5);
  background: #46351b;
}

.segmented {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.09);
}

.segmented button {
  border-right-color: rgba(255, 255, 255, 0.08);
}

.segmented button.is-active {
  background: #2f8177;
}

.book-card,
.issue-card,
.panel,
.metric,
.empty-state,
.chapter-review-card,
.highlight-row {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.075);
  box-shadow: var(--shadow-soft);
}

.book-card {
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.book-card:hover {
  transform: translateY(-2px);
  border-color: rgba(98, 210, 192, 0.26);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

.cover {
  background: #252a25;
}

.cover.placeholder {
  background:
    linear-gradient(145deg, rgba(98, 210, 192, 0.18), transparent 46%),
    #20231f;
}

.cover.placeholder::before {
  border-color: rgba(245, 241, 232, 0.2);
}

.book-body {
  padding: 14px;
}

.book-title,
.issue-title,
.chapter-review-card h2,
.highlight-row h2 {
  font-weight: 730;
}

.pill,
.metadata-stats span,
.analysis-tag {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
}

.metric {
  position: relative;
  overflow: hidden;
  background: var(--surface);
}

.metric::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--teal);
}

.metric-value {
  font-size: 27px;
}

.workspace-heading {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.075);
  box-shadow: var(--shadow-soft);
}

.reader-mark-tools,
.reader-toolbar {
  background: rgba(18, 23, 21, 0.92);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-soft);
}

.reader-surface {
  max-width: 1040px;
  margin: 0 auto;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.28);
}

.listen-layout .reader-surface {
  max-width: 1120px;
}

.reader-surface.theme-dark {
  --reader-bg: #191a17;
  --reader-text: #f0eadc;
  --reader-line: #3d3e36;
}

.chapter-heading {
  font-weight: 760;
}

.reader-paragraph.active-paragraph {
  border-left-color: var(--amber);
}

.sentence.active-sentence {
  background: rgba(228, 184, 92, 0.2);
  box-shadow: 0 0 0 2px rgba(228, 184, 92, 0.08);
}

.word.active-word {
  background: rgba(98, 210, 192, 0.15);
  color: inherit;
  box-shadow: inset 0 -0.22em 0 rgba(98, 210, 192, 0.72);
}

.listen-rail .panel,
.settings-rail .panel {
  background: var(--surface);
}

.now-reading,
.playback-status {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.08);
}

.control-grid {
  gap: 9px;
}

.category-button,
.mark-option,
.chapter-mark-row,
.diagnostic-grid > div,
.report-preview {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.08);
}

.category-button:hover,
.category-button.is-active,
.mark-option:hover,
.mark-option.is-active,
.chapter-mark-row:hover {
  border-color: rgba(98, 210, 192, 0.4);
  background: rgba(98, 210, 192, 0.1);
}

.listen-dock {
  min-height: 76px;
  border-color: rgba(98, 210, 192, 0.25);
  background: rgba(15, 18, 17, 0.94);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.36);
}

.listen-dock-kicker {
  color: var(--soft);
  text-transform: uppercase;
  font-size: 10px;
}

.listen-dock-line {
  font-size: 14px;
}

.listen-dock-word {
  font-weight: 700;
}

.mark-menu {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.highlight-row {
  background:
    linear-gradient(90deg, var(--issue-bg, rgba(98, 210, 192, 0.12)), transparent 48%),
    var(--surface);
}

.issue-shot {
  border-color: rgba(255, 255, 255, 0.08);
}

.toast {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(17, 20, 19, 0.96);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(98, 210, 192, 0.72);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  .mobile-topbar {
    min-height: 54px;
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: rgba(10, 14, 13, 0.94);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  }

  .mobile-menu-button {
    border-color: rgba(98, 210, 192, 0.24);
    background: rgba(98, 210, 192, 0.08);
  }

  .app-shell.mobile-menu-open .sidebar {
    top: 62px;
    background: rgba(10, 14, 13, 0.98);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .main {
    padding: 12px;
  }

  .reader-options-head {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.035);
    padding: 7px 8px;
  }

  .reader-toolbar.is-open,
  .reader-mark-tools {
    background: rgba(18, 23, 21, 0.96);
  }

  .reader-surface {
    max-width: none;
  }

  .listen-dock {
    border-color: rgba(98, 210, 192, 0.26);
    background: rgba(14, 17, 16, 0.96);
  }
}

@media (max-width: 520px) {
  .topline h1 {
    font-size: 25px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .book-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .book-card .cover {
    height: 132px;
  }

  .book-card.list-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .book-card.list-row .cover {
    height: auto;
  }

  .book-body {
    padding: 12px;
  }

  .book-actions .button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 12px;
  }

  .reader-mark-tools {
    gap: 8px;
  }

  .listen-dock {
    min-height: 56px;
  }
}

/* Listening and revision workflow upgrade */
.chapter-workbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.chapter-workbar strong,
.chapter-workbar span,
.chapter-workbar em {
  min-width: 0;
}

.workbar-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.workbar-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: end;
}

.workbar-stats span,
.workbar-focus,
.session-status {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--soft);
  padding: 5px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.workbar-focus {
  border-color: color-mix(in srgb, var(--issue-color) 45%, transparent);
  color: var(--text);
}

.session-panel {
  align-content: start;
}

.session-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.session-metrics div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 9px;
}

.session-metrics strong,
.session-metrics span {
  display: block;
}

.session-metrics strong {
  font-size: 22px;
}

.session-metrics span {
  color: var(--muted);
  font-size: 11px;
}

.session-current {
  margin-top: 10px;
  border-left: 3px solid var(--issue-color);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 9px 10px;
}

.session-current span,
.recent-mark span,
.issue-note-editor span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.session-current strong,
.recent-mark strong {
  display: block;
  margin-top: 2px;
}

.session-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.recent-mark-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.recent-mark,
.chapter-strip-item {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
}

.recent-mark {
  padding: 8px 9px;
}

.recent-mark strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.mark-shortcuts {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.mark-shortcut,
.selection-quick {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--issue-color) 42%, rgba(255, 255, 255, 0.08));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.mark-shortcut.is-active,
.selection-quick.is-active,
.mark-shortcut:hover,
.selection-quick:hover {
  background: color-mix(in srgb, var(--issue-color) 18%, rgba(255, 255, 255, 0.04));
}

.selection-quickbar {
  grid-column: 1 / -1;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-top: 2px;
  scrollbar-width: thin;
}

.issue-note-editor {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.issue-note-editor .textarea {
  min-height: 74px;
}

.chapter-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 240px);
  gap: 9px;
  margin: 0 0 14px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: thin;
}

.chapter-strip-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
  padding: 9px 10px;
}

.chapter-strip-item span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(98, 210, 192, 0.12);
  color: var(--teal);
  font-weight: 700;
}

.chapter-strip-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-strip-item em {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.chapter-strip-item.is-active {
  border-color: rgba(98, 210, 192, 0.34);
  background: rgba(98, 210, 192, 0.09);
}

@media (max-width: 820px) {
  .chapter-workbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .workbar-stats {
    justify-content: start;
  }

  .session-actions {
    grid-template-columns: 1fr;
  }

  .listen-dock.is-choosing-mark {
    padding-bottom: 70px;
  }

  .listen-dock .mark-menu {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    z-index: 60;
    max-height: min(56vh, 420px);
    border: 1px solid rgba(98, 210, 192, 0.28);
    border-radius: 12px;
    background: rgba(14, 17, 16, 0.98);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
    padding: 12px;
    overflow: auto;
  }

  .listen-dock .mark-menu.hidden {
    display: none;
  }
}

@media (max-width: 520px) {
  .session-metrics {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .session-metrics strong {
    font-size: 18px;
  }

  .chapter-strip {
    grid-auto-columns: minmax(158px, 78vw);
  }
}

/* Mobile revision controls and local editing drawer */
.mobile-work-dock {
  display: none;
}

.revision-drawer-tab {
  position: fixed;
  top: 48%;
  right: 0;
  z-index: 54;
  min-height: 70px;
  border: 1px solid rgba(98, 210, 192, 0.28);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: rgba(18, 23, 21, 0.96);
  color: var(--teal);
  font-weight: 800;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 10px 7px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

.revision-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 72;
  width: min(420px, 94vw);
  border-left: 1px solid rgba(98, 210, 192, 0.22);
  background: rgba(13, 17, 16, 0.985);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.42);
  transform: translateX(102%);
  transition: transform 180ms ease;
  overflow: auto;
  padding: 14px;
}

.revision-drawer.is-open {
  transform: translateX(0);
}

.revision-scrim {
  display: none;
}

.revision-scrim.is-open {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: block;
  background: rgba(0, 0, 0, 0.34);
}

.revision-drawer-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: -14px -14px 12px;
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 17, 16, 0.98);
}

.revision-drawer-head span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.revision-drawer-head strong {
  display: block;
  margin-top: 2px;
}

.drawer-section {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.drawer-section h2 {
  margin: 0;
  font-size: 15px;
}

.drawer-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.drawer-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 220px;
  overflow: auto;
  scrollbar-width: thin;
}

.drawer-category {
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--issue-color) 38%, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 12px;
  text-align: left;
  padding: 0 9px;
}

.drawer-category.is-active,
.drawer-category:hover {
  background: color-mix(in srgb, var(--issue-color) 18%, rgba(255, 255, 255, 0.04));
}

.drawer-note {
  min-height: 78px;
}

.paragraph-editor {
  min-height: 220px;
  resize: vertical;
  line-height: 1.55;
}

.drawer-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.drawer-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.drawer-stats span {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  padding: 8px;
  font-size: 12px;
}

.drawer-stats strong {
  display: block;
  color: var(--text);
  font-size: 18px;
}

.export-handoff-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.export-handoff-panel h2 {
  margin: 0;
  font-size: 18px;
}

.export-handoff-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.sidebar-note strong,
.sidebar-note span,
.sidebar-note em {
  display: block;
}

.sidebar-note strong {
  color: var(--text);
  font-size: 12px;
}

.sidebar-note span {
  margin-top: 4px;
}

.sidebar-note em {
  margin-top: 8px;
  color: var(--teal);
  font-style: normal;
  font-size: 11px;
}

.info-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 8px 0;
}

.info-nav button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 12px;
}

.info-nav button:hover,
.info-nav button.is-active {
  border-color: rgba(98, 210, 192, 0.34);
  background: rgba(98, 210, 192, 0.09);
  color: var(--text);
}

.account-link {
  min-height: 42px;
  margin: 12px 8px 0;
  border: 1px solid rgba(98, 210, 192, 0.24);
  border-radius: var(--radius);
  background: rgba(98, 210, 192, 0.07);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  text-decoration: none;
  font-size: 13px;
}

.account-link:hover {
  border-color: rgba(98, 210, 192, 0.42);
  background: rgba(98, 210, 192, 0.12);
}

.info-page {
  max-width: 1160px;
}

.compact-topline {
  align-items: flex-start;
}

.version-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(98, 210, 192, 0.28);
  border-radius: 999px;
  background: rgba(98, 210, 192, 0.08);
  color: var(--teal);
  padding: 8px 12px;
  font-size: 12px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.info-grid .panel {
  min-height: 150px;
}

.info-grid .panel p,
.muted-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.info-hero {
  grid-column: 1 / -1;
}

.feature-list.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.feature-list.compact span {
  border: 1px solid rgba(98, 210, 192, 0.18);
  border-radius: 999px;
  background: rgba(98, 210, 192, 0.06);
  color: var(--text);
  padding: 7px 10px;
  font-size: 12px;
}

.settings-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(98, 210, 192, 0.12), transparent 32rem),
    var(--bg);
}

.auth-card {
  width: min(980px, 100%);
  display: grid;
  gap: 14px;
}

.auth-card.narrow {
  width: min(520px, 100%);
}

.auth-top-nav {
  position: sticky;
  top: 10px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(127, 161, 210, 0.16);
  border-radius: var(--radius);
  background: rgba(4, 8, 17, 0.9);
  backdrop-filter: blur(12px);
}

.auth-top-nav a {
  min-height: 40px;
  flex: 1 1 136px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(127, 161, 210, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  font-size: 13px;
}

.auth-top-nav a:hover {
  border-color: rgba(31, 220, 255, 0.34);
  background: rgba(31, 220, 255, 0.08);
}

.auth-brand {
  padding: 0;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form h1,
.auth-form h2 {
  margin: 0;
}

.auth-status {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  padding: 12px 14px;
}

.auth-status[data-kind="success"] {
  border-color: rgba(149, 189, 111, 0.35);
  color: var(--green);
}

.auth-status[data-kind="error"] {
  border-color: rgba(214, 109, 93, 0.38);
  color: var(--red);
}

.auth-beta-note {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 203, 107, 0.34);
  border-radius: var(--radius);
  background: rgba(255, 203, 107, 0.08);
  color: var(--muted);
  padding: 12px 14px;
  line-height: 1.45;
}

.auth-beta-note strong {
  color: var(--amber);
}

.auth-beta-note span {
  display: block;
}

.auth-actions {
  margin-bottom: 0;
}

.brand-mark {
  overflow: hidden;
  border: 1px solid rgba(98, 210, 192, 0.28);
  background: #080d0c;
  box-shadow: 0 10px 26px rgba(88, 199, 183, 0.14);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-mark .logo-neon {
  display: none;
}

.brand-mark span {
  display: none;
}

.theme-preview-panel {
  position: relative;
  overflow: hidden;
}

.theme-preview-panel::after {
  content: "";
  position: absolute;
  inset: auto 14px 14px auto;
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: radial-gradient(circle, rgba(20, 177, 255, 0.16), transparent 68%);
  pointer-events: none;
}

.theme-swatches {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.theme-swatches span {
  width: 46px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.theme-swatches span.is-active {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

[data-theme-swatch="workspace"] {
  background: linear-gradient(135deg, #101312, #1b211e 48%, #58c7b7);
}

[data-theme-swatch="echo-neon"] {
  background: linear-gradient(135deg, #03060d, #111827 42%, #13d8ff 68%, #1167ff);
}

body[data-theme="echo-neon"] {
  --bg: #03060d;
  --bg-2: #070b15;
  --panel: #0d1420;
  --panel-2: #121d2d;
  --line: rgba(127, 161, 210, 0.22);
  --line-strong: rgba(60, 205, 255, 0.38);
  --text: #f7fbff;
  --muted: #aab8cb;
  --soft: #7f8da5;
  --teal: #1edcff;
  --teal-dark: #086ddc;
  --amber: #ffcb6b;
  --reader-bg: #090d12;
  --reader-text: #f5f0e8;
  --reader-muted: #a6b1c4;
  --reader-line: rgba(70, 133, 203, 0.28);
  --shadow: 0 20px 70px rgba(0, 33, 89, 0.42);
  background:
    radial-gradient(circle at 82% 8%, rgba(24, 150, 255, 0.18), transparent 26rem),
    radial-gradient(circle at 18% 16%, rgba(31, 220, 255, 0.1), transparent 24rem),
    #03060d;
}

.app-shell[data-theme="echo-neon"] {
  background:
    radial-gradient(circle at 76% 8%, rgba(23, 115, 255, 0.18), transparent 32rem),
    radial-gradient(circle at 42% 28%, rgba(31, 220, 255, 0.08), transparent 24rem),
    linear-gradient(180deg, #050812 0%, #03060d 100%);
}

.app-shell[data-theme="echo-neon"] .sidebar {
  background:
    linear-gradient(180deg, rgba(12, 20, 34, 0.98), rgba(3, 6, 13, 0.98)),
    #050812;
  border-right-color: rgba(77, 186, 255, 0.18);
  box-shadow: inset -1px 0 0 rgba(31, 220, 255, 0.08), 14px 0 42px rgba(0, 20, 60, 0.22);
}

.app-shell[data-theme="echo-neon"] .brand {
  padding-bottom: 24px;
}

.app-shell[data-theme="echo-neon"] .brand-mark,
body[data-theme="echo-neon"] .auth-brand .brand-mark {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(70, 190, 255, 0.34);
  border-radius: 16px;
  background: #050812;
  color: #f7fbff;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 28px rgba(16, 116, 255, 0.35);
}

.app-shell[data-theme="echo-neon"] .brand-mark img,
body[data-theme="echo-neon"] .auth-brand .brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-shell[data-theme="echo-neon"] .brand-mark .logo-workspace {
  display: none;
}

.app-shell[data-theme="echo-neon"] .brand-mark .logo-neon {
  display: block;
}

.app-shell[data-theme="echo-neon"] .brand-mark span,
body[data-theme="echo-neon"] .auth-brand .brand-mark span {
  display: none;
}

.app-shell[data-theme="echo-neon"] .brand-title,
body[data-theme="echo-neon"] .auth-brand .brand-title {
  font-size: 20px;
  letter-spacing: 0;
  color: #ffffff;
}

.app-shell[data-theme="echo-neon"] .brand-title::first-letter {
  color: #ffffff;
}

.app-shell[data-theme="echo-neon"] .brand-subtitle,
body[data-theme="echo-neon"] .auth-brand .brand-subtitle {
  color: #dce7f8;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 10px;
}

.app-shell[data-theme="echo-neon"] .nav-button {
  border-color: rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.018);
  color: #aab8cb;
}

.app-shell[data-theme="echo-neon"] .nav-button:hover,
.app-shell[data-theme="echo-neon"] .nav-button.is-active {
  border-color: rgba(31, 220, 255, 0.34);
  background: linear-gradient(90deg, rgba(24, 150, 255, 0.18), rgba(31, 220, 255, 0.08));
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(31, 220, 255, 0.06), 0 10px 28px rgba(0, 69, 165, 0.16);
}

.app-shell[data-theme="echo-neon"] .nav-icon {
  border-color: rgba(31, 220, 255, 0.32);
  background: rgba(16, 96, 220, 0.12);
  color: #46e6ff;
  box-shadow: 0 0 18px rgba(31, 220, 255, 0.12);
}

.app-shell[data-theme="echo-neon"] .panel,
body[data-theme="echo-neon"] .auth-form,
body[data-theme="echo-neon"] .auth-status,
.app-shell[data-theme="echo-neon"] .book-card,
.app-shell[data-theme="echo-neon"] .reader-toolbar,
.app-shell[data-theme="echo-neon"] .reader-mark-tools,
.app-shell[data-theme="echo-neon"] .listen-dock,
.app-shell[data-theme="echo-neon"] .mobile-work-dock,
.app-shell[data-theme="echo-neon"] .revision-drawer {
  border-color: rgba(127, 161, 210, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    rgba(9, 14, 25, 0.92);
  box-shadow: 0 16px 54px rgba(0, 17, 48, 0.24);
}

.app-shell[data-theme="echo-neon"] .reader-surface.theme-dark {
  border-color: rgba(127, 161, 210, 0.22);
  background: linear-gradient(180deg, #0c1016, #080b10);
}

.app-shell[data-theme="echo-neon"] .button.primary,
body[data-theme="echo-neon"] .button.primary {
  border-color: rgba(31, 220, 255, 0.45);
  background: linear-gradient(135deg, #1edcff, #126cff);
  color: #03101f;
  box-shadow: 0 12px 34px rgba(18, 108, 255, 0.28);
}

.app-shell[data-theme="echo-neon"] .button.mark {
  border-color: rgba(255, 203, 107, 0.48);
  background: linear-gradient(135deg, rgba(255, 203, 107, 0.22), rgba(31, 220, 255, 0.12));
}

.app-shell[data-theme="echo-neon"] .input,
.app-shell[data-theme="echo-neon"] .select,
.app-shell[data-theme="echo-neon"] .textarea,
body[data-theme="echo-neon"] .input {
  border-color: rgba(127, 161, 210, 0.25);
  background: rgba(5, 9, 17, 0.88);
  color: #f7fbff;
}

.app-shell[data-theme="echo-neon"] .active-sentence {
  background: rgba(20, 124, 255, 0.16);
  box-shadow: 0 0 0 2px rgba(31, 220, 255, 0.08);
}

.app-shell[data-theme="echo-neon"] .word.active-word {
  background: rgba(31, 220, 255, 0.18);
  box-shadow: inset 0 -0.24em 0 rgba(31, 220, 255, 0.82), 0 0 12px rgba(31, 220, 255, 0.12);
}

.app-shell[data-theme="echo-neon"] .sidebar-note,
.app-shell[data-theme="echo-neon"] .info-nav button,
.app-shell[data-theme="echo-neon"] .account-link {
  border-color: rgba(127, 161, 210, 0.18);
  background: rgba(255, 255, 255, 0.028);
}

.app-shell[data-theme="echo-neon"] .account-link:hover {
  border-color: rgba(31, 220, 255, 0.34);
  background: rgba(31, 220, 255, 0.08);
}

.app-shell[data-theme="echo-neon"] .mobile-topbar {
  background: rgba(5, 8, 18, 0.96);
  border-bottom-color: rgba(31, 220, 255, 0.18);
}

body[data-theme="echo-neon"] .auth-page {
  background:
    radial-gradient(circle at 70% 8%, rgba(18, 108, 255, 0.25), transparent 32rem),
    radial-gradient(circle at 18% 20%, rgba(31, 220, 255, 0.14), transparent 24rem),
    #03060d;
}

@media (max-width: 820px) {
  .reader-screen {
    padding-bottom: 92px;
  }

  .mobile-work-dock {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 35;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 56px;
    border: 1px solid rgba(98, 210, 192, 0.26);
    border-radius: var(--radius);
    background: rgba(14, 17, 16, 0.96);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.36);
    padding: 7px;
  }

  .mobile-work-status {
    min-width: 0;
  }

  .mobile-work-status span,
  .mobile-work-status strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-work-status span {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
  }

  .mobile-work-status strong {
    font-size: 12px;
    line-height: 1.25;
  }

  .mobile-work-actions {
    display: grid;
    grid-template-columns: repeat(3, 48px);
    gap: 5px;
  }

  .mobile-work-actions .button {
    min-height: 34px;
    padding: 0 5px;
    font-size: 11px;
  }

  .revision-drawer-tab {
    top: auto;
    right: 0;
    bottom: 94px;
  }

  .export-handoff-panel {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .compact-topline {
    display: grid;
  }

  .version-pill {
    width: fit-content;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .auth-top-nav {
    top: 6px;
    gap: 6px;
  }

  .auth-top-nav a {
    min-height: 36px;
    flex-basis: calc(50% - 6px);
    padding: 7px 8px;
    font-size: 12px;
  }
}

@media (max-width: 520px) {
  .revision-drawer {
    width: min(390px, 96vw);
    padding: 12px;
  }

  .revision-drawer-head {
    margin: -12px -12px 10px;
    padding: 12px;
  }

  .drawer-control-grid,
  .drawer-category-grid {
    grid-template-columns: 1fr 1fr;
  }

  .paragraph-editor {
    min-height: 190px;
  }
}
