:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --gold: #ffd166;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen {
  width: 100%; height: 100%; position: absolute; top: 0; left: 0;
  display: flex; flex-direction: column;
  padding: 20px; gap: 16px;
}
.screen.hidden { display: none; }
.hidden { display: none !important; }

.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer; outline: none;
}
.focusable:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

/* Topbar */
.topbar {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  border: 1px solid #26263a;
  flex-shrink: 0;
}
.topbar-label {
  font-size: 15px; font-weight: 700; letter-spacing: 2px;
  color: var(--accent);
}
.topbar-sub {
  font-size: 14px; color: var(--text-secondary); margin-top: 4px;
}

/* Quote stage */
.quote-stage {
  flex: 1 1 auto;
  background: var(--bg-primary);
  border: 1px solid #26263a;
  border-radius: var(--radius-md);
  padding: 28px 26px;
  display: flex; flex-direction: column; justify-content: center;
  overflow-y: auto; min-height: 0;
}
.quote-text {
  font-size: 30px; line-height: 1.32; font-weight: 600;
  color: var(--text-primary);
}
.quote-text::before { content: "\201C"; color: var(--accent); margin-right: 2px; }
.quote-text::after  { content: "\201D"; color: var(--accent); margin-left: 2px; }
.quote-text.small  { font-size: 24px; }
.quote-text.tiny   { font-size: 20px; }
.quote-author {
  margin-top: 22px; font-size: 18px; font-weight: 600;
  color: var(--accent-secondary);
}
.quote-author::before { content: "— "; color: var(--text-muted); }

/* Actions */
.actions { flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 17px; font-weight: 600;
  min-height: 64px; padding: 8px 14px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 2px solid #2c2c40;
}
.btn:focus { border-color: var(--focus-ring); }
.btn-primary {
  background: linear-gradient(180deg, #16263a, #0e1a2a);
  border-color: #1f4a66;
  min-height: 72px; font-size: 19px;
}
.btn .glyph { font-size: 22px; line-height: 1; }
.btn.saved { color: var(--gold); border-color: #4a3d18; }
.btn.saved .glyph { color: var(--gold); }

/* List screens */
.list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding-right: 4px;
}
.list-item {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 2px solid #26263a;
  padding: 14px 16px; min-height: 72px;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
}
.list-item:focus { border-color: var(--focus-ring); }
.li-quote {
  font-size: 17px; line-height: 1.3; color: var(--text-primary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.li-meta { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.li-author { color: var(--accent-secondary); font-weight: 600; }
.li-star { color: var(--gold); font-size: 15px; margin-left: auto; }

.empty {
  flex: 1 1 auto; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center;
  color: var(--text-secondary);
}
.empty .big { font-size: 44px; }
.empty .msg { font-size: 18px; }
.empty .sub { font-size: 15px; color: var(--text-muted); }

/* Hint bar */
.hintbar {
  flex-shrink: 0; text-align: center;
  font-size: 13px; color: var(--text-muted); letter-spacing: 0.5px;
}

/* About */
.about-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  background: var(--bg-primary);
  border: 1px solid #26263a; border-radius: var(--radius-md);
  padding: 24px; display: flex; flex-direction: column; gap: 16px;
}
.about-body p { font-size: 19px; line-height: 1.45; }
.about-body .muted { color: var(--text-secondary); }
.keys { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.keys li { font-size: 16px; color: var(--text-secondary); display: flex; align-items: center; gap: 12px; }
.kbd {
  display: inline-block; min-width: 92px; text-align: center;
  background: var(--bg-tertiary); border: 1px solid #2c2c40;
  border-radius: 8px; padding: 6px 10px; color: var(--text-primary);
  font-size: 15px; font-weight: 600;
}

.toast {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--bg-tertiary); color: var(--text-primary);
  border: 1px solid #2c2c40; border-radius: 999px;
  padding: 10px 22px; font-size: 15px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 50;
}
.toast.show { opacity: 1; }
