:root {
  --reader-font: "Inter", "SF Pro Text", system-ui, -apple-system, sans-serif;
  --reader-font-size: 28px;
  --reader-font-weight: 500;
  --reader-line-height: 1.4;
  --reader-letter-spacing: 0.02em;
  --safe-pad-x: 48px;
  --safe-pad-y: 44px;
  --reader-fg: #ffffff;
  --reader-accent: #a5f3fc;
  --reader-brightness: 0.92;
  --context-dim: 0.28;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  background: #000000;
  color: var(--reader-fg);
  font-family: var(--reader-font);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

.glasses-viewport {
  position: relative;
  width: 600px;
  height: 600px;
  max-width: 100vw;
  max-height: 100vh;
  background: #000000;
  color: var(--reader-fg);
  opacity: var(--reader-brightness);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view {
  position: absolute;
  inset: 0;
  padding: var(--safe-pad-y) var(--safe-pad-x);
  display: flex;
  flex-direction: column;
  background: #000000;
}

.hidden {
  display: none !important;
}

/* Header & Footer bars kept ultra-minimal for additive optics */
.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 16px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.hud-title {
  font-weight: 700;
  color: var(--reader-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-badge {
  font-size: 13px;
  font-weight: 600;
  padding: 2px 8px;
  border: 1px solid var(--reader-accent);
  border-radius: 999px;
  color: var(--reader-accent);
  flex-shrink: 0;
}

.hint-bar {
  margin-top: auto;
  padding-top: 10px;
  font-size: 14px;
  opacity: 0.72;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

/* Library List */
.library-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
}

.library-list::-webkit-scrollbar {
  display: none;
}

.library-item {
  padding: 12px 14px;
  border-left: 4px solid transparent;
  opacity: 0.55;
  transition: opacity 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
  cursor: pointer;
}

.library-item.focused {
  opacity: 1;
  border-left-color: var(--reader-accent);
  padding-left: 18px;
}

.library-item-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}

.library-item-meta {
  font-size: 14px;
  margin-top: 4px;
  color: var(--reader-accent);
  display: flex;
  gap: 10px;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  font-size: 20px;
  line-height: 1.4;
  opacity: 0.85;
}

/* Reading View */
.reading-view {
  padding: var(--safe-pad-y) var(--safe-pad-x);
}

.reading-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  opacity: 0.75;
  margin-bottom: 6px;
  flex-shrink: 0;
  gap: 8px;
}

.reading-top-chapter {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reading-status-pill {
  color: var(--reader-accent);
  font-weight: 700;
  flex-shrink: 0;
}

.reading-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
}

/* Teleprompter Stream */
.teleprompter-track {
  position: relative;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  padding-top: 180px;
  padding-bottom: 220px;
}

.teleprompter-track::-webkit-scrollbar {
  display: none;
}

.tp-block {
  font-family: var(--reader-font);
  font-size: var(--reader-font-size);
  font-weight: var(--reader-font-weight);
  line-height: var(--reader-line-height);
  letter-spacing: var(--reader-letter-spacing);
  margin-bottom: 0.75em;
  opacity: var(--context-dim);
  transition: opacity 0.22s ease;
}

.tp-block.heading {
  font-weight: 800;
  color: var(--reader-accent);
  font-size: calc(var(--reader-font-size) * 1.12);
}

.tp-block.active {
  opacity: 1;
}

.tp-block.near {
  opacity: calc(min(0.82, var(--context-dim) + 0.25));
}

/* Lateral Card Mode */
.card-stage {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

.card-block {
  font-family: var(--reader-font);
  font-size: var(--reader-font-size);
  font-weight: var(--reader-font-weight);
  line-height: var(--reader-line-height);
  letter-spacing: var(--reader-letter-spacing);
  margin-bottom: 0.65em;
  opacity: 1;
}

.card-block.heading {
  font-weight: 800;
  color: var(--reader-accent);
  font-size: calc(var(--reader-font-size) * 1.12);
}

/* Bottom Progress Line */
.progress-strip {
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.16);
  margin-top: 8px;
  flex-shrink: 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--reader-accent);
  transition: width 0.2s ease;
}

/* Quick HUD Overlay (pure black backdrop so additive lens stays clean) */
.hud-overlay {
  position: absolute;
  inset: 0;
  background: #000000;
  padding: var(--safe-pad-y) var(--safe-pad-x);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.hud-menu {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-menu::-webkit-scrollbar {
  display: none;
}

.hud-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border-left: 4px solid transparent;
  font-size: 19px;
  opacity: 0.58;
  cursor: pointer;
}

.hud-menu-item.focused {
  opacity: 1;
  border-left-color: var(--reader-accent);
  padding-left: 16px;
}

.hud-menu-value {
  color: var(--reader-accent);
  font-weight: 700;
}

/* Passcode Gate */
.passcode-view {
  justify-content: center;
  gap: 16px;
}

.passcode-input {
  background: #000000;
  color: var(--reader-fg);
  border: 2px solid var(--reader-accent);
  padding: 12px 14px;
  font-size: 22px;
  border-radius: 6px;
  outline: none;
}

.passcode-btn {
  background: #000000;
  color: var(--reader-accent);
  border: 2px solid var(--reader-accent);
  padding: 10px 16px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
}

.error-text {
  color: #ff7b7b;
  font-size: 16px;
}
