: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;
  --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; }
.screen.hidden { display: none; }
.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); }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  flex: 0 0 auto;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: var(--bg-primary);
  border-bottom: 1px solid #23232f;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 9px;
  font-weight: 800; font-size: 22px; line-height: 1;
  color: var(--accent);
}
.brand-name { font-size: 21px; font-weight: 700; letter-spacing: 0.3px; }

.status { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text-muted); }
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.2s ease;
}
.status.live .dot { background: var(--accent-secondary); box-shadow: 0 0 9px var(--accent-secondary); }
.status.live #status-text { color: var(--accent-secondary); }
.badge {
  min-width: 26px; height: 26px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary); border-radius: 999px;
  font-size: 15px; font-weight: 700; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* ---------- reader ---------- */
.reader { flex: 1 1 auto; display: flex; padding: 16px; min-height: 0; }
.card {
  --cat: var(--accent);
  --cat-soft: rgba(0, 212, 255, 0.14);
  flex: 1 1 auto;
  display: flex; flex-direction: column;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  min-height: 0;
  border: 2px solid #2a2a3a;
  border-left: 4px solid var(--cat);
}
.card.focusable:focus { border-color: var(--focus-ring); border-left-color: var(--cat); box-shadow: 0 0 20px var(--focus-glow); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 0 0 auto; }
.chip {
  display: inline-block;
  max-width: 70%;
  font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--cat);
  background: var(--cat-soft);
  border: 1px solid var(--cat);
  padding: 4px 10px; border-radius: 999px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.counter {
  font-size: 15px; font-weight: 700; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.art-title {
  margin-top: 12px;
  font-size: 28px; line-height: 1.16; font-weight: 800;
  flex: 0 0 auto;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.meta-row { flex: 0 0 auto; margin-top: 8px; }
.meta-read { font-size: 13px; color: var(--text-muted); }
.art-extract {
  flex: 1 1 auto;
  margin-top: 14px;
  font-size: 20px; line-height: 1.5;
  color: var(--text-primary);
  display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { flex: 0 0 auto; margin-top: 12px; }
.hint { font-size: 13px; color: var(--text-muted); }

/* ---------- action bar ---------- */
.actionbar {
  flex: 0 0 auto;
  display: flex; gap: 8px;
  padding: 10px 12px 14px;
  background: var(--bg-primary);
  border-top: 1px solid #23232f;
}
.actbtn {
  flex: 1 1 0;
  min-height: 76px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 11px;
  font-family: inherit;
}
.actbtn .ab-ico { font-size: 23px; line-height: 1; }
.actbtn .ab-lbl { font-size: 13px; font-weight: 600; }
.actbtn.primary { background: rgba(0, 212, 255, 0.12); color: var(--accent); }
.actbtn.primary .ab-ico { color: var(--accent); }
.actbtn.saved-on { color: var(--accent-secondary); }
.actbtn.saved-on .ab-ico { color: var(--accent-secondary); }
.actbtn.focusable:focus { background: var(--bg-secondary); color: var(--text-primary); }

/* ---------- saved list ---------- */
.list-wrap {
  flex: 1 1 auto;
  overflow: hidden;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.list-item {
  flex: 0 0 auto;
  min-height: 76px;
  background: var(--bg-secondary);
  border-radius: 11px;
  padding: 12px 14px;
  border: 2px solid #23232f;
}
.list-item.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.li-head { display: flex; align-items: baseline; gap: 9px; }
.li-title {
  font-size: 18px; font-weight: 700; flex: 1 1 auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.li-topic { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--accent); flex: 0 0 auto; }
.li-extract {
  margin-top: 4px; font-size: 14px; color: var(--text-secondary); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.empty {
  flex: 1 1 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: var(--text-muted); text-align: center; padding: 20px;
}
.empty .e-ico { font-size: 48px; }
.empty .e-txt { font-size: 17px; line-height: 1.4; max-width: 360px; }

/* ---------- about ---------- */
.about-wrap {
  flex: 1 1 auto;
  padding: 22px;
  display: flex; flex-direction: column; gap: 16px;
  overflow: hidden;
}
.about-p { font-size: 18px; line-height: 1.5; color: var(--text-secondary); }
.about-p strong { color: var(--text-primary); }
.ctrl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ctrl {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-secondary); border-radius: 10px; padding: 12px 14px;
}
.key {
  min-width: 66px; text-align: center;
  font-weight: 700; font-size: 15px; color: var(--accent);
  background: var(--bg-tertiary); border-radius: 8px; padding: 7px 8px;
}
.ctxt { font-size: 15px; color: var(--text-primary); }
.about-note { margin-top: auto; font-size: 13px; color: var(--text-muted); line-height: 1.5; }
